upload-nightly-wheels.sh 1.46 KB
Newer Older
1
2
3
4
#!/usr/bin/env bash

set -ex

5
6
# Upload a single wheel to S3 (rename linux -> manylinux).
# Index generation is handled separately by generate-and-upload-nightly-index.sh.
7
8
9
10
11

BUCKET="vllm-wheels"
SUBPATH=$BUILDKITE_COMMIT
S3_COMMIT_PREFIX="s3://$BUCKET/$SUBPATH/"

12
# ========= collect, rename & upload the wheel ==========
13

14
15
16
17
18
19
20
21
22
23
# 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]}"

24
25
# default build image uses ubuntu 20.04, which corresponds to manylinux_2_31
# we also accept params as manylinux tag
26
# refer to https://github.com/mayeut/pep600_compliance?tab=readme-ov-file#acceptable-distros-to-build-wheels
27
manylinux_version="${1:-manylinux_2_31}"
28
29

# Rename 'linux' to the appropriate manylinux version in the wheel filename
30
31
32
33
if [[ "$wheel" != *"linux"* ]]; then
  echo "Error: Wheel filename does not contain 'linux': $wheel"
  exit 1
fi
34
new_wheel="${wheel/linux/$manylinux_version}"
35
36
mv -- "$wheel" "$new_wheel"
wheel="$new_wheel"
37
echo "Renamed wheel to: $wheel"
38
39
40

# Extract the version from the wheel
version=$(unzip -p "$wheel" '**/METADATA' | grep '^Version: ' | cut -d' ' -f2)
41
echo "Version in wheel: $version"
42

43
44
# copy wheel to its own bucket
aws s3 cp "$wheel" "$S3_COMMIT_PREFIX"
45

46
echo "Wheel uploaded. Index generation is handled by a separate step."