slurm

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: GPL-3.0, LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package slurm handles Slurm version discovery and configuration generation.

Index

Constants

View Source
const MungeKeySize = 128

MungeKeySize is the default munge key size in bytes (1024 bits), matching the mungekey --create default.

Variables

This section is empty.

Functions

func AddNodesToConf

func AddNodesToConf(existing string, nodes []NodeEntry) string

AddNodesToConf adds node definitions to existing sind-nodes.conf content. New NodeName lines are inserted and the PartitionName Nodes= list is updated to include both existing and new nodes.

func DiscoverVersion

func DiscoverVersion(ctx context.Context, dc *docker.Client, image string) (string, error)

DiscoverVersion runs slurmctld -V in an ephemeral container and returns the Slurm version string (e.g. "25.11.0").

func GenerateCgroupConf

func GenerateCgroupConf() string

GenerateCgroupConf generates the cgroup.conf content for cgroupv2 support.

func GenerateMungeKey

func GenerateMungeKey() []byte

GenerateMungeKey generates a random munge authentication key.

func GenerateNodesConf

func GenerateNodesConf(nodes []config.Node) string

GenerateNodesConf generates the sind-nodes.conf content with NodeName and PartitionName directives. Only managed worker nodes are included. Non-worker nodes and unmanaged worker nodes are skipped.

func GenerateSlurmConf

func GenerateSlurmConf(clusterName string) string

GenerateSlurmConf generates the main slurm.conf content for a cluster. Node definitions are not included here; they go in sind-nodes.conf.

func ParseMemoryMB

func ParseMemoryMB(s string) (int, error)

ParseMemoryMB parses a Docker-style memory string (e.g. "2g", "512m") and returns the value in megabytes.

func RemoveNodesFromConf

func RemoveNodesFromConf(existing string, names []string) string

RemoveNodesFromConf removes the named nodes from existing sind-nodes.conf content. NodeName lines for the removed nodes are deleted and the PartitionName Nodes= list is updated.

Types

type NodeEntry

type NodeEntry struct {
	Name     string
	CPUs     int
	MemoryMB int
}

NodeEntry represents a single node to add to sind-nodes.conf.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL