Skip to content
Snippets Groups Projects
Commit 337f2f6b authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added a CI/CD build Dockerfile for jupyterlab to create an image with the...

Added a CI/CD build Dockerfile for jupyterlab to create an image with the current nomad-lab Python package.
parent ee3bd1d3
No related tags found
1 merge request!85Added a CI/CD build Dockerfile for jupyterlab to create an image with the...
Pipeline #150048 passed
# default installed image for docker executor is: python:3.6
# using an image that can do git, docker, docker-compose
image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair/ci-runner:latest
stages:
- build
build:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_UPDATE_FLAGS: --jobs 4
DOCKER_BUILDKIT: 1
before_script:
- docker --version
- echo "${CI_REGISTRY_PASSWORD}" | docker login ${CI_REGISTRY} --username ${CI_REGISTRY_USER} --password-stdin
script:
- docker build -t ${CI_REGISTRY_IMAGE}/jupyterlab:latest docker/jupyterlab
- docker push ${CI_REGISTRY_IMAGE}/jupyterlab:latest
rules:
- if: $CI_COMMIT_TAG
when: never
- when: on_success
\ No newline at end of file
# Create a build stage from the current nomad dev_python image to copy the nomad-lab
# distribution
FROM gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair/dev_python:develop AS dev_python
FROM jupyter/datascience-notebook
COPY --from=dev_python /app/dist/nomad-lab-*.tar.gz .
RUN pip install nomad-lab-*.tar.gz
## JupyterLab
We are using the [jupyter/datascience-notebook](https://hub.docker.com/r/jupyter/datascience-notebook) image from DockerHub with some added arguments. This folder stores the docker run command we can use in the launch endpoint.
We are use a custom image based on [jupyter/datascience-notebook](https://hub.docker.com/r/jupyter/datascience-notebook).
We add the latest version of the `nomad-lab` Python package. The image is build by the
CI/CD and stored in the projects container registry.
To build the image
```
docker build -t gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/jupyterlab:latest .
```
This folder stores the `Dockerfile` and a `run` command.
There are also Python named string parameters to make the cmd a bit more dynamic.
docker run -p {port}:8888 -v {mountpoint}:/home/jovyan/work --user 1000:1000 --group-add users jupyter/datascience-notebook start-notebook.sh --NotebookApp.base_url='{endpoint}'
\ No newline at end of file
docker run -p {port}:8888 -v {mountpoint}:/home/jovyan/work --user 1000:1000 --group-add users gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/jupyterlab:latest start-notebook.sh --NotebookApp.base_url='{endpoint}'
\ No newline at end of file
......@@ -2,7 +2,7 @@
"jupyter": {
"short_description": "Basic jupyter run with an empty notebook or on given notebook file.",
"description": "### **Jupyter Notebook**: The Classic Notebook Interface\n\nThe Jupyter Notebook is the original web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience.",
"image": "jupyter/datascience-notebook",
"image": "gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/jupyterlab:latest",
"path_prefix": "tree",
"mount_path": "/home/jovyan",
"icon": "jupyter_logo.svg",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment