项目作者: angt

项目描述 :
A simple HTTPS API for Slurm
高级语言: Go
项目地址: git://github.com/angt/slurm-https.git
创建时间: 2015-07-27T10:35:26Z
项目社区:https://github.com/angt/slurm-https

开源协议:MIT License

下载


slurm-https

A simple HTTPS API for Slurm.

Quick Start

Build

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

Run

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

By default, the server listen on :8443.

API

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

endpoint description
/nodes get all node configuration information if changed since UpdateTime
/node/update update node’s configuration (root only)
/licenses get license information
/conf get control configuration information if changed since UpdateTime
/jobs get all job configuration information if changed since UpdateTime
/job/alloc allocate resources for a job request
/job/submit submit a job for later execution
/job/lookup get info for an existing resource allocation
/job/update update job’s configuration
/job/notify send message to the job’s stdout (root only)
/job/kill send the specified signal to all steps of an existing job (with flags)
/job/signal send the specified signal to all steps of an existing job
/job/complete note the completion of a job and all of its steps
/job/suspend suspend execution of a job
/job/resume resume execution of a previously suspended job
/job/requeue re-queue a batch job, if already running then terminate it first
/job/step/kill send the specified signal to an existing job step
/job/step/signal send the specified signal to an existing job step
/job/step/terminate terminates a job step
/frontends get all frontend configuration information if changed since UpdateTime
/frontend/update update frontend node’s configuration (root only)
/topologies get all switch topology configuration information
/partitions get all partition configuration information if changed since UpdateTime
/partition/create create a new partition (root only)
/partition/update update a partition’s configuration (root only)
/partition/delete delete a partition (root only)
/reservations get all reservation configuration information if changed since UpdateTime
/reservation/create create a new reservation (root only)
/reservation/update update a reservation’s configuration (root only)
/reservation/delete delete a reservation (root only)
/triggers get all event trigger information
/trigger/create create an event trigger
/trigger/delete delete an event trigger
/ping ping the slurm controller
/reconfigure force the slurm controller to reload its configuration file
/shutdown shutdown the slurm controller
/takeover force the slurm backup controller to take over the primary controller

Test it with cURL

Get the conf

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

Submit a batch job

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