Skip to content

Commit

Permalink
[CI] Make nightly builds of CPack for amd64 and aarch64 (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 authored May 9, 2023
1 parent e7467fc commit 1463269
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/linux-wheel-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,19 @@ jobs:
- name: Test wheel
run: |
bash ops/test-linux-python-wheel.sh
cpack-builder:
name: Build CPack
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: mamba-org/provision-with-micromamba@v14
with:
cache-downloads: true
cache-env: true
environment-name: dev
environment-file: ops/conda_env/dev.yml
- name: Build CPack
run: |
bash ops/build-cpack.sh
33 changes: 33 additions & 0 deletions ops/build-cpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -euo pipefail

echo "##[section] Building Treelite for amd64..."
tests/ci_build/ci_build.sh ubuntu20 tests/ci_build/build_via_cmake.sh

echo "##[section] Packing CPack for amd64..."
tests/ci_build/ci_build.sh ubuntu20 bash -c "cd build/ && cpack -G TGZ"
for tgz in build/treelite-*-Linux.tar.gz
do
mv -v "${tgz}" "${tgz%-Linux.tar.gz}+${COMMIT_ID}-Linux-amd64.tar.gz"
done

echo "##[section]Uploading CPack for amd64..."
python -m awscli s3 cp build/*.tar.gz s3://treelite-cpack/ --acl public-read || true

rm -rf build/

echo "##[section] Building Treelite for aarch64..."
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
tests/ci_build/ci_build.sh ubuntu20_aarch64 tests/ci_build/build_via_cmake.sh

echo "##[section] Packing CPack for aarch64..."
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
tests/ci_build/ci_build.sh ubuntu20_aarch64 bash -c "cd build/ && cpack -G TGZ"
for tgz in build/treelite-*-Linux.tar.gz
do
mv -v "${tgz}" "${tgz%-Linux.tar.gz}+${COMMIT_ID}-Linux-aarch64.tar.gz"
done

echo "##[section]Uploading CPack for aarch64..."
python -m awscli s3 cp build/*.tar.gz s3://treelite-cpack/ --acl public-read || true
10 changes: 5 additions & 5 deletions ops/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ set -euo pipefail
TAG=manylinux2014_x86_64

echo "##[section]Building Treelite..."
tests/ci_build/ci_build.sh cpu tests/ci_build/build_via_cmake.sh
tests/ci_build/ci_build.sh centos7 tests/ci_build/build_via_cmake.sh

echo "##[section]Packaging Python wheel for Treelite..."
tests/ci_build/ci_build.sh cpu bash -c "cd python/ && python setup.py bdist_wheel --universal"
tests/ci_build/ci_build.sh centos7 bash -c "cd python/ && python setup.py bdist_wheel --universal"
tests/ci_build/ci_build.sh auditwheel_x86_64 auditwheel repair --only-plat --plat ${TAG} python/dist/*.whl
rm -v python/dist/*.whl
mv -v wheelhouse/*.whl python/dist/
tests/ci_build/ci_build.sh cpu python tests/ci_build/rename_whl.py python/dist ${COMMIT_ID} ${TAG}
tests/ci_build/ci_build.sh centos7 python tests/ci_build/rename_whl.py python/dist ${COMMIT_ID} ${TAG}

echo "##[section]Packaging Python wheel for Treelite runtime..."
tests/ci_build/ci_build.sh cpu bash -c "cd runtime/python/ && python setup.py bdist_wheel --universal"
tests/ci_build/ci_build.sh centos7 bash -c "cd runtime/python/ && python setup.py bdist_wheel --universal"
tests/ci_build/ci_build.sh auditwheel_x86_64 auditwheel repair --only-plat --plat ${TAG} runtime/python/dist/*.whl
rm -v runtime/python/dist/*.whl
mv -v wheelhouse/*.whl runtime/python/dist/
tests/ci_build/ci_build.sh cpu python tests/ci_build/rename_whl.py runtime/python/dist ${COMMIT_ID} ${TAG}
tests/ci_build/ci_build.sh centos7 python tests/ci_build/rename_whl.py runtime/python/dist ${COMMIT_ID} ${TAG}
File renamed without changes.
22 changes: 22 additions & 0 deletions tests/ci_build/Dockerfile.ubuntu20
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:20.04
LABEL maintainer "DMLC"

ENV GOSU_VERSION 1.13
ENV DEBIAN_FRONTEND noninteractive

RUN \
apt-get update && \
apt-get install -y build-essential git wget unzip tar cmake ninja-build

# Install lightweight sudo (not bound to TTY)
RUN set -ex; \
wget -nv -O /usr/local/bin/gosu "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"]
22 changes: 22 additions & 0 deletions tests/ci_build/Dockerfile.ubuntu20_aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM arm64v8/ubuntu:20.04
LABEL maintainer "DMLC"

ENV GOSU_VERSION 1.13
ENV DEBIAN_FRONTEND noninteractive

RUN \
apt-get update && \
apt-get install -y build-essential git wget unzip tar cmake ninja-build

# Install lightweight sudo (not bound to TTY)
RUN set -ex; \
wget -nv -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-arm64" && \
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 1463269

Please sign in to comment.