generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.
Description
What would you like to be documented or improved:
I would like to provide an example configMap. Maybe as the one use for e2e tests:
apiVersion: v1
kind: ConfigMap
metadata:
name: ray-job-autoscaling-code-sample
data:
sample_code.py: |
import ray
import os
ray.init()
@ray.remote
def my_task(x, s):
import time
time.sleep(s)
return x * x
# run tasks in sequence to avoid triggering autoscaling in the beginning
print([ray.get(my_task.remote(i, 1)) for i in range(4)])
# run tasks in parallel to trigger autoscaling (scaling up)
print(ray.get([my_task.remote(i, 4) for i in range(16)]))
# run tasks in sequence to trigger scaling down
print([ray.get(my_task.remote(i, 1)) for i in range(32)])
https://kueue.sigs.k8s.io/docs/tasks/run/rayjobs/#example-rayjob-with-autoscaling
Location (URL, file path, or section if applicable):
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.