Skip to content

Commit 00b27d8

Browse files
committed
Isolate Poetry validation into its own release-only job
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. Three coordinated changes: 1. Split the Poetry test into a standalone linux-poetry job modeled on the existing linux-amazon-2023 job. The new job only runs on inputs.channel == 'release' and exports a fixed Python 3.11 / stable-CUDA combination, matching what the old inline gate selected. 2. Drop the inline `source validate_poetry.sh` block from the main matrix job so Poetry ecosystem churn can no longer flake binary validation. 3. In validate_poetry.sh, pin Poetry to a released version via POETRY_VERSION (default 2.4.1, env-overridable) instead of installing from poetry@main, and replace `--quiet` with `--no-interaction` so resolution errors are no longer silently swallowed. Authored with Claude Code.
1 parent eea0e12 commit 00b27d8

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)