2024-11-14 23:31:52 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
2026-03-27 15:44:18 +08:00
|
|
|
# Upload a single wheel to S3 (rename linux -> manylinux).
|
|
|
|
|
# Index generation is handled separately by generate-and-upload-nightly-index.sh.
|
2025-12-02 14:17:10 +08:00
|
|
|
|
|
|
|
|
BUCKET="vllm-wheels"
|
|
|
|
|
SUBPATH=$BUILDKITE_COMMIT
|
|
|
|
|
S3_COMMIT_PREFIX="s3://$BUCKET/$SUBPATH/"
|
|
|
|
|
|
2026-03-27 15:44:18 +08:00
|
|
|
# ========= collect, rename & upload the wheel ==========
|
2025-12-02 14:17:10 +08:00
|
|
|
|
2024-11-14 23:31:52 -08:00
|
|
|
# Assume wheels are in artifacts/dist/*.whl
|
|
|
|
|
wheel_files=(artifacts/dist/*.whl)
|
|
|
|
|
|
|
|
|
|
# Check that exactly one wheel is found
|
|
|
|
|
if [[ ${#wheel_files[@]} -ne 1 ]]; then
|
|
|
|
|
echo "Error: Expected exactly one wheel file in artifacts/dist/, but found ${#wheel_files[@]}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
wheel="${wheel_files[0]}"
|
|
|
|
|
|
2025-12-12 00:42:30 +08:00
|
|
|
# default build image uses ubuntu 20.04, which corresponds to manylinux_2_31
|
|
|
|
|
# we also accept params as manylinux tag
|
2025-12-02 14:17:10 +08:00
|
|
|
# refer to https://github.com/mayeut/pep600_compliance?tab=readme-ov-file#acceptable-distros-to-build-wheels
|
2025-12-12 00:42:30 +08:00
|
|
|
manylinux_version="${1:-manylinux_2_31}"
|
2025-08-21 23:32:55 +08:00
|
|
|
|
|
|
|
|
# Rename 'linux' to the appropriate manylinux version in the wheel filename
|
2025-12-02 14:17:10 +08:00
|
|
|
if [[ "$wheel" != *"linux"* ]]; then
|
|
|
|
|
echo "Error: Wheel filename does not contain 'linux': $wheel"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2025-08-21 23:32:55 +08:00
|
|
|
new_wheel="${wheel/linux/$manylinux_version}"
|
2024-11-14 23:31:52 -08:00
|
|
|
mv -- "$wheel" "$new_wheel"
|
|
|
|
|
wheel="$new_wheel"
|
2025-12-02 14:17:10 +08:00
|
|
|
echo "Renamed wheel to: $wheel"
|
2024-11-14 23:31:52 -08:00
|
|
|
|
|
|
|
|
# Extract the version from the wheel
|
|
|
|
|
version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2)
|
2025-12-02 14:17:10 +08:00
|
|
|
echo "Version in wheel: $version"
|
2024-12-21 23:53:44 -08:00
|
|
|
|
2025-12-02 14:17:10 +08:00
|
|
|
# copy wheel to its own bucket
|
|
|
|
|
aws s3 cp "$wheel" "$S3_COMMIT_PREFIX"
|
2024-12-22 00:39:11 -08:00
|
|
|
|
2026-03-27 15:44:18 +08:00
|
|
|
echo "Wheel uploaded. Index generation is handled by a separate step."
|