Skip to content

Commit

Permalink
Add instructions and configs for Waldur SLURM service setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-zaiaev authored and livenson committed Sep 6, 2022
1 parent 9ea0fb1 commit 6a66e5e
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,79 @@ docker restart keycloak
```

Login to the admin interface at [https://localhost/auth/admin](https://localhost/auth/admin) and create Waldur users

## Inegration with SLURM

SLURM integration requires several major actions.

The preparation step is creation of a shared network for Waldur and FireCREST:

```bash
docker network create waldur-external
```

This network will be used for communication between Waldur and FireCREST services.

### Deployment of FirecREST

**NB**: FirecREST integration is not implemented for now. Better check the [Waldur SLURM service setup](#service-provider-setup).

The first step is deployment of [FirecREST demo](https://github.com/eth-cscs/firecrest). This repository includes build-in SLURM cluster together with FirecREST application itself and several utils (keycloak, minio, jaeger, openapi). An user needs to replace the default keycloak configuration in the firecrest repository. For this, the user should execute the following commands:

```bash
echo config/firecrest-override/config.json > firecrest/deploy/demo/keycloak/config.json
echo config/firecrest-override/client_secrets.json > firecrest/deploy/demo/demo_client/client_secrets.json
echo config/firecrest-override/docker-compose.yml > firecrest/deploy/demo/docker-compose.yml
```

Firecrest deployment can be started with these commands:

```bash
cd deploy/demo/
chmod 400 ../test-build/environment/keys/ca-key ../test-build/environment/keys/user-key
docker build -f base/Dockerfile . -t f7t-base
docker-compose build --build-arg SLURM_VERSION=20.11.9
docker-compose up -d
```

### Update of Waldur setup

Waldur setting should be updated in order to interact with Keycloak service from FireCREST and with [FreeIPA demo](https://www.freeipa.org/page/Demo).

```bash
echo config/waldur-slurm-service/override.conf.py > config/waldur-mastermind/override.conf.py
```

The deployment should be restarted with the fresh settings.

```bash
docker compose down
docker compose up -d
```

### Service provider setup

After this, the service provider should import the SLURM cluster to Waldur. This can be done on Waldur marketplace level, so the result is an offering with the corresponding data.

- Go to `Public services` -> `Public offerings` -> `Add offering`
- Input name and other offering details and choose `SLURM remote allocation` in "Management" tab
- In the page of the new offering, copy uuid from URL (see image below)

![offering-uuid](img/offering-uuid.png)

The copied value will be used for deployment of Waldur-SLURM integration service as `WALDUR_OFFERING_UUID` variable.

- Go to user management tab, set API token lifetime to `token will not time out` and click `Update profile` button. See [the example](https://docs.waldur.com/integrator-guide/APIs/authentication/#authentication-token-management) for more details
- Copy value from `Current API token` field. This value will be used as `WALDUR_API_TOKEN`

The value of `WALDUR_API_TOKEN` and `WALDUR_OFFERING_UUID` variables should be adjusted in `config/waldur-slurm-service/service-pull-env` and `config/waldur-slurm-service/service-push-env` files.

### Deployment of Waldur SLURM service

The final action is deployment of `waldur-slurm-service` module, which is responsible for data synchronization between Waldur and SLURM cluster and modification of corresponding object states in these 2 systems. The user needs to start the deployment in the following way in order to enable `waldur-slurm-service` module:

```bash
docker compose -f docker-compose.yml -f waldur-slurm-service.yml up -d
```

For more configuration details, check [Waldur SLURM service guide](https://code.opennodecloud.com/waldur/waldur-slurm-service/-/blob/main/README.md).
6 changes: 6 additions & 0 deletions config/waldur-slurm-service/service-pull-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
WALDUR_SYNC_DIRECTION=pull
WALDUR_API_URL=http://waldur-mastermind-api/api/
WALDUR_API_TOKEN=<service-provider-token>
WALDUR_OFFERING_UUID=<slurm-offering-uuid>
SLURM_DEFAULT_ACCOUNT=root
SLURM_CONTAINER_NAME=cluster
5 changes: 5 additions & 0 deletions config/waldur-slurm-service/service-push-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WALDUR_SYNC_DIRECTION=push
WALDUR_API_URL=http://waldur-mastermind-api/api/
WALDUR_API_TOKEN=<service-provider-token>
WALDUR_OFFERING_UUID=<slurm-offering-uuid>
SLURM_CONTAINER_NAME=cluster
Binary file added img/offering-uuid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions waldur-slurm-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
slurm_service_pull:
image: opennode/waldur-slurm-service:latest
container_name: waldur_slurm_service_pull
env_file: ${CONFIG_FOLDER}/waldur-slurm-service/service-pull-env
volumes:
- /var/run/docker.sock:/var/run/docker.sock

slurm_service_push:
image: opennode/waldur-slurm-service:latest
container_name: waldur_slurm_service_push
env_file: ${CONFIG_FOLDER}/waldur-slurm-service/service-push-env
volumes:
- /var/run/docker.sock:/var/run/docker.sock

networks:
default:
name: waldur-external
external: true

0 comments on commit 6a66e5e

Please sign in to comment.