Skip to content

Repository files navigation

slurm-https

A simple HTTPS API for Slurm.

Quick Start

Build

$ git clone https://github.com/angt/slurm-https.git
$ cd slurm-https
$ go build

Run

$ ./create-cert.sh
$ ./slurm-https

By default, the server listen on :8443.

API

The API is nearly a direct mapping to slurm.h.

endpointdescription
/nodesget all node configuration information if changed since UpdateTime
/node/updateupdate node's configuration (root only)
/licensesget license information
/confget control configuration information if changed since UpdateTime
/jobsget all job configuration information if changed since UpdateTime
/job/allocallocate resources for a job request
/job/submitsubmit a job for later execution
/job/lookupget info for an existing resource allocation
/job/updateupdate job's configuration
/job/notifysend message to the job's stdout (root only)
/job/killsend the specified signal to all steps of an existing job (with flags)
/job/signalsend the specified signal to all steps of an existing job
/job/completenote the completion of a job and all of its steps
/job/suspendsuspend execution of a job
/job/resumeresume execution of a previously suspended job
/job/requeuere-queue a batch job, if already running then terminate it first
/job/step/killsend the specified signal to an existing job step
/job/step/signalsend the specified signal to an existing job step
/job/step/terminateterminates a job step
/frontendsget all frontend configuration information if changed since UpdateTime
/frontend/updateupdate frontend node's configuration (root only)
/topologiesget all switch topology configuration information
/partitionsget all partition configuration information if changed since UpdateTime
/partition/createcreate a new partition (root only)
/partition/updateupdate a partition's configuration (root only)
/partition/deletedelete a partition (root only)
/reservationsget all reservation configuration information if changed since UpdateTime
/reservation/createcreate a new reservation (root only)
/reservation/updateupdate a reservation's configuration (root only)
/reservation/deletedelete a reservation (root only)
/triggersget all event trigger information
/trigger/createcreate an event trigger
/trigger/deletedelete an event trigger
/pingping the slurm controller
/reconfigureforce the slurm controller to reload its configuration file
/shutdownshutdown the slurm controller
/takeoverforce the slurm backup controller to take over the primary controller

Test it with cURL

Get the conf

$ curl --cert ./client.crt --cacert ./ca.crt --key ./client.key --insecure -d @- https://localhost:8443/conf <<EOF{ "UpdateTime":0}EOF

Submit a batch job

$ curl --cert ./client.crt --cacert ./ca.crt --key ./client.key --insecure -d @- https://localhost:8443/job/submit <<EOF{  "Name":"test", "TimeLimit":200, "MinNodes":1, "UserId":$(id -u), "GroupId":$(id -g), "WorkDir":"${HOME}", "Script":"#!/bin/sh\nhostname\n"} EOF

About

A simple HTTPS API for Slurm

Topics

Resources

Stars

43 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages