An example for Jupyter NORTH tool (Jupyter docker image).
Project description
NORTH Jupyter tool
nomad-north-jupyter is a NOMAD plugin that provides an entry point for using a JupyterLab environment in NORTH (NOMAD Remote Tools Hub).
Quickstart
This plugin is available in PyPI under the name nomad-north-jupyter. To install this plugin into a NOMAD Oasis, add the following to your pyproject.toml:
[project.optional-dependencies]
plugins = [
"nomad-north-jupyter",
...
]
By adding this plugin, the jupyter NORTH tool will become available in the NORTH tools registry of the NOMAD Oasis.
By default this plugin is configured to use a generic Jupyter environment, but you can build your own custom image for your Oasis and switch to it using the nomad.yaml configuration file:
plugins:
entry_points:
options:
nomad_north_jupyter.north_tools.jupyter:
north_tool:
image: <your-docker-image-path>
Plugin overview
The jupyter NORTH tool instance provided by this plugin, offers a containerized JupyterLab environment for interactive analysis. The plugin contains the NORTH tool configuration and the
nomad-north-jupyter image for a Jupyter-based tool in the NORTH (NOMAD Oasis Remote Tools Hub) environment.
In the following sections, we will cover:**
-
Adding
nomad-north-jupyterimage directly in a NOMAD Oasis (not recommended) -
Using
nomad-north-jupyteras a base image for customNORTHtools
Adding the nomad-north-jupyter plugin to NOMAD
Currently, NOMAD has two distinct flavors (NOMAD Oasis and NOMAD development environment) that are relevant depending on your role as an user.
Adding the nomad-north-jupyter plugin in your NOMAD Oasis
If you work with the nomad-distro-template, the nomad-north-jupyter plugin is installed by default. This facilitates NOMAD to autonomously discover and integrate the NORTHTool via NorthToolEntryPoint defined in the plugin. The tool will automatically be available in the NORTH tools registry of the NOMAD Oasis environment. Learn more about how this plugin is integrated in the nomad-distro-template documentation.
Adding nomad-north-jupyter plugin in your local NOMAD installation
We recommend using the dedicated nomad-distro-dev to facilitate NOMAD plugin development. To add nomad-north-jupyter to your local development environment, add it as a dependency in pyproject.toml. NOMAD will automatically discover the NORTHToolEntryPoint instance jupyter defined in nomad-north-jupyter. To replace or modify the NORTH tool configuration (for instance, changing the image or image version), you can adjust the entry point configuration in your nomad.yaml file.
Reconfigure existing NORTH tool entry point
As outlined above, the image shipped with nomad-north-jupyter by default is a generic slim Jupyter container that may be too simplistic for your use case. In that case, you can change to a different image to use in the container. A NORTHTool entry point can be reconfigured via the nomad.yaml configuration file of your NOMAD Oasis instance (you can learn more about this reconfiguration and the merge strategy in the NOMAD docs). Hence, if you have the nomad-north-jupyter plugin installed, you can do so by adjusting the entry point configuration in your nomad.yaml file:
plugins:
entry_points:
options:
nomad_north_jupyter.north_tools:jupyter:
north_tool:
image: ghcr.io/fairmat-nfdi/nomad-north-jupyter:<another_tag>
display_name: "renamed jupyter tool"
A note on publishing
In our Python package publishing workflow, before building the package, we update the image tag in the NORTHTool entry point to the latest release version of the image (e.g., v0.1.5), and then publish the package to PyPI.
However, the updated image tag in NORTHTool is not pushed back to the GitHub repository. Therefore, the image tag in the GitHub repository always remains set to main, even when you check out a specific release tag. For this reason, we recommend installing the plugin from PyPI, where the entry point always contains the correct image tag corresponding to the release.
If you download a ZIP file of a specific release from GitHub, the image tag in the entry point will still be set to main, which is not correct. In that case, you can either manually update the image tag in the entry point to the correct release version (e.g., v0.1.5), or install the plugin directly from PyPI.
Adding nomad-north-jupyter image directly in an Oasis (not recommended)
[!WARNING] We strongly recommend integrating
nomad-north-jupyterinto NOMAD as a plugin. The following approach is only recommended if you have an existing NOMAD Oasis instance that you do not want to rebuild, but still want to add the Jupyter image to the runningNORTHservice.
If you cannot use the plugin approach, you can add the nomad-north-jupyter image to your NORTH service by editing the nomad.yaml file in a nomad-distro-template instance. Define the corresponding NORTH tool in nomad.yaml as shown below (see the full NORTH tool configuration in the NOMAD documentation):
# Not a recommended way
north:
jupyterhub_crypt_key: "978bfb2e13a8448a253c629d8dd84ffsd587f30e635b753153960930cad9d36d"
tools:
options:
jupyter:
image: ghcr.io/fairmat-nfdi/nomad-north-jupyter:latest
description: "### **Jupyter Notebook**: The Classic Notebook Interface"
file_extensions:
- ipynb
icon: jupyter_logo.svg
image_pull_policy: Always
maintainer:
- email: fairmat@physik.hu-berlin.de
name: NOMAD Authors
mount_path: /home/jovyan
path_prefix: lab/tree
privileged: false
short_description: ""
with_path: true
Building and testing the Docker image locally
Build the Docker image locally:
docker build -f src/nomad_north_jupyter/north_tools/jupyter_north_tool/Dockerfile \
-t ghcr.io/fairmat-nfdi/nomad-north-jupyter:latest .
Test the image:
docker run -p 8888:8888 ghcr.io/fairmat-nfdi/nomad-north-jupyter:latest
Access JupyterLab at http://localhost:8888.
Using nomad-north-jupyter as a base image for custom NORTH tools
The nomad-north-jupyter image from this plugin provides the default base image for Dockerfile which is used as a basis to define custom Jupyter NORTH tools.
This image is designed to be used as a base for custom NOMAD NORTH Jupyter tools. When extending this image in your plugin's Dockerfile created from cookiecutter-nomad-plugin, keep the following in mind:
Package management
Both uv and pip are available as package managers in the image. Both install and uninstall packages in the Conda environment, so you can use either one of them to manage your Python dependencies.
Example using uv:
RUN uv pip install numpy pandas scipy
Example using pip:
RUN pip install --no-cache-dir matplotlib seaborn
Port and user configuration
Like other Jupyter notebook images, port 8888 is exposed for JupyterLab access. The default user is ${NB_USER} (usually jovyan), and you should switch to this user when installing packages or copying files to ensure proper permissions.
Fixing permissions
After customizing the base image (e.g., installing additional packages or adding files), you may need to fix file permissions to avoid permission issues when running the container. Add the following lines at the end of your Dockerfile after all customizations:
COPY --chown=${NB_USER}:${NB_GID} . ${HOME}/${PLUGIN_NAME}
RUN fix-permissions "/home/${NB_USER}" \
&& fix-permissions "${CONDA_DIR}"
Documentation
For comprehensive documentation on creating and managing NORTH tools, including detailed information on topics such as:
- Entry point configuration and
NORTHToolAPI - Docker image structure and best practices
- Dependency management
See the NOMAD NORTH Tools documentation.
[!NOTE] This NOMAD plugin was generated with
Cookiecutteralong with@nomad'scookiecutter-nomad-plugintemplate.
Main contributors
| Name | |
|---|---|
| NOMAD Authors | fairmat@physik.hu-berlin.de |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nomad_north_jupyter-0.2.4.tar.gz.
File metadata
- Download URL: nomad_north_jupyter-0.2.4.tar.gz
- Upload date:
- Size: 110.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba73a16f35776b169534daf84b9c33de13900e6135c2573b75604392bd4dcfb0
|
|
| MD5 |
a4f9dab1beb74c7e75ea1a4c9b506688
|
|
| BLAKE2b-256 |
c282c527b533a1bcaa81bb63a0367647201bf83cf8c4a4d9e6db8da12dad117e
|
Provenance
The following attestation bundles were made for nomad_north_jupyter-0.2.4.tar.gz:
Publisher:
publish.yml on FAIRmat-NFDI/nomad-north-jupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomad_north_jupyter-0.2.4.tar.gz -
Subject digest:
ba73a16f35776b169534daf84b9c33de13900e6135c2573b75604392bd4dcfb0 - Sigstore transparency entry: 1110088508
- Sigstore integration time:
-
Permalink:
FAIRmat-NFDI/nomad-north-jupyter@a53d03c5c46d545521a34af5c259d0778a485ef3 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/FAIRmat-NFDI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a53d03c5c46d545521a34af5c259d0778a485ef3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nomad_north_jupyter-0.2.4-py3-none-any.whl.
File metadata
- Download URL: nomad_north_jupyter-0.2.4-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21c670ee1acb53a49832f1bd34f28b0029f596a7fc74d686b767804a80e2a390
|
|
| MD5 |
bb8bd6bf915c55da8c45837ed20d19e5
|
|
| BLAKE2b-256 |
e528f35fd12b6cfd582b927f74f45e345727448a920d7c262fd7e42678e90883
|
Provenance
The following attestation bundles were made for nomad_north_jupyter-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on FAIRmat-NFDI/nomad-north-jupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomad_north_jupyter-0.2.4-py3-none-any.whl -
Subject digest:
21c670ee1acb53a49832f1bd34f28b0029f596a7fc74d686b767804a80e2a390 - Sigstore transparency entry: 1110088513
- Sigstore integration time:
-
Permalink:
FAIRmat-NFDI/nomad-north-jupyter@a53d03c5c46d545521a34af5c259d0778a485ef3 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/FAIRmat-NFDI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a53d03c5c46d545521a34af5c259d0778a485ef3 -
Trigger Event:
release
-
Statement type: