|
| 1 | +#!/bin/bash |
| 2 | +## Build Python wheels using Wheel Variant prototype (WheelNext) |
| 3 | + |
| 4 | +set -euo pipefail |
| 5 | + |
| 6 | +if [[ -z "${GITHUB_SHA:-}" ]] |
| 7 | +then |
| 8 | + echo "Make sure to set environment variable GITHUB_SHA" |
| 9 | + exit 1 |
| 10 | +fi |
| 11 | + |
| 12 | +image_repo='xgb-ci.gpu_build_rockylinux8' |
| 13 | + |
| 14 | +source ops/pipeline/classify-git-branch.sh |
| 15 | +source ops/pipeline/get-docker-registry-details.sh |
| 16 | +source ops/pipeline/get-image-tag.sh |
| 17 | + |
| 18 | +WHEEL_TAG=manylinux_2_28_x86_64 |
| 19 | +BUILD_IMAGE_URI="${DOCKER_REGISTRY_URL}/${image_repo}:${IMAGE_TAG}" |
| 20 | +MANYLINUX_IMAGE_URI="${DOCKER_REGISTRY_URL}/xgb-ci.${WHEEL_TAG}:${IMAGE_TAG}" |
| 21 | + |
| 22 | +echo "--- Build with CUDA" |
| 23 | + |
| 24 | +if [[ ($is_pull_request == 1) || ($is_release_branch == 0) ]] |
| 25 | +then |
| 26 | + export BUILD_ONLY_SM75=1 |
| 27 | +else |
| 28 | + export BUILD_ONLY_SM75=0 |
| 29 | +fi |
| 30 | +export USE_RMM=0 |
| 31 | + |
| 32 | +set -x |
| 33 | + |
| 34 | +python3 ops/docker_run.py \ |
| 35 | + --image-uri ${BUILD_IMAGE_URI} \ |
| 36 | + --run-args='-e BUILD_ONLY_SM75 -e USE_RMM' \ |
| 37 | + -- ops/pipeline/build-cuda-impl.sh |
| 38 | + |
| 39 | +echo "--- Audit binary wheel to ensure it's compliant with ${WHEEL_TAG} standard" |
| 40 | +python3 ops/docker_run.py \ |
| 41 | + --image-uri ${MANYLINUX_IMAGE_URI} \ |
| 42 | + -- auditwheel repair --only-plat \ |
| 43 | + --plat ${WHEEL_TAG} python-package/dist/*.whl |
| 44 | +python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \ |
| 45 | + wheelhouse/*.whl |
| 46 | +mv -v wheelhouse/*.whl python-package/dist/ |
| 47 | + |
| 48 | +echo "--- Convert Python wheel to variant wheel" |
| 49 | +python3 ops/docker_run.py \ |
| 50 | + --image-uri ${BUILD_IMAGE_URI} \ |
| 51 | + -- ops/pipeline/build-variant-wheels-impl.sh |
0 commit comments