Repository navigation
Add TCP readiness probes to Pathways head containers and scope custom libtpu to Pathways containers. - #378
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_1010547914
branch
4 times, most recently
from
November 2, 2026 22:42
af782fc to
e7a3bbb
Compare
… libtpu to Pathways containers.
Why:
`_build_rm_container` and `_build_proxy_container` had no `readinessProbe`, so Kubernetes marked the `pathways-head` pod `Ready` as soon as the container processes spawned. When `TPU_LIBRARY_PATH` points to a `libtpu.so` on a cold GCSFuse mount, `pathways-rm` and `pathways-proxy` spend ~30-40s inside `dlopen` before binding their gRPC ports 29001 (`PATHWAYS_RM_PORT`) and 29000 (`PATHWAYS_PROXY_PORT`), so anything that acts on the pod's `Ready` condition (for example `kubectl wait --for=condition=Ready` followed by `kubectl port-forward`) hit `connection refused`.
`with_custom_libtpu(..., containers="all")` also injected `TPU_LIBRARY_PATH` into every container and initContainer in the pod spec, including non-Pathways ones (staging init containers, `user-workload`, `colocated-python-sidecar`). All three Pathways containers do need the custom `libtpu.so`: `pathways-rm` hosts the compilation service and `pathways-worker` executes the compiled programs, so they must load the same PJRT/TPU runtime ABI; otherwise programs fail with `FAILED_PRECONDITION: The base ABI version required by the program (165) is not supported by the current runtime (which has version 164)`.
What changed:
- Add TCP socket `readinessProbe`s (`periodSeconds=1`) on `PATHWAYS_RM_PORT` in `_build_rm_container` and on `PATHWAYS_PROXY_PORT` in `_build_proxy_container`, so `pathways-head` is `Ready` only once both gRPC servers are listening.
- Scope `containers="all"` in `PathwaysJobSet.with_custom_libtpu` to `("pathways-rm", "pathways-proxy", "pathways-worker")`.
- Only warn in `_apply_container_kwargs` when a caller-supplied field differs from the default value.
Behavior change for `PathwaysJobSet` users:
The generated JobSet uses `startupPolicy: InOrder` with `replicatedJobs: [pathways-head, pathways-worker]`, and JobSet creates the next ReplicatedJob only once the previous one's Jobs report `status.ready` (pods with the `Ready` condition). With these probes, `pathways-worker` Jobs are created only after `pathways-rm` and `pathways-proxy` are listening, which is what `InOrder` was meant to express; previously the head pod was `Ready` about a second after start, so `InOrder` was effectively a no-op. This delays worker Job creation by the head's startup time (~3-5s with a node-local `libtpu.so`, ~30-40s with a GCSFuse-mounted one). The head pod's DNS name is unaffected (`network.publishNotReadyAddresses: true`), readiness probes never restart containers, and the probes can be overridden with `rm_container_kwargs` / `proxy_container_kwargs={"readiness_probe": ...}`.
PiperOrigin-RevId: 1012474348
copybara-service
Bot
force-pushed
the
test_1010547914
branch
from
November 2, 2026 23:00
e7a3bbb to
c070ed9
Compare
This branch was successfully deployed
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.
Add TCP readiness probes to Pathways head containers and scope custom libtpu to Pathways containers.
Why:
_build_rm_containerand_build_proxy_containerhad noreadinessProbe, so Kubernetes marked thepathways-headpodReadyas soon as the container processes spawned. WhenTPU_LIBRARY_PATHpoints to alibtpu.soon a cold GCSFuse mount,pathways-rmandpathways-proxyspend ~30-40s insidedlopenbefore binding their gRPC ports 29001 (PATHWAYS_RM_PORT) and 29000 (PATHWAYS_PROXY_PORT), so anything that acts on the pod'sReadycondition (for examplekubectl wait --for=condition=Readyfollowed bykubectl port-forward) hitconnection refused.with_custom_libtpu(..., containers="all")also injectedTPU_LIBRARY_PATHinto every container and initContainer in the pod spec, including non-Pathways ones (staging init containers,user-workload,colocated-python-sidecar). All three Pathways containers do need the customlibtpu.so:pathways-rmhosts the compilation service andpathways-workerexecutes the compiled programs, so they must load the same PJRT/TPU runtime ABI; otherwise programs fail withFAILED_PRECONDITION: The base ABI version required by the program (165) is not supported by the current runtime (which has version 164).What changed:
readinessProbes (periodSeconds=1) onPATHWAYS_RM_PORTin_build_rm_containerand onPATHWAYS_PROXY_PORTin_build_proxy_container, sopathways-headisReadyonly once both gRPC servers are listening.containers="all"inPathwaysJobSet.with_custom_libtputo("pathways-rm", "pathways-proxy", "pathways-worker")._apply_container_kwargswhen a caller-supplied field differs from the default value.Behavior change for
PathwaysJobSetusers:The generated JobSet uses
startupPolicy: InOrderwithreplicatedJobs: [pathways-head, pathways-worker], and JobSet creates the next ReplicatedJob only once the previous one's Jobs reportstatus.ready(pods with theReadycondition). With these probes,pathways-workerJobs are created only afterpathways-rmandpathways-proxyare listening, which is whatInOrderwas meant to express; previously the head pod wasReadyabout a second after start, soInOrderwas effectively a no-op. This delays worker Job creation by the head's startup time (~3-5s with a node-locallibtpu.so, ~30-40s with a GCSFuse-mounted one). The head pod's DNS name is unaffected (network.publishNotReadyAddresses: true), readiness probes never restart containers, and the probes can be overridden withrm_container_kwargs/proxy_container_kwargs={"readiness_probe": ...}.