This is an automated email from the ASF dual-hosted git repository.

rexxiong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 7be4d6b0a [CELEBORN-1951][HELM] Rename resources.{master,worker} to 
{master,worker}.resoruces
7be4d6b0a is described below

commit 7be4d6b0ac8bf8a7e734d47c3a048eb352ea3266
Author: Yi Chen <[email protected]>
AuthorDate: Thu Apr 24 09:27:25 2025 +0800

    [CELEBORN-1951][HELM] Rename resources.{master,worker} to 
{master,worker}.resoruces
    
    ### What changes were proposed in this pull request?
    
    - Rename `resources.master` to `master.resources`.
    - Rename `resources.worker` to `worker.resources`.
    - Add corresponding Helm unit tests.
    
    ### Why are the changes needed?
    
    Unify the values naming by prefixing them with `master` or `worker`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes.
    
    ### How was this patch tested?
    
    Helm unit test by `helm unittest charts/celeborn --file 
"tests/**/*_test.yaml" --strict --debug`.
    
    Closes #3216 from ChenYi015/helm/resources.
    
    Authored-by: Yi Chen <[email protected]>
    Signed-off-by: Shuang <[email protected]>
---
 charts/celeborn/ci/values.yaml                     | 20 ++++++------
 charts/celeborn/templates/master/statefulset.yaml  |  4 +--
 charts/celeborn/templates/worker/statefulset.yaml  |  4 +--
 charts/celeborn/tests/master/statefulset_test.yaml | 30 ++++++++++++++++++
 charts/celeborn/tests/worker/statefulset_test.yaml | 30 ++++++++++++++++++
 charts/celeborn/values.yaml                        | 37 +++++++++++-----------
 6 files changed, 93 insertions(+), 32 deletions(-)

diff --git a/charts/celeborn/ci/values.yaml b/charts/celeborn/ci/values.yaml
index 242e1b0c7..9d806f4ce 100644
--- a/charts/celeborn/ci/values.yaml
+++ b/charts/celeborn/ci/values.yaml
@@ -96,23 +96,25 @@ dnsPolicy: ClusterFirstWithHostNet
 # -- Specifies whether to use the host's network namespace
 hostNetwork: true
 
-resources:
-  # -- Pod resources for Celeborn master pods
-  master:
-    limits:
-      cpu: 100m
-      memory: 800Mi
+# -- Resources for Celeborn master containers.
+master:
+  resources:
     requests:
       cpu: 100m
       memory: 800Mi
-  # -- Pod resources for Celeborn worker pods
-  worker:
     limits:
       cpu: 100m
-      memory: 1Gi
+      memory: 800Mi
+
+# -- Resources for Celeborn worker containers.
+worker:
+  resources:
     requests:
       cpu: 100m
       memory: 1Gi
+    limits:
+      cpu: 100m
+      memory: 1Gi
 
 # -- Container security context
 securityContext:
diff --git a/charts/celeborn/templates/master/statefulset.yaml 
b/charts/celeborn/templates/master/statefulset.yaml
index 27cb4c51d..52a1ca197 100644
--- a/charts/celeborn/templates/master/statefulset.yaml
+++ b/charts/celeborn/templates/master/statefulset.yaml
@@ -52,7 +52,7 @@ spec:
         volumeMounts:
         - name: {{ $.Release.Name }}-master-vol-0
           mountPath: {{ (index $dirs 0).mountPath }}
-        {{- with .Values.resources.master }}
+        {{- with .Values.master.resources }}
         resources:
           {{- toYaml . | nindent 10 }}
         {{- end }}
@@ -97,7 +97,7 @@ spec:
         - name: {{ $.Release.Name }}-master-vol-{{ $index }}
           mountPath: {{ .mountPath }}
         {{- end }}
-        {{- with .Values.resources.master }}
+        {{- with .Values.master.resources }}
         resources:
           {{- toYaml . | nindent 10 }}
         {{- end }}
diff --git a/charts/celeborn/templates/worker/statefulset.yaml 
b/charts/celeborn/templates/worker/statefulset.yaml
index feee75b05..b545c653e 100644
--- a/charts/celeborn/templates/worker/statefulset.yaml
+++ b/charts/celeborn/templates/worker/statefulset.yaml
@@ -56,7 +56,7 @@ spec:
         - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
           mountPath: {{ $dir.mountPath }}
         {{- end}}
-        {{- with .Values.resources.worker }}
+        {{- with .Values.worker.resources }}
         resources:
           {{- toYaml . | nindent 10 }}
         {{- end }}
@@ -100,7 +100,7 @@ spec:
         - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
           mountPath: {{ .mountPath }}
         {{- end }}
-        {{- with .Values.resources.worker }}
+        {{- with .Values.worker.resources }}
         resources:
           {{- toYaml . | nindent 10 }}
         {{- end }}
diff --git a/charts/celeborn/tests/master/statefulset_test.yaml 
b/charts/celeborn/tests/master/statefulset_test.yaml
index 21c33deb2..a01c5a62d 100644
--- a/charts/celeborn/tests/master/statefulset_test.yaml
+++ b/charts/celeborn/tests/master/statefulset_test.yaml
@@ -58,6 +58,36 @@ tests:
           path: spec.template.spec.containers[0].imagePullPolicy
           value: Always
 
+  - it: Should use the specified resources if `master.resources` is set
+    set:
+      master:
+        resources:
+          requests:
+            cpu: 100m
+            memory: 128Mi
+          limits:
+            cpu: 100m
+            memory: 128Mi
+    asserts:
+      - equal:
+          path: spec.template.spec.initContainers[0].resources
+          value:
+            requests:
+              cpu: 100m
+              memory: 128Mi
+            limits:
+              cpu: 100m
+              memory: 128Mi
+      - equal:
+          path: spec.template.spec.containers[?(@.name=='celeborn')].resources
+          value:
+            requests:
+              cpu: 100m
+              memory: 128Mi
+            limits:
+              cpu: 100m
+              memory: 128Mi
+
   - it: Should add secrets if `imagePullSecrets` is set
     set:
       imagePullSecrets:
diff --git a/charts/celeborn/tests/worker/statefulset_test.yaml 
b/charts/celeborn/tests/worker/statefulset_test.yaml
index caa6ebe77..aabc23231 100644
--- a/charts/celeborn/tests/worker/statefulset_test.yaml
+++ b/charts/celeborn/tests/worker/statefulset_test.yaml
@@ -58,6 +58,36 @@ tests:
           path: spec.template.spec.containers[0].imagePullPolicy
           value: Always
 
+  - it: Should use the specified resources if `worker.resources` is set
+    set:
+      worker:
+        resources:
+          requests:
+            cpu: 100m
+            memory: 128Mi
+          limits:
+            cpu: 100m
+            memory: 128Mi
+    asserts:
+      - equal:
+          path: spec.template.spec.initContainers[0].resources
+          value:
+            requests:
+              cpu: 100m
+              memory: 128Mi
+            limits:
+              cpu: 100m
+              memory: 128Mi
+      - equal:
+          path: spec.template.spec.containers[?(@.name=='celeborn')].resources
+          value:
+            requests:
+              cpu: 100m
+              memory: 128Mi
+            limits:
+              cpu: 100m
+              memory: 128Mi
+
   - it: Should add secrets if `imagePullSecrets` is set
     set:
       imagePullSecrets:
diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml
index f4e876dfa..c96fa4361 100644
--- a/charts/celeborn/values.yaml
+++ b/charts/celeborn/values.yaml
@@ -139,25 +139,6 @@ dnsPolicy: ClusterFirst
 # -- Specifies whether to use the host's network namespace
 hostNetwork: false
 
-resources:
-  # -- Pod resources for Celeborn master pods
-  master: {}
-    # limits:
-    #   cpu: 100m
-    #   memory: 128Mi
-    # requests:
-    #   cpu: 100m
-    #   memory: 128Mi
-
-  # -- Pod resources for Celeborn worker pods
-  worker: {}
-    # limits:
-    #   cpu: 100m
-    #   memory: 128Mi
-    # requests:
-    #   cpu: 100m
-    #   memory: 128Mi
-
 # -- Container security context
 securityContext:
   # Specifies the user ID to run the entrypoint of the container process
@@ -192,6 +173,15 @@ master:
     # key1: value1
     # key2: value2
 
+  # -- Resources for Celeborn master containers.
+  resources:
+    # requests:
+    #   cpu: 100m
+    #   memory: 128Mi
+    # limits:
+    #   cpu: 100m
+    #   memory: 128Mi
+
   # -- Node selector for Celeborn master pods.
   nodeSelector:
     # key1: value1
@@ -213,6 +203,15 @@ worker:
     # key1: value1
     # key2: value2
 
+  # -- Resources for Celeborn worker containers.
+  resources:
+    # requests:
+    #   cpu: 100m
+    #   memory: 128Mi
+    # limits:
+    #   cpu: 100m
+    #   memory: 128Mi
+
   # -- Node selector for Celeborn worker pods.
   nodeSelector:
     # key1: value1

Reply via email to