From 4eb149867c1aee6964b338ad207686cd707b1c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20=C5=BBywica?= Date: Wed, 2 Dec 2020 13:22:03 +0100 Subject: [PATCH] add docker config, gitignore --- .gitignore | 3 +++ 0-install/.env | 4 ++++ 0-install/docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ 0-install/jupyter.Dockerfile | 11 +++++++++++ 4 files changed, 51 insertions(+) create mode 100644 .gitignore create mode 100644 0-install/.env create mode 100644 0-install/docker-compose.yml create mode 100755 0-install/jupyter.Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2c5bbd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.ipynb_checkpoints +datasets +1-intro/data diff --git a/0-install/.env b/0-install/.env new file mode 100644 index 0000000..ea11e7a --- /dev/null +++ b/0-install/.env @@ -0,0 +1,4 @@ +ROOT_DIR=/home/wmi/repos +JUPYTER_PORT=42065 +JUPYTER_TOKEN=some_token +JUPYTER_DIR=/jupyter diff --git a/0-install/docker-compose.yml b/0-install/docker-compose.yml new file mode 100644 index 0000000..c9be533 --- /dev/null +++ b/0-install/docker-compose.yml @@ -0,0 +1,33 @@ +version: "3.8" +services: + jupyter-server: + image: dl-jupyter + init: true + build: + context: ./ + dockerfile: jupyter.Dockerfile + env_file: ./.env + ports: + - ${JUPYTER_PORT}:${JUPYTER_PORT} + volumes: + - ${ROOT_DIR}:/jupyter + environment: + - NVIDIA_VISIBLE_DEVICES=all + command: + [ + "jupyter", + "notebook", + "--ip=*", + "--port=${JUPYTER_PORT}", + "--allow-root", + "--notebook-dir=${JUPYTER_DIR}", + '--NotebookApp.token=${JUPYTER_TOKEN}' + ] + deploy: + resources: + reservations: + devices: + - 'driver': 'nvidia' + 'count': 1 + 'capabilities': ['gpu', 'utility', 'compute'] + diff --git a/0-install/jupyter.Dockerfile b/0-install/jupyter.Dockerfile new file mode 100755 index 0000000..e4a12f0 --- /dev/null +++ b/0-install/jupyter.Dockerfile @@ -0,0 +1,11 @@ +FROM nvidia/cuda:10.2-runtime AS jupyter-base +WORKDIR / +RUN apt update && apt install -y --no-install-recommends \ + git build-essential \ + python3-dev python3-pip python3-setuptools +RUN pip3 -q install pip --upgrade + +RUN pip3 install jupyter numpy pandas torch torchvision tensorboardX + +FROM jupyter-base +RUN pip3 install transformers barbar matplotlib