Documentation
¶
Overview ¶
Package slurm handles Slurm version discovery and configuration generation.
Index ¶
- Constants
- func AddNodesToConf(existing string, nodes []NodeEntry) string
- func DiscoverVersion(ctx context.Context, dc *docker.Client, image string, pull bool) (string, error)
- func GenerateCgroupConf() string
- func GenerateMungeKey() []byte
- func GenerateNodesConf(nodes []config.Node) string
- func GenerateSlurmConf(clusterName string) string
- func ParseMemoryMB(s string) (int, error)
- func RemoveNodesFromConf(existing string, names []string) string
- type NodeEntry
Constants ¶
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 ¶
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, pull bool) (string, error)
DiscoverVersion runs slurmctld -V in an ephemeral container and returns the Slurm version string (e.g. "25.11.0"). When pull is true, the image is always pulled before running the container.
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 ¶
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 ¶
GenerateSlurmConf generates the main slurm.conf content for a cluster. Node definitions are not included here; they go in sind-nodes.conf.
func ParseMemoryMB ¶
ParseMemoryMB parses a Docker-style memory string (e.g. "2g", "512m") and returns the value in megabytes.
func RemoveNodesFromConf ¶
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.