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

[Bug] Allow zero replica for Helm #965

Closed
2 tasks done
ducviet00 opened this issue Mar 16, 2023 · 2 comments
Closed
2 tasks done

[Bug] Allow zero replica for Helm #965

ducviet00 opened this issue Mar 16, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ducviet00
Copy link
Contributor

ducviet00 commented Mar 16, 2023

Search before asking

  • I searched the issues and found no similar issues.

KubeRay Component

Others

What happened + What you expected to happen

I'm using helm for creating ray cluster. I modified replica number and minReplica number in helm values but it doesn't work.

In the helm values file:

additionalWorkerGroups:
  smallGroup:
    replicas: 0
    minReplicas: 0
    maxReplicas: 3

When CRDs deployed:

- groupName: smallGroup
    replicas: 1
    minReplicas: 1
    maxReplicas: 3

Expected:

- groupName: smallGroup
    replicas: 0
    minReplicas: 0
    maxReplicas: 3

Reproduction script

Set the worker replica number to zero in values file

# Default values for ray-cluster.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# The KubeRay community welcomes PRs to expose additional configuration
# in this Helm chart.

image:
  repository: rayproject/ray
  tag: 2.0.0
  pullPolicy: IfNotPresent

nameOverride: "kuberay"
fullnameOverride: ""

imagePullSecrets: []

head:
  labels: {}
  rayStartParams:
    dashboard-host: '0.0.0.0'
    block: 'true'
  containerEnv: []
  envFrom: []
  resources:
    limits:
      cpu: "1"
      memory: "2G"
    requests:
      cpu: "1"
      memory: "2G"
  annotations: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}
  securityContext: {}
  volumes:
    - name: log-volume
      emptyDir: {}
  volumeMounts:
    - mountPath: /tmp/ray
      name: log-volume
  sidecarContainers: []
  command: []
  args: []


worker:
  groupName: workergroup
  replicas: 1
  labels: {}
  rayStartParams:
    block: 'true'
  initContainerImage: 'busybox:1.28'  # Enable users to specify the image for init container. Users can pull the busybox image from their private repositories.
  initContainerSecurityContext: {}
  containerEnv: []
  envFrom: []
  resources:
    limits:
      cpu: "1"
      memory: "1G"
    requests:
      cpu: "1"
      memory: "1G"
  annotations: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}
  securityContext: {}
  volumes:
    - name: log-volume
      emptyDir: {}
  volumeMounts:
    - mountPath: /tmp/ray
      name: log-volume
  sidecarContainers: []
  command: []
  args: []

additionalWorkerGroups:
  smallGroup:
    # Disabled by default
    disabled: true
    replicas: 0
    minReplicas: 0
    maxReplicas: 3
    labels: {}
    rayStartParams:
      block: 'true'
    initContainerImage: 'busybox:1.28'  # Enable users to specify the image for init container. Users can pull the busybox image from their private repositories..
    initContainerSecurityContext: {}
    containerEnv: []
    envFrom: []
    resources:
      limits:
        cpu: 1
        memory: "1G"
      requests:
        cpu: 1
        memory: "1G"
    annotations: {}
    nodeSelector: {}
    tolerations: []
    affinity: {}
    securityContext: {}
    volumes:
      - name: log-volume
        emptyDir: {}
    volumeMounts:
      - mountPath: /tmp/ray
        name: log-volume
    sidecarContainers: [].
    command: []
    args: []

service:
  type: ClusterIP

Install helm chart.
helm upgrade --install --create-namespace -n ray-v2 ray-helm .

Get the values of CRD.
kubectl get rayclusters -n ray-v2 ray-helm-kuberay -o yaml

You can see minReplica number is 1

Anything else

This happens because ternary function in template file. {{ 0 | 1 }} = 1

minReplicas: {{ $values.minReplicas | default (default 1 $values.miniReplicas) }}

minReplicas: {{ .Values.worker.minReplicas | default (default 1 .Values.worker.miniReplicas) }}

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@ducviet00 ducviet00 added the bug Something isn't working label Mar 16, 2023
@nvtkaszpir
Copy link

kuberay raycluster updates are extremely limited:

While updating replicas and workersToDeleteUpdate is supported, updating other fields in RayCluster manifests is not 
supported. In particular, updating Ray head pod and Ray worker pod configuration is not supported.
To update pod configuration, delete the RayCluster, edit its configuration and then re-create the cluster
In other words, use kubectl delete and kubectl create to update a RayCluster's pod configuration,
rather than kubectl apply.
Support for in-place updates of pod configuration is tracked in KubeRay issue [#527](https://github.com/ray-project/kuberay/issues/527).

#527

@kevin85421
Copy link
Member

Closed by #968.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants