Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/pypi_release_domain_library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Prepare binary and release binary to pypi

on:
pull_request:
paths:
- .github/workflows/pypi_release_domain_library.yml
workflow_dispatch:
inputs:
domain:
description: "Domain to prepare and release"
required: false
type: choice
default: torchao
options:
- torchao

jobs:
trigger:
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: pytorch/almalinux-builder:cpu
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Stage torchao binaries for release
shell: bash
run: |
set -ex
cd release/pypi
# Install requirements
pip install auditwheel awscli
LINUX_VERSION_SUFFIX="%2Bcu128"
CPU_VERSION_SUFFIX="%2Bcpu"
DRY_RUN=enabled
TORCHAO_VERSION=0.13.0

pwd
upload_pypi_to_staging() {
local package_name
package_name=$1
local promote_version
promote_version=$2
echo "=-=-=-= Promoting ${package_name}'s v${promote_version} to pypi staging' =-=-=-="
(
set -x
PACKAGE_VERSION="${promote_version}" PACKAGE_NAME="${package_name}" DRY_RUN="${DRY_RUN}" bash ./upload_pypi_to_staging.sh
)
echo
}
PLATFORM="none-any" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torchao "${TORCHAO_VERSION}"
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu128" upload_pypi_to_staging torchao "${TORCHAO_VERSION}"
Empty file modified release/pypi/promote_pypi_to_production.sh
100644 → 100755
Empty file.
Empty file modified release/pypi/promote_pypi_to_staging.sh
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions release/pypi/upload_pypi_to_staging.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ ARCH=${ARCH:-cpu}

# This extract links to packages from the index.html
# We strip all extra characters including final sha256 char
echo "Retrieving packages for promotion for ${PACKAGE_NAME} ${PACKAGE_VERSION}"
pkgs_to_promote=$(\
curl -fsSL "https://download.pytorch.org/whl/test/${ARCH}/${PACKAGE_NAME}/index.html" \
| grep "${PACKAGE_NAME}-${PACKAGE_VERSION}${VERSION_SUFFIX}-" \
| grep "${PLATFORM}" \
| cut -d '"' -f2 \
| cut -d "#" -f1
)
echo "Found ${pkgs_to_promote}"

tmp_dir="$(mktemp -d)"
output_tmp_dir="$(mktemp -d)"
Expand All @@ -53,6 +55,7 @@ for pkg in ${pkgs_to_promote}; do
curl -fSL -o "${orig_pkg}" "https://download.pytorch.org${pkg}"
)


if [[ -n "${VERSION_SUFFIX}" ]]; then
OUTPUT_DIR="${output_tmp_dir}" python "${DIR}/prep_binary_for_pypi.py" "${orig_pkg}" --output-dir .
else
Expand Down
Loading