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(cgroup config.Section) string
- func GenerateMungeKey() []byte
- func GenerateNodesConf(nodes []config.Node) string
- func GeneratePlugstackConf(plugstack config.Section) string
- func GenerateSectionConf(name string, section config.Section) string
- func GenerateSlurmConf(clusterName string, main config.Section) string
- func ParseMemoryMB(s string) (int, error)
- func RemoveNodesFromConf(existing string, names []string) string
- type NodeEntry
- type Service
Constants ¶
const ( ConfDir = "/etc/slurm" NodesConfFile = "sind-nodes.conf" NodesConfPath = ConfDir + "/" + NodesConfFile )
Container paths for Slurm configuration files.
const ( MungeDir = "/etc/munge" MungeKeyFile = "munge.key" MungeKeyPath = MungeDir + "/" + MungeKeyFile )
Container paths for munge configuration.
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 ¶
GenerateCgroupConf generates the cgroup.conf content for cgroupv2 support. The cgroup section can append content (string form) or include a .conf.d directory (map form).
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 GeneratePlugstackConf ¶ added in v0.7.0
GeneratePlugstackConf generates the plugstack.conf content. Always includes the .conf.d directory for fragment support.
func GenerateSectionConf ¶ added in v0.7.0
GenerateSectionConf generates the content for a standalone config file (gres.conf, topology.conf). String form returns content directly; map form returns include lines for each fragment file.
func GenerateSlurmConf ¶
GenerateSlurmConf generates the main slurm.conf content for a cluster. Node definitions are not included here; they go in sind-nodes.conf. The main section can append content (string form) or include a .conf.d directory (map form).
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.