| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | # Upload a single wheel to S3, after detecting and applying the appropriate |
| 6 | # manylinux platform tag with auditwheel. |
| 7 | # Index generation is handled separately by generate-and-upload-nightly-index.sh. |
| 8 | |
| 9 | # auditwheel is Linux-only; macOS wheels already carry a valid tag, so skip the |
| 10 | # manylinux retag for them. |
| 11 | WHEEL_PLATFORM="${VLLM_WHEEL_PLATFORM:-linux}" |
| 12 | |
| 13 | if [[ "$WHEEL_PLATFORM" == "linux" ]]; then |
| 14 | # shellcheck source=lib/manylinux.sh |
| 15 | source .buildkite/scripts/lib/manylinux.sh |
| 16 | fi |
| 17 | |
| 18 | BUCKET="vllm-wheels" |
| 19 | SUBPATH=$BUILDKITE_COMMIT |
| 20 | S3_COMMIT_PREFIX="s3://$BUCKET/$SUBPATH/" |
| 21 | |
| 22 | # ========= locate the wheel ========== |
| 23 | |
| 24 | # Assume wheels are in artifacts/dist/*.whl |
| 25 | wheel_files=(artifacts/dist/*.whl) |
| 26 | |
| 27 | # Check that exactly one wheel is found |
| 28 | if [[ ${#wheel_files[@]} -ne 1 ]]; then |
| 29 | echo "Error: Expected exactly one wheel file in artifacts/dist/, but found ${#wheel_files[@]}" |
| 30 | exit 1 |
| 31 | fi |
| 32 | wheel="${wheel_files[0]}" |
| 33 | |
| 34 | # ========= detect manylinux tag and rename ========== |
| 35 | |
| 36 | if [[ "$WHEEL_PLATFORM" == "linux" ]]; then |
| 37 | wheel="$(apply_manylinux_tag "$wheel")" |
| 38 | echo "Renamed wheel to: $wheel" |
| 39 | fi |
| 40 | |
| 41 | # Extract the version from the wheel |
| 42 | version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2) |
| 43 | echo "Version in wheel: $version" |
| 44 | |
| 45 | # copy wheel to its own bucket |
| 46 | aws s3 cp "$wheel" "$S3_COMMIT_PREFIX" |
| 47 | |
| 48 | echo "Wheel uploaded. Index generation is handled by a separate step." |