add docker config, gitignore

This commit is contained in:
Patryk Żywica 2020-12-02 13:22:03 +01:00
parent 8a2a9643d4
commit 4eb149867c
4 changed files with 51 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.ipynb_checkpoints
datasets
1-intro/data

4
0-install/.env Normal file
View File

@ -0,0 +1,4 @@
ROOT_DIR=/home/wmi/repos
JUPYTER_PORT=42065
JUPYTER_TOKEN=some_token
JUPYTER_DIR=/jupyter

View File

@ -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']

11
0-install/jupyter.Dockerfile Executable file
View File

@ -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