LinuxCommandLibrary

slurmrestd

Provide REST API to Slurm cluster

TLDR

Change the group ID (and drop supplemental groups) before processing client requests

$ slurmrestd -g [group_id] [[host]:port | unix:/path/to/socket]
copy

Comma-delimited list of authentication plugins to load
$ slurmrestd -a [authentication_plugins] [[host]:port | unix:/path/to/socket]
copy

Read Slurm configuration from the specified file
$ slurmrestd -f [path/to/file]
copy

Change user ID before processing client request
$ slurmrestd -u [user_id]
copy

Display help
$ slurmrestd -h
copy

Display version
$ slurmrestd -V
copy

SYNOPSIS

slurmrestd [OPTIONS]

PARAMETERS

-f <config_file>
    Specifies the path to the slurmrestd.conf configuration file. If not specified, the default path is used.

-D
    Daemonizes the slurmrestd process, detaching it from the controlling terminal and running it in the background.

-v
    Increases the verbosity of logging output. Can be specified multiple times to further increase verbosity (e.g., -vvv).

-L <log_file>
    Specifies the path to the log file where slurmrestd will write its output. Overrides the LogFile setting in the configuration.

-h
    Displays help information for the command and exits.

DESCRIPTION

slurmrestd is a daemon that provides a RESTful interface to the Slurm Workload Manager. It enables external applications and services to interact with a Slurm cluster programmatically over HTTP/HTTPS. This includes operations such as submitting jobs, querying job status, retrieving cluster information, managing reservations, and user accounts.

It acts as a gateway, translating REST requests into Slurm Remote Procedure Calls (RPCs) and vice-versa, thereby facilitating seamless integration with web-based portals, monitoring tools, and other third-party systems. Running slurmrestd enhances automation and accessibility for Slurm environments, allowing for modern, API-driven cluster management.

CAVEATS

Security: Proper authentication (e.g., SlurmDBD, JWT) and authorization mechanisms are critical when exposing the REST API. Without appropriate security measures, it poses a significant risk. Ensure firewalls restrict access to authorized clients only.
Performance: Excessive or inefficient API calls can impact the performance of the Slurm control daemon (slurmctld), as slurmrestd relays requests to it.
Configuration Dependency: slurmrestd relies heavily on a correctly configured slurmrestd.conf file, and also on the overall slurm.conf setup for cluster operation details.

CONFIGURATION

The behavior and operational parameters of slurmrestd are primarily controlled by its dedicated configuration file, slurmrestd.conf. This file specifies crucial settings such as the listening port (e.g., 6820), SSL/TLS settings for secure communication, authentication plugins (e.g., 'jwt', 'slurmdbd'), and various logging options. Proper configuration is vital for its functionality and security.

AUTHENTICATION

slurmrestd supports robust authentication mechanisms to secure access to the REST API. Common methods include authentication via the Slurm Database Daemon (slurmdbd), which allows Slurm user credentials to be validated, and JSON Web Tokens (JWT), which provide a stateless, secure way to transmit information between parties. These mechanisms ensure that only authorized users or services can interact with the Slurm cluster through the API.

HISTORY

slurmrestd was introduced to address the evolving needs of modern HPC environments, providing a programmatic and web-friendly interface to the Slurm Workload Manager. Its development reflects a shift towards API-driven infrastructure management, making Slurm more accessible for integration with web portals, cloud orchestration systems, and other third-party applications, beyond traditional command-line interactions. It aims to simplify automation and improve the user experience for cluster administrators and users alike.

SEE ALSO

slurmctld(8), slurmd(8), sbatch(1), squeue(1), sacct(1), sinfo(1)

Copied to clipboard