Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Lips
docker-resources
Commits
21644428
Commit
21644428
authored
Apr 27, 2022
by
Thomas Lips
Browse files
v0.0
parent
d85dcc94
Pipeline
#62589
passed with stage
in 43 minutes and 8 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docker/base.Dockerfile
View file @
21644428
...
...
@@ -2,7 +2,6 @@ FROM nvidia/cuda:11.3.0-cudnn8-runtime-ubuntu20.04
ARG
conda_env=python39
ARG
py_ver=3.9
ARG
torch_version=1.11 # make sure this matches the CUDA version of the container
# set default shell to bash
SHELL
["/bin/bash", "-c"]
...
...
@@ -10,6 +9,7 @@ SHELL ["/bin/bash", "-c"]
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
build-essential
\
curl
\
nano
\
wget \
p7zip-full \
unzip \
...
...
@@ -30,40 +30,37 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV
CONDA_PATH=/opt/conda
RUN
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-q
&&
\
bash Miniconda3-latest-Linux-x86_64.sh -b -p ${CONDA_PATH} && \
ln -s ${CONDA_PATH}/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo "source conda init && conda activate ${conda_env}" >> /home/user/.bashrc && \
rm -f Miniconda3-latest-Linux-x86_64.sh && \
chmod -R 777 ${CONDA_PATH}
# activate conda base nev
ENV
PATH=${CONDA_PATH}/bin:$PATH
# change to user and set working dir
USER
user
WORKDIR
/home/user
RUN
source
${
CONDA_PATH
}
/bin/activate
&&
conda init
# initialize conda
ENV
PATH=${CONDA_PATH}/bin:$PATH
RUN
conda init
# create conda environment and link it to jupyter
# create conda environment and link it to jupyter
kernel to use it in notebooks
RUN
conda create
--quiet
--yes
-p
"
${
CONDA_PATH
}
/envs/
${
conda_env
}
"
python
=
${
py_ver
}
ipython ipykernel jupyter
&&
\
conda clean
--all
-f
-y
&&
\
"${CONDA_PATH}/envs/${conda_env}/bin/python" -m ipykernel install --user --name="${conda_env}"
# activate the conda_env in bash terminals by default.
# not the case for docker RUN commands as these run in separate shells.
RUN
echo
"conda activate
${
conda_env
}
"
>>
/home/user/.bashrc
#set as default
ENV
CONDA_DEFAULT_ENV ${conda_env}
# install pytorch 1.11
RUN
conda
install
numpy
=
&&
\
conda
install
pytorch
=
1.11 torchvision cudatoolkit
-c
pytorch
&&
\
# install pytorch 1.11 and dependencies in the conda env
RUN
source
${
CONDA_PATH
}
/bin/activate
&&
conda activate
${
conda_env
}
&&
\
conda install numpy=
1.21.5
&& \
conda install pytorch=1.11 torchvision
=0.12.0
cudatoolkit
=11.3.1
-c pytorch && \
conda clean --all -f -y
# install pip requirements
# install pip requirements
in the conda env
COPY
requirements.txt /tmp/
RUN
pip
install
--quiet
--no-cache-dir
-r
/tmp/requirements.txt
RUN
"
${
CONDA_PATH
}
/envs/
${
conda_env
}
/bin/pip"
install
--quiet
--no-cache-dir
-r
/tmp/requirements.txt
# keep container running (so no need to explicitly use interactive mode for starting the container)
CMD
tail -f /dev/null
\ No newline at end of file
docker/gpulab-jupyterhub.Dockerfile
View file @
21644428
...
...
@@ -21,15 +21,14 @@ ENV PATH "${CONDA_DIR}/envs/${conda_env}/bin:${PATH}"
# set to default
ENV
CONDA_DEFAULT_ENV ${conda_env}
## install dependencies
## install dependencies
# install pytorch
RUN
conda
install
numpy
&&
\
conda
install
pytorch
=
1.11 torchvision
cudatoolkit
=
11.3
-c
pytorch
&&
\
# install pytorch 1.11
RUN
source
${
CONDA_DIR
}
/bin/activate
&&
conda activate
${
conda_env
}
&&
\
conda install numpy=1.21.5 && \
conda install pytorch=1.11 torchvision=0.12.0 cudatoolkit=11.3.1 -c pytorch && \
conda clean --all -f -y
# install pip requirements
COPY
requirements.txt /tmp/
RUN
"
${
CONDA_DIR
}
/envs/
${
conda_env
}
/bin/pip"
install
--quiet
--no-cache-dir
-r
/tmp/requirements.txt
RUN
"
${
CONDA_DIR
}
/envs/
${
conda_env
}
/bin/pip"
install
--quiet
--no-cache-dir
-r
/tmp/requirements.txt
\ No newline at end of file
docker/requirements.txt
View file @
21644428
pytorch-lightning
matplotlib
pytorch-lightning
==1.6
matplotlib
==3.5.1
requests
pyyaml
pandas
scipy
scikit-learn
scikit-image
seaborn
wandb
pandas
==1.4.2
scipy
==1.8.0
scikit-learn
==1.0.2
scikit-image
==0.19.2
seaborn
==0.11.2
wandb
==0.12.15
ipywidgets
tqdm
pre-commit
pytest
timm
albumentations
timm
==0.5.4
albumentations
==1.1.0
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment