From 2150bb1f70eb611fbb600514f5219d6a4b725980 Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Sat, 3 Aug 2024 23:00:25 -0400 Subject: [PATCH] progress --- research/fastai_jupyter/.env | 2 ++ research/fastai_jupyter/Dockerfile | 31 ++++++++++++++++++++++ research/fastai_jupyter/docker-compose.yml | 24 +++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 research/fastai_jupyter/.env create mode 100644 research/fastai_jupyter/Dockerfile create mode 100644 research/fastai_jupyter/docker-compose.yml diff --git a/research/fastai_jupyter/.env b/research/fastai_jupyter/.env new file mode 100644 index 0000000..f951c4d --- /dev/null +++ b/research/fastai_jupyter/.env @@ -0,0 +1,2 @@ +ROOT_DIR=/opt/jupyter_gpu/fastai +JUPYTER_PORT=7777 diff --git a/research/fastai_jupyter/Dockerfile b/research/fastai_jupyter/Dockerfile new file mode 100644 index 0000000..a515176 --- /dev/null +++ b/research/fastai_jupyter/Dockerfile @@ -0,0 +1,31 @@ +# Relies on JUPYTER_PORT being set in docker-compose.yml +# ------------------------------------------------------- + FROM pytorch/pytorch:latest + + # RUN useradd -m -s /bin/bash oleg + + # Install packages + # --- this version of jupyter is required to work with the widgets + RUN pip install jupyterlab==3.6.7 + # + RUN pip install ipywidgets + RUN pip install pandas numpy plotly + # + RUN pip install fastbook + + # Install additional applications + RUN apt update + RUN apt-get install graphviz -y + + # Set environment variables, etc. + #ENV MY_ENV_VAR=myvalue + + # Set the working directory + WORKDIR /workspace + + # Expose the port for JupyterLab + EXPOSE ${JUPYTER_PORT} + + # Command to run JupyterLab + CMD ["jupyter-lab", "--ip=0.0.0.0", "--port=7777", "--no-browser", "--allow-root", "--NotebookApp.token=''"] + diff --git a/research/fastai_jupyter/docker-compose.yml b/research/fastai_jupyter/docker-compose.yml new file mode 100644 index 0000000..f0d9d64 --- /dev/null +++ b/research/fastai_jupyter/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +#================================================== +# Relies on the file `.env` content for varables: +# ROOT_DIR +# JUPYTER_PORT +#================================================== +services: + jupyter: + build: ${ROOT_DIR} + image: cvtt/fastai:v0.0.1 + container_name: fastai_jupyter + runtime: nvidia + restart: unless-stopped + environment: + - JUPYTER_ENABLE_LAB=yes + volumes: + - ${ROOT_DIR}/notebooks:/workspace + - ${ROOT_DIR}/jupyter_settings/user-settings:/root/.jupyter/lab/user-settings + - ${ROOT_DIR}/jupyter_settings/workspaces:/root/.jupyter/lab/workspaces + - ${ROOT_DIR}/.cache/torch:/root/.cache/torch + ports: + - "${JUPYTER_PORT}:${JUPYTER_PORT}" + shm_size: "8gb"