Skip to content

Commit

Permalink
[CI] Set up pipeline to build manylinux2014 wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jun 23, 2024
1 parent f46ed8a commit 0adc883
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 3 deletions.
26 changes: 26 additions & 0 deletions tests/buildkite/build-manylinux2014-aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -euo pipefail

source tests/buildkite/conftest.sh

WHEEL_TAG=manylinux2014_aarch64
command_wrapper="tests/ci_build/ci_build.sh manylinux2014_aarch64"

echo "--- Build binary wheel for ${WHEEL_TAG}"
$command_wrapper bash -c \
"cd python-package && pip wheel --no-deps -vvv . --wheel-dir dist/"
$command_wrapper auditwheel repair --plat ${WHEEL_TAG} python-package/dist/*.whl
$command_wrapper python tests/ci_build/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${BUILDKITE_COMMIT} \
--platform-tag ${WHEEL_TAG}
mv -v wheelhouse/*.whl python-package/dist/

echo "--- Upload Python wheel"
buildkite-agent artifact upload python-package/dist/*.whl
if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
then
aws s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${BRANCH_NAME}/ \
--acl public-read --no-progress
fi
26 changes: 26 additions & 0 deletions tests/buildkite/build-manylinux2014-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -euo pipefail

source tests/buildkite/conftest.sh

WHEEL_TAG=manylinux2014_x86_64
command_wrapper="tests/ci_build/ci_build.sh manylinux2014_x86_64"

echo "--- Build binary wheel for ${WHEEL_TAG}"
$command_wrapper bash -c \
"cd python-package && pip wheel --no-deps -vvv . --wheel-dir dist/"
$command_wrapper auditwheel repair --plat ${WHEEL_TAG} python-package/dist/*.whl
$command_wrapper python tests/ci_build/rename_whl.py \
--wheel-path wheelhouse/*.whl \
--commit-hash ${BUILDKITE_COMMIT} \
--platform-tag ${WHEEL_TAG}
mv -v wheelhouse/*.whl python-package/dist/

echo "--- Upload Python wheel"
buildkite-agent artifact upload python-package/dist/*.whl
if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]]
then
aws s3 cp python-package/dist/*.whl s3://xgboost-nightly-builds/${BRANCH_NAME}/ \
--acl public-read --no-progress
fi
15 changes: 12 additions & 3 deletions tests/buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ steps:
key: run-clang-tidy
agents:
queue: linux-amd64-cpu
- wait
- label: ":console: Build CPU"
command: "tests/buildkite/build-cpu.sh"
key: build-cpu
agents:
queue: linux-amd64-cpu
- label: ":console: Build CPU ARM64"
- label: ":console: Build CPU ARM64 + manylinux2_28_aarch64 wheel"
command: "tests/buildkite/build-cpu-arm64.sh"
key: build-cpu-arm64
agents:
queue: linux-arm64-cpu
- label: ":console: Build CUDA"
- label: ":console: Build CUDA + manylinux2_28_x86_64 wheel"
command: "tests/buildkite/build-cuda.sh"
key: build-cuda
agents:
Expand All @@ -62,6 +61,16 @@ steps:
key: build-jvm-doc
agents:
queue: linux-amd64-cpu
- label: ":console: Build manylinux2014_x86_64 wheel"
command: "tests/buildkite/build-manylinux2014-x86_64.sh"
key: build-manylinux2014-x86_64
agents:
queue: linux-amd64-cpu
- label: ":console: Build manylinux2014_aarch64 wheel"
command: "tests/buildkite/build-manylinux2014-aarch64.sh"
key: build-manylinux2014-aarch64
agents:
queue: linux-amd64-arm64
- wait
#### -------- TEST --------
- label: ":console: Test Python package, CPU"
Expand Down
15 changes: 15 additions & 0 deletions tests/ci_build/Dockerfile.manylinux2014_aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM quay.io/pypa/manylinux2014_aarch64

# Install lightweight sudo (not bound to TTY)
ENV GOSU_VERSION 1.10
RUN set -ex; \
curl -o /usr/local/bin/gosu -L "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" && \
chmod +x /usr/local/bin/gosu && \
gosu nobody true

# Default entry-point to use if running locally
# It will preserve attributes of created files
COPY entrypoint.sh /scripts/

WORKDIR /workspace
ENTRYPOINT ["/scripts/entrypoint.sh"]
15 changes: 15 additions & 0 deletions tests/ci_build/Dockerfile.manylinux2014_x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM quay.io/pypa/manylinux2014_x86_64

# Install lightweight sudo (not bound to TTY)
ENV GOSU_VERSION 1.10
RUN set -ex; \
curl -o /usr/local/bin/gosu -L "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" && \
chmod +x /usr/local/bin/gosu && \
gosu nobody true

# Default entry-point to use if running locally
# It will preserve attributes of created files
COPY entrypoint.sh /scripts/

WORKDIR /workspace
ENTRYPOINT ["/scripts/entrypoint.sh"]

0 comments on commit 0adc883

Please sign in to comment.