Skip to content

Commit

Permalink
Try creating xgboost-cpu on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jul 30, 2024
1 parent 257a391 commit 33ae243
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/buildkite/build-win64-cpu.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Build Python package xgboost-cpu (minimal install)

$ErrorActionPreference = "Stop"

. tests/buildkite/conftest.ps1

Write-Host "--- Build libxgboost on Windows (minimal)"

mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -A x64
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }
cmake --build . --config Release -- /m /nodeReuse:false `
"/consoleloggerparameters:ShowCommandLine;Verbosity=minimal"
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }

Write-Host "--- Build binary wheel"
cd ..
# Patch to rename pkg to xgboost-cpu
patch -p0 < tests/buildkite/remove_nccl_dep.patch
patch -p0 < tests/buildkite/cpu_only_pypkg.patch

cd python-package
conda activate
& pip install --user -v "pip>=23"
& pip --version
& pip wheel --no-deps -v . --wheel-dir dist/
Get-ChildItem . -Filter dist/*.whl |
Foreach-Object {
& python ../tests/ci_build/rename_whl.py `
--wheel-path $_.FullName `
--commit-hash $Env:BUILDKITE_COMMIT `
--platform-tag win_amd64
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }
}

Write-Host "--- Upload Python wheel"
cd ..
Get-ChildItem . -Filter python-package/dist/*.whl |
Foreach-Object {
& buildkite-agent artifact upload python-package/dist/$_
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }
}
# if ( $is_release_branch -eq 1 ) {
Get-ChildItem . -Filter python-package/dist/*.whl |
Foreach-Object {
& aws s3 cp python-package/dist/$_ s3://xgboost-nightly-builds/$Env:BUILDKITE_BRANCH/ `
--acl public-read --no-progress
if ($LASTEXITCODE -ne 0) { throw "Last command failed" }
}
#}
2 changes: 2 additions & 0 deletions tests/buildkite/build-win64-gpu.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Build Python package and gtest with GPU enabled

$ErrorActionPreference = "Stop"

. tests/buildkite/conftest.ps1
Expand Down
5 changes: 5 additions & 0 deletions tests/buildkite/pipeline-win64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ steps:
key: build-win64-gpu
agents:
queue: windows-cpu
- label: ":windows: Build XGBoost for Windows (minimal)"
command: "tests/buildkite/build-win64-cpu.ps1"
key: build-win64-cpu
agents:
queue: windows-cpu

- wait

Expand Down

0 comments on commit 33ae243

Please sign in to comment.