├── Dockerfile ├── README.md ├── cmakelists.patch └── setup.patch /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tensorflow/tensorflow:1.14.0-py3-jupyter 2 | 3 | RUN apt-get update && apt-get install -y wget git pkg-config libprotobuf-dev protobuf-compiler libjson-c-dev intltool libx11-dev libxext-dev 4 | RUN pip3 install --no-cache-dir six scipy tensorflow-hub tensorflow-probability==0.7 dm-sonnet==1.35 5 | 6 | RUN wget https://github.com/Kitware/CMake/releases/download/v3.15.4/cmake-3.15.4-Linux-x86_64.sh \ 7 | -q -O /tmp/cmake-install.sh \ 8 | && chmod u+x /tmp/cmake-install.sh \ 9 | && mkdir /usr/bin/cmake \ 10 | && /tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake \ 11 | && rm /tmp/cmake-install.sh 12 | 13 | ENV PATH="/usr/bin/cmake/bin:${PATH}" 14 | 15 | RUN git clone https://github.com/deepmind/spiral.git 16 | WORKDIR /tf/spiral 17 | 18 | RUN git submodule update --init --recursive \ 19 | && wget -c https://github.com/mypaint/mypaint-brushes/archive/v1.3.0.tar.gz -O - | tar -xz -C third_party \ 20 | && git clone https://github.com/dli/paint third_party/paint \ 21 | && patch third_party/paint/shaders/setbristles.frag third_party/paint-setbristles.patch 22 | 23 | COPY setup.patch setup.patch 24 | RUN patch setup.py setup.patch 25 | 26 | COPY cmakelists.patch cmakelists.patch 27 | RUN patch CMakeLists.txt cmakelists.patch 28 | 29 | RUN python3 setup.py develop --user 30 | 31 | RUN apt-get autoremove -y && apt-get remove -y wget git pkg-config && apt-get autoremove -y 32 | 33 | CMD ["bash", "-c", "source /etc/bash.bashrc && jupyter notebook --notebook-dir=/tf/spiral/notebooks --ip 0.0.0.0 --no-browser --allow-root"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker for SPIRAL 2 | 3 | [Docker](https://docs.docker.com/install/) is easiest way to get the 4 | [SPIRAL](https://github.com/deepmind/spiral) agent up and running on your machine. 5 | There is no need to build anything or install any packages (besides `Docker` itself). 6 | 7 | ## Quickstart 8 | 9 | 1. [Install Docker](https://docs.docker.com/install/) on your local host machine. 10 | 2. Run the following command in the terminal: 11 | 12 | ```shell 13 | docker run -it -p 8888:8888 ddtm/spiral:latest 14 | ``` 15 | 16 | This will start an instance of [Jupyter Notebook](https://jupyter.org/) server. 17 | 18 | Note that you can replace `8888:8888` with `:8888` where `` 19 | is a port on your local host machine. 20 | 3. Follow the instructions and open the URL in your host web browser: `http://127.0.0.1:8888/?token=...` 21 | 4. You should see a file browser. Select `spiral-demo.ipynb`. 22 | 5. **Voilà!** 23 | 24 | Now you should be able to go through the **demo notebook**. Use `Shift + Enter` to execute a cell 25 | and go to the next one. For more information on how to use Jupyter notebooks see, for example, 26 | [this tutorial](https://www.codecademy.com/articles/how-to-use-jupyter-notebooks). 27 | -------------------------------------------------------------------------------- /cmakelists.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2019-10-09 21:39:55.000000000 +0100 2 | +++ CMakeLists.txt 2019-10-09 21:41:01.000000000 +0100 3 | @@ -45,6 +45,8 @@ 4 | add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/glog) 5 | 6 | set(BUILD_VULKAN OFF CACHE BOOL "Build the Vulkan library") 7 | +set(BUILD_SAMPLES OFF CACHE BOOL "Build sample programs") 8 | +set(BUILD_TESTS OFF CACHE BOOL "Build test programs") 9 | add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/swiftshader) 10 | 11 | set(PYBIND11_PYTHON_VERSION ${Python3_VERSION}) 12 | -------------------------------------------------------------------------------- /setup.patch: -------------------------------------------------------------------------------- 1 | --- setup.py 2019-10-09 21:25:18.000000000 +0100 2 | +++ setup.py 2019-10-09 21:26:41.000000000 +0100 3 | @@ -69,7 +69,7 @@ 4 | 5 | def build_cmake(self, ext): 6 | cfg = "Debug" if self.debug else "Release" 7 | - subprocess.check_call(["cmake", "--build", ".", "--config", cfg], 8 | + subprocess.check_call(["cmake", "--build", ".", "--config", cfg, "-j 4"], 9 | cwd=self.build_temp) 10 | 11 | 12 | --------------------------------------------------------------------------------