Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme with curl instructions #10

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,3 @@ This repository is a template for creating your own custom NOMAD Oasis distribut
Click [here](https://github.com/new?template_name=nomad-distribution-template&template_owner=FAIRmat-NFDI)
to use this template, or click the `Use this template` button in the upper right corner of
the main GitHub page for this template.

## Deploying the distribution

Below are instructions for how to deploy this NOMAD Oasis distribution
[for a new Oasis](#for-a-new-oasis) and [for an existing Oasis](#for-an-existing-oasis)

### For a new Oasis

- Find a Linux computer.
- Make sure you have [docker](https://docs.docker.com/engine/install/) installed.
Docker nowadays comes with `docker compose` built in. Prior, you needed to
install the stand-alone [docker-compose](https://docs.docker.com/compose/install/).
- Download the modified configuration files [nomad-oasis.zip](nomad-oasis.zip) from this repository.
- Run the following commands (skip `chown` on MacOS and Windows computers)


```sh
unzip nomad-oasis.zip
cd nomad-oasis
sudo chown -R 1000 .volumes
docker compose pull
docker compose up -d
curl localhost/nomad-oasis/alive
```

- Open [http://localhost/nomad-oasis](http://localhost/nomad-oasis) in your browser.

To run NORTH (the NOMAD Remote Tools Hub), the `hub` container needs to run docker and
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.
Run `id` if you are a docker user, or `getent group | grep docker` to find your
systems docker gid. The user id 1000 is used as the nomad user inside all containers.

You can find more details on setting up and maintaining an Oasis in the NOMAD docs here:
[nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html)

### For an existing Oasis

If you already have an Oasis running you only need to change the image being pulled in
your `docker-compose.yaml` with `ghcr.io/GITHUB_REPOSITORY:main` for the services
`worker`, `app`, `north`, and `logtransfer`.

If you want to use the `nomad.yaml` from this repository you also need to comment out
the inclusion of the `nomad.yaml` under the volumes key of those services in the
`docker-compose.yaml`.

```yaml
volumes:
# - ./configs/nomad.yaml:/app/nomad.yaml
```
34 changes: 27 additions & 7 deletions template_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,43 @@ Below are instructions for how to deploy this NOMAD Oasis distribution

### For a new Oasis

- Find a Linux computer.
- Make sure you have [docker](https://docs.docker.com/engine/install/) installed.
1. Make sure you have [docker](https://docs.docker.com/engine/install/) installed.
Docker nowadays comes with `docker compose` built in. Prior, you needed to
install the stand-alone [docker-compose](https://docs.docker.com/compose/install/).
- Download the modified configuration files [nomad-oasis.zip](nomad-oasis.zip) from this repository.
- Run the following commands (skip `chown` on MacOS and Windows computers)


2. Get the `nomad-oasis.zip` archive from your distribution repository using for example curl
```sh
curl -L -o nomad-oasis.zip "https://github.com/GITHUB_REPOSITORY/raw/main/nomad-oasis.zip"
```
3. Unzip the `nomad-oasis.zip` file and enter the extracted directory
```sh
unzip nomad-oasis.zip
cd nomad-oasis
```
4. _On Linux only,_ recursively change the owner of the `.volumes` directory to the nomad user (1000)
```sh
sudo chown -R 1000 .volumes
```
5. Pull the images speicified in the `docker-compose.yaml` (retrieved from the `nomad-oasis.zip`) using
```sh
docker compose pull
```
6. And run it with docker compose in detached (--detach or -d) mode
```sh
docker compose up -d
```
7. Optionally you can now test that NOMAD is running with
```
curl localhost/nomad-oasis/alive
```
8. Finally, open [http://localhost/nomad-oasis](http://localhost/nomad-oasis) in your browser to start using your new NOMAD Oasis.

- Open [http://localhost/nomad-oasis](http://localhost/nomad-oasis) in your browser.
Whenever you update your image you need to shut down NOMAD using
```sh
docker compose down
```
and then repeat steps 5. and 6. above.

#### NOMAD Remote Tools Hub (NORTH)
To run NORTH (the NOMAD Remote Tools Hub), the `hub` container needs to run docker and
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.
Expand All @@ -68,6 +86,8 @@ the inclusion of the `nomad.yaml` under the volumes key of those services in the
# - ./configs/nomad.yaml:/app/nomad.yaml
```

To run the new image you can follow steps 5. and 6. [above](#for-a-new-oasis).

## Adding a plugin

To add a new plugin to the docker image you should add it to the [plugins.txt](plugins.txt) file.
Expand Down
Loading