8000 MSP-3642: add some configmap values by Uburro · Pull Request #223 · nebius/soperator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MSP-3642: add some configmap values #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
$(GOLANGCI_LINT) run --fix

.PHONY: helm
helm: generate ## Update soperator Helm chart
helm: generate manifests ## Update soperator Helm chart
$(KUSTOMIZE) build config/crd > $(CHART_OPERATOR_PATH)/crds/slurmcluster-crd.yaml
$(KUSTOMIZE) build config/crd > $(CHART_OPERATOR_CRDS_PATH)/templates/slurmcluster-crd.yaml
mv $(CHART_OPERATOR_PATH)/values.yaml $(CHART_OPERATOR_PATH)/values.yaml.bak
Expand Down
34 changes: 34 additions & 0 deletions api/v1/slurmcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,40 @@ type SlurmClusterSpec struct {
// https://slurm.schedmd.com/slurm.conf.html#SECTION_PARTITION-CONFIGURATION
// +kubebuilder:validation:Optional
PartitionConfiguration PartitionConfiguration `json:"partitionConfiguration,omitempty"`

// SlurmConfig represents the Slurm configuration in slurm.conf. Not all options are supported.
//
// +kubebuilder:validation:Optional
SlurmConfig SlurmConfig `json:"slurmConfig,omitempty"`
}

// SlurmConfig represents the Slurm configuration in slurm.conf
type SlurmConfig struct {
// Default real memory size available per allocated node in mebibytes.
//
// +kubebuilder:validation:Optional
// +kubebuilder:default=1228800
DefMemPerNode int32 `json:"defMemPerNode,omitempty"`
// Default count of CPUs allocated per allocated GPU
//
// +kubebuilder:validation:Optional
// +kubebuilder:default=16
DefCpuPerGPU int32 `json:"defCpuPerGPU,omitempty"`
// The time to wait, in seconds, when any job is in the COMPLETING state before any additional jobs are scheduled.
//
// +kubebuilder:validation:Optional
// +kubebuilder:default=5
CompleteWait int32 `json:"completeWait,omitempty"`
// Defines specific subsystems which should provide more detailed event logging.
//
// +kubebuilder:validation:Optional
// +kubebuilder:default="Cgroup,CPU_Bind,Gres,JobComp,Priority,Script,SelectType,Steps,TraceJobs"
// +kubebuilder:validation:Pattern="^((Accrue|Agent|AuditRPCs|Backfill|BackfillMap|BurstBuffer|Cgroup|ConMgr|CPU_Bind|CpuFrequency|Data|DBD_Agent|Dependency|Elasticsearch|Energy|Federation|FrontEnd|Gres|Hetjob|Gang|GLOB_SILENCE|JobAccountGather|JobComp|JobContainer|License|Network|NetworkRaw|NodeFeatures|NO_CONF_HASH|Power|Priority|Profile|Protocol|Reservation|Route|Script|SelectType|Steps|Switch|TLS|TraceJobs|Triggers)(,)?)+$"
DebugFlags string `json:"debugFlags,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default="Verbose"
// +kubebuilder:validation:Pattern="^((None|Cores|Sockets|Threads|SlurmdOffSpec|OOMKillStep|Verbose|Autobind)(,)?)+$"
TaskPluginParam string `json:"taskPluginParam,omitempty"`
}

type PartitionConfiguration struct {
Expand Down
16 changes: 16 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions config/crd/bases/slurm.nebius.ai_slurmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,38 @@ spec:
with ssh keys for SSHD server
type: string
type: object
slurmConfig:
description: SlurmConfig represents the Slurm configuration in slurm.conf.
Not all options are supported.
properties:
completeWait:
default: 5
description: The time to wait, in seconds, when any job is in
the COMPLETING state before any additional jobs are scheduled.
format: int32
type: integer
debugFlags:
default: Cgroup,CPU_Bind,Gres,JobComp,Priority,Script,SelectType,Steps,TraceJobs
description: Defines specific subsystems which should provide
more detailed event logging.
pattern: ^((Accrue|Agent|AuditRPCs|Backfill|BackfillMap|BurstBuffer|Cgroup|ConMgr|CPU_Bind|CpuFrequency|Data|DBD_Agent|Dependency|Elasticsearch|Energy|Federation|FrontEnd|Gres|Hetjob|Gang|GLOB_SILENCE|JobAccountGather|JobComp|JobContainer|License|Network|NetworkRaw|NodeFeatures|NO_CONF_HASH|Power|Priority|Profile|Protocol|Reservation|Route|Script|SelectType|Steps|Switch|TLS|TraceJobs|Triggers)(,)?)+$
type: string
defCpuPerGPU:
default: 16
description: Default count of CPUs allocated per allocated GPU
format: int32
type: integer
defMemPerNode:
default: 1228800
description: Default real memory size available per allocated
node in mebibytes.
format: int32
type: integer
taskPluginParam:
default: Verbose
pattern: ^((None|Cores|Sockets|Threads|SlurmdOffSpec|OOMKillStep|Verbose|Autobind)(,)?)+$
type: string
type: object
slurmNodes:
description: SlurmNodes define the desired state of Slurm nodes
properties:
Expand Down
32 changes: 32 additions & 0 deletions helm/soperator-crds/templates/slurmcluster-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,38 @@ spec:
with ssh keys for SSHD server
type: string
type: object
slurmConfig:
description: SlurmConfig represents the Slurm configuration in slurm.conf.
Not all options are supported.
properties:
completeWait:
default: 5
description: The time to wait, in seconds, when any job is in
the COMPLETING state before any additional jobs are scheduled.
format: int32
type: integer
debugFlags:
default: Cgroup,CPU_Bind,Gres,JobComp,Priority,Script,SelectType,Steps,TraceJobs
description: Defines specific subsystems which should provide
more detailed event logging.
pattern: ^((Accrue|Agent|AuditRPCs|Backfill|BackfillMap|BurstBuffer|Cgroup|ConMgr|CPU_Bind|CpuFrequency|Data|DBD_Agent|Dependency|Elasticsearch|Energy|Federation|FrontEnd|Gres|Hetjob|Gang|GLOB_SILENCE|JobAccountGather|JobComp|JobContainer|License|Network|NetworkRaw|NodeFeatures|NO_CONF_HASH|Power|Priority|Profile|Protocol|Reservation|Route|Script|SelectType|Steps|Switch|TLS|TraceJobs|Triggers)(,)?)+$
type: string
defCpuPerGPU:
default: 16
description: Default count of CPUs allocated per allocated GPU
format: int32
type: integer
defMemPerNode:
default: 1228800
description: Default real memory size available per allocated
node in mebibytes.
format: int32
type: integer
taskPluginParam:
default: Verbose
pattern: ^((None|Cores|Sockets|Threads|SlurmdOffSpec|OOMKillStep|Verbose|Autobind)(,)?)+$
type: string
type: object
slurmNodes:
description: SlurmNodes define the desired state of Slurm nodes
properties:
Expand Down
32 changes: 32 additions & 0 deletions helm/soperator/crds/slurmcluster-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,38 @@ spec:
with ssh keys for SSHD server
type: string
type: object
slurmConfig:
description: SlurmConfig represents the Slurm configuration in slurm.conf.
Not all options are supported.
properties:
completeWait:
default: 5
description: The time to wait, in seconds, when any job is in
the COMPLETING state before any additional jobs are scheduled.
format: int32
type: integer
debugFlags:
default: Cgroup,CPU_Bind,Gres,JobComp,Priority,Script,SelectType,Steps,TraceJobs
description: Defines specific subsystems which should provide
more detailed event logging.
pattern: ^((Accrue|Agent|AuditRPCs|Backfill|BackfillMap|BurstBuffer|Cgroup|ConMgr|CPU_Bind|CpuFrequency|Data|DBD_Agent|Dependency|Elasticsearch|Energy|Federation|FrontEnd|Gres|Hetjob|Gang|GLOB_SILENCE|JobAccountGather|JobComp|JobContainer|License|Network|NetworkRaw|NodeFeatures|NO_CONF_HASH|Power|Priority|Profile|Protocol|Reservation|Route|Script|SelectType|Steps|Switch|TLS|TraceJobs|Triggers)(,)?)+$
type: string
defCpuPerGPU:
default: 16
description: Default count of CPUs allocated per allocated GPU
format: int32
type: integer
defMemPerNode:
default: 1228800
description: Default real memory size available per allocated
node in mebibytes.
format: int32
type: integer
taskPluginParam:
default: Verbose
pattern: ^((None|Cores|Sockets|Threads|SlurmdOffSpec|OOMKillStep|Verbose|Autobind)(,)?)+$
type: string
type: object
slurmNodes:
description: SlurmNodes define the desired state of Slurm nodes
properties:
Expand Down
15 changes: 15 additions & 0 deletions internal/render/common/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ func generateSlurmConfig(cluster *values.SlurmCluster) renderutils.ConfigFile {
res.AddProperty("AuthType", "auth/"+consts.Munge)
res.AddProperty("CredType", "cred/"+consts.Munge)
res.AddComment("")
res.AddComment("SlurnConfig Spec")
v := reflect.ValueOf(cluster.SlurmConfig)
t := reflect.TypeOf(cluster.SlurmConfig)

for i := 0; i < v.NumField(); i++ {
field := v.Field(i)
fieldName := t.Field(i).Name

if field.Kind() == reflect.String && field.String() == "" {
continue
}

res.AddProperty(fieldName, field.Interface())
}
res.AddComment("")
if cluster.ClusterType == consts.ClusterTypeGPU {
res.AddProperty("GresTypes", "gpu")
}
Expand Down
2 changes: 2 additions & 0 deletions internal/values/slurm_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type SlurmCluster struct {
NodeLogin SlurmLogin
Telemetry *slurmv1.Telemetry
SlurmExporter SlurmExporter
SlurmConfig slurmv1.SlurmConfig
}

// BuildSlurmClusterFrom creates a new instance of SlurmCluster given a SlurmCluster CRD
Expand Down Expand Up @@ -68,6 +69,7 @@ func BuildSlurmClusterFrom(ctx context.Context, cluster *slurmv1.SlurmCluster) (
NodeLogin: buildSlurmLoginFrom(cluster.Name, &cluster.Spec.SlurmNodes.Login),
Telemetry: cluster.Spec.Telemetry,
SlurmExporter: buildSlurmExporterFrom(&cluster.Spec.SlurmNodes.Exporter),
SlurmConfig: cluster.Spec.SlurmConfig,
}

if err := res.Validate(ctx); err != nil {
Expand Down
Loading
0