From 252fd05f2f07e4d5f4f9538e0be21a4c57cf64fa Mon Sep 17 00:00:00 2001 From: Daniel Weibel Date: Thu, 19 Aug 2021 11:26:15 +0200 Subject: [PATCH] Add Dockerfile and add notes to README --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ README.md | 20 ++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..feccf1c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM ubuntu:20.04 + +# Install dependencies +# DEBIAN_FRONTEND=noninteractive necessary for tzdata dependency package +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + clang \ + cmake \ + libboost-all-dev \ + libprotobuf-dev \ + protobuf-compiler \ + git \ + pip +RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \ + update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 + +# Install SEAL +WORKDIR /home/root +RUN git clone -b v3.6.4 https://github.com/microsoft/SEAL.git && \ + cd SEAL && \ + cmake -DSEAL_THROW_ON_TRANSPARENT_CIPHERTEXT=OFF . && \ + make -j && \ + make install + +# Install EVA +WORKDIR /home/root +RUN git clone -b v1.0.1 https://github.com/microsoft/EVA && \ + cd EVA && \ + git submodule update --init && \ + cmake . && \ + make -j && \ + python3 -m pip install -e python && \ + python3 python/setup.py bdist_wheel --dist-dir='.' && \ + python3 -m pip install numpy && \ + python3 tests/all.py diff --git a/README.md b/README.md index 460ab11..01fbec0 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ EVA targets [Microsoft SEAL](https://github.com/microsoft/SEAL) — the industry EVA is a native library written in C++17 with bindings for Python. Both Linux and Windows are supported. The instructions below show how to get started with EVA on Ubuntu. For building on Windows [EVA's Azure Pipelines script](azure-pipelines.yml) is a useful reference. +You can also build a Docker image with EVA and SEAL installed. This is useful if you want to run EVA on unsupported platforms (e.g. macOS). See [Getting Started with Docker](#getting-started-with-docker) below. + ### Installing Dependencies To install dependencies on Ubuntu 20.04: @@ -68,6 +70,24 @@ python3 image_processing.py This will compile and run homomorphic evaluations of a Sobel edge detection filter and a Harris corner detection filter on `examples/baboon.png`, producing results of homomorphic evaluation in `*_encrypted.png` and reference results from normal execution in `*_reference.png`. The script also reports the mean squared error between these for each filter. +## Getting Started with Docker + +Build the Docker image: + +```bash +docker build -t eva:v1.0.1 . +``` + +Run the Docker image: + +```bash +docker run -ti eva:v1.0.1 +``` + +This will drop you into the running Docker container where you will find a working installation of SEAL and EVA. + +> For installing Docker, follow the instructions [here](https://docs.docker.com/get-docker/). + ## Programming with PyEVA PyEVA is a thin Python-embedded DSL for producing EVA programs.