Skip to content
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

[Helm][minor] Make "disabled" flag for worker groups optional #548

Merged
merged 2 commits into from
Sep 12, 2022

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Sep 9, 2022

Why are these changes needed?

As mentioned by @tbabej in #537, an error will be reported if the disabled key on the default worker group is undefined. In old Helm versions, when disabled key is undefined, it will be set to nil. Hence, when we run the following command, it will report the error "incompatible types for comparison". Obviously, nil and boolean cannot be compared for equality. See helm/helm#6376 for more details.

$ helm lint    
==> Linting .
[ERROR] templates/: template: ray-cluster/templates/raycluster-cluster.yaml:105:9: executing "ray-cluster/templates/raycluster-cluster.yaml" at <ne .Values.worker.disabled true>: error calling ne: incompatible types for comparison

Error: 1 chart(s) linted, 1 chart(s) failed

In this PR, I give the disabled key a default value to make it become an optional field.

Related issue number

Closes #544
#499

Checks

$ git diff | cat         
diff --git a/helm-chart/ray-cluster/templates/raycluster-cluster.yaml b/helm-chart/ray-cluster/templates/raycluster-cluster.yaml
index 67922d4..5432068 100644
--- a/helm-chart/ray-cluster/templates/raycluster-cluster.yaml
+++ b/helm-chart/ray-cluster/templates/raycluster-cluster.yaml
@@ -102,7 +102,7 @@ spec:
 {{ include "ray-cluster.labels" $ | indent 10 }}
   {{- end }}
   {{- end }}
-  {{- if ne .Values.worker.disabled true }}
+  {{- if ne (.Values.worker.disabled | default false) true }}
   - rayStartParams:
     {{- range $key, $val := .Values.worker.initArgs }}
       {{ $key }}: {{ $val | quote }}
diff --git a/helm-chart/ray-cluster/values.yaml b/helm-chart/ray-cluster/values.yaml
index be80d86..a099a50 100644
--- a/helm-chart/ray-cluster/values.yaml
+++ b/helm-chart/ray-cluster/values.yaml
@@ -54,7 +54,7 @@ head:
 worker:
   # If you want to disable the default workergroup
   # change the line below
-  disabled: false
+  # disabled: false
   groupName: workergroup
   replicas: 1
   type: worker

$ helm lint     
==> Linting .

1 chart(s) linted, 0 chart(s) failed
  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@kevin85421
Copy link
Member Author

cc @DmitriGekhtman @tbabej

@DmitriGekhtman
Copy link
Collaborator

Thanks for the fix!
To finish this up, could you return values.yaml to its state prior to #543?
(That will make it clearer that the disabled field is optional.)

@kevin85421
Copy link
Member Author

@DmitriGekhtman Thank you for your review! I have updated it.

Copy link
Collaborator

@DmitriGekhtman DmitriGekhtman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@DmitriGekhtman
Copy link
Collaborator

Merging before CI finishes, as Helm charts aren't yet tested in CI.

@DmitriGekhtman DmitriGekhtman merged commit 25d0f2b into ray-project:master Sep 12, 2022
lowang-bh pushed a commit to lowang-bh/kuberay that referenced this pull request Sep 24, 2023
…oject#548)

In this PR, I give the disabled key a default value to make it become an optional field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Helm][minor] Make "disabled" flag for worker groups optional
2 participants