Skip to content
Snippets Groups Projects
Commit 6b540688 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Merge branch '2098-plugin-install-docs-update' into 'develop'

Resolve "Plugin install docs update"

Closes #2098

See merge request !2025
parents 08c72538 baeac742
Branches
Tags
1 merge request!2025Resolve "Plugin install docs update"
Pipeline #215921 passed
...@@ -36,9 +36,9 @@ curl localhost/nomad-oasis/alive ...@@ -36,9 +36,9 @@ curl localhost/nomad-oasis/alive
- Open [http://localhost/nomad-oasis](http://localhost/nomad-oasis){:target="_blank"} in your browser. - Open [http://localhost/nomad-oasis](http://localhost/nomad-oasis){:target="_blank"} in your browser.
To run NORTH (the NOMAD Remote Tools Hub), the `hub` container needs to run docker and To run NORTH (the NOMAD Remote Tools Hub), the `north` container needs to run docker and
the container has to be run under the docker group. You need to replace the default group the container has to be run under the docker group. You need to replace the default group
id `991` in the `docker-compose.yaml`'s `hub` section with your systems docker group id. id `991` in the `docker-compose.yaml`'s `north` section with your systems docker group id.
Run `id` if you are a docker user, or `getent group | grep docker` to find our your Run `id` if you are a docker user, or `getent group | grep docker` to find our your
systems docker gid. The user id 1000 is used as the nomad user inside all containers. systems docker gid. The user id 1000 is used as the nomad user inside all containers.
...@@ -182,7 +182,7 @@ a version tag (format is `vX.X.X`, you find all releases [here](https://gitlab.m ...@@ -182,7 +182,7 @@ a version tag (format is `vX.X.X`, you find all releases [here](https://gitlab.m
- All containers will be named `nomad_oasis_*`. These names can be used later to reference the container with the `docker` cmd. - All containers will be named `nomad_oasis_*`. These names can be used later to reference the container with the `docker` cmd.
- The services are setup to restart `always`, you might want to change this to `no` while debugging errors to prevent indefinite restarts. - The services are setup to restart `always`, you might want to change this to `no` while debugging errors to prevent indefinite restarts.
- Make sure that the `PWD` environment variable is set. NORTH needs to create bind mounts that require absolute paths and we need to pass the current working directory to the configuration from the PWD variable (see hub service in the `docker-compose.yaml`). - Make sure that the `PWD` environment variable is set. NORTH needs to create bind mounts that require absolute paths and we need to pass the current working directory to the configuration from the PWD variable (see hub service in the `docker-compose.yaml`).
- The `hub` service needs to run docker containers. We have to use the systems docker group as a group. You might need to replace `991` with your - The `north` service needs to run docker containers. We have to use the systems docker group as a group. You might need to replace `991` with your
systems docker group id. systems docker group id.
#### nomad.yaml #### nomad.yaml
...@@ -555,7 +555,7 @@ An example file `~/.docker/config.json` could look like this. ...@@ -555,7 +555,7 @@ An example file `~/.docker/config.json` could look like this.
} }
``` ```
Since not all used services respect proxy variables, one also has to change the docker compose config file `docker-compose.yaml` for elastic search to: Since not all used services respect proxy variables, one also has to change the docker compose config file `docker-compose.yaml` for elastic search to:
```yaml hl_lines="7 8" ```yaml hl_lines="7 8"
elastic: elastic:
......
...@@ -23,8 +23,14 @@ If you already have an existing NOMAD Oasis setup, or do not wish to use the tem ...@@ -23,8 +23,14 @@ If you already have an existing NOMAD Oasis setup, or do not wish to use the tem
```Dockerfile ```Dockerfile
FROM gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:latest FROM gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:latest
# Switch to root user to install packages to the system with pip
USER root
# Install your plugin here, e.g.: # Install your plugin here, e.g.:
RUN pip install git+https://<repository_url> RUN pip install git+https://<repository_url>
# Remember to switch back to the 'nomad' user
USER nomad
``` ```
Depending on how your plugin code is distributed, you have several options for the actual install steps: Depending on how your plugin code is distributed, you have several options for the actual install steps:
...@@ -47,28 +53,17 @@ Depending on how your plugin code is distributed, you have several options for t ...@@ -47,28 +53,17 @@ Depending on how your plugin code is distributed, you have several options for t
RUN pip install nomad-example-schema-plugin --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple RUN pip install nomad-example-schema-plugin --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
``` ```
4. Copy plugin code from host machine: 4. Copy plugin folder from host machine. Note that the folder needs to be in the [Docker build context](https://docs.docker.com/build/building/context/):
```sh ```sh
RUN pip install build COPY <nomad-plugin-folder-name> <nomad-plugin-folder-name>
RUN cd <nomad-plugin-folder-name> && pip install .
COPY \
nomadschemaexample \
tests \
README.md \
LICENSE \
pyproject.toml \
.
RUN python -m build --sdist
RUN pip install dist/nomad-schema-plugin-example-*.tar.gz
``` ```
The customized image can then be built like this: The customized image can then be built like this:
``` ```
docker build -t nomad-with-plugins . --build-arg SETUPTOOLS_SCM_PRETEND_VERSION=<insert-nomad-version> docker build -t nomad-with-plugins .
``` ```
This will create a new image with the tag `nomad-with-plugins`, which you can use in your `docker-compose.yaml` file: This will create a new image with the tag `nomad-with-plugins`, which you can use in your `docker-compose.yaml` file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment