Skip to content

Conversation

fscnick
Copy link
Contributor

@fscnick fscnick commented May 31, 2025

Why are these changes needed?

In order to help users getting involved uv easier, provides this ray-cluster.uv.yaml as an example. It enables the runtime env hook so that uv run ... could work with runtime environment in the RayCluster, reference uv + Ray: Pain-Free Python Dependencies in Clusters for more information about this runtime env hook.

RAY_RUNTIME_ENV_HOOK=ray._private.runtime_env.uv_runtime_env_hook.hook

By the way, the working_dir is under /home/ray as default, which contains files. It might cause some errors during preparing runtime env because some limitations. Changing to folder /home/ray/samples could avoid this issue.

kubectl exec -it $HEAD_POD -- /bin/bash -c "cd samples && uv run --with emoji /home/ray/samples/sample_code.py"

Related issue number

Closes #3039

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Signed-off-by: fscnick <fscnick.dev@gmail.com>
@fscnick
Copy link
Contributor Author

fscnick commented May 31, 2025

execution result:
sample result

@fscnick fscnick marked this pull request as ready for review May 31, 2025 02:38
@fscnick
Copy link
Contributor Author

fscnick commented May 31, 2025

@kevin85421 PTAL

Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

Why do you need to create a worker group? If this example doesn't require worker group, please remove it. If you want to run something on the worker Pods, please try to schedule the Ray tasks on the worker Pods (ex: setting num-cpus: 0 to the head group).

@kevin85421
Copy link
Member

@MortalHappiness can you review this PR and ray-project/ray#53303?

Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
@fscnick fscnick force-pushed the add-ray-cluster-uv-doc branch from f911cb5 to a9fd0d4 Compare May 31, 2025 09:09
@fscnick
Copy link
Contributor Author

fscnick commented May 31, 2025

Hi @MortalHappiness, CI has passed.

@kevin85421 kevin85421 merged commit d55dfc3 into ray-project:master Jun 1, 2025
25 checks passed
@fscnick fscnick deleted the add-ray-cluster-uv-doc branch June 1, 2025 07:07
pawelpaszki pushed a commit to opendatahub-io/kuberay that referenced this pull request Jun 10, 2025
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.

Use uv in sample YAML files
3 participants