From d4faf60254a77419aada55af52ee897788f83e4b Mon Sep 17 00:00:00 2001 From: Stefan Schneider Date: Sun, 25 Apr 2021 13:06:26 +0200 Subject: [PATCH] add Dockerfile and update readme accordingly --- Dockerfile | 15 +++++++++++++++ README.md | 37 ++++++++++++++++++++++++++++++++----- docker_start.sh | 7 +++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 Dockerfile create mode 100644 docker_start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3a0ea83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:focal + +# installation +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + cmake build-essential zlib1g-dev python3-dev python3-pip ffmpeg imagemagick +RUN pip3 install deepcomp + +# start tensorboard and http server (for rendered videos) +ADD docker_start.sh docker_start.sh +RUN chmod +x docker_start.sh +CMD ./docker_start.sh + +# expose corresponding ports +EXPOSE 6006 8000 diff --git a/README.md b/README.md index 896be84..b8514a5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![CI](https://github.com/CN-UPB/DeepCoMP/actions/workflows/python-test.yml/badge.svg)](https://github.com/CN-UPB/DeepCoMP/actions/workflows/python-test.yml) [![PyPi](https://github.com/CN-UPB/DeepCoMP/actions/workflows/python-publish.yml/badge.svg?branch=v1.1.0)](https://github.com/CN-UPB/DeepCoMP/actions/workflows/python-publish.yml) [![DeepSource](https://deepsource.io/gh/CN-UPB/DeepCoMP.svg/?label=active+issues)](https://deepsource.io/gh/CN-UPB/DeepCoMP/?ref=repository-badge) @@ -94,16 +95,42 @@ You can choose a custom location with `--result-dir `. ### Docker +**Note:** By default, results within the Docker container are not stored persistently. +To save them, copy them from the Docker container or use a Docker volume. + +#### Start the Container + If you want to use the `deepcomp` Docker container and pulled the corresponding image from Docker Hub, you can use it as follows: ``` -# start Docker container and connect to it -docker run -it --rm --name deepcomp deepcomp +docker run -d -p 6006:6006 -p 8000:8000 --rm --name deepcomp deepcomp ``` -TODO +This starts the Docker container in the background, publishing port 6006 for TensorBoard and port 8000 for the +HTTP server (described below). +The container automatically starts TensorBoard and the HTTP server, so this does not need to be done manually. +The `--rm` flag automatically removes the container once it is stopped. -**Note:** By default, results within the Docker container are not stored persistently. -To save them, copy them from the Docker container or use a Docker volume. +#### Use DeepCoMP on the Container + +To execute commands on the running Docker container, use `docker exec ` as follows: +``` +docker exec deepcomp deepcomp +``` +Here, the arguments are identical with the ones described above. +For example, the following command lists all CLI options: +``` +docker exec deepcomp deepcomp -h +``` + +To inspect training progress or view create files (e.g., rendered videos), use TensorBoard and the HTTP server, +which are available via `localhost:6006` and `localhost:8000`. + +#### Terminate the Container + +Stop the container with +``` +docker stop deepcomp +``` ### Accessing results remotely diff --git a/docker_start.sh b/docker_start.sh new file mode 100644 index 0000000..eeb4d05 --- /dev/null +++ b/docker_start.sh @@ -0,0 +1,7 @@ +# start tensorboard and http server in background +echo "DeepCoMP: Starting TensorBoard and HTTP Server (for videos)..." +mkdir results +mkdir results/train +cd results +python3 -m http.server & +tensorboard --logdir train/ --host 0.0.0.0