Skip to content

[ci] Stop exporting an image index the build cannot reach - #65603

Merged
elliot-barn merged 1 commit into
masterfrom
elliot-barn/fix-image-index-export
Aug 19, 2026
Merged

elliot-barn merged 1 commit into
masterfrom
elliot-barn/fix-image-index-export

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

Fixes wheel builds broken on master by #65602.

postmerge 19281 failed wanda: wheel py3.{10,11,12,13} on 8ed2aa20e (the hook commit); 19280 passed on the commit before. Release build 104832 shows the same failure on wanda: wheel py3.11/py3.12.

pip inside the image build was pointed at the agent's bridge gateway, could not reach it, and failed with cython==3.0.12 (from versions: none) — no 502, no origin fetch, no index at all.

Why it was worse than a no-op: ray-wheel.Dockerfile reads ${RAYCI_IMAGE_PIP_INDEX_URL:-https://pypi.org/simple}, so an absent value falls back to PyPI while a present but unreachable one fails hard. The fail-open that protects every other path does not extend into an image build.

What I got wrong: premerge 72149 proved a docker build could reach a step container on the bridge (172.16.0.2). Reaching the host at the bridge gateway is a different hop, and I conflated them.

The loopback export stays, and it is proven: 104832's init resolved 562 bazel repositories with zero direct fetches to files.pythonhosted.org, where 104694 failed on aiobotocore.

Restoring the image half needs an address verified from inside a build on the agent that will run it.

AI assistance (Claude Code) was used for this change.

This broke every wheel build on master. postmerge 19281 failed
wanda: wheel py3.{10,11,12,13} on 8ed2aa2 -- the commit that added the agent hook --
where 19280 passed on the commit before it.

pip inside the image build was pointed at the agent's docker bridge gateway, could not
reach it, and reported:

  export RAYCI_IMAGE_PIP_INDEX_URL=http://172.17.0.1:35999/simple
  ERROR: Could not find a version that satisfies the requirement cython==3.0.12
         (from versions: none)

with no 502 and no origin fetch, because it never reached any index at all.

Two mistakes compounded. The gateway is not the address a build can reach: premerge 72149
measured a docker build reaching a *step container* on the bridge (172.16.0.2), which is a
different hop from reaching the *host* at the bridge gateway, and I treated them as the
same. And the fail-open does not extend into an image build -- ray-wheel.Dockerfile reads
${RAYCI_IMAGE_PIP_INDEX_URL:-https://pypi.org/simple}, so an absent value falls back to
PyPI while a present-but-unreachable one fails the build outright. Setting it was strictly
worse than leaving it unset.

The loopback export stays. That half is proven: release 104832's init resolved 562 bazel
repositories with zero direct fetches to files.pythonhosted.org, where 104694 failed on
aiobotocore and 104736 survived on luck.

Restoring the image half needs an address verified from inside a build on the agent that
will run it, not inferred from docker network inspect.

AI assistance (Claude Code) was used for this change.

Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn requested review from a team as code owners August 19, 2026 22:00

@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 removes the export of RAYCI_IMAGE_PIP_INDEX_URL from ci/pypi_proxy_agent.sh and adds an explanatory comment detailing how the previous implementation broke wheel builds on master due to unreachable gateway addresses. There are no review comments on this pull request, so no additional feedback is provided.

@elliot-barn
elliot-barn merged commit f2c28c1 into master Aug 19, 2026
4 of 5 checks passed
@elliot-barn
elliot-barn deleted the elliot-barn/fix-image-index-export branch August 19, 2026 22:19
elliot-barn added a commit that referenced this pull request Aug 19, 2026
Restores the image-build index that #65603 removed, using the mechanism that works
rather than the one that did not.

wanda now passes --add-host rayci.localhost:host-gateway (rayci#501), so a build resolves
the agent by name and docker computes the address itself. The previous attempt inferred
it from `docker network inspect bridge`, the build could not reach what that returned,
and every wheel build on master failed (postmerge 19281 against 19280) -- because
ray-wheel.Dockerfile reads ${RAYCI_IMAGE_PIP_INDEX_URL:-https://pypi.org/simple}, a
present-but-unreachable value fails the build outright where an absent one falls back.

--add-host rather than --network=host, which also reaches the agent: that shares the
agent's whole network namespace with the build, including anything on loopback. This adds
one hosts entry and leaves the namespace intact. rayci.localhost is the name
ci/ray_ci/linux_container.py already passes to `docker run`, so the agent is addressed
identically from a test container and from an image build.

Gated on the pinned rayci version rather than on merge order, because exporting against a
wanda that does not pass the flag reproduces the same failure. Verified both ways: with
.rayciversion at 0.46.0 nothing is exported and the log says why; at 0.47.0 the name is
exported. The .rayciversion bump can therefore land before, after, or with this.

AI assistance (Claude Code) was used for this change.

Signed-off-by: elliot-barn <[email protected]>
elliot-barn added a commit that referenced this pull request Aug 20, 2026
Windows is the last platform still resolving from files.pythonhosted.org
(pypi/support#11895), and it needs its own entry point: the two places that
install packages there are not login shells, so the profile.d hook the Linux
images use never runs. `RUN bash build_ray.sh` inside the docker build the
tester starts, and the command list the wheel builder passes to `docker run`,
both source ci/ray_ci/windows/pypi_proxy.sh explicitly.

The proxy runs inside the container on loopback rather than on the agent. The
Windows host carries Python 3.8, below what the proxy supports, while conda
in the image supplies 3.10 -- enough, since the only dependency needing 3.11
is skipped by the installer and guarded at import. Loopback also means pip and
uv accept it over plain HTTP with no trusted-host handling, and the venv is
baked into the windowsbuild image by build_base.sh, so nothing is installed at
job time.

Two shared pieces gain Windows support rather than being copied:
install_pypi_proxy.sh picks Scripts/ over bin/ for the venv, and
pypi_proxy_profile.sh takes the interpreter from RAYCI_PYPI_PROXY_PYTHON when
a caller names it, which ci/pypi_proxy_agent.sh already does for the same
reason.

Every failure path leaves the environment untouched, so a job resolves from
public PyPI exactly as it does today.

Rebased onto master: the earlier revision of this branch predated the agent
hook (#65602), the bazel downloader rewrite (#65599) and the index-shape
correction (#65603), and would have reverted all three.

Tested: bash -n over the five touched shell scripts. The Windows paths
themselves need a windowsbuild image build to exercise, which is what this
PR's premerge does.

AI assistance was used for this change.

Signed-off-by: Elliot Barnwell <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…t#65603)

Fixes wheel builds broken on master by ray-project#65602.

postmerge 19281 failed `wanda: wheel py3.{10,11,12,13}` on `8ed2aa20e`
(the hook commit); 19280 passed on the commit before. Release build
104832 shows the same failure on `wanda: wheel py3.11/py3.12`.

pip inside the image build was pointed at the agent's bridge gateway,
could not reach it, and failed with `cython==3.0.12 (from versions:
none)` — no 502, no origin fetch, no index at all.

**Why it was worse than a no-op:** `ray-wheel.Dockerfile` reads
`${RAYCI_IMAGE_PIP_INDEX_URL:-https://pypi.org/simple}`, so an *absent*
value falls back to PyPI while a *present but unreachable* one fails
hard. The fail-open that protects every other path does not extend into
an image build.

**What I got wrong:** premerge 72149 proved a docker build could reach a
*step container* on the bridge (172.16.0.2). Reaching the *host* at the
bridge gateway is a different hop, and I conflated them.

**The loopback export stays**, and it is proven: 104832's `init`
resolved 562 bazel repositories with zero direct fetches to
files.pythonhosted.org, where 104694 failed on `aiobotocore`.

Restoring the image half needs an address verified from inside a build
on the agent that will run it.

AI assistance (Claude Code) was used for this change.

Signed-off-by: elliot-barn <[email protected]>
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.

1 participant