Skip to content

Commit

Permalink
Release soperator 1.15.5 (#211)
Browse files Browse the repository at this point in the history
* notask: fix space in ln (#208)

* NOTASK: real memory convert bytes to mebibytes (#209)

* bump 1.15.5 (#210)
  • Loading branch information
Uburro authored Dec 3, 2024
1 parent 4160a71 commit 4847905
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.4
1.15.5
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ resources:
images:
- name: controller
newName: cr.eu-north1.nebius.cloud/soperator/slurm-operator
newTag: 1.15.4
newTag: 1.15.5
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ spec:
value: "false"
- name: SLURM_OPERATOR_WATCH_NAMESPACES
value: "*"
image: controller:1.15.4
image: controller:1.15.5
imagePullPolicy: Always
name: manager
securityContext:
Expand Down
4 changes: 2 additions & 2 deletions helm/slurm-cluster-storage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: helm-slurm-cluster-storage
description: A Helm chart for Kubernetes
type: application
version: "1.15.4"
appVersion: "1.15.4"
version: "1.15.5"
appVersion: "1.15.5"
4 changes: 2 additions & 2 deletions helm/slurm-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: helm-slurm-cluster
description: A Helm chart for Kubernetes
type: application
version: "1.15.4"
appVersion: "1.15.4"
version: "1.15.5"
appVersion: "1.15.5"
18 changes: 9 additions & 9 deletions helm/slurm-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,13 @@ telemetry: {}
# otelCollectorPort: 8429

images:
slurmctld: "cr.eu-north1.nebius.cloud/soperator/controller_slurmctld:1.15.4-jammy-slurm24.05.2"
slurmrestd: "cr.eu-north1.nebius.cloud/soperator/slurmrestd:1.15.4-jammy-slurm24.05.2"
slurmd: "cr.eu-north1.nebius.cloud/soperator/worker_slurmd:1.15.4-jammy-slurm24.05.2"
sshd: "cr.eu-north1.nebius.cloud/soperator/login_sshd:1.15.4-jammy-slurm24.05.2"
munge: "cr.eu-north1.nebius.cloud/soperator/munge:1.15.4-jammy-slurm24.05.2"
populateJail: "cr.eu-north1.nebius.cloud/soperator/populate_jail:1.15.4-jammy-slurm24.05.2"
ncclBenchmark: "cr.eu-north1.nebius.cloud/soperator/nccl_benchmark:1.15.4-jammy-slurm24.05.2"
slurmdbd: "cr.eu-north1.nebius.cloud/soperator/controller_slurmdbd:1.15.4-jammy-slurm24.05.2"
exporter: "cr.eu-north1.nebius.cloud/soperator/exporter:1.15.4-jammy-slurm24.05.2"
slurmctld: "cr.eu-north1.nebius.cloud/soperator/controller_slurmctld:1.15.5-jammy-slurm24.05.2"
slurmrestd: "cr.eu-north1.nebius.cloud/soperator/slurmrestd:1.15.5-jammy-slurm24.05.2"
slurmd: "cr.eu-north1.nebius.cloud/soperator/worker_slurmd:1.15.5-jammy-slurm24.05.2"
sshd: "cr.eu-north1.nebius.cloud/soperator/login_sshd:1.15.5-jammy-slurm24.05.2"
munge: "cr.eu-north1.nebius.cloud/soperator/munge:1.15.5-jammy-slurm24.05.2"
populateJail: "cr.eu-north1.nebius.cloud/soperator/populate_jail:1.15.5-jammy-slurm24.05.2"
ncclBenchmark: "cr.eu-north1.nebius.cloud/soperator/nccl_benchmark:1.15.5-jammy-slurm24.05.2"
slurmdbd: "cr.eu-north1.nebius.cloud/soperator/controller_slurmdbd:1.15.5-jammy-slurm24.05.2"
exporter: "cr.eu-north1.nebius.cloud/soperator/exporter:1.15.5-jammy-slurm24.05.2"
mariaDB: "docker-registry1.mariadb.com/library/mariadb:11.4.3"
4 changes: 2 additions & 2 deletions helm/soperator-crds/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: helm-soperator-crds
description: A Helm chart for Kubernetes
type: application
version: 1.15.4
appVersion: "1.15.4"
version: 1.15.5
appVersion: "1.15.5"
4 changes: 2 additions & 2 deletions helm/soperator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: helm-soperator
description: A Helm chart for Kubernetes
type: application
version: 1.15.4
appVersion: "1.15.4"
version: 1.15.5
appVersion: "1.15.5"
2 changes: 1 addition & 1 deletion helm/soperator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ controllerManager:
slurmOperatorWatchNamespaces: '*'
image:
repository: cr.eu-north1.nebius.cloud/soperator/slurm-operator
tag: 1.15.4
tag: 1.15.5
imagePullPolicy: Always
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion images/worker/slurmd_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ln -s /mnt/jail/etc/gshadow /etc/gshadow
chown -h 0:42 /etc/{shadow,gshadow}

echo "Link home from jail because slurmd uses it"
ln -s /mnt/jail/home /home
ln -s /mnt/jail/home /home

echo "Bind-mount slurm configs from K8S config map"
for file in /mnt/slurm-configs/*; do
Expand Down
2 changes: 1 addition & 1 deletion internal/consts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package consts

const (
VersionCR = "1.15.4"
VersionCR = "1.15.5"
)
7 changes: 3 additions & 4 deletions internal/render/worker/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ func renderSlurmdEnv(clusterName, cgroupVersion string, clusterType consts.Clust
return envVar
}

// Convert to bytes and then to megabytes for real memory value
func renderRealMemorySlurmd(resources corev1.ResourceRequirements) int64 {
// Convert the memory quantity to bytes
memoryInBytes := resources.Requests.Memory().Value()
// Convert bytes to megabytes (DecimalSI uses 1000 for conversions)
memoryInMegabytes := memoryInBytes / 1_000_000 // 1 MB = 1,000,000 bytes
return memoryInMegabytes
// Convert bytes to mebibytes (1 MiB = 1,048,576 bytes)
memoryInMebibytes := memoryInBytes / 1_048_576 // 1 MiB = 1,048,576 bytes
return memoryInMebibytes
}
34 changes: 19 additions & 15 deletions internal/render/worker/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func Test_RenderRealMemorySlurmd(t *testing.T) {
name string
container corev1.ResourceRequirements
resourceMemory string // Original memory resource as a string (e.g., "512Mi", "1G")
expectError bool
expectedValue int64 // Expected memory value in mebibytes
}{
{
name: "Valid memory resource - 512Mi",
Expand All @@ -96,7 +96,7 @@ func Test_RenderRealMemorySlurmd(t *testing.T) {
},
},
resourceMemory: "512Mi", // Input memory value
expectError: false,
expectedValue: 512, // Expected value in MiB
},
{
name: "Valid memory resource - 1G",
Expand All @@ -109,33 +109,37 @@ func Test_RenderRealMemorySlurmd(t *testing.T) {
},
},
resourceMemory: "1G", // Input memory value
expectError: false,
expectedValue: 953, // Expected value in MiB (1G = 1024MB, 1024MB / 1.048576 = 953MiB)
},
{
name: "Valid memory resource - 1000MB",
container: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("1000M"),
},
Requests: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("1000M"),
},
},
resourceMemory: "1000M", // Input memory value
expectedValue: 953, // Expected value in MiB (1000MB / 1.048576 = 953MiB)
},
{
name: "No memory resource",
container: corev1.ResourceRequirements{},
resourceMemory: "", // No memory specified
expectError: true,
expectedValue: 0, // Expected value in MiB
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Dynamically parse and calculate the expected value
var expectedValue int64
if tt.resourceMemory != "" {
// Parse the resource memory value
quantity := resource.MustParse(tt.resourceMemory)
memoryInBytes, _ := quantity.AsInt64()
expectedValue = memoryInBytes / 1_000_000 // Convert bytes to MB
}

// Call the function under test
value := renderRealMemorySlurmd(tt.container)

// Validate the value
if !tt.expectError && value != expectedValue {
t.Errorf("renderRealMemorySlurmd() = %v, expectedValue %v (from %s)", value, expectedValue, tt.resourceMemory)
if value != tt.expectedValue {
t.Errorf("renderRealMemorySlurmd() = %v, expectedValue %v (from %s)", value, tt.expectedValue, tt.resourceMemory)
}
})
}
Expand Down

0 comments on commit 4847905

Please sign in to comment.