Repository navigation
[ci] Build the manylinux wheels without pip build isolation - #65577
Merged
Merged
Conversation
This script pins cython and setuptools into the interpreter and then never uses them: `pip wheel` builds in an isolated environment by default, and python/ has no pyproject.toml, so pip synthesizes a build system and fetches setuptools, cython, wheel, pip and packaging itself, unpinned. Observed on premerge 72104, every `wanda: wheel py3.*` job made exactly those five requests to files.pythonhosted.org: #22 5.755 Running command installing build dependencies Obtaining dependency information for setuptools>=40.8.0 from https://files... ... cython>=3.0.12, wheel, pip, packaging>=24.0 Two reasons that is worth removing rather than routing elsewhere. It is a docker build, so it cannot see a package index configured in the step's environment -- these are the only fetches in the job and they have no mirror available to them, which matters while files.pythonhosted.org returns intermittent 502s (pypi/support#11895). And the versions that build the release wheels are then whatever is newest that day, rather than the ones this script takes the trouble to pin. wheel is added to the pinned set because the isolated environment was providing it. setuptools 80.9.0 carries bdist_wheel itself, so this is belt and braces rather than strictly required, and pinning it costs nothing. Signed-off-by: elliot-barn <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the manylinux wheel build script to install wheel version 0.45.1 and append the --no-build-isolation flag to the pip wheel commands. This ensures that the pinned dependencies are used and prevents pip from making external requests to fetch unpinned packages in an isolated environment. There are no review comments, so no feedback is provided.
Dropping build isolation leaves three fetches: the cython, setuptools and wheel pins this script installs deliberately. They can 502 like any other, and unlike the ones removed in the previous commit they cannot simply be deleted -- the build needs them. So they get an index. Both wheel builder stages build FROM the upstream manylinux image rather than a CI root, so they inherit no ENV from the rest of the image graph and need the build arg directly; wanda resolves it from RAYCI_IMAGE_PIP_INDEX_URL in the job environment, and an empty value leaves pip on PyPI as before. Also drops -q from that install. It hid the "Obtaining dependency information ... from https://files.pythonhosted.org/..." lines, which is why a log scan of these jobs counted five fetches when there were seven: five from the isolated build environment, two silent. Network fetches that do not appear in the log of a build that fails on network are a bad trade for a few lines of output. Signed-off-by: elliot-barn <[email protected]>
elliot-barn
added a commit
that referenced
this pull request
Aug 20, 2026
## Description Docker builds are the one CI surface that cannot be pointed at a package index by configuring the step: BuildKit `RUN` steps inherit nothing from the environment of the process that started the build. On premerge 72104 that showed up as five direct `files.pythonhosted.org` fetches in every `wanda: wheel py3.*` job, while every forge-based step in the same build resolved elsewhere. The only channel into a build is a build arg. This adds one on the four roots of the CI image graph (`base.test`, `base.gpu`, `forge`, `manylinux`) plus `ci/ray_ci/tests.env.Dockerfile`; children inherit it through `ENV`. **Safe for anyone building these images outside CI.** The arg is generic and empty by default — nothing here names a host — and a build that passes nothing resolves from `https://pypi.org/simple`, exactly as today. The published images under `docker/` are untouched. wanda resolves the value from `RAYCI_IMAGE_PIP_INDEX_URL` in the job environment, so setting it is a CI-side decision rather than a repo one, and unsetting it is a complete rollback with no code change. ## Caveat that gates turning it on The value must be **stable across jobs**. Build args are part of wanda's content-addressed cache key, so a per-job address would rebuild all 23 images on every build. A fixed hostname is fine; anything job-scoped is not. It also has to be an index that works directly — pointing a build at a metadata-only path would mirror the index and leave the artifacts on the origin. Until both hold, leaving the variable unset keeps this inert. ## Related issues pypi/support#11895. Complements #65571 (steps) and #65576 (manylinux steps); independent of #65577, which removes the build-time fetches from the wheel builds rather than redirecting them — where that is possible it is strictly better, since it needs no configuration at all. Not a duplicate: no open PR touches these Dockerfiles' index configuration. ## Testing - `PYTHONPATH=.:release python -m pytest -q ci/ray_ci/test_linux_tester_container.py ci/ray_ci/test_linux_container.py` — 12 passed, including the argv assertion for the new `--build-arg`. - `pre-commit` clean over all 15 changed files. - Not verified: an actual image build with the arg set, which needs a CI job. The failure mode of a wrong value is a failed `pip install` during the image build, not a silently mis-built image. AI assistance (Claude Code) was used for this change. --------- Signed-off-by: elliot-barn <[email protected]> Signed-off-by: Elliot Barnwell <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…ect#65577) ## Description `ci/build/build-manylinux-wheel.sh` pins cython and setuptools into the interpreter and then never uses them. `pip wheel` builds in an isolated environment by default, and `python/` has no `pyproject.toml`, so pip synthesizes a build system and fetches its own copies of `setuptools`, `cython`, `wheel`, `pip` and `packaging` — unpinned. Observed on premerge 72104, where every `wanda: wheel py3.*` job made exactly those five requests and nothing else: ``` ray-project#22 5.755 Running command installing build dependencies Obtaining dependency information for setuptools>=40.8.0 from https://files.pythonhosted.org/... ... cython>=3.0.12, wheel, pip, packaging>=24.0 ``` Two reasons to remove them rather than route them somewhere: - **They are the only network fetches in that job, and they have no mirror available.** These run inside `docker build`, where BuildKit `RUN` steps do not inherit the step container's environment, so an index configured for CI cannot reach them. That matters while `files.pythonhosted.org` returns intermittent 502s (pypi/support#11895) — one failed fetch fails a release wheel build. - **Determinism.** The versions that build the release wheels are currently whatever is newest that day, rather than the ones this script deliberately pins two lines earlier. `wheel` joins the pinned set because the isolated environment had been providing it. setuptools 80.9.0 carries `bdist_wheel` itself, so that is belt and braces rather than strictly required, and pinning it costs nothing. ## Related issues Upstream cause: pypi/support#11895. Independent of the CI mirror work in ray-project#65571 and ray-project#65576 — this path cannot use a mirror at all, which is precisely why it is worth eliminating the fetches instead. Not a duplicate: `gh pr list --repo ray-project/ray --state open --search "build-isolation"` and `"build-manylinux-wheel"` return nothing. ## Testing - `bash -n` and `pre-commit` (shellcheck, semgrep) clean. - The behaviour is verified by construction from the build log above: the five packages pip fetched are exactly the ones the isolated environment builds, and cython/setuptools are already installed by the preceding line at the versions `setup.py` requires (`setup_requires=["cython >= 3.0.12", ...]` against a pinned `cython==3.0.12`). - Not verified locally: a full manylinux wheel build, which needs the manylinux image and a Bazel build of the core. The failure mode if a build dependency is genuinely missing is loud and immediate — `pip wheel` errors during the build rather than producing a subtly different wheel. - The check on this PR is the `wanda: wheel py3.*` jobs: they should produce wheels with **zero** `files.pythonhosted.org` requests, where today there are five per job. AI assistance (Claude Code) was used for this change. --------- Signed-off-by: elliot-barn <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
) ## Description Docker builds are the one CI surface that cannot be pointed at a package index by configuring the step: BuildKit `RUN` steps inherit nothing from the environment of the process that started the build. On premerge 72104 that showed up as five direct `files.pythonhosted.org` fetches in every `wanda: wheel py3.*` job, while every forge-based step in the same build resolved elsewhere. The only channel into a build is a build arg. This adds one on the four roots of the CI image graph (`base.test`, `base.gpu`, `forge`, `manylinux`) plus `ci/ray_ci/tests.env.Dockerfile`; children inherit it through `ENV`. **Safe for anyone building these images outside CI.** The arg is generic and empty by default — nothing here names a host — and a build that passes nothing resolves from `https://pypi.org/simple`, exactly as today. The published images under `docker/` are untouched. wanda resolves the value from `RAYCI_IMAGE_PIP_INDEX_URL` in the job environment, so setting it is a CI-side decision rather than a repo one, and unsetting it is a complete rollback with no code change. ## Caveat that gates turning it on The value must be **stable across jobs**. Build args are part of wanda's content-addressed cache key, so a per-job address would rebuild all 23 images on every build. A fixed hostname is fine; anything job-scoped is not. It also has to be an index that works directly — pointing a build at a metadata-only path would mirror the index and leave the artifacts on the origin. Until both hold, leaving the variable unset keeps this inert. ## Related issues pypi/support#11895. Complements ray-project#65571 (steps) and ray-project#65576 (manylinux steps); independent of ray-project#65577, which removes the build-time fetches from the wheel builds rather than redirecting them — where that is possible it is strictly better, since it needs no configuration at all. Not a duplicate: no open PR touches these Dockerfiles' index configuration. ## Testing - `PYTHONPATH=.:release python -m pytest -q ci/ray_ci/test_linux_tester_container.py ci/ray_ci/test_linux_container.py` — 12 passed, including the argv assertion for the new `--build-arg`. - `pre-commit` clean over all 15 changed files. - Not verified: an actual image build with the arg set, which needs a CI job. The failure mode of a wrong value is a failed `pip install` during the image build, not a silently mis-built image. AI assistance (Claude Code) was used for this change. --------- Signed-off-by: elliot-barn <[email protected]> Signed-off-by: Elliot Barnwell <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ci/build/build-manylinux-wheel.shpins cython and setuptools into the interpreter and then never uses them.pip wheelbuilds in an isolated environment by default, andpython/has nopyproject.toml, so pip synthesizes a build system and fetches its own copies ofsetuptools,cython,wheel,pipandpackaging— unpinned.Observed on premerge 72104, where every
wanda: wheel py3.*job made exactly those five requests and nothing else:Two reasons to remove them rather than route them somewhere:
docker build, where BuildKitRUNsteps do not inherit the step container's environment, so an index configured for CI cannot reach them. That matters whilefiles.pythonhosted.orgreturns intermittent 502s (Pip Failures Seen with Max Retry Errors in us-west-2 pypi/support#11895) — one failed fetch fails a release wheel build.wheeljoins the pinned set because the isolated environment had been providing it. setuptools 80.9.0 carriesbdist_wheelitself, so that is belt and braces rather than strictly required, and pinning it costs nothing.Related issues
Upstream cause: pypi/support#11895. Independent of the CI mirror work in #65571 and #65576 — this path cannot use a mirror at all, which is precisely why it is worth eliminating the fetches instead.
Not a duplicate:
gh pr list --repo ray-project/ray --state open --search "build-isolation"and"build-manylinux-wheel"return nothing.Testing
bash -nandpre-commit(shellcheck, semgrep) clean.setup.pyrequires (setup_requires=["cython >= 3.0.12", ...]against a pinnedcython==3.0.12).pip wheelerrors during the build rather than producing a subtly different wheel.wanda: wheel py3.*jobs: they should produce wheels with zerofiles.pythonhosted.orgrequests, where today there are five per job.AI assistance (Claude Code) was used for this change.