Commit e4f162bd authored by Thomas Lips's avatar Thomas Lips
Browse files

base image

parent b9c8022c
decrypted_login_ilabt_tlips@ugent.be.pem
......@@ -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
......
{
"ros.distro": "noetic"
}
\ No newline at end of file
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
......@@ -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.10 torchvision cudatoolkit=10.2 -c pytorch && \
# install pytorch
RUN conda install numpy && \
conda install pytorch=1.11 torchvision cudatoolkit=11.3 -c pytorch && \
conda clean --all -f -y
# install pip requirements
......
......@@ -13,3 +13,4 @@ tqdm
pre-commit
pytest
timm
albumentations
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment