Repository navigation
[ci] Keep the job-local package index out of requirements_compiled.txt - #65655
Conversation
Signed-off-by: Jeffrey Wang <[email protected]>
There was a problem hiding this comment.
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.
| 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 \ |
There was a problem hiding this comment.
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.
| 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 \ |
…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]>
Description
pip-compilebakes 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 dependenciesstep in #65351.Validation
pip-compile dependenciesstep passes after cp'ing this fix.Additional information