Skip to content

A test Docker build for SLURM with the SLURM REST API configured.

License

Notifications You must be signed in to change notification settings

JBris/slurm-rest-api-docker

Repository files navigation

Slurm REST Docker Cluster

Table of contents

Introduction

This is a fork of the SLURM Docker repo here.

The principal difference is that the dependencies required for the SLURM REST API have been included in the image build.

REST API

  1. Run docker compose up -d to launch a local SLURM cluster.
  2. Within the c2 node, set the JSON web token: export $(docker compose exec c2 scontrol token)
  3. Test that you can access the SLURM API documentation: curl -k -vvvv -H X-SLURM-USER-TOKEN:${SLURM_JWT} -H X-SLURM-USER-NAME:root -X GET 'http://localhost:9200/openapi/v3' > docs.json
  4. Submit a SLURM job: curl -X POST "http://localhost:9200/slurm/v0.0.37/job/submit" -H "X-SLURM-USER-NAME:root" -H "X-SLURM-USER-TOKEN:${SLURM_JWT}" -H "Content-Type: application/json" -d @rest_api_test.json
  5. Check that the SLURM job completed successfully: docker compose exec c1 cat /root/test.out