diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..31b29988e3834017757f946e0d56c278a77dbef6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +# 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 diff --git a/docker/jupyterlab/Dockerfile b/docker/jupyterlab/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..27e2cb498640331742b8ffb1f2c9f6b3aea946fd --- /dev/null +++ b/docker/jupyterlab/Dockerfile @@ -0,0 +1,8 @@ +# 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 diff --git a/docker/jupyterlab/README.md b/docker/jupyterlab/README.md index f90c4d7f10d023cdfd7a7f2ed43b6b75f56c895c..032a24dcababd5feb9ddc26d5884dafd25ee1f6c 100644 --- a/docker/jupyterlab/README.md +++ b/docker/jupyterlab/README.md @@ -1,4 +1,13 @@ ## 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. diff --git a/docker/jupyterlab/run b/docker/jupyterlab/run index 96235ce62d20bf5ad3aa73c138a16124d61df972..9111ac976bb7291f098c95d508dc29998d2ebd55 100644 --- a/docker/jupyterlab/run +++ b/docker/jupyterlab/run @@ -1 +1 @@ -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 diff --git a/tools.json b/tools.json index 6765aad831d49fcf86fbad3956954493e98e75d5..b032ac717d99c5df7790e0dbec97a2416583b1c8 100644 --- a/tools.json +++ b/tools.json @@ -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",