Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Lips
docker-resources
Commits
e4f162bd
Commit
e4f162bd
authored
Apr 25, 2022
by
Thomas Lips
Browse files
base image
parent
b9c8022c
Changes
6
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
e4f162bd
decrypted_login_ilabt_tlips@ugent.be.pem
.gitlab-ci.yml
View file @
e4f162bd
...
...
@@ -3,7 +3,7 @@ services:
-
docker:18-dind
stages
:
-
build
-jupyterlab
-
build
-
release
variables
:
...
...
@@ -18,10 +18,10 @@ before_script:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build_jupyterlab-pytorch
:
stage
:
build
-jupyterlab
stage
:
build
script
:
-
docker pull $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE ||
true
-
docker build --pull --cache-from $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE --tag $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
JupyterLab
-
docker build --pull --cache-from $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE --tag $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
. -f gpulab-jupyterhub.Dockerfile
-
docker push $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
...
...
.vscode/settings.json
0 → 100644
View file @
e4f162bd
{
"ros.distro"
:
"noetic"
}
\ No newline at end of file
docker/base.Dockerfile
0 → 100644
View file @
e4f162bd
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"]
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
build-essential
\
curl
\
wget
\
p7zip-full
\
unzip \
screen \
sudo \
git \
openssh-server
# add user
# bc running as root will result in all outputfiles in mounted volumes to be root only
# for convenience, disable pwd for sudo (UNSAFE for production etc.)
RUN
useradd
-ms
/bin/bash user
&&
usermod
-aG
sudo
user
RUN
echo
'%sudo ALL=(ALL) NOPASSWD:ALL'
>>
/etc/sudoers
# install miniconda for all users
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
# create conda environment and link it to jupyter
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}"
#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
&&
\
conda clean
--all
-f
-y
# install pip requirements
COPY
requirements.txt /tmp/
RUN
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
J
upyter
Lab/
Dockerfile
→
docker/gpulab-j
upyter
hub.
Dockerfile
View file @
e4f162bd
...
...
@@ -23,9 +23,9 @@ ENV CONDA_DEFAULT_ENV ${conda_env}
## install dependencies
# install pytorch
1.10
RUN
conda
install
numpy
=
1.21.2
&&
\
conda
install
pytorch
=
1.1
0
torchvision
cudatoolkit
=
1
0.2
-c
pytorch
&&
\
# install pytorch
RUN
conda
install
numpy
&&
\
conda
install
pytorch
=
1.1
1
torchvision
cudatoolkit
=
1
1.3
-c
pytorch
&&
\
conda clean
--all
-f
-y
# install pip requirements
...
...
JupyterLab
/requirements.txt
→
docker
/requirements.txt
View file @
e4f162bd
...
...
@@ -13,3 +13,4 @@ tqdm
pre-commit
pytest
timm
albumentations
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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