Skip to content

[ci] Keep the job-local package index out of requirements_compiled.txt - #65655

Merged
elliot-barn merged 1 commit into
masterfrom
ci-pip-compile-index
Aug 21, 2026
Merged

elliot-barn merged 1 commit into
masterfrom
ci-pip-compile-index

Conversation

@jeffreywang88

@jeffreywang88 jeffreywang88 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

pip-compile bakes whatever index it used into the file it writes. Since #65578 that's CI's per-job mirror URL, so the regenerated lockfile never matches the committed one and the step fails. Unsetting the index vars for that command keeps the header canonical.

Related issues

Resolves pip-compile dependencies step in #65351.

Validation

pip-compile dependencies step passes after cp'ing this fix.

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@jeffreywang88
jeffreywang88 requested review from a team as code owners August 21, 2026 22:17

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ci/ci.sh to prevent temporary CI mirror URLs from being written into the lockfile by unsetting pip and uv index environment variables during the execution of pip-compile. The reviewer suggested using the shell's built-in unset command instead of env -u to achieve this, as the function is already executed within a subshell, which would avoid spawning an extra process.

Comment thread ci/ci.sh
Comment on lines +44 to +46
env -u PIP_INDEX_URL -u PIP_EXTRA_INDEX_URL -u PIP_TRUSTED_HOST \
-u UV_INDEX_URL -u UV_EXTRA_INDEX_URL -u UV_INSECURE_HOST \
pip-compile --verbose --resolver=backtracking \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Since the entire compile_pip_dependencies function body is already wrapped in a subshell ( ... ) (starting on line 28 and ending on line 86), any environment variable modifications are completely isolated to this function and won't leak to the rest of the CI script.

Instead of using env -u to unset these variables for the single pip-compile command, we can use the shell's built-in unset command. This is more idiomatic, cleaner, and avoids spawning an extra env process.

Suggested change
env -u PIP_INDEX_URL -u PIP_EXTRA_INDEX_URL -u PIP_TRUSTED_HOST \
-u UV_INDEX_URL -u UV_EXTRA_INDEX_URL -u UV_INSECURE_HOST \
pip-compile --verbose --resolver=backtracking \
unset PIP_INDEX_URL PIP_EXTRA_INDEX_URL PIP_TRUSTED_HOST \
UV_INDEX_URL UV_EXTRA_INDEX_URL UV_INSECURE_HOST
pip-compile --verbose --resolver=backtracking \

@jeffreywang88 jeffreywang88 added the go add ONLY when ready to merge, run all tests label Aug 21, 2026
@elliot-barn
elliot-barn merged commit e7f152d into master Aug 21, 2026
6 checks passed
@elliot-barn
elliot-barn deleted the ci-pip-compile-index branch August 21, 2026 23:58
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…xt` (ray-project#65655)

## Description
`pip-compile` bakes whatever index it used into the file it writes.
Since ray-project#65578 that's CI's per-job mirror URL, so the regenerated lockfile
never matches the committed one and the step fails. Unsetting the index
vars for that command keeps the header canonical.

## Related issues
Resolves `pip-compile dependencies`
[step](https://buildkite.com/ray-project/premerge/builds/72282/table) in
ray-project#65351.

## Validation
`pip-compile dependencies`
[step](https://buildkite.com/ray-project/premerge/builds/72323/canvas?sid=01a02668-48bd-45a5-96f8-12929b8c0deb&tab=output)
passes after cp'ing this fix.

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: Jeffrey Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants