-
Notifications
You must be signed in to change notification settings - Fork 665
RayJob Volcano Integration #3972
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6e4184a
modify batch scheduler interface to support CRD other than RayCluster
troychiu 973fe82
[Feature] RayJob Volcano integration
win5923 2ee7e8a
Modify kai scheduler and sheduler plugins
win5923 92e7d95
Revert interface migration
win5923 dd38daa
Append submitter resources
win5923 a33a3b7
Remove empty ResourceList
win5923 42479c2
Add K8sJobMode check to prevent YuniKorn from adding submitter pod an…
win5923 597e57d
Apply Troy's comments
win5923 a64c011
Log more information
win5923 b8cb224
Add sidecarmode
win5923 84d39f9
fix
Future-Outlier cf6b48b
Update Rueian's advice
Future-Outlier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
ray-operator/config/samples/ray-job.volcano-scheduler-queue.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| apiVersion: scheduling.volcano.sh/v1beta1 | ||
| kind: Queue | ||
| metadata: | ||
| name: kuberay-test-queue | ||
| spec: | ||
| weight: 1 | ||
| capability: | ||
| cpu: 4 | ||
| memory: 6Gi | ||
| --- | ||
| apiVersion: ray.io/v1 | ||
| kind: RayJob | ||
| metadata: | ||
| name: rayjob-sample-0 | ||
| labels: | ||
| ray.io/scheduler-name: volcano | ||
| volcano.sh/queue-name: kuberay-test-queue | ||
| spec: | ||
| entrypoint: python /home/ray/samples/sample_code.py | ||
| runtimeEnvYAML: | | ||
| pip: | ||
| - requests==2.26.0 | ||
| - pendulum==2.1.2 | ||
| env_vars: | ||
| counter_name: "test_counter" | ||
| rayClusterSpec: | ||
| rayVersion: '2.46.0' | ||
| headGroupSpec: | ||
| rayStartParams: {} | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: ray-head | ||
| image: rayproject/ray:2.46.0 | ||
| ports: | ||
| - containerPort: 6379 | ||
| name: gcs-server | ||
| - containerPort: 8265 | ||
| name: dashboard | ||
| - containerPort: 10001 | ||
| name: client | ||
| resources: | ||
| limits: | ||
| cpu: "1" | ||
| memory: "2Gi" | ||
| requests: | ||
| cpu: "1" | ||
| memory: "2Gi" | ||
| volumeMounts: | ||
| - mountPath: /home/ray/samples | ||
| name: code-sample | ||
| volumes: | ||
| - name: code-sample | ||
| configMap: | ||
| name: ray-job-code-sample | ||
| items: | ||
| - key: sample_code.py | ||
| path: sample_code.py | ||
| workerGroupSpecs: | ||
| - replicas: 2 | ||
| minReplicas: 2 | ||
| maxReplicas: 2 | ||
| groupName: small-group | ||
| rayStartParams: {} | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: ray-worker | ||
| image: rayproject/ray:2.46.0 | ||
| resources: | ||
| limits: | ||
| cpu: "1" | ||
| memory: "1Gi" | ||
| requests: | ||
| cpu: "1" | ||
| memory: "1Gi" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: ray-job-code-sample | ||
| data: | ||
| sample_code.py: | | ||
| import ray | ||
| import os | ||
| import requests | ||
|
|
||
| ray.init() | ||
|
|
||
| @ray.remote | ||
| class Counter: | ||
| def __init__(self): | ||
| # Used to verify runtimeEnv | ||
| self.name = os.getenv("counter_name") | ||
| assert self.name == "test_counter" | ||
| self.counter = 0 | ||
|
|
||
| def inc(self): | ||
| self.counter += 1 | ||
|
|
||
| def get_counter(self): | ||
| return "{} got {}".format(self.name, self.counter) | ||
|
|
||
| counter = Counter.remote() | ||
|
|
||
| for _ in range(5): | ||
| ray.get(counter.inc.remote()) | ||
| print(ray.get(counter.get_counter.remote())) | ||
|
|
||
| # Verify that the correct runtime env was used for the job. | ||
| assert requests.__version__ == "2.26.0" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @win5923
can we add
ray.io/gang-scheduling-enabled: "true"in the example and test them?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, adding
ray.io/gang-scheduling-enabled: "true"does not have any effect. This only works withYuniKornor theScheduler plugin.kuberay/ray-operator/controllers/ray/batchscheduler/yunikorn/yunikorn_scheduler.go
Lines 120 to 123 in c6bafa3
kuberay/ray-operator/controllers/ray/batchscheduler/scheduler-plugins/scheduler_plugins.go
Lines 109 to 112 in c6bafa3
And I think this is a breaking change if we add this check. We should also update the doc to mention that starting from version 1.5.0, users need to add
ray.io/gang-scheduling-enabled: "true"to enable gang scheduling for Volcano. https://docs.ray.io/en/latest/cluster/kubernetes/k8s-ecosystem/volcano.htmlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that volcano's default scheduler configmap is gang scheduling enabled!
so in the future, if the user want to disable it, we might need to tell them to edit the configmap or figure out some way to control it by adding more information in our CR.
thank you!!