Skip to content

Commit

Permalink
Add an optional artifact upload, consolidate fixes to `prep_binary_fo…
Browse files Browse the repository at this point in the history
…r_pypi.sh`
  • Loading branch information
izaitsevfb committed Dec 14, 2022
1 parent 64281f4 commit d1c4130
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/validate-repackaged-binary-sizes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ name: Validate manywheel binaries
# * download the binaries,
# * run release/pypi/prep_binary_for_pypi.sh
# * run smoke tests on the repackaged binaries
# * display the size before and after repackaging
# * display the size before and after repackaging as the workflow annotation
# * optionally upload the repackaged binaries as artifacts (for debug or promotion)

on:
pull_request:
paths:
- .github/workflows/validate-repackaged-binary-sizes.yml
- release/pypi/prep_binary_for_pypi.sh

jobs:
validate-binary-size:
Expand All @@ -20,21 +24,26 @@ jobs:
matrix:
whl:
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp310-cp310-linux_x86_64.whl
python: "3.10"
python: "3.10" # python version to use for smoke tests
upload_artifact: false # upload the repackaged binary as an artifact
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp37-cp37m-linux_x86_64.whl
python: "3.7"
artifact: false
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp38-cp38-linux_x86_64.whl
python: "3.8"
artifact: false
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp39-cp39-linux_x86_64.whl
python: "3.9"
# - url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp311-cp311-linux_x86_64.whl
# python: "3.11"
artifact: false
# - url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp311-cp311-linux_x86_64.whl
# python: "3.11"
# artifact: false

uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.4xlarge.nvidia.gpu
job-name: "Validate binary size"
upload-artifact: pipy_wheel
upload-artifact: ${{ matrix.whl.upload_artifact == 'true' && 'repackaged-binary' || '' }}
script: |
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
Expand Down
8 changes: 0 additions & 8 deletions release/pypi/prep_binary_for_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,7 @@ for whl_file in "$@"; do
find "${dist_info_folder}" -type f -exec sed -i "s!${version_with_suffix}!${version_no_suffix}!" {} \;
# Moves distinfo from one with a version suffix to one without
# Example: torch-1.8.0+cpu.dist-info => torch-1.8.0.dist-info

echo "Before moving dist_info_folder"
ls -l "${whl_dir}"

mv "${dist_info_folder}" "${dirname_dist_info_folder}/${basename_dist_info_folder/${version_with_suffix}/${version_no_suffix}}"

echo "After moving dist_info_folder"
ls -l "${whl_dir}"

cd "${whl_dir}"

(
Expand Down

0 comments on commit d1c4130

Please sign in to comment.