Skip to content

fix(cli): disable ray's uv run runtime env hook by default#905

Merged
michael-johnston merged 4 commits into
mainfrom
maj_uv_run_fix_ado
Apr 24, 2026
Merged

fix(cli): disable ray's uv run runtime env hook by default#905
michael-johnston merged 4 commits into
mainfrom
maj_uv_run_fix_ado

Conversation

@michael-johnston
Copy link
Copy Markdown
Member

Context & Problem

Ray’s uv run integration automatically packages the current working directory for workers (#506). While useful for distributed setups, it causes significant friction for local ado executions (uv run ado ...). It unnecessarily attempts to upload the source-tree plus untracked files to the local object store, leading to slow startup times and frequent failures in dev/agent workflows.

Since ado explicitly manages remote environments via ado --remote this automatic Ray hook is redundant for our default paths.

Changes in this PR

  • Opt-in rather than Opt-out: We now disable the integration by default by setting os.environ.setdefault("RAY_ENABLE_UV_RUN_RUNTIME_ENV", "0") at ado entrypoints . This must happens before ray is imported.
  • Maintains User Choice: Users who want Ray's native behavior can export RAY_ENABLE_UV_RUN_RUNTIME_ENV=1.
  • Removes Broken Workaround: Drops the old runtime_env={"working_dir": None} hack in ray.init(). Newer Ray versions validate this as a path string, meaning None now raises a TypeError (bug(tests): unable to run tests with uv run due to none working dir #893 )

Comment thread website/docs/getting-started/remote_run.md Outdated
Comment thread website/docs/getting-started/remote_run.md Outdated
Comment thread website/docs/getting-started/remote_run.md Outdated
Comment thread website/docs/getting-started/remote_run.md Outdated
@AlessandroPomponio AlessandroPomponio changed the title fix(cli): disable uv run runtime env hook by default; fix(cli): disable ray's uv run runtime env hook by default Apr 24, 2026
Co-authored-by: Alessandro Pomponio <10339005+AlessandroPomponio@users.noreply.github.com>
Signed-off-by: Michael Johnston <66301584+michael-johnston@users.noreply.github.com>
Comment thread website/docs/getting-started/remote_run.md Outdated
Signed-off-by: Michael Johnston <66301584+michael-johnston@users.noreply.github.com>
Copy link
Copy Markdown
Member

@AlessandroPomponio AlessandroPomponio left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-johnston michael-johnston added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 502ba2b Apr 24, 2026
19 checks passed
@michael-johnston michael-johnston deleted the maj_uv_run_fix_ado branch April 24, 2026 09:13
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.

bug: unable to run ado create operation with uv run

2 participants