davidADSP / GDL_code

The official code repository for examples in the O'Reilly book 'Generative Deep Learning'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker compose files seems to be missing

thisiseshan opened this issue · comments

I am unable to find the yaml file to follow along with the book. Kindly let us know if it is intended and will be added at a later date or if I am missing something.

If you still need it, I develop my own docker-compose.yml file:

version: '3.8'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.gpu
    container_name: app
    restart: unless-stopped
    volumes:
      - ./notebooks/:/home/gdl/notebooks
    ports:
      - "8888:8888"
      - "6006:6006"
    entrypoint: jupyter notebook --ip 0.0.0.0 --port=8888 /home/gdl/notebooks

In order to make this work you must:

  • create a directory called notebooks on the same level where the Dockerfiles lie
  • move all .ipynb files inside the directory notebooks
  • move the folders data, models, run, scripts and utils inside the directory notebooks
  • change the permissions of the files with the following command sudo chmod -R ugo+rw notebooks/

In this case I'm using the GPU Dockerfile version, just replace with the CPU version if you don't need it.

Lastly, I modified the Dockerfile.gpu as follow since I met some key issues with the Nvidia repository and the git package was missing:

FROM tensorflow/tensorflow:latest-gpu-py3-jupyter

## modify below
ARG username=gdl
ARG groupid=1000
ARG userid=1000
## end modify

RUN apt-key del 7fa2af80 && \
    apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

RUN apt-get update && apt-get install -y \
    graphviz \
    libgraphviz-dev \
    git

COPY ./requirements.txt /
RUN python3 -m pip install --upgrade pip
RUN pip install -r /requirements.txt

# -m option creates a fake writable home folder for Jupyter.
RUN groupadd -g $groupid $username \
    && useradd -m -r -u $userid -g $username $username
USER $username