Skip to content

Commit 598133e

Browse files
authored
Improve design and address comments in the new CI (#11079)
* Update doc * Add more examples for local testing with Docker * Add note about VM images * Update doc for stashing files * GITHUB_ACTION -> GITHUB_ACTIONS * Move container build to xgboost-devops * Remove build_via_cmake.sh Also combine build-cuda.sh / build-cuda-with-rmm.sh * Replace stash-artifacts.{sh,py} -> manage-artifacts.py Also: * Remove publish-artifacts.sh * Upload artifacts to /{commit_id}/ prefix * Remove rename_whl.py * Remove remaining uses of awscli * Typo * Fix * Install wheel on arm64 * Try python3 -m pip * [MacOS] Trust cibuildwheel to produce correct tag * Update patch * No ls -lh on Windows * Fix Windows * Don't install wheel * Don't use backslash on Windows * Fix * Fix Windows * Cap scikit-learn<=1.5.2 * Fix Windows * Add missing step in doc * doc typo * Use latest container
1 parent b760a42 commit 598133e

File tree

72 files changed

+1163
-2005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1163
-2005
lines changed

.github/workflows/i386.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: XGBoost-i386-test
33
on: [push, pull_request]
44

55
permissions:
6-
contents: read # to fetch code (actions/checkout)
6+
contents: read # to fetch code (actions/checkout)
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -12,32 +12,16 @@ concurrency:
1212
jobs:
1313
build-32bit:
1414
name: Build 32-bit
15-
runs-on: ubuntu-latest
16-
services:
17-
registry:
18-
image: registry:2
19-
ports:
20-
- 5000:5000
15+
runs-on:
16+
- runs-on=${{ github.run_id }}
17+
- runner=linux-amd64-cpu
18+
- tag=i386-build-32bit
2119
steps:
20+
# Restart Docker daemon so that it recognizes the ephemeral disks
21+
- run: sudo systemctl restart docker
2222
- uses: actions/checkout@v4
2323
with:
24-
submodules: 'true'
25-
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v3
27-
with:
28-
driver-opts: network=host
29-
- name: Build and push container
30-
uses: docker/build-push-action@v6
31-
with:
32-
context: .
33-
file: ops/docker/dockerfile/Dockerfile.i386
34-
push: true
35-
tags: localhost:5000/xgboost/build-32bit:latest
36-
cache-from: type=gha
37-
cache-to: type=gha,mode=max
38-
- name: Build XGBoost
39-
run: |
40-
docker run --rm -v $PWD:/workspace -w /workspace \
41-
-e CXXFLAGS='-Wno-error=overloaded-virtual -Wno-error=maybe-uninitialized -Wno-error=redundant-move' \
42-
localhost:5000/xgboost/build-32bit:latest \
43-
bash ops/script/build_via_cmake.sh
24+
submodules: "true"
25+
- name: Log into Docker registry (AWS ECR)
26+
run: bash ops/pipeline/login-docker-registry.sh
27+
- run: bash ops/pipeline/test-cpp-i386.sh

.github/workflows/jvm_tests.yml

Lines changed: 50 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,12 @@ concurrency:
1212
env:
1313
BRANCH_NAME: >-
1414
${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }}
15-
USE_DOCKER_CACHE: 1
1615
1716
jobs:
18-
build-containers:
19-
name: Build CI containers (${{ matrix.container_id }})
20-
runs-on:
21-
- runs-on
22-
- runner=${{ matrix.runner }}
23-
- run-id=${{ github.run_id }}
24-
- tag=jvm-tests-build-containers-${{ matrix.container_id }}
25-
strategy:
26-
matrix:
27-
container_id:
28-
- xgb-ci.manylinux2014_x86_64
29-
- xgb-ci.jvm
30-
- xgb-ci.jvm_gpu_build
31-
runner: [linux-amd64-cpu]
32-
include:
33-
- container_id: xgb-ci.manylinux2014_aarch64
34-
runner: linux-arm64-cpu
35-
steps:
36-
# Restart Docker daemon so that it recognizes the ephemeral disks
37-
- run: sudo systemctl restart docker
38-
- uses: actions/checkout@v4
39-
with:
40-
submodules: "true"
41-
- name: Build ${{ matrix.container_id }}
42-
run: bash ops/docker_build.sh ${{ matrix.container_id }}
43-
4417
build-jvm-manylinux2014:
4518
name: >-
4619
Build libxgboost4j.so targeting glibc 2.17
4720
(arch ${{ matrix.arch }}, runner ${{ matrix.runner }})
48-
needs: build-containers
4921
runs-on:
5022
- runs-on
5123
- runner=${{ matrix.runner }}
@@ -65,19 +37,12 @@ jobs:
6537
- uses: actions/checkout@v4
6638
with:
6739
submodules: "true"
68-
- name: Fetch container from cache
69-
run: bash ops/docker_build.sh xgb-ci.manylinux2014_${{ matrix.arch }}
40+
- name: Log into Docker registry (AWS ECR)
41+
run: bash ops/pipeline/login-docker-registry.sh
7042
- run: bash ops/pipeline/build-jvm-manylinux2014.sh ${{ matrix.arch }}
71-
- name: Upload libxgboost4j.so
72-
run: |
73-
libname=lib/libxgboost4j_linux_${{ matrix.arch }}_${{ github.sha }}.so
74-
mv -v lib/libxgboost4j.so ${libname}
75-
bash ops/pipeline/publish-artifact.sh ${libname} \
76-
s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/
7743

7844
build-jvm-gpu:
7945
name: Build libxgboost4j.so with CUDA
80-
needs: build-containers
8146
runs-on:
8247
- runs-on=${{ github.run_id }}
8348
- runner=linux-amd64-cpu
@@ -88,12 +53,15 @@ jobs:
8853
- uses: actions/checkout@v4
8954
with:
9055
submodules: "true"
91-
- name: Fetch container from cache
92-
run: bash ops/docker_build.sh xgb-ci.jvm_gpu_build
56+
- name: Log into Docker registry (AWS ECR)
57+
run: bash ops/pipeline/login-docker-registry.sh
9358
- run: bash ops/pipeline/build-jvm-gpu.sh
9459
- name: Stash files
9560
run: |
96-
bash ops/pipeline/stash-artifacts.sh stash build-jvm-gpu lib/libxgboost4j.so
61+
python3 ops/pipeline/manage-artifacts.py upload \
62+
--s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
63+
--prefix cache/${{ github.run_id }}/build-jvm-gpu \
64+
lib/libxgboost4j.so
9765
9866
build-jvm-mac:
9967
name: "Build libxgboost4j.dylib for ${{ matrix.description }}"
@@ -104,22 +72,25 @@ jobs:
10472
include:
10573
- description: "MacOS (Apple Silicon)"
10674
script: ops/pipeline/build-jvm-macos-apple-silicon.sh
107-
libname: libxgboost4j_m1_${{ github.sha }}.dylib
75+
libname: libxgboost4j_m1.dylib
10876
runner: macos-14
10977
- description: "MacOS (Intel)"
11078
script: ops/pipeline/build-jvm-macos-intel.sh
111-
libname: libxgboost4j_intel_${{ github.sha }}.dylib
79+
libname: libxgboost4j_intel.dylib
11280
runner: macos-13
11381
steps:
11482
- uses: actions/checkout@v4
11583
with:
11684
submodules: "true"
11785
- run: bash ${{ matrix.script }}
11886
- name: Upload libxgboost4j.dylib
87+
if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')
11988
run: |
12089
mv -v lib/libxgboost4j.dylib ${{ matrix.libname }}
121-
bash ops/pipeline/publish-artifact.sh ${{ matrix.libname }} \
122-
s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/
90+
python3 ops/pipeline/manage-artifacts.py upload \
91+
--s3-bucket xgboost-nightly-builds \
92+
--prefix ${{ env.BRANCH_NAME }}/${{ github.sha }} --make-public \
93+
${{ matrix.libname }}
12394
env:
12495
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }}
12596
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }}
@@ -137,21 +108,25 @@ jobs:
137108
- uses: actions/checkout@v4
138109
with:
139110
submodules: "true"
140-
- name: Fetch container from cache
141-
run: bash ops/docker_build.sh xgb-ci.jvm_gpu_build
111+
- name: Log into Docker registry (AWS ECR)
112+
run: bash ops/pipeline/login-docker-registry.sh
142113
- name: Unstash files
143114
run: |
144-
bash ops/pipeline/stash-artifacts.sh unstash build-jvm-gpu lib/libxgboost4j.so
115+
python3 ops/pipeline/manage-artifacts.py download \
116+
--s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
117+
--prefix cache/${{ github.run_id }}/build-jvm-gpu \
118+
--dest-dir lib \
119+
libxgboost4j.so
145120
- run: bash ops/pipeline/build-jvm-doc.sh
146121
- name: Upload JVM doc
147122
run: |
148-
bash ops/pipeline/publish-artifact.sh \
149-
jvm-packages/${{ env.BRANCH_NAME }}.tar.bz2 \
150-
s3://xgboost-docs/
123+
python3 ops/pipeline/manage-artifacts.py upload \
124+
--s3-bucket xgboost-docs \
125+
--prefix ${BRANCH_NAME}/${GITHUB_SHA} --make-public \
126+
jvm-packages/${{ env.BRANCH_NAME }}.tar.bz2
151127
152128
build-test-jvm-packages:
153129
name: Build and test JVM packages (Linux, Scala ${{ matrix.scala_version }})
154-
needs: build-containers
155130
runs-on:
156131
- runs-on=${{ github.run_id }}
157132
- runner=linux-amd64-cpu
@@ -166,16 +141,18 @@ jobs:
166141
- uses: actions/checkout@v4
167142
with:
168143
submodules: "true"
169-
- name: Fetch container from cache
170-
run: bash ops/docker_build.sh xgb-ci.jvm
144+
- name: Log into Docker registry (AWS ECR)
145+
run: bash ops/pipeline/login-docker-registry.sh
171146
- name: Build and test JVM packages (Scala ${{ matrix.scala_version }})
172147
run: bash ops/pipeline/build-test-jvm-packages.sh
173148
env:
174149
SCALA_VERSION: ${{ matrix.scala_version }}
175150
- name: Stash files
176151
run: |
177-
bash ops/pipeline/stash-artifacts.sh stash \
178-
build-test-jvm-packages lib/libxgboost4j.so
152+
python3 ops/pipeline/manage-artifacts.py upload \
153+
--s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
154+
--prefix cache/${{ github.run_id }}/build-test-jvm-packages \
155+
lib/libxgboost4j.so
179156
if: matrix.scala_version == '2.13'
180157

181158
build-test-jvm-packages-other-os:
@@ -210,11 +187,10 @@ jobs:
210187
mvn test -B -pl :xgboost4j_2.12
211188
- name: Publish artifact xgboost4j.dll to S3
212189
run: |
213-
cd lib/
214-
Rename-Item -Path xgboost4j.dll -NewName xgboost4j_${{ github.sha }}.dll
215-
python -m awscli s3 cp xgboost4j_${{ github.sha }}.dll `
216-
s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/ `
217-
--acl public-read --region us-west-2
190+
python ops/pipeline/manage-artifacts.py upload \
191+
--s3-bucket xgboost-nightly-builds \
192+
--prefix ${{ env.BRANCH_NAME }}/${{ github.sha }} --make-public \
193+
lib/xgboost4j.dll
218194
if: |
219195
(github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) &&
220196
matrix.os == 'windows-latest'
@@ -239,11 +215,15 @@ jobs:
239215
- uses: actions/checkout@v4
240216
with:
241217
submodules: "true"
242-
- name: Fetch container from cache
243-
run: bash ops/docker_build.sh xgb-ci.jvm_gpu_build
218+
- name: Log into Docker registry (AWS ECR)
219+
run: bash ops/pipeline/login-docker-registry.sh
244220
- name: Unstash files
245221
run: |
246-
bash ops/pipeline/stash-artifacts.sh unstash build-jvm-gpu lib/libxgboost4j.so
222+
python3 ops/pipeline/manage-artifacts.py download \
223+
--s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
224+
--prefix cache/${{ github.run_id }}/build-jvm-gpu \
225+
--dest-dir lib \
226+
libxgboost4j.so
247227
- run: bash ops/pipeline/test-jvm-gpu.sh
248228
env:
249229
SCALA_VERSION: ${{ matrix.scala_version }}
@@ -273,13 +253,15 @@ jobs:
273253
- uses: actions/checkout@v4
274254
with:
275255
submodules: "true"
276-
- name: Fetch container from cache
277-
run: bash ops/docker_build.sh ${{ matrix.variant.container_id }}
256+
- name: Log into Docker registry (AWS ECR)
257+
run: bash ops/pipeline/login-docker-registry.sh
278258
- name: Unstash files
279259
run: |
280-
bash ops/pipeline/stash-artifacts.sh \
281-
unstash ${{ matrix.variant.artifact_from }} \
282-
lib/libxgboost4j.so
260+
python3 ops/pipeline/manage-artifacts.py download \
261+
--s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
262+
--prefix cache/${{ github.run_id }}/${{ matrix.variant.artifact_from }} \
263+
--dest-dir lib \
264+
libxgboost4j.so
283265
ls -lh lib/libxgboost4j.so
284266
- name: Deploy JVM packages to S3
285267
run: |

.github/workflows/lint.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,8 @@ env:
1414
${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }}
1515
1616
jobs:
17-
build-containers:
18-
name: Build CI containers
19-
env:
20-
CONTAINER_ID: xgb-ci.clang_tidy
21-
runs-on:
22-
- runs-on=${{ github.run_id }}
23-
- runner=linux-amd64-cpu
24-
- tag=lint-build-containers
25-
steps:
26-
# Restart Docker daemon so that it recognizes the ephemeral disks
27-
- run: sudo systemctl restart docker
28-
- uses: actions/checkout@v4
29-
with:
30-
submodules: "true"
31-
- name: Build ${{ env.CONTAINER_ID }}
32-
run: bash ops/docker_build.sh ${{ env.CONTAINER_ID }}
33-
3417
clang-tidy:
3518
name: Run clang-tidy
36-
needs: build-containers
3719
runs-on:
3820
- runs-on=${{ github.run_id }}
3921
- runner=linux-amd64-cpu
@@ -44,8 +26,8 @@ jobs:
4426
- uses: actions/checkout@v4
4527
with:
4628
submodules: "true"
47-
- name: Fetch container from cache
48-
run: bash ops/docker_build.sh xgb-ci.clang_tidy
29+
- name: Log into Docker registry (AWS ECR)
30+
run: bash ops/pipeline/login-docker-registry.sh
4931
- run: bash ops/pipeline/run-clang-tidy.sh
5032

5133
python-mypy-lint:

0 commit comments

Comments
 (0)