[simulation] Set up Dockerfile (#14)

This commit is contained in:
Justin D. Harris 2019-06-21 15:25:56 -04:00 коммит произвёл GitHub
Родитель 0d7ab6d6f0
Коммит 1a6fd975d4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 45 добавлений и 5 удалений

Просмотреть файл

@ -1,6 +1,9 @@
FROM node:10.15
MAINTAINER Justin Harris (justin.harris@microsoft.com)
LABEL maintainer="Justin Harris (justin.harris@microsoft.com)"
LABEL org.label-schema.vendor="Microsoft"
LABEL org.label-schema.url="https://github.com/microsoft/0xDeCA10B/tree/master/demo"
LABEL org.label-schema.vcs-url="https://github.com/microsoft/0xDeCA10B/tree/master/demo"
WORKDIR /root/workspace/demo

Просмотреть файл

@ -21,8 +21,8 @@ Run
## Docker Setup
You can use Docker by running:
```bash
docker build -t decai .
docker run --rm -it -p 3000:3000 -p 5387:5387 -p 7545:7545 -v ${PWD}:/root/workspace/demo -v /root/workspace/demo/node_modules -v /root/workspace/demo/client/node_modules --name decai decai bash
docker build -t decai-demo .
docker run --rm -it -p 3000:3000 -p 5387:5387 -p 7545:7545 -v ${PWD}:/root/workspace/demo -v /root/workspace/demo/node_modules -v /root/workspace/demo/client/node_modules --name decai-demo decai-demo bash
# If you run into issues inside the Docker container, then
# try to redo the setup by running: `rm -rf node_modules client/node_modules && ./setup.sh` in the container to ensure that everything is set up properly.

23
simulation/Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,23 @@
FROM continuumio/miniconda3:4.6.14
LABEL maintainer="Justin Harris (justin.harris@microsoft.com)"
LABEL org.label-schema.vendor="Microsoft"
LABEL org.label-schema.url="https://github.com/microsoft/0xDeCA10B/tree/master/simulation"
LABEL org.label-schema.vcs-url="https://github.com/microsoft/0xDeCA10B/tree/master/simulation"
EXPOSE 5006
ENV LC_ALL C.UTF-8
RUN conda create --channel conda-forge --name decai-simulation --yes python=3.7 bokeh ipython mkl mkl-service numpy phantomjs scikit-learn scipy six tensorflow
RUN conda init bash
WORKDIR /root/workspace/0xDeCA10B/simulation
COPY setup.py .
RUN conda run --name decai-simulation pip install -e .
RUN echo "conda activate decai-simulation" >> ~/.bashrc
CMD ["bash"]

Просмотреть файл

@ -23,11 +23,18 @@ Despite the malicious efforts, the accuracy can still be maintained and the hone
# Setup
Run:
```bash
conda create --name decai-simulation python=3.7 bokeh ipython mkl mkl-service numpy phantomjs scikit-learn scipy six tensorflow
conda create --channel conda-forge --name decai-simulation python=3.7 bokeh ipython mkl mkl-service numpy phantomjs scikit-learn scipy six tensorflow
conda activate decai-simulation
pip install -e .
```
## Docker Setup
You can use Docker by running:
```bash
docker build -t decai-simulation .
docker run --rm -it -p 5006:5006 -v ${PWD}:/root/workspace/0xDeCA10B/simulation --name decai-simulation decai-simulation bash
```
# Running Simulations
Run:
```bash

Просмотреть файл

@ -7,7 +7,14 @@ install_requires = [
'expiringdict>=1.1.4',
'injector>=0.16.2',
'joblib>=0.13.2',
'Keras>=2.1',
# Use a specific commit because the latest released version has a bug:
# https://github.com/keras-team/keras/issues/12729
# Fix: https://github.com/keras-team/keras/pull/12714
'keras @ git+https://github.com/keras-team/keras.git@47e1b18c0b7e3ddeef4e9fcded409a55d0479a4f',
# Used to be: 'Keras>=2.1',
'numpy',
# Required for saving plots.