common

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SlurmUser    = "slurm"
	SlurmUserUid = int64(401)
	SlurmUserGid = SlurmUserUid

	SlurmConfigVolume = "slurm-config"
	SlurmConfigDir    = "/mnt/slurm"

	SlurmEtcVolume   = "slurm-etc"
	SlurmEtcMountDir = "/mnt/etc/slurm"
	SlurmEtcDir      = "/etc/slurm"

	SlurmPidFileVolume = "run"
	SlurmPidFileDir    = "/run"

	SlurmLogFileVolume = "slurm-logfile"
	SlurmLogFileDir    = "/var/log/slurm"

	SlurmKeyFile = "slurm.key"
	AuthType     = "auth/slurm"
	CredType     = "cred/slurm" // #nosec G101
	AuthInfo     = "use_client_ids"

	AuthAltTypes = "auth/jwt"

	JwtKeyFile           = "jwt.key"
	JwtKeyPath           = SlurmEtcDir + "/" + JwtKeyFile
	JwtAuthAltParameters = "jwt_key=" + JwtKeyPath

	JwksKeyFile           = "jwks.json"
	JwksKeyPath           = SlurmEtcDir + "/" + JwksKeyFile
	JwksAuthAltParameters = "jwks=" + JwksKeyPath

	DevNull = "/dev/null"

	SlurmLivez  = "/livez"
	SlurmReadyz = "/readyz"
)
View Source
const (
	SlurmdPort = 6818
	SshPort    = 22

	SlurmdUser = "root"

	SlurmdLogFile     = "slurmd.log"
	SlurmdLogFilePath = SlurmLogFileDir + "/" + SlurmdLogFile

	SlurmdSpoolDir = "/var/spool/slurmd"
)

Worker

View Source
const (
	SlurmctldPort = 6817

	SlurmctldLogFile     = "slurmctld.log"
	SlurmctldLogFilePath = SlurmLogFileDir + "/" + SlurmctldLogFile

	SlurmAuthSocketVolume  = "slurm-authsocket"
	SlurmctldAuthSocketDir = "/run/slurmctld"

	SlurmctldStateSaveVolume = "statesave"

	SlurmctldSpoolDir = "/var/spool/slurmctld"
)

Controller

View Source
const (
	SlurmdbdPort = 6819

	SlurmdbdConfFile = "slurmdbd.conf"
)

Accounting

View Source
const (
	AnnotationAuthSlurmKeyHash = slinkyv1beta1.SlinkyPrefix + "slurm-key-hash"
	AnnotationAuthJwtKeyHash   = slinkyv1beta1.SlinkyPrefix + "jwt-key-hash"
)
View Source
const (
	AnnotationSshdConfHash    = slinkyv1beta1.SlinkyPrefix + "sshd-conf-hash"
	AnnotationSssdConfHash    = slinkyv1beta1.SlinkyPrefix + "sssd-conf-hash"
	AnnotationSshHostKeysHash = slinkyv1beta1.SlinkyPrefix + "ssh-host-keys-hash"
)
View Source
const (
	AnnotationDefaultContainer = "kubectl.kubernetes.io/default-container"
)

Variables

This section is empty.

Functions

func BuildMergedConfig added in v1.2.0

func BuildMergedConfig(confRaw string, mergeConfig map[string][]string) string

BuildMergedConfig returns a slurm.conf snippet containing merged parameter options.

func ConfiglessArgs

func ConfiglessArgs(controller *slinkyv1beta1.Controller) []string

func DefaultPort

func DefaultPort(port, def int32) int32

func EtcSlurmVolume

func EtcSlurmVolume() corev1.Volume

func GetSlurmNodeSetName added in v1.1.1

func GetSlurmNodeSetName(nodeset *slinkyv1beta1.NodeSet) string

GetSlurmNodeSetName returns the Slurm NodeSet name.

func JwksConfigProjection

func JwksConfigProjection(configMap *corev1.ConfigMapKeySelector, path string) corev1.ConfigMapProjection

func JwtSecretProjection

func JwtSecretProjection(secret *corev1.SecretKeySelector, path string) corev1.SecretProjection

func LogFileVolume

func LogFileVolume() corev1.Volume

func MergeEnvVar

func MergeEnvVar(envVarList1, envVarList2 []corev1.EnvVar, sep string) []corev1.EnvVar

func PidfileVolume

func PidfileVolume() corev1.Volume

func SlurmClusterWorkerPodDisruptionBudgetName

func SlurmClusterWorkerPodDisruptionBudgetName(controllerName string) string

slurmClusterWorkerPodDisruptionBudgetName returns the PDB name for all worker nodes in a Slurm cluster Format: "slurm-workers-pdb-{controller-name}"

func SlurmClusterWorkerService

func SlurmClusterWorkerService(controllerName, namespace string) string

func SlurmClusterWorkerServiceName

func SlurmClusterWorkerServiceName(controllerName string) string

slurmClusterWorkerServiceName returns the service name for all worker nodes in a Slurm cluster Format: "slurm-workers-{controller-name}"

Types

type CommonBuilder

type CommonBuilder struct {
	// contains filtered or unexported fields
}

func New

func New(c client.Client) *CommonBuilder

func (*CommonBuilder) BuildConfigMap

func (b *CommonBuilder) BuildConfigMap(opts ConfigMapOpts, owner metav1.Object) (*corev1.ConfigMap, error)

func (*CommonBuilder) BuildContainer

func (b *CommonBuilder) BuildContainer(opts ContainerOpts) corev1.Container

func (*CommonBuilder) BuildPodDisruptionBudget

func (b *CommonBuilder) BuildPodDisruptionBudget(opts PodDisruptionBudgetOpts, owner metav1.Object) (*policyv1.PodDisruptionBudget, error)

func (*CommonBuilder) BuildPodTemplate

func (b *CommonBuilder) BuildPodTemplate(opts PodTemplateOpts) corev1.PodTemplateSpec

func (*CommonBuilder) BuildSecret

func (b *CommonBuilder) BuildSecret(opts SecretOpts, owner metav1.Object) (*corev1.Secret, error)

func (*CommonBuilder) BuildService

func (b *CommonBuilder) BuildService(opts ServiceOpts, owner metav1.Object) (*corev1.Service, error)

func (*CommonBuilder) BuildTokenSecret

func (b *CommonBuilder) BuildTokenSecret(token *slinkyv1beta1.Token) (*corev1.Secret, error)

func (*CommonBuilder) GetContainerResourceLimits

func (b *CommonBuilder) GetContainerResourceLimits(container corev1.Container) (int64, int64)

func (*CommonBuilder) GetPodResourceLimits

func (b *CommonBuilder) GetPodResourceLimits(pod corev1.PodSpec) (int64, int64)

func (*CommonBuilder) InitconfContainer

func (b *CommonBuilder) InitconfContainer(container slinkyv1beta1.ContainerWrapper) corev1.Container

func (*CommonBuilder) LogfileContainer

func (b *CommonBuilder) LogfileContainer(container slinkyv1beta1.ContainerWrapper, logfilePath string) corev1.Container

type ConfigMapOpts

type ConfigMapOpts struct {
	Key        types.NamespacedName
	Metadata   slinkyv1beta1.Metadata
	Data       map[string]string
	BinaryData map[string][]byte
	Immutable  bool
}

type ContainerOpts

type ContainerOpts struct {
	Base  corev1.Container
	Merge corev1.Container
}

type PodDisruptionBudgetOpts

type PodDisruptionBudgetOpts struct {
	Key      types.NamespacedName
	Metadata slinkyv1beta1.Metadata
	policyv1.PodDisruptionBudgetSpec
}

type PodTemplateOpts

type PodTemplateOpts struct {
	Key      types.NamespacedName
	Metadata slinkyv1beta1.Metadata
	Base     corev1.PodSpec
	Merge    corev1.PodSpec
}

type SecretOpts

type SecretOpts struct {
	Key        types.NamespacedName
	Metadata   slinkyv1beta1.Metadata
	Data       map[string][]byte
	StringData map[string]string
	Immutable  bool
}

type ServiceOpts

type ServiceOpts struct {
	Key      types.NamespacedName
	Metadata slinkyv1beta1.Metadata
	corev1.ServiceSpec
	Selector map[string]string
	Headless bool
}

Jump to

Keyboard shortcuts

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