Skip to content

Commit

Permalink
Remove rename_whl.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Dec 10, 2024
1 parent cf8bda4 commit 80b212c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 100 deletions.
16 changes: 7 additions & 9 deletions ops/pipeline/build-cpu-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,24 @@ set -x
python3 ops/docker_run.py \
--container-tag ${BUILD_CONTAINER_TAG} \
-- ops/pipeline/build-cpu-arm64-impl.sh
python3 ops/script/rename_whl.py \
--wheel-path python-package/dist/*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}

echo "--- Audit binary wheel to ensure it's compliant with ${WHEEL_TAG} standard"
python3 ops/docker_run.py \
--container-tag ${BUILD_CONTAINER_TAG} \
-- auditwheel repair --plat ${WHEEL_TAG} python-package/dist/*.whl
python3 ops/script/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}
-- auditwheel repair --only-plat \
--plat ${WHEEL_TAG} python-package/dist/*.whl
python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \
wheelhouse/*.whl
mv -v wheelhouse/*.whl python-package/dist/

if ! unzip -l ./python-package/dist/*.whl | grep libgomp > /dev/null; then
echo "error: libgomp.so was not vendored in the wheel"
exit -1
fi

# Check size of wheel
pydistcheck --config python-package/pyproject.toml python-package/dist/*.whl

echo "--- Upload Python wheel"
if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
then
Expand Down
15 changes: 6 additions & 9 deletions ops/pipeline/build-cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,23 @@ python3 ops/docker_run.py \
--container-tag ${BUILD_CONTAINER_TAG} \
--run-args='-e BUILD_ONLY_SM75 -e USE_RMM' \
-- ops/pipeline/build-cuda-impl.sh
python3 ops/script/rename_whl.py \
--wheel-path python-package/dist/*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}

echo "--- Audit binary wheel to ensure it's compliant with ${WHEEL_TAG} standard"
python3 ops/docker_run.py \
--container-tag ${MANYLINUX_CONTAINER_TAG} \
-- auditwheel repair \
-- auditwheel repair --only-plat \
--plat ${WHEEL_TAG} python-package/dist/*.whl
python3 ops/script/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}
python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \
wheelhouse/*.whl
mv -v wheelhouse/*.whl python-package/dist/
if ! unzip -l ./python-package/dist/*.whl | grep libgomp > /dev/null; then
echo "error: libgomp.so was not vendored in the wheel"
exit -1
fi

# Check size of wheel
pydistcheck --config python-package/pyproject.toml python-package/dist/*.whl

if [[ $USE_RMM == 0 ]]
then
# Generate the meta info which includes xgboost version and the commit info
Expand Down
18 changes: 8 additions & 10 deletions ops/pipeline/build-manylinux2014.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ git checkout python-package/pyproject.toml python-package/xgboost/core.py

python3 ops/docker_run.py \
--container-tag "${CONTAINER_TAG}" \
-- auditwheel repair --plat ${WHEEL_TAG} python-package/dist/*.whl
python3 ops/script/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}
-- auditwheel repair --only-plat \
--plat ${WHEEL_TAG} python-package/dist/*.whl
python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \
wheelhouse/*.whl
rm -rf python-package/dist/
mkdir python-package/dist/
mv -v wheelhouse/*.whl python-package/dist/
Expand All @@ -59,11 +58,10 @@ git checkout python-package/pyproject.toml # discard the patch

python3 ops/docker_run.py \
--container-tag "${CONTAINER_TAG}" \
-- auditwheel repair --plat ${WHEEL_TAG} python-package/dist/xgboost_cpu-*.whl
python3 ops/script/rename_whl.py \
--wheel-path wheelhouse/xgboost_cpu-*.whl \
--commit-hash ${GITHUB_SHA} \
--platform-tag ${WHEEL_TAG}
-- auditwheel repair --only-plat \
--plat ${WHEEL_TAG} python-package/dist/xgboost_cpu-*.whl
python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \
wheelhouse/xgboost_cpu-*.whl
rm -v python-package/dist/xgboost_cpu-*.whl
mv -v wheelhouse/xgboost_cpu-*.whl python-package/dist/

Expand Down
10 changes: 4 additions & 6 deletions ops/pipeline/build-python-wheels-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ commit_id=$2
if [[ "$platform_id" == macosx_* ]]; then
if [[ "$platform_id" == macosx_arm64 ]]; then
# MacOS, Apple Silicon
wheel_tag=macosx_12_0_arm64
WHEEL_TAG=macosx_12_0_arm64
cpython_ver=310
cibw_archs=arm64
export MACOSX_DEPLOYMENT_TARGET=12.0
elif [[ "$platform_id" == macosx_x86_64 ]]; then
# MacOS, Intel
wheel_tag=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64
WHEEL_TAG=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64
cpython_ver=310
cibw_archs=x86_64
export MACOSX_DEPLOYMENT_TARGET=10.15
Expand All @@ -42,10 +42,8 @@ export CIBW_REPAIR_WHEEL_COMMAND_MACOS="delocate-wheel --require-archs {delocate

python -m pip install cibuildwheel
python -m cibuildwheel python-package --output-dir wheelhouse
python ops/script/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${commit_id} \
--platform-tag ${wheel_tag}
python3 -m wheel tags --python-tag py3 --abi-tag none --platform ${WHEEL_TAG} --remove \
wheelhouse/*.whl

# List dependencies of libxgboost.dylib
mkdir tmp
Expand Down
7 changes: 3 additions & 4 deletions ops/pipeline/build-win64-gpu.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ pip install --user -v "pip>=23"
pip --version
pip wheel --no-deps -v . --wheel-dir dist/
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }
python ../ops/script/rename_whl.py `
--wheel-path (Get-ChildItem dist/*.whl | Select-Object -Expand FullName) `
--commit-hash $Env:GITHUB_SHA `
--platform-tag win_amd64
python -m wheel tags --python-tag py3 --abi-tag none `
--platform win_amd64 --remove \
(Get-ChildItem dist/*.whl | Select-Object -Expand FullName)
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }

Write-Host "--- Upload Python wheel"
Expand Down
1 change: 1 addition & 0 deletions ops/script/format_wheel_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def main(args: argparse.Namespace) -> None:
version = tokens[1].split("+")[0]

meta_info = {
"wheel_path": f"{args.commit_hash}/{wheel_name}",
"wheel_name": wheel_name,
"platform_tag": args.platform_tag,
"version": version,
Expand Down
62 changes: 0 additions & 62 deletions ops/script/rename_whl.py

This file was deleted.

0 comments on commit 80b212c

Please sign in to comment.