Skip to content

Commit 737cf7a

Browse files
authored
Isolate Poetry validation into its own release-only job (pytorch#8075)
## Summary The Poetry-based validation was sourced inline inside the main `manywheel` matrix job in `validate-linux-binaries.yml`, gated by a 5-condition check, and Poetry itself was installed from its dev branch (`poetry@main`). When Poetry's main branch regressed, the whole binary-validation job went red for the stable-CUDA Python 3.11 combination, masking the actual binary signal. See [this failed run](https://github.com/pytorch/test-infra/actions/runs/25807301043/job/75813679800) for the most recent example. Three coordinated changes: ### 1. Split Poetry into a standalone `linux-poetry` job In `.github/workflows/validate-linux-binaries.yml`, the inline `source validate_poetry.sh` block (with its 5-condition gate) is removed from the `linux:` matrix job. A new `linux-poetry:` top-level job is added, modeled on the existing `linux-amazon-2023:` job: ```yaml linux-poetry: if: ${{ inputs.channel == 'release' }} uses: ./.github/workflows/linux_job_v2.yml name: poetry-test with: runner: "linux.g5.4xlarge.nvidia.gpu" repository: "pytorch/pytorch" ref: main job-name: "poetry-test" docker-image: 'pytorch/almalinux-builder:cpu-main' docker-build-dir: "skip-docker-build" timeout: 60 ``` It runs **only on `inputs.channel == 'release'`** and exports a fixed Python 3.11 / stable-CUDA combination, matching what the old inline gate selected. ### 2. Pin Poetry to a released version In `.github/scripts/validate_poetry.sh`: ```diff -curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@main +POETRY_VERSION="${POETRY_VERSION:-2.4.1}" +curl -sSL https://install.python-poetry.org | python3 - --version "${POETRY_VERSION}" ``` Installing from `poetry@main` has caused recurring CI flakes whenever Poetry's dev branch regresses. `POETRY_VERSION` is env-overridable; bump deliberately to upgrade. ### 3. Surface Poetry's actual error `poetry --quiet add ...` silenced resolution errors (today's `exit 1` had no further output). Replaced with `poetry add --no-interaction ...` so resolution errors print but Poetry still doesn't prompt. ## Test plan - [x] `bash -n .github/scripts/validate_poetry.sh` passes. - [x] The new `linux-poetry:` job mirrors the existing `linux-amazon-2023:` job structure; both reuse `linux_job_v2.yml` with the same input shape. - [ ] Verify via dispatch on the `release` channel that the new `linux-poetry` job appears and runs; verify on `nightly` / `test` channels that it is skipped. - [ ] Verify that the next `validate-linux-binaries` run is no longer red when Poetry's main is broken. ## Effect on `vllm#40077`-style flakes | Before | After | |---|---| | Poetry-main breakage → red `manywheel-py3_11-cuda13_0` job → looks like a binary regression | Poetry-main breakage → red `poetry-test` job only; binary validation is unaffected | | `--quiet` hides the real error | `--no-interaction` keeps prompts off but lets errors print | | Poetry installed from `@main` | Poetry pinned to `${POETRY_VERSION:-2.4.1}` | | Poetry runs on every matrix entry matching 5 conditions | Poetry runs once, on `channel == 'release'` only | Authored with Claude Code.
1 parent d7b57bf commit 737cf7a

2 files changed

Lines changed: 42 additions & 15 deletions

File tree

.github/scripts/validate_poetry.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
conda create -y -n ${ENV_NAME}_poetry python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
33
conda activate ${ENV_NAME}_poetry
4-
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@main
4+
# Pin Poetry to a released version. Installing from @main has caused
5+
# recurring CI flakes whenever Poetry's dev branch regresses. Bump
6+
# POETRY_VERSION deliberately when you want to upgrade.
7+
POETRY_VERSION="${POETRY_VERSION:-2.4.1}"
8+
curl -sSL https://install.python-poetry.org | python3 - --version "${POETRY_VERSION}"
59
export PATH="/root/.local/bin:$PATH"
610

711
poetry --version
@@ -24,11 +28,11 @@ if [[ ! -z ${RELEASE_VERSION} ]]; then
2428
fi
2529

2630
if [[ ${TORCH_ONLY} == 'true' ]]; then
27-
poetry --quiet add torch${RELEASE_SUFFIX}
31+
poetry add --no-interaction torch${RELEASE_SUFFIX}
2832
elif [[ ${INCLUDE_TORCHAUDIO:-} == 'true' ]]; then
29-
poetry --quiet add torch${RELEASE_SUFFIX} torchaudio torchvision
33+
poetry add --no-interaction torch${RELEASE_SUFFIX} torchaudio torchvision
3034
else
31-
poetry --quiet add torch${RELEASE_SUFFIX} torchvision
35+
poetry add --no-interaction torch${RELEASE_SUFFIX} torchvision
3236
fi
3337

3438
pushd ${PWD}/../.ci/pytorch/

.github/workflows/validate-linux-binaries.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,42 @@ jobs:
141141
eval "$(conda shell.bash hook)"
142142
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
143143
144-
CUDA_VERSION_STABLE=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${MATRIX_CHANNEL})
145-
# Special case PyPi installation package. And Install of PyPi package via poetry
146-
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" && \
147-
${MATRIX_GPU_ARCH_VERSION} == "${CUDA_VERSION_STABLE}" && \
148-
${MATRIX_CHANNEL} == "release" && \
149-
${USE_ONLY_DL_PYTORCH_ORG} == "false" && \
150-
${USE_WHEEL_VARIANTS} == "false" ]]; then
151-
source ../../test-infra/.github/scripts/validate_poetry.sh
152-
fi
153-
154-
# Validate binaries
144+
# Validate binaries. Poetry-based validation now lives in the
145+
# standalone linux-poetry job below so Poetry's own ecosystem
146+
# churn (it was previously installed from poetry@main) cannot
147+
# flake the binary matrix.
155148
source ../../test-infra/.github/scripts/validate_binaries.sh
156149
150+
linux-poetry:
151+
if: ${{ inputs.channel == 'release' }}
152+
uses: ./.github/workflows/linux_job_v2.yml
153+
name: poetry-test
154+
with:
155+
runner: "linux.g5.4xlarge.nvidia.gpu"
156+
repository: "pytorch/pytorch"
157+
ref: main
158+
job-name: "poetry-test"
159+
docker-image: 'pytorch/almalinux-builder:cpu-main'
160+
docker-build-dir: "skip-docker-build"
161+
timeout: 60
162+
script: |
163+
set -ex
164+
export ENV_NAME="conda-env-${{ github.run_id }}"
165+
export TORCH_ONLY=${{ inputs.torchonly }}
166+
export INCLUDE_TORCHAUDIO=${{ inputs.include-torchaudio }}
167+
export RELEASE_VERSION=${{ inputs.version }}
168+
export TARGET_OS="linux"
169+
eval "$(conda shell.bash hook)"
170+
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
171+
172+
# Poetry test is release-channel-only and covers a single
173+
# stable-CUDA / Python 3.11 path. The full validate-binaries
174+
# matrix above already covers every other combination via pip.
175+
export MATRIX_PYTHON_VERSION="3.11"
176+
export MATRIX_GPU_ARCH_VERSION=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${{ inputs.channel }})
177+
178+
source ../../test-infra/.github/scripts/validate_poetry.sh
179+
157180
linux-amazon-2023:
158181
uses: ./.github/workflows/linux_job_v2.yml
159182
name: amazon-linux-2023-test

0 commit comments

Comments
 (0)