Commit 4fccbc89 authored by Thomas Lips's avatar Thomas Lips
Browse files

update documentation and rename images

parent eae90037
Pipeline #44782 passed with stages
in 25 minutes and 10 seconds
......@@ -3,33 +3,33 @@ services:
- docker:18-dind
stages:
- build-pytorch
- build-jupyterlab
- release
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
CONTAINER_PYTORCH_IMAGE: $CI_REGISTRY_IMAGE/pytorch:$CI_COMMIT_REF_SLUG
CONTAINER_PYTORCH_RELEASE_IMAGE: $CI_REGISTRY_IMAGE/pytorch:latest
CONTAINER_JUPYTERLAB_PYTORCH_IMAGE: $CI_REGISTRY_IMAGE/jupyterlab-pytorch:$CI_COMMIT_REF_SLUG
CONTAINER_JUPYTERLAB_PYTORCH_RELEASE_IMAGE: $CI_REGISTRY_IMAGE/jupyterlab-pytorch:latest
before_script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build_pytorch:
stage: build-pytorch
build_jupyterlab-pytorch:
stage: build-jupyterlab
script:
- docker pull $CONTAINER_PYTORCH_IMAGE || true
- docker build -f JupyterLab/Dockerfile --pull --cache-from $CONTAINER_PYTORCH_IMAGE --tag $CONTAINER_PYTORCH_IMAGE .
- docker push $CONTAINER_PYTORCH_IMAGE
- docker pull $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE || true
- docker build --pull --cache-from $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE --tag $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE JupyterLab
- docker push $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
release_pytorch:
stage: release
script:
- docker pull $CONTAINER_PYTORCH_IMAGE
- docker tag $CONTAINER_PYTORCH_IMAGE $CONTAINER_PYTORCH_RELEASE_IMAGE
- docker push $CONTAINER_PYTORCH_RELEASE_IMAGE
- docker pull $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
- docker tag $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE $CONTAINER_JUPYTERLAB_PYTORCH_RELEASE_IMAGE
- docker push $CONTAINER_JUPYTERLAB_PYTORCH_IMAGE
only:
- main
# select base image: minimal jupyter notebook (gpu-enabled)
FROM gitlab.ilabt.imec.be:4567/ilabt/gpu-docker-stacks/minimal-notebook:cuda10.1-ubuntu18.04
# set python version to 3.0
## create custom conda env to select python version, based on
## https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#using-pip-install-or-conda-install-in-a-child-docker-image
# set python version to 3.8
ARG conda_env=python38
ARG py_ver=3.8
......@@ -18,6 +21,8 @@ ENV PATH "${CONDA_DIR}/envs/${conda_env}/bin:${PATH}"
# set to default
ENV CONDA_DEFAULT_ENV ${conda_env}
## install dependencies
# install pytorch 1.9.1
RUN conda install numpy=1.21.2 && \
conda install pytorch=1.9.1 torchvision cudatoolkit=10.2 -c pytorch && \
......
......@@ -2,7 +2,24 @@
Docker resources for GPULab
## Available Docker images:
- `jupyterlab-pytorch` : a Pytorch ecosystem image for use with the Jupyterhub.
## Local development
- build using `docker build -t jupyter-lab:test JupyterLab/`
- run the container using `docker run -p 8888:8888 -it -e JUPYTER_ENABLE_LAB=yes jupyter-lab:test`
- follow the URL in the cli to open the jupyter lab instance and test the environment
## Using the images on the IDLab JupyterHub:
- use `gitlab+deploy-token-8:sjP_1QfesuQvig1R3fWu@gitlab.ilabt.imec.be:4567/tlips/gpulab/jupyterlab-pytorch:latest` as custom docker image.
### Known Issues:
- sometimes a 403 error appears in jupyter lab when opening the `python38` kernel, this has to do with caching of chrome (cf https://github.com/jupyter/notebook/issues/2396). The solution is to do a hard refresh (CTRL + F5).
\ No newline at end of file
- sometimes a 403 error appears in jupyter lab when opening the `python38` kernel, this has to do with caching of chrome (cf https://github.com/jupyter/notebook/issues/2396). The solution is to do a hard refresh (CTRL + F5).
## documentation & inspiration
- gitlab build: https://gitlab.ilabt.imec.be/dml/gpulab/-/blob/master/.gitlab-ci.yml
- custom conda env: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#using-pip-install-or-conda-install-in-a-child-docker-image
- base images: https://gitlab.ilabt.imec.be/ilabt/gpu-docker-stacks ; https://doc.ilabt.imec.be/ilabt/jupyter/configuration.html#docker-image
\ No newline at end of file
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