Skip to content

Commit ee64b69

Browse files
33 add jupyter dependencies (#34)
* Added empty jupyter category in toml and install in Dockerfile * Added jupyter instructions to the readme * Added instructions on pre pulling jupyter image * Correctly replace image name in README
1 parent e75ce30 commit ee64b69

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

.github/workflows/initialize.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
- name: Update README
2727
run: |
2828
sed -i "/# NOMAD Oasis Distribution/,/button on the right./d" README.md
29+
export image_name="${{ github.repository }}"
30+
sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" README.md
2931
sed -i "s|FAIRmat-NFDI/nomad-distribution-template|${{ github.repository }}|g" README.md
3032
sed -i "s|FAIRmat-NFDI|${{ github.repository_owner }}|g" README.md
3133
sed -i "s|nomad-distribution-template|${{ github.event.repository.name }}|g" README.md

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /bin/uv
142142
RUN --mount=type=cache,target=/root/.cache/uv \
143143
--mount=type=bind,source=uv.lock,target=uv.lock \
144144
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
145-
uv export --extra plugins | uv pip install -r /dev/stdin --system
145+
uv export --extra plugins --extra jupyter | uv pip install -r /dev/stdin --system
146146

147147

148148
# Get rid ot the following message when you open a terminal in jupyterlab:

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ and how to customize it through [adding plugins](#adding-a-plugin).
3636
In this README you will find instructions for:
3737
1. [Deploying the distribution](#deploying-the-distribution)
3838
2. [Adding a plugin](#adding-a-plugin)
39-
3. [Updating the distribution from the template](#updating-the-distribution-from-the-template)
40-
4. [Solving common issues](#faqtrouble-shooting)
39+
3. [Using the jupyter image](#the-jupyter-image)
40+
4. [Updating the distribution from the template](#updating-the-distribution-from-the-template)
41+
5. [Solving common issues](#faqtrouble-shooting)
4142

4243
## Deploying the distribution
4344

@@ -109,13 +110,15 @@ id `991` in the `docker-compose.yaml`'s `hub` section with your systems docker g
109110
Run `id` if you are a docker user, or `getent group | grep docker` to find your
110111
systems docker gid. The user id 1000 is used as the nomad user inside all containers.
111112
113+
Please see the [Jupyter image](#the-jupyter-image) section below for more information on the jupyter NORTH image being generated in this repository.
114+
112115
You can find more details on setting up and maintaining an Oasis in the NOMAD docs here:
113116
[nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html)
114117
115118
### For an existing Oasis
116119
117120
If you already have an Oasis running you only need to change the image being pulled in
118-
your `docker-compose.yaml` with `ghcr.io/FAIRmat-NFDI/nomad-distribution-template:main` for the services
121+
your `docker-compose.yaml` with `ghcr.io/fairmat-nfdi/nomad-distribution-template:main` for the services
119122
`worker`, `app`, `north`, and `logtransfer`.
120123
121124
If you want to use the `nomad.yaml` from this repository you also need to comment out
@@ -131,7 +134,7 @@ To run the new image you can follow steps 5. and 6. [above](#for-a-new-oasis).
131134
132135
## Adding a plugin
133136
134-
To add a new plugin to the docker image you should add it to the plugins table in the `pyproject.toml` file.
137+
To add a new plugin to the docker image you should add it to the plugins table in the [`pyproject.toml`](pyproject.toml) file.
135138
136139
Here you can put either plugins distributed to PyPI, e.g.
137140
@@ -172,6 +175,31 @@ plugins = [
172175
Once the changes have been committed to the main branch, the new image will automatically
173176
be generated.
174177
178+
## The Jupyter image
179+
180+
In addition to the Docker image for running the oasis, this repository also builds a custom NORTH image for running a jupyter hub with the installed plugins.
181+
This image has been added to the [`configs/nomad.yaml`](configs/nomad.yaml) during the initialization of this repository and should therefore already be available in your Oasis under "Analyze / NOMAD Remote Tools Hub / jupyter"
182+
183+
The image is quite large and might cause a timeout the first time it is run. In order to avoid this you can pre pull the image with:
184+
185+
```
186+
docker pull ghcr.io/fairmat-nfdi/nomad-distribution-template/jupyter:main
187+
```
188+
189+
If you want additional python packages to be available to all users in the jupyter hub you can add those to the jupyter table in the [`pyproject.toml`](pyproject.toml):
190+
191+
```toml
192+
[project.optional-dependencies]
193+
jupyter = [
194+
"voila",
195+
"ipyaggrid",
196+
"ipysheet",
197+
"ipydatagrid",
198+
"jupyter-flex",
199+
]
200+
```
201+
202+
175203
## Updating the distribution from the template
176204
177205
In order to update an existing distribution with any potential changes in the template you can add a new `git remote` for the template and merge with that one while allowing for unrelated histories:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ plugins = [
4040
"nomad-parser-plugins-workflow>=1.0",
4141
"nomad-parser-plugins-database>=1.0",
4242
]
43+
jupyter = []
4344
dev = ["nomad-lab[parsing, infrastructure, dev]>=1.3.4"]
4445

4546
[tool.uv]

0 commit comments

Comments
 (0)