acoustic-carpenter-78188
05/20/2026, 9:17 PMflyte/distributed/_entrypoint.py — runs as PID 1 via python -m flyte.distributed._entrypoint, derives MASTER_ADDR from JOBSET_NAME + POD_NAMESPACE, busy-waits for DNS (5-min timeout), then os.execvp("torchrun", [...])
• RDZV_ID is rotated on each JobSet restart (JOBSET_NAME-JOBSET_RESTART_ATTEMPT) so torchrun does a fresh rendezvous rather than reconnecting to a stale one
• Adds flyte/distributed/__init__.py as a package stub — public API (ClusteredTaskEnvironment etc.) added in PR 5. This is PR 2 of the plan.
• 7 unit tests covering happy path, DNS timeout, missing env vars, RDZV_ID rotation, NODE_RANK mapping, and MASTER_PORT default (29500)
Test Plan
• cd flyte-sdk && .venv/bin/pytest tests/flyte/distributed/test_entrypoint.py -v — all 7 tests pass
• python -c "import flyte.distributed._entrypoint" — module is importable with no side effects
flyteorg/flyte-sdkacoustic-carpenter-78188
05/21/2026, 6:13 PM