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

[Feature] Add kubectl plugin to help scale ray raycluster #110

Open
2 tasks done
chenk008 opened this issue Dec 8, 2021 · 6 comments · May be fixed by #2926
Open
2 tasks done

[Feature] Add kubectl plugin to help scale ray raycluster #110

chenk008 opened this issue Dec 8, 2021 · 6 comments · May be fixed by #2926
Assignees
Labels
cli kubectl plugin enhancement New feature or request rfc

Comments

@chenk008
Copy link
Contributor

chenk008 commented Dec 8, 2021

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

When we want to scale out/shrink a ray cluster, we use kubectl edit raycluster xxx to edit the raycluster. Especially in shrinking, we have to add ScaleStrategy in the CRD. It is a little complicated.

We can create a kubectl plugin to simplify the way.

kubectl ray scale $groupName $replica
kubectl ray shrink $groupName $delete-podname-0 $delete-podname-1

@Jeffwan @akanso WDYT?

Use case

A kubectl plugin to help user to scale out/shrink easily.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@chenk008 chenk008 added the enhancement New feature or request label Dec 8, 2021
@akanso
Copy link
Collaborator

akanso commented Dec 8, 2021

yes good idea. I guess we would also need to specify the CR instance name for the raycluster.

kubectl ray scale $raycluster $groupName $replica

@Jeffwan
Copy link
Member

Jeffwan commented Jan 12, 2022

kubectl ray scale $raycluster $groupName $replica I assume this would be used for both scale out and scale in?
and shrink is used for fine grain control?

Or we want user only use shrink to scale in the cluster?

@akanso
Copy link
Collaborator

akanso commented Jan 13, 2022

I guess scaling down might require an optional flag, which is the name of the pod to scale down. Because in certain situations we cannot take down a random pod, it needs to be an idle one.

@Jeffwan Jeffwan added this to the v0.3.0 release milestone Jan 19, 2022
@daikeshi
Copy link
Contributor

daikeshi commented May 2, 2022

I'm wonder if this functionality can be included in Kuberay CLI? So users don't need to rely on kubectl (another CLI) to interact with the Ray clusters.

@Jeffwan Jeffwan added the rfc label May 30, 2022
@Jeffwan Jeffwan removed this from the v0.3.0 release milestone Jun 28, 2022
@andrewsykim
Copy link
Collaborator

I didn't know this issue existed, but here's a proposal on this idea https://docs.google.com/document/d/1msUpb59QBE9ypc1fLy7Od2FsZOzgRgMkPOJG7xHN1UU/edit?usp=sharing&resourcekey=0-G216URZBuFHOjvgcznRaAQ

@kevin85421 and I discussed this earlier this week. I plan to put together a PR for the initial version soon

@davidxia
Copy link
Contributor

davidxia commented Feb 4, 2025

Is anyone working on this? Happy to contribute a PR if the CLI interface has been decided.

davidxia added a commit to davidxia/kuberay that referenced this issue Feb 5, 2025
to scale a RayCluster's worker group.

contributes to ray-project#110

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 5, 2025
to scale a RayCluster's worker group.

contributes to ray-project#110

Signed-off-by: David Xia <[email protected]>
@davidxia davidxia linked a pull request Feb 5, 2025 that will close this issue
4 tasks
@MortalHappiness MortalHappiness added the cli kubectl plugin label Feb 5, 2025
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 6, 2025
to scale a RayCluster's worker group.

contributes to ray-project#110

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 6, 2025
to scale a RayCluster's worker group.

contributes to ray-project#110

## Example Usage

```console
$ kubectl ray scale -n hyperkube default-group -c NONEXISTENT -r 0
Error: failed to scale worker group default-group in Ray cluster dxia-testsd in namespace hyperkube: rayclusters.ray.io "NONEXISTENT" not found

$ kubectl ray scale -n hyperkube DEADBEEF -c dxia-test -r 1
Error: worker group DEADBEEF not found in Ray cluster dxia-test in namespace hyperkube. Available worker groups: default-group, another-group, yet-another-group

$ kubectl ray scale -n hyperkube default-group -c dxia-test -r 3
Scaled worker group default-group in Ray cluster dxia-test in namespace hyperkube from 0 to 3 replicas

$ kubectl ray scale -n hyperkube default-group -c dxia-test -r 1
Scaled worker group default-group in Ray cluster dxia-test in namespace hyperkube from 3 to 1 replicas

$ kubectl ray scale -n hyperkube default-group -c dxia-test -r -1
Error: must specify -r/--replicas with a non-negative integer
```

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 13, 2025
to scale a RayCluster's worker group.

contributes to ray-project#110

## Example Usage

```console
$ kubectl ray scale default-group --ray-cluster NONEXISTENT --replicas 0
Error: failed to scale worker group default-group in Ray cluster NONEXISTENT in namespace default: rayclusters.ray.io "NONEXISTENT" not found

$ kubectl ray scale DEADBEEF --ray-cluster dxia-test --replicas 1
Error: worker group DEADBEEF not found in Ray cluster dxia-test in namespace default. Available worker groups: default-group, another-group, yet-another-group

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 3
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 0 to 3 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 1
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 3 to 1 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas -1
Error: must specify -r/--replicas with a non-negative integer
```

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 14, 2025
to scale a RayCluster's worker group.

closes ray-project#110

## Example Usage

```console
$ kubectl ray scale default-group --ray-cluster NONEXISTENT --replicas 0
Error: failed to scale worker group default-group in Ray cluster NONEXISTENT in namespace default: rayclusters.ray.io "NONEXISTENT" not found

$ kubectl ray scale DEADBEEF --ray-cluster dxia-test --replicas 1
Error: worker group DEADBEEF not found in Ray cluster dxia-test in namespace default. Available worker groups: default-group, another-group, yet-another-group

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 3
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 0 to 3 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 1
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 3 to 1 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas -1
Error: must specify -r/--replicas with a non-negative integer
```

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 17, 2025
to scale a RayCluster's worker group.

closes ray-project#110

## Example Usage

```console
$ kubectl ray scale cluster -h                                                                                                                (base)
Scale a Ray cluster's worker group.

Usage:
  ray scale cluster (WORKERGROUP) (-c/--ray-cluster RAYCLUSTER) (-r/--replicas N) [flags]

Examples:
  # Scale a Ray cluster's worker group to 3 replicas
  kubectl ray scale cluster my-workergroup --ray-cluster my-raycluster --replicas 3

$ kubectl ray scale default-group --ray-cluster NONEXISTENT --replicas 0
Error: failed to scale worker group default-group in Ray cluster NONEXISTENT in namespace default: rayclusters.ray.io "NONEXISTENT" not found

$ kubectl ray scale DEADBEEF --ray-cluster dxia-test --replicas 1
Error: worker group DEADBEEF not found in Ray cluster dxia-test in namespace default. Available worker groups: default-group, another-group, yet-another-group

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 3
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 0 to 3 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 1
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 3 to 1 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas -1
Error: must specify -r/--replicas with a non-negative integer
```

Signed-off-by: David Xia <[email protected]>
davidxia added a commit to davidxia/kuberay that referenced this issue Feb 27, 2025
to scale a RayCluster's worker group.

closes ray-project#110

## Example Usage

```console
$ kubectl ray scale cluster -h                                                                                                                (base)
Scale a Ray cluster's worker group.

Usage:
  ray scale cluster (WORKERGROUP) (-c/--ray-cluster RAYCLUSTER) (-r/--replicas N) [flags]

Examples:
  # Scale a Ray cluster's worker group to 3 replicas
  kubectl ray scale cluster my-workergroup --ray-cluster my-raycluster --replicas 3

$ kubectl ray scale default-group --ray-cluster NONEXISTENT --replicas 0
Error: failed to scale worker group default-group in Ray cluster NONEXISTENT in namespace default: rayclusters.ray.io "NONEXISTENT" not found

$ kubectl ray scale DEADBEEF --ray-cluster dxia-test --replicas 1
Error: worker group DEADBEEF not found in Ray cluster dxia-test in namespace default. Available worker groups: default-group, another-group, yet-another-group

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 3
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 0 to 3 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas 1
Scaled worker group default-group in Ray cluster dxia-test in namespace default from 3 to 1 replicas

$ kubectl ray scale default-group --ray-cluster dxia-test --replicas -1
Error: must specify -r/--replicas with a non-negative integer
```

Signed-off-by: David Xia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli kubectl plugin enhancement New feature or request rfc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants