upload-wheels.sh 2.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash

set -ex

# 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

# Get the single wheel file
wheel="${wheel_files[0]}"

# Rename 'linux' to 'manylinux1' in the wheel filename
new_wheel="${wheel/linux/manylinux1}"
mv -- "$wheel" "$new_wheel"
wheel="$new_wheel"

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

26
27
normal_wheel="$wheel" # Save the original wheel filename

28
29
# If the version contains "dev", rename it to v1.0.0.dev for consistency
if [[ $version == *dev* ]]; then
30
31
32
33
34
35
    suffix="${version##*.}"
    if [[ $suffix == cu* ]]; then
        new_version="1.0.0.dev+${suffix}"
    else
        new_version="1.0.0.dev"
    fi
36
    new_wheel="${wheel/$version/$new_version}"
37
38
    # use cp to keep both files in the artifacts directory
    cp -- "$wheel" "$new_wheel"
39
40
41
42
43
    wheel="$new_wheel"
    version="$new_version"
fi

# Upload the wheel to S3
44
45
46
python3 .buildkite/generate_index.py --wheel "$normal_wheel"

# generate index for this commit
47
aws s3 cp "$wheel" "s3://vllm-wheels/$BUILDKITE_COMMIT/"
48
aws s3 cp "$normal_wheel" "s3://vllm-wheels/$BUILDKITE_COMMIT/"
49
50
51
52

if [[ $normal_wheel == *"cu118"* ]]; then
    # if $normal_wheel matches cu118, do not upload the index.html
    echo "Skipping index files for cu118 wheels"
Huy Do's avatar
Huy Do committed
53
54
55
elif [[ $normal_wheel == *"cu126"* ]]; then
    # if $normal_wheel matches cu126, do not upload the index.html
    echo "Skipping index files for cu126 wheels"
56
else
Huy Do's avatar
Huy Do committed
57
    # only upload index.html for cu128 wheels (default wheels)
58
59
60
    aws s3 cp index.html "s3://vllm-wheels/$BUILDKITE_COMMIT/vllm/index.html"
    aws s3 cp "s3://vllm-wheels/nightly/index.html" "s3://vllm-wheels/$BUILDKITE_COMMIT/index.html"
fi
61
62

# generate index for nightly
63
aws s3 cp "$wheel" "s3://vllm-wheels/nightly/"
64
aws s3 cp "$normal_wheel" "s3://vllm-wheels/nightly/"
65
66
67
68

if [[ $normal_wheel == *"cu118"* ]]; then
    # if $normal_wheel matches cu118, do not upload the index.html
    echo "Skipping index files for cu118 wheels"
Huy Do's avatar
Huy Do committed
69
70
71
elif [[ $normal_wheel == *"cu126"* ]]; then
    # if $normal_wheel matches cu126, do not upload the index.html
    echo "Skipping index files for cu126 wheels"
72
else
Huy Do's avatar
Huy Do committed
73
    # only upload index.html for cu128 wheels (default wheels)
74
75
    aws s3 cp index.html "s3://vllm-wheels/nightly/vllm/index.html"
fi
76

Huy Do's avatar
Huy Do committed
77
aws s3 cp "$wheel" "s3://vllm-wheels/$version/"
78
aws s3 cp index.html "s3://vllm-wheels/$version/vllm/index.html"