Spaces:
Sleeping
Sleeping
Commit
·
f58f618
1
Parent(s):
7a0abd3
Add application file
Browse files- docker/.env +33 -0
- docker/DESCRIPTION +18 -0
- docker/Dockerfile.jupyter +146 -0
- docker/Dockerfile.rstudio +83 -0
- docker/dl_module/.devcontainer/.devcontainer.json +62 -0
- docker/docker-compose.yml +88 -0
- docker/entrypoint-rstudio.sh +25 -0
- docker/entrypoint.sh +10 -0
- docker/environment.yml +73 -0
- docker/get_jupyter_token.sh +7 -0
- docker/ipython_config.py +1 -0
- docker/jupyter_build.logs +0 -0
- docker/jupyter_config/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings +5 -0
- docker/jupyter_config/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings +90 -0
- docker/jupyter_config/lab/user-settings/@parente/jupyterlab-quickopen/plugin.jupyterlab-settings +23 -0
- docker/port +1 -0
- docker/postBuild +1 -0
- docker/requirements.txt +1 -0
docker/.env
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# The name of the docker-compose project
|
2 |
+
COMPOSE_PROJECT_NAME=dvats-macu
|
3 |
+
# The user ID you are using to run docker-compose
|
4 |
+
#G3 1004
|
5 |
+
#G4 1004
|
6 |
+
USER_ID=1004
|
7 |
+
# The group ID you are using to run docker-compose (you can get it with id -g in a terminal)
|
8 |
+
GROUP_ID=1004
|
9 |
+
# The user name assigned to the user id
|
10 |
+
USER_NAME=macu
|
11 |
+
# The port from which you want to access Jupyter lab
|
12 |
+
JUPYTER_PORT=8866
|
13 |
+
#127.0.0.1:8888
|
14 |
+
#http://127.0.0.1:8888/?token=c27a0876fb83515d508e140531ecabde308b5f6db9e5a0fa
|
15 |
+
# The token used to access (like a password)
|
16 |
+
JUPYTER_TOKEN=patataFeliz
|
17 |
+
# The path toz your data files to train/test the models
|
18 |
+
LOCAL_DATA_PATH=/home/macu/work_dir
|
19 |
+
# The W&B entity
|
20 |
+
WANDB_ENTITY=mi-santamaria
|
21 |
+
# The W&B project
|
22 |
+
WANDB_PROJECT=deepvats
|
23 |
+
# The W&B personal API key (see https://wandb.ai/authorize)
|
24 |
+
WANDB_API_KEY=c071bbe845e7da7f602d784bc088a9596206ba69
|
25 |
+
# List of comma separated GPU indices that will be available in the container (by default only 0, the first one)
|
26 |
+
CUDA_VISIBLE_DEVICES=1 #0,1,2
|
27 |
+
# Github PAT (see https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and>
|
28 |
+
GH_TOKEN=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
|
29 |
+
# Port in which you want Rstudio server to be deployed (for developing in the front end)
|
30 |
+
RSTUDIO_PORT=8867
|
31 |
+
# Password to access the Rstudio server
|
32 |
+
RSTUDIO_PASSWD=patataFeliz
|
33 |
+
|
docker/DESCRIPTION
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Depends:
|
2 |
+
R (>= 3.6.0),
|
3 |
+
shiny,
|
4 |
+
pals,
|
5 |
+
shinyWidgets,
|
6 |
+
dygraphs,
|
7 |
+
shinycssloaders,
|
8 |
+
shinyjs,
|
9 |
+
Rcpp,
|
10 |
+
reactlog,
|
11 |
+
feather,
|
12 |
+
fasttime,
|
13 |
+
zoo,
|
14 |
+
reticulate,
|
15 |
+
xts
|
16 |
+
Remotes:
|
17 |
+
r-lib/later,
|
18 |
+
apache/arrow/r
|
docker/Dockerfile.jupyter
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#############################
|
2 |
+
# JUPYTER VOLUME DOCKERFILE #
|
3 |
+
#***************************#
|
4 |
+
# Set up a jupyter-lab for #
|
5 |
+
# developing using deepvats #
|
6 |
+
#############################
|
7 |
+
##############
|
8 |
+
# Base image #
|
9 |
+
##############
|
10 |
+
##--- Setup Ubuntu
|
11 |
+
ARG CUDA_VERSION
|
12 |
+
FROM nvidia/cuda:${CUDA_VERSION}
|
13 |
+
|
14 |
+
#--- Tags
|
15 |
+
LABEL maintainer="vrodriguezf <[email protected]>"
|
16 |
+
LABEL cuda_version=${CUDA_VERSION}
|
17 |
+
LABEL log_path=${log_path}
|
18 |
+
##---Initialize bash
|
19 |
+
LABEL cuda_version=${CUDA_VERSION}
|
20 |
+
|
21 |
+
RUN echo "Cuda version: $CUDA_VERSION"
|
22 |
+
##---Initialize bash
|
23 |
+
SHELL [ "/bin/bash", "--login", "-c" ]
|
24 |
+
|
25 |
+
##################
|
26 |
+
# Packages setup #
|
27 |
+
##################
|
28 |
+
#TODO: Automatizar que lo coja de /etc/timezone
|
29 |
+
#Only neccesary for libarchive & libtiff if error appears
|
30 |
+
ARG TZ=Etc/UTC
|
31 |
+
|
32 |
+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
|
33 |
+
&& apt-get update --fix-missing \
|
34 |
+
#if errors with libtiff library
|
35 |
+
#&& apt-get install -y wget bzip2 curl git sudo libarchive-dev libtiff5-dev \
|
36 |
+
&& apt-get install -y wget bzip2 curl git sudo libarchive-dev libtiff5-dev zsh\
|
37 |
+
#Otherwise
|
38 |
+
# && apt-get install -y wget bzip2 curl git sudo \
|
39 |
+
&& apt-get clean \
|
40 |
+
&& rm -rf /var/lib/apt/lists/*
|
41 |
+
|
42 |
+
#-- Environmental variables for wandb
|
43 |
+
ENV LC_ALL=C.UTF-8 \
|
44 |
+
LANG=C.UTF-8
|
45 |
+
|
46 |
+
########################
|
47 |
+
# Create non-root user #
|
48 |
+
########################
|
49 |
+
ARG username=user\
|
50 |
+
uid=1000 \
|
51 |
+
gid=1000
|
52 |
+
ENV USER=$username \
|
53 |
+
UID=$uid \
|
54 |
+
GID=$gid
|
55 |
+
ENV HOME=/home/$USER
|
56 |
+
|
57 |
+
#-- Passwordless sudo (TODO: mv to root section)
|
58 |
+
RUN addgroup --gid $GID $USER \
|
59 |
+
&& adduser --disabled-password \
|
60 |
+
--gecos "Non-root user" \
|
61 |
+
--uid $UID \
|
62 |
+
--gid $GID \
|
63 |
+
--home $HOME $USER\
|
64 |
+
&& echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
65 |
+
#-- Move to user
|
66 |
+
USER $USER
|
67 |
+
|
68 |
+
# Add the jupyterlab settings
|
69 |
+
COPY --chown=$uid:$gid docker/jupyter_config $HOME/.jupyter
|
70 |
+
#####################
|
71 |
+
# Install miniconda #
|
72 |
+
#####################
|
73 |
+
|
74 |
+
ENV MINICONDA_VERSION=4.10.3 \
|
75 |
+
#ENV MINICONDA_VERSION=23.9.0 \
|
76 |
+
CONDA_DIR=$HOME/miniconda3 \
|
77 |
+
# Make non-activate conda commands available
|
78 |
+
PATH=$CONDA_DIR/bin:$PATH \
|
79 |
+
PROJECT_DIR=$HOME
|
80 |
+
|
81 |
+
RUN echo "HOME: ${HOME} | CONDA_DIR = ${CONDA_DIR}" \
|
82 |
+
#-- Install MINICONDA
|
83 |
+
&& wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_$MINICONDA_VERSION-Linux-x86_64.sh -O ~/miniconda.sh \
|
84 |
+
&& chmod +x ~/miniconda.sh \
|
85 |
+
&& ~/miniconda.sh -b -p $CONDA_DIR \
|
86 |
+
&& rm ~/miniconda.sh
|
87 |
+
|
88 |
+
# Make conda activate command available from /bin/bash --login shells
|
89 |
+
RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile
|
90 |
+
# make conda activate command available from /bin/bash --interative shells
|
91 |
+
RUN conda init bash \
|
92 |
+
# create a project directory inside user home
|
93 |
+
&& mkdir -p $PROJECT_DIR
|
94 |
+
|
95 |
+
WORKDIR $PROJECT_DIR
|
96 |
+
##########################
|
97 |
+
# Install & update MAMBA #
|
98 |
+
##########################
|
99 |
+
ENV ENV_PREFIX $PROJECT_DIR/env
|
100 |
+
RUN conda install --name base --channel conda-forge mamba \
|
101 |
+
&& mamba update --name base --channel defaults conda
|
102 |
+
#-- Build the mamba environment
|
103 |
+
RUN mamba install conda-lock -c conda-forge
|
104 |
+
COPY --chown=$UID:$GID docker/environment.yml docker/requirements.txt /tmp/
|
105 |
+
#RUN mamba lock -f /tmp/environment.yml --lockfile /tmp/environment.lock
|
106 |
+
#RUN mamba create --prefix ${ENV_PREFIX} --file /tmp/environment.lock
|
107 |
+
RUN mamba env create --prefix ${ENV_PREFIX} --file /tmp/environment.yml
|
108 |
+
RUN conda clean --all --yes
|
109 |
+
|
110 |
+
# run the postBuild script to install the JupyterLab extensions
|
111 |
+
COPY --chown=$UID:$GID docker/postBuild /usr/local/bin
|
112 |
+
RUN chmod u+x /usr/local/bin/postBuild \
|
113 |
+
&& conda activate $ENV_PREFIX \
|
114 |
+
&& /usr/local/bin/postBuild \
|
115 |
+
&& conda deactivate \
|
116 |
+
# Make bash automatically activate the conda environment
|
117 |
+
&& echo "conda activate $ENV_PREFIX" >> ~/.bashrc
|
118 |
+
RUN chmod u+x /usr/local/bin/postBuild \
|
119 |
+
&& conda activate $ENV_PREFIX \
|
120 |
+
&& /usr/local/bin/postBuild \
|
121 |
+
&& conda deactivate \
|
122 |
+
# Make bash automatically activate the conda environment
|
123 |
+
&& echo "conda activate $ENV_PREFIX" >> ~/.bashrc
|
124 |
+
|
125 |
+
|
126 |
+
#####################################################
|
127 |
+
# Install external libraries not available in conda #
|
128 |
+
#####################################################
|
129 |
+
RUN chmod u+x /usr/local/bin/postBuild \
|
130 |
+
&& conda activate $ENV_PREFIX \
|
131 |
+
&& pip install zennit==0.5.1 \
|
132 |
+
&& conda deactivate
|
133 |
+
|
134 |
+
RUN conda list --prefix ${ENV_PREFIX}
|
135 |
+
|
136 |
+
COPY --chown=$UID:$GID docker/entrypoint.sh /usr/local/bin
|
137 |
+
RUN chmod u+x /usr/local/bin/entrypoint.sh
|
138 |
+
|
139 |
+
|
140 |
+
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
141 |
+
|
142 |
+
ARG JUPYTER_TOKEN
|
143 |
+
ENV JUPYTER_TOKEN=${JUPYTER_TOKEN}
|
144 |
+
# default command will be to launch JupyterLab server for development
|
145 |
+
|
146 |
+
CMD ["sh", "-c", "jupyter lab --no-browser --ip 0.0.0.0 --ContentsManager.allow_hidden=True --NotebookApp.token=$JUPYTER_TOKEN"]
|
docker/Dockerfile.rstudio
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#############################
|
2 |
+
# RSTUDIO-SERVER #
|
3 |
+
# VOLUME DOCKERFILE #
|
4 |
+
#***************************#
|
5 |
+
# Set up a jupyter-lab for #
|
6 |
+
# developing using deepvats #
|
7 |
+
#############################
|
8 |
+
##############
|
9 |
+
# Base image #
|
10 |
+
##############
|
11 |
+
#FROM vrodriguezf/rstudio-server-shiny-development
|
12 |
+
# Adds rstudio server, tiyverse, devtools to rocker/cuda
|
13 |
+
FROM rocker/ml:4.2
|
14 |
+
|
15 |
+
SHELL [ "/bin/bash", "--login", "-c" ]
|
16 |
+
|
17 |
+
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
|
18 |
+
RUN apt-get update
|
19 |
+
RUN apt-get install -y python3-pip
|
20 |
+
RUN python3 -m pip install --upgrade pip
|
21 |
+
RUN apt-get install -y python3-venv libxt-dev
|
22 |
+
## Install R packages
|
23 |
+
|
24 |
+
#COPY docker/DESCRIPTION /tmp/
|
25 |
+
COPY --chown=${UID}:${GID} docker/DESCRIPTION /tmp/
|
26 |
+
|
27 |
+
RUN ls -la /tmp/ && sleep 5
|
28 |
+
|
29 |
+
#RUN R -e "install.packages(deps_path = '/tmp/DESCRIPTION', remotes::dev_package_deps(dependencies = TRUE), repos = NULL)"
|
30 |
+
|
31 |
+
RUN R -e "devtools::install_deps('/tmp/', dependencies = TRUE)"
|
32 |
+
|
33 |
+
#RUN R -e "install.packages(c('shiny', 'pals', 'shinyWidgets', 'dygraphs', 'shinycssloaders', 'shinyjs', 'Rcpp', 'reactlog', 'pals', 'feather', 'fasttime', 'zoo', 'shinyWidgets'))"
|
34 |
+
#RUN R -e "remotes::install_github('r-lib/later')"
|
35 |
+
#RUN R -e "remotes::install_github('apache/arrow/r')"
|
36 |
+
|
37 |
+
## Install reticulate and create virtual environment using default Ubuntu installed Python
|
38 |
+
#RUN R -e "install.packages('reticulate')"
|
39 |
+
|
40 |
+
ARG USER=user
|
41 |
+
ARG UID=1000
|
42 |
+
ARG GID=1000
|
43 |
+
ENV HOME /home/$USER
|
44 |
+
ENV ENV_PREFIX $HOME/env
|
45 |
+
|
46 |
+
RUN addgroup --gid $GID $USER
|
47 |
+
RUN adduser --disabled-password \
|
48 |
+
--gecos "Non-root user" \
|
49 |
+
--uid $UID \
|
50 |
+
--gid $GID \
|
51 |
+
--home $HOME \
|
52 |
+
$USER
|
53 |
+
|
54 |
+
RUN adduser $USER sudo
|
55 |
+
RUN echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
56 |
+
|
57 |
+
|
58 |
+
ARG RETICULATE_MINICONDA_PATH=/usr/local/share/r-miniconda
|
59 |
+
ARG RETICULATE_PYTHON_ENV=/usr/virtualenvs/venv_shiny_app
|
60 |
+
ENV RETICULATE_PYTHON=${RETICULATE_PYTHON_ENV}/bin/python/
|
61 |
+
|
62 |
+
#RUN R -e "reticulate::virtualenv_create(envname='${RETICULATE_PYTHON_ENV}', python='/usr/bin/python3')"
|
63 |
+
#RUN R -e "reticulate::virtualenv_install(c('numpy', 'pandas', 'wandb', 'hdbscan'), envname='${RETICULATE_PYTHON_ENV}')"
|
64 |
+
|
65 |
+
RUN echo "RETICULATE_PYTHON_ENV=${RETICULATE_PYTHON_ENV}" >> ${HOME}/.Renviron
|
66 |
+
RUN echo "RETICULATE_PYTHON=${RETICULATE_PYTHON}" >> ${HOME}/.Renviron
|
67 |
+
|
68 |
+
## Export W&B environment variable to Rstudio
|
69 |
+
|
70 |
+
ARG WANDB_API_KEY
|
71 |
+
RUN echo "WANDB_API_KEY=${WANDB_API_KEY}" >> /${HOME}/.Renviron
|
72 |
+
|
73 |
+
# use an entrypoint script to insure conda environment is properly activated at runtime
|
74 |
+
|
75 |
+
COPY --chown=${UID}:${GID} docker/entrypoint-rstudio.sh /usr/local/bin
|
76 |
+
RUN chmod u+x /usr/local/bin/entrypoint-rstudio.sh
|
77 |
+
ENTRYPOINT [ "/usr/local/bin/entrypoint-rstudio.sh" ]
|
78 |
+
|
79 |
+
# Rewrite the miniconda path environment in case it has been redefined in the compose file
|
80 |
+
RUN echo "RETICULATE_MINICONDA_PATH=${RETICULATE_MINICONDA_PATH}" >> ${HOME}/.Renviron
|
81 |
+
|
82 |
+
# make non-activate conda commands available
|
83 |
+
ENV PATH=${RETICULATE_MINICONDA_PATH}/bin:${PATH}
|
docker/dl_module/.devcontainer/.devcontainer.json
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
2 |
+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
|
3 |
+
{
|
4 |
+
"name": "Deep Learning Module (backend)",
|
5 |
+
"dockerComposeFile": ["../../docker-compose.yml"],
|
6 |
+
"service": "jupyter",
|
7 |
+
//"workspaceFolder": "/workspace/frontend", // TODO: What does this do?
|
8 |
+
// Configure tool-specific properties.
|
9 |
+
"customizations": {
|
10 |
+
// Configure properties specific to VS Code.
|
11 |
+
"vscode": {
|
12 |
+
// Set *default* container specific settings.json values on container create.
|
13 |
+
"settings": {
|
14 |
+
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
15 |
+
"python.linting.enabled": true,
|
16 |
+
"python.linting.pylintEnabled": true,
|
17 |
+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
18 |
+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
19 |
+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
20 |
+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
21 |
+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
|
22 |
+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
23 |
+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
24 |
+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
25 |
+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
|
26 |
+
},
|
27 |
+
|
28 |
+
// Add the IDs of extensions you want installed when the container is created.
|
29 |
+
"extensions": [
|
30 |
+
"ms-python.python",
|
31 |
+
"ms-python.vscode-pylance",
|
32 |
+
"ms-toolsai.jupyter",
|
33 |
+
"github.copilot",
|
34 |
+
"genieai.chatgpt-vscode",
|
35 |
+
"run-ai.vscode-genv"
|
36 |
+
]
|
37 |
+
}
|
38 |
+
},
|
39 |
+
|
40 |
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
41 |
+
// "forwardPorts": [],
|
42 |
+
|
43 |
+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
44 |
+
"remoteUser": "victor",
|
45 |
+
"features": {
|
46 |
+
"git": "latest",
|
47 |
+
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {},
|
48 |
+
"ghcr.io/devcontainers/features/python:1": {
|
49 |
+
"installTools": false, // TODO: Enabling this causes the container to fail to build
|
50 |
+
"installJupyterlab": true
|
51 |
+
}
|
52 |
+
// This should be by default given by the compose file
|
53 |
+
// "ghcr.io/devcontainers/features/nvidia-cuda:1": {
|
54 |
+
// "installCudnn": true
|
55 |
+
// }
|
56 |
+
},
|
57 |
+
"runArgs": ["--env-file", "../.env"]
|
58 |
+
//"runArgs": ["--env-file", ".devcontainer/devcontainer.env", "--gpus", "all"] // For machines with GPUs
|
59 |
+
|
60 |
+
// Use 'postCreateCommand' to run commands after the container is created.
|
61 |
+
//"postCreateCommand": "pip install --user -r requirements.txt"
|
62 |
+
}
|
docker/docker-compose.yml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
services:
|
2 |
+
jupyter:
|
3 |
+
build:
|
4 |
+
args:
|
5 |
+
- username=${USER_NAME}
|
6 |
+
- uid=${USER_ID}
|
7 |
+
- gid=${GROUP_ID}
|
8 |
+
- CUDA_VERSION=12.2.0-devel-ubuntu20.04
|
9 |
+
- JUPYTER_TOKEN=${JUPYTER_TOKEN}
|
10 |
+
context: ../
|
11 |
+
dockerfile: docker/Dockerfile.jupyter
|
12 |
+
image: dvats-jupyter:12.2.0-devel-ubuntu20.04
|
13 |
+
ports:
|
14 |
+
- "${JUPYTER_PORT}:8888"
|
15 |
+
environment:
|
16 |
+
- WANDB_ENTITY=${WANDB_ENTITY}
|
17 |
+
- WANDB_PROJECT=${WANDB_PROJECT}
|
18 |
+
- WANDB_API_KEY=${WANDB_API_KEY}
|
19 |
+
- GH_TOKEN=${GH_TOKEN}
|
20 |
+
- CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
|
21 |
+
- WANDB_DIR=/home/${USER_NAME}/work
|
22 |
+
- JUPYTER_TOKEN=${JUPYTER_TOKEN}
|
23 |
+
volumes:
|
24 |
+
- ../:/home/${USER}/work
|
25 |
+
- ${LOCAL_DATA_PATH}:/home/${USER_NAME}/data/
|
26 |
+
- conda-env:/home/${USER_NAME}/env
|
27 |
+
- miniconda:/home/${USER_NAME}/miniconda3
|
28 |
+
- lib:/home/${USER_NAME}/lib
|
29 |
+
init: true
|
30 |
+
stdin_open: true
|
31 |
+
tty: true
|
32 |
+
deploy:
|
33 |
+
resources:
|
34 |
+
reservations:
|
35 |
+
devices:
|
36 |
+
- driver: nvidia
|
37 |
+
count: all
|
38 |
+
capabilities: [gpu]
|
39 |
+
|
40 |
+
rstudio-server:
|
41 |
+
build:
|
42 |
+
context: ../
|
43 |
+
dockerfile: docker/Dockerfile.rstudio
|
44 |
+
args:
|
45 |
+
- WANDB_API_KEY=${WANDB_API_KEY} #
|
46 |
+
- RETICULATE_PYTHON_ENV=/home/${USER_NAME}/env
|
47 |
+
- RETICULATE_MINICONDA_PATH=/home/${USER_NAME}/miniconda3
|
48 |
+
- USER=${USER_NAME} #*
|
49 |
+
- UID=${USER_ID} #*
|
50 |
+
- GID=${GROUP_ID} #*
|
51 |
+
image: dvats-r:rocker-ml_4.2
|
52 |
+
ports:
|
53 |
+
- "${RSTUDIO_PORT}:8787" #*
|
54 |
+
environment:
|
55 |
+
- WANDB_ENTITY=${WANDB_ENTITY}
|
56 |
+
- WANDB_PROJECT=${WANDB_PROJECT}
|
57 |
+
- USER=${USER_NAME} #*
|
58 |
+
- USERID=${USER_ID} #*
|
59 |
+
- GROUPID=${GROUP_ID} #*
|
60 |
+
- PASSWORD=${RSTUDIO_PASSWD} #*
|
61 |
+
- ROOT=FALSE
|
62 |
+
- CUDA_VISIBLE_DEVICES=0,1,2
|
63 |
+
#- CUDA_VISIBLE_DEVICES=1
|
64 |
+
# - CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
|
65 |
+
- GH_TOKEN=${GH_TOKEN} #*
|
66 |
+
# TODO (28/03/2023): I don't know why it is not working without this
|
67 |
+
- ENV_VARS=WANDB_ENTITY,WANDB_PROJECT,USER,USERID,GROUPID,PASSWORD,ROOT,CUDA_VISIBLE_DEVICES
|
68 |
+
volumes:
|
69 |
+
- ../r_shiny_app:/home/${USER_NAME}/app #*
|
70 |
+
- ${LOCAL_DATA_PATH}:/home/${USER_NAME}/data/ #*
|
71 |
+
- ../dvats:/home/${USER_NAME}/dvats
|
72 |
+
- conda-env:/home/${USER_NAME}/env
|
73 |
+
- miniconda:/home/${USER_NAME}/miniconda3 #:ro
|
74 |
+
- lib:/home/${USER_NAME}/lib
|
75 |
+
deploy:
|
76 |
+
resources:
|
77 |
+
#limits:
|
78 |
+
#cpus: '0.75'
|
79 |
+
reservations:
|
80 |
+
devices:
|
81 |
+
- driver: nvidia
|
82 |
+
count: all
|
83 |
+
capabilities: [gpu]
|
84 |
+
|
85 |
+
volumes:
|
86 |
+
conda-env:
|
87 |
+
miniconda:
|
88 |
+
lib:
|
docker/entrypoint-rstudio.sh
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash --login
|
2 |
+
set -e
|
3 |
+
|
4 |
+
echo ". ${HOME}/miniconda3/etc/profile.d/conda.sh" >> ${HOME}/.bashrc
|
5 |
+
# Make bash automatically activate the conda environment
|
6 |
+
echo "conda activate ${ENV_PREFIX}" >> ~/.bashrc
|
7 |
+
#echo "export WANDB_ENTITY=${WANDB_ENTITY:-default}" >> ${HOME}/.bashrc
|
8 |
+
# echo "WANDB_ENTITY=${WANDB_ENTITY:-default}" >> ${HOME}/.Renviron
|
9 |
+
|
10 |
+
# Define an array of environment variable names from the ENV_VARS Compose variable
|
11 |
+
IFS=',' read -ra ENV_VAR_NAMES <<< "$ENV_VARS"
|
12 |
+
|
13 |
+
echo "ENV_VAR_NAMES=${ENV_VAR_NAMES[@]}"
|
14 |
+
|
15 |
+
# Loop through the array of environment variable names and set the variables
|
16 |
+
for ENV_VAR_NAME in "${ENV_VAR_NAMES[@]}"; do
|
17 |
+
ENV_VAR_VALUE="${!ENV_VAR_NAME:-default}"
|
18 |
+
echo "$ENV_VAR_NAME=$ENV_VAR_VALUE" >> ${HOME}/.Renviron
|
19 |
+
done
|
20 |
+
|
21 |
+
ulimit -s 16384
|
22 |
+
|
23 |
+
# start rstudio server
|
24 |
+
/init
|
25 |
+
exec "$@"
|
docker/entrypoint.sh
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash --login
|
2 |
+
set -e
|
3 |
+
echo $ENV_PREFIX
|
4 |
+
conda activate $ENV_PREFIX
|
5 |
+
conda list
|
6 |
+
pip install -e /home/$USER/work
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
exec "$@"
|
docker/environment.yml
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: dvats_env
|
2 |
+
channels:
|
3 |
+
#--- Torch & Cuda
|
4 |
+
- pytorch
|
5 |
+
#- nvidia/label/cuda-12.2.0
|
6 |
+
- nvidia
|
7 |
+
#--- Generic
|
8 |
+
- conda-forge
|
9 |
+
- defaults
|
10 |
+
#--- AI
|
11 |
+
- fastai
|
12 |
+
- rapidsai
|
13 |
+
- defaults
|
14 |
+
- conda-forge
|
15 |
+
|
16 |
+
- timeseriesai
|
17 |
+
dependencies:
|
18 |
+
##########################
|
19 |
+
# Generic configurations #
|
20 |
+
##########################
|
21 |
+
- nano=7.2=h8228510_0
|
22 |
+
- git=2.42.0=pl5321h86e50cf_0
|
23 |
+
#--- github
|
24 |
+
- gh=2.37.0=ha8f183a_0
|
25 |
+
#--- Python
|
26 |
+
- python=3.10.13=hd12c33a_0_cpython
|
27 |
+
#WANDB <= 0.15.12 needs this version. See https://github.com/wandb/wandb/issues/6546
|
28 |
+
- ipython=8.16.1=pyh0d859eb_0
|
29 |
+
- pip=23.3.1=pyhd8ed1ab_0
|
30 |
+
- conda-forge::twine=4.0.2=pyhd8ed1ab_0
|
31 |
+
- conda-forge::xeus-python=0.15.10=py310hd41b1e2_1
|
32 |
+
#--- NodeJS
|
33 |
+
- conda-forge::nodejs=20.8.1=h1990674_0
|
34 |
+
#---Jupyter
|
35 |
+
- conda-forge::ipywidgets=8.1.1=pyhd8ed1ab_0
|
36 |
+
- conda-forge::jupyterlab=4.0.7=pyhd8ed1ab_0
|
37 |
+
- conda-forge::jupyterlab-git=0.41.0=pyhd8ed1ab_1
|
38 |
+
- conda-forge::nbclassic=1.0.0=pyhb4ecaf3_1
|
39 |
+
- conda-forge::nbdev=2.2.10=pyhd8ed1ab_0
|
40 |
+
- nbformat>=5.1.3
|
41 |
+
#--- passwords & files
|
42 |
+
- keyrings.alt
|
43 |
+
- platformdirs=2.5.2
|
44 |
+
- conda-forge::keyrings.alt=4.2.0=pyhd8ed1ab_0
|
45 |
+
- psutil>=5.4.8
|
46 |
+
##############
|
47 |
+
# CUDA & GPU #
|
48 |
+
##############
|
49 |
+
- nvidia::cuda-toolkit=11.6=0
|
50 |
+
- rapidsai::cudf=23.02=cuda_11_py310_g5ad4a85b9d_0
|
51 |
+
- rapidsai::cuml=23.02=cuda11_py310_g3356f05bd_0
|
52 |
+
- conda-forge::genv=1.2.0=pyhd8ed1ab_0
|
53 |
+
############
|
54 |
+
# Specific #
|
55 |
+
############
|
56 |
+
#--- Torch
|
57 |
+
- pytorch=1.13=py3.10_cuda11.7_cudnn8.5.0_0
|
58 |
+
#---Graphs & imgs
|
59 |
+
- conda-forge::plotly=5.18.0=pyhd8ed1ab_0
|
60 |
+
- conda-forge::jpeg=9e=h166bdaf_2
|
61 |
+
- conda-forge::seaborn=0.13.0=hd8ed1ab_0
|
62 |
+
- conda-forge::matplotlib=3.8.1=py310hff52083_0
|
63 |
+
#--- IA
|
64 |
+
- conda-forge::hdbscan=0.8.33=py310h1f7b6fc_4
|
65 |
+
- conda-forge::imbalanced-learn>= 0.8.0
|
66 |
+
- conda-forge::pyts >= 0.12.0
|
67 |
+
- conda-forge::umap-learn=0.5.4=py310hff52083_0
|
68 |
+
- conda-forge::scikit-learn=1.2.2=py310hf7d194e_2
|
69 |
+
- conda-forge::wandb=0.14.2=pyhd8ed1ab_0
|
70 |
+
- fastai::fastai>=2.7.9
|
71 |
+
- timeseriesai::tsai
|
72 |
+
- conda-forge::feather-format
|
73 |
+
- conda-forge::python-kaleido #0.2.1
|
docker/get_jupyter_token.sh
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#Para obtener url si no va la contraseña del token
|
2 |
+
ip="127.0.0.1"
|
3 |
+
port=$(hostname | sed -e "s/.*-//")
|
4 |
+
nombre=$port".etsisi.upm.es"
|
5 |
+
puerto_original="8888"
|
6 |
+
puerto_final="8866"
|
7 |
+
docker compose logs jupyter | grep "token=" | tail -n 1 | sed -e "s/$ip/$nombre/" -e "s/$puerto_original/$puerto_final/" | sed "s/.*\(http\)/\1/"
|
docker/ipython_config.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
c.Completer.use_jedi = False
|
docker/jupyter_build.logs
ADDED
File without changes
|
docker/jupyter_config/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"codeCellConfig": {
|
3 |
+
"rulers": [80]
|
4 |
+
}
|
5 |
+
}
|
docker/jupyter_config/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"shortcuts": [
|
3 |
+
{
|
4 |
+
"command": "quickopen:activate",
|
5 |
+
"keys": [
|
6 |
+
"Accel ."
|
7 |
+
],
|
8 |
+
"selector": "body",
|
9 |
+
"title": "Activate Quick Open",
|
10 |
+
"category": "Main Area"
|
11 |
+
},
|
12 |
+
{
|
13 |
+
"command": "application:activate-next-tab",
|
14 |
+
"keys": [
|
15 |
+
"Alt ArrowRight"
|
16 |
+
],
|
17 |
+
"selector": "body"
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"command": "application:activate-previous-tab",
|
21 |
+
"keys": [
|
22 |
+
"Alt ArrowLeft"
|
23 |
+
],
|
24 |
+
"selector": "body"
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"command": "notebook:run-all-above",
|
28 |
+
"keys": [
|
29 |
+
"Accel F8"
|
30 |
+
],
|
31 |
+
"selector": ".jp-Notebook:focus"
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"command": "notebook:run-all-below",
|
35 |
+
"keys": [
|
36 |
+
"Accel F10"
|
37 |
+
],
|
38 |
+
"selector": ".jp-Notebook:focus"
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"command": "notebook:run-all-cells",
|
42 |
+
"keys": [
|
43 |
+
"Accel F9"
|
44 |
+
],
|
45 |
+
"selector": ".jp-Notebook:focus"
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"command": "kernelmenu:restart-and-clear",
|
49 |
+
"keys": [
|
50 |
+
"0 0"
|
51 |
+
],
|
52 |
+
"selector": "[data-jp-kernel-user]:focus"
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"command": "notebook:clear-cell-output",
|
56 |
+
"keys": [
|
57 |
+
"Accel o"
|
58 |
+
],
|
59 |
+
"selector": ".jp-Notebook:focus"
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"command": "console:run-forced",
|
63 |
+
"keys": [
|
64 |
+
"Enter"
|
65 |
+
],
|
66 |
+
"selector": ".jp-CodeConsole[data-jp-interaction-mode='notebook'] .jp-CodeConsole-promptCell"
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"command": "console:run-forced",
|
70 |
+
"keys": [
|
71 |
+
"Enter"
|
72 |
+
],
|
73 |
+
"selector": ".jp-CodeConsole[data-jp-interaction-mode='terminal'] .jp-CodeConsole-promptCell"
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"command": "console:linebreak",
|
77 |
+
"keys": [
|
78 |
+
"Accel Enter"
|
79 |
+
],
|
80 |
+
"selector": ".jp-CodeConsole[data-jp-interaction-mode='notebook'] .jp-CodeConsole-promptCell"
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"command": "console:linebreak",
|
84 |
+
"keys": [
|
85 |
+
"Accel Enter"
|
86 |
+
],
|
87 |
+
"selector": ".jp-CodeConsole[data-jp-interaction-mode='terminal'] .jp-CodeConsole-promptCell"
|
88 |
+
}
|
89 |
+
]
|
90 |
+
}
|
docker/jupyter_config/lab/user-settings/@parente/jupyterlab-quickopen/plugin.jupyterlab-settings
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
// Quick Open
|
3 |
+
// @parente/jupyterlab-quickopen:plugin
|
4 |
+
// Quick open panel settings
|
5 |
+
// ************************************
|
6 |
+
|
7 |
+
// Exclude Patterns
|
8 |
+
// File and directory patterns to exclude from the list
|
9 |
+
"excludes": [
|
10 |
+
"env",
|
11 |
+
"miniconda3",
|
12 |
+
"data",
|
13 |
+
"wandb",
|
14 |
+
".*",
|
15 |
+
"node_modules",
|
16 |
+
"__pycache__",
|
17 |
+
"*.egg-info"
|
18 |
+
],
|
19 |
+
|
20 |
+
// Relative Search
|
21 |
+
// Whether to search from currently selected directory
|
22 |
+
"relativeSearch": false
|
23 |
+
}
|
docker/port
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
g4
|
docker/postBuild
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
#jupyter lab build --dev-build=False --minimize=False
|
docker/requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
|