From dfd5624d181ba550d2719eca06652f15702ffa79 Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Tue, 19 Nov 2024 08:09:48 -0800 Subject: [PATCH] Fixes --- .github/workflows/freebsd.yml | 32 ++-- .github/workflows/i386.yml | 44 +++--- .github/workflows/jvm_tests.yml | 91 +++++------ .github/workflows/lint.yml | 122 +++++++-------- .github/workflows/misc.yml | 172 ++++++++++---------- .github/workflows/python_tests.yml | 182 +++++++++++----------- .github/workflows/python_wheels_macos.yml | 46 +++--- .github/workflows/r_nold.yml | 40 ++--- .github/workflows/r_tests.yml | 152 +++++++++--------- .github/workflows/sycl_tests.yml | 58 +++---- .github/workflows/update_rapids.yml | 32 ++-- 11 files changed, 487 insertions(+), 484 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index d3208a1294d1..d0eb13c20fb6 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -15,20 +15,20 @@ jobs: timeout-minutes: 20 name: A job to run test in FreeBSD steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - - name: Test in FreeBSD - id: test - uses: vmactions/freebsd-vm@v1 - with: - usesh: true - prepare: | - pkg install -y cmake git ninja googletest + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Test in FreeBSD + id: test + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + prepare: | + pkg install -y cmake git ninja googletest - run: | - mkdir build - cd build - cmake .. -GNinja -DGOOGLE_TEST=ON - ninja -v - ./testxgboost + run: | + mkdir build + cd build + cmake .. -GNinja -DGOOGLE_TEST=ON + ninja -v + ./testxgboost diff --git a/.github/workflows/i386.yml b/.github/workflows/i386.yml index aa71147e2581..455d6ea91033 100644 --- a/.github/workflows/i386.yml +++ b/.github/workflows/i386.yml @@ -19,25 +19,25 @@ jobs: ports: - 5000:5000 steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.7.1 - with: - driver-opts: network=host - - name: Build and push container - uses: docker/build-push-action@v6 - with: - context: . - file: ops/docker/dockerfile/Dockerfile.i386 - push: true - tags: localhost:5000/xgboost/build-32bit:latest - cache-from: type=gha - cache-to: type=gha,mode=max - - name: Build XGBoost - run: | - docker run --rm -v $PWD:/workspace -w /workspace \ - -e CXXFLAGS='-Wno-error=overloaded-virtual -Wno-error=maybe-uninitialized -Wno-error=redundant-move' \ - localhost:5000/xgboost/build-32bit:latest \ - bash ops/script/build_via_cmake.sh + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.7.1 + with: + driver-opts: network=host + - name: Build and push container + uses: docker/build-push-action@v6 + with: + context: . + file: ops/docker/dockerfile/Dockerfile.i386 + push: true + tags: localhost:5000/xgboost/build-32bit:latest + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Build XGBoost + run: | + docker run --rm -v $PWD:/workspace -w /workspace \ + -e CXXFLAGS='-Wno-error=overloaded-virtual -Wno-error=maybe-uninitialized -Wno-error=redundant-move' \ + localhost:5000/xgboost/build-32bit:latest \ + bash ops/script/build_via_cmake.sh diff --git a/.github/workflows/jvm_tests.yml b/.github/workflows/jvm_tests.yml index f9385fa4acaf..ab21e2f19466 100644 --- a/.github/workflows/jvm_tests.yml +++ b/.github/workflows/jvm_tests.yml @@ -110,6 +110,9 @@ jobs: with: submodules: "true" - run: bash ${{ matrix.script }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} build-jvm-docs: name: Build docs for JVM packages @@ -169,50 +172,50 @@ jobs: os: [windows-latest, macos-13] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - - uses: actions/setup-java@v4.5.0 - with: - distribution: 'temurin' - java-version: '8' - - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: jvm_tests - environment-file: ops/conda_env/jvm_tests.yml - use-mamba: true - - - name: Cache Maven packages - uses: actions/cache@v4.1.2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('./jvm-packages/pom.xml') }} - restore-keys: ${{ runner.os }}-m2-${{ hashFiles('./jvm-packages/pom.xml') }} - - - name: Test XGBoost4J (Core) - run: | - cd jvm-packages - mvn test -B -pl :xgboost4j_2.12 - - - name: Publish artifact xgboost4j.dll to S3 - run: | - cd lib/ - Rename-Item -Path xgboost4j.dll -NewName xgboost4j_${{ github.sha }}.dll - dir - python -m awscli s3 cp xgboost4j_${{ github.sha }}.dll ` - s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/ ` - --acl public-read --region us-west-2 - if: matrix.os == 'windows-latest' - # if: | - # (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && - # matrix.os == 'windows-latest' - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + + - uses: actions/setup-java@v4.5.0 + with: + distribution: 'temurin' + java-version: '8' + + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: jvm_tests + environment-file: ops/conda_env/jvm_tests.yml + use-mamba: true + + - name: Cache Maven packages + uses: actions/cache@v4.1.2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('./jvm-packages/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ hashFiles('./jvm-packages/pom.xml') }} + + - name: Test XGBoost4J (Core) + run: | + cd jvm-packages + mvn test -B -pl :xgboost4j_2.12 + + - name: Publish artifact xgboost4j.dll to S3 + run: | + cd lib/ + Rename-Item -Path xgboost4j.dll -NewName xgboost4j_${{ github.sha }}.dll + dir + python -m awscli s3 cp xgboost4j_${{ github.sha }}.dll ` + s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/ ` + --acl public-read --region us-west-2 + if: matrix.os == 'windows-latest' + # if: | + # (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) && + # matrix.os == 'windows-latest' + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} test-jvm-packages-gpu: name: Test JVM packages with CUDA diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index caceb3e3893b..59b3cecf57ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -58,52 +58,52 @@ jobs: runs-on: ubuntu-latest name: Type and format checks for the Python package steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: python_lint - environment-file: ops/conda_env/python_lint.yml - use-mamba: true - - name: Display Conda env - shell: bash -el {0} - run: | - conda info - conda list - - name: Run mypy - shell: bash -el {0} - run: | - python ops/script/lint_python.py --format=0 --type-check=1 --pylint=0 - - name: Run formatter - shell: bash -el {0} - run: | - python ops/script/lint_python.py --format=1 --type-check=0 --pylint=0 - - name: Run pylint - shell: bash -el {0} - run: | - python ops/script/lint_python.py --format=0 --type-check=0 --pylint=1 + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: python_lint + environment-file: ops/conda_env/python_lint.yml + use-mamba: true + - name: Display Conda env + shell: bash -el {0} + run: | + conda info + conda list + - name: Run mypy + shell: bash -el {0} + run: | + python ops/script/lint_python.py --format=0 --type-check=1 --pylint=0 + - name: Run formatter + shell: bash -el {0} + run: | + python ops/script/lint_python.py --format=1 --type-check=0 --pylint=0 + - name: Run pylint + shell: bash -el {0} + run: | + python ops/script/lint_python.py --format=0 --type-check=0 --pylint=1 cpp-lint: runs-on: ubuntu-latest name: Code linting for C++ steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - uses: actions/setup-python@v5.3.0 - with: - python-version: "3.10" - architecture: 'x64' - - name: Install Python packages - run: | - python -m pip install wheel setuptools cmakelint cpplint==1.6.1 pylint - - name: Run lint - run: | - python3 ops/script/lint_cpp.py - bash ops/script/lint_cmake.sh + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - uses: actions/setup-python@v5.3.0 + with: + python-version: "3.10" + architecture: 'x64' + - name: Install Python packages + run: | + python -m pip install wheel setuptools cmakelint cpplint==1.6.1 pylint + - name: Run lint + run: | + python3 ops/script/lint_cpp.py + bash ops/script/lint_cmake.sh lintr: runs-on: ${{ matrix.os }} @@ -118,27 +118,27 @@ jobs: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' - - uses: r-lib/actions/setup-r@v2.11.0 - with: - r-version: ${{ matrix.r }} + - uses: r-lib/actions/setup-r@v2.11.0 + with: + r-version: ${{ matrix.r }} - - name: Cache R packages - uses: actions/cache@v4.1.2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} + - name: Cache R packages + uses: actions/cache@v4.1.2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} + restore-keys: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} - - name: Install dependencies - shell: Rscript {0} - run: | - source("./R-package/tests/helper_scripts/install_deps.R") + - name: Install dependencies + shell: Rscript {0} + run: | + source("./R-package/tests/helper_scripts/install_deps.R") - - name: Run lintr - run: | - MAKEFLAGS="-j$(nproc)" R CMD INSTALL R-package/ - Rscript ops/script/lint_r.R $(pwd) + - name: Run lintr + run: | + MAKEFLAGS="-j$(nproc)" R CMD INSTALL R-package/ + Rscript ops/script/lint_r.R $(pwd) diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index 7294faa0d93b..b1b92c1528b7 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -22,23 +22,23 @@ jobs: matrix: os: [macos-13] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Install system packages - run: | - brew install ninja libomp - - name: Build gtest binary - run: | - mkdir build - cd build - cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -GNinja -DBUILD_DEPRECATED_CLI=ON -DUSE_SANITIZER=ON -DENABLED_SANITIZERS=address -DCMAKE_BUILD_TYPE=RelWithDebInfo - ninja -v - - name: Run gtest binary - run: | - cd build - ./testxgboost - ctest -R TestXGBoostCLI --extra-verbose + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Install system packages + run: | + brew install ninja libomp + - name: Build gtest binary + run: | + mkdir build + cd build + cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -GNinja -DBUILD_DEPRECATED_CLI=ON -DUSE_SANITIZER=ON -DENABLED_SANITIZERS=address -DCMAKE_BUILD_TYPE=RelWithDebInfo + ninja -v + - name: Run gtest binary + run: | + cd build + ./testxgboost + ctest -R TestXGBoostCLI --extra-verbose gtest-cpu-nonomp: name: Test Google C++ unittest (CPU Non-OMP) @@ -48,23 +48,23 @@ jobs: matrix: os: [ubuntu-latest] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Install system packages - run: | - sudo apt-get install -y --no-install-recommends ninja-build - - name: Build and install XGBoost - shell: bash -l {0} - run: | - mkdir build - cd build - cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_OPENMP=OFF -DBUILD_DEPRECATED_CLI=ON - ninja -v - - name: Run gtest binary - run: | - cd build - ctest --extra-verbose + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Install system packages + run: | + sudo apt-get install -y --no-install-recommends ninja-build + - name: Build and install XGBoost + shell: bash -l {0} + run: | + mkdir build + cd build + cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_OPENMP=OFF -DBUILD_DEPRECATED_CLI=ON + ninja -v + - name: Run gtest binary + run: | + cd build + ctest --extra-verbose c-api-demo: name: Test installing XGBoost lib + building the C API demo @@ -78,56 +78,56 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.10"] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: cpp_test - environment-file: ops/conda_env/cpp_test.yml - use-mamba: true - - name: Display Conda env - run: | - conda info - conda list - - name: Build and install XGBoost static library - run: | - mkdir build - cd build - cmake .. -DBUILD_STATIC_LIB=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja - ninja -v install - cd - - - name: Build and run C API demo with static - run: | - pushd . - cd demo/c-api/ - mkdir build - cd build - cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX - ninja -v - ctest - cd .. - rm -rf ./build - popd + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: cpp_test + environment-file: ops/conda_env/cpp_test.yml + use-mamba: true + - name: Display Conda env + run: | + conda info + conda list + - name: Build and install XGBoost static library + run: | + mkdir build + cd build + cmake .. -DBUILD_STATIC_LIB=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja + ninja -v install + cd - + - name: Build and run C API demo with static + run: | + pushd . + cd demo/c-api/ + mkdir build + cd build + cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX + ninja -v + ctest + cd .. + rm -rf ./build + popd - - name: Build and install XGBoost shared library - run: | - cd build - cmake .. -DBUILD_STATIC_LIB=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja -DPLUGIN_FEDERATED=ON -DGOOGLE_TEST=ON - ninja -v install - ./testxgboost - cd - - - name: Build and run C API demo with shared - run: | - pushd . - cd demo/c-api/ - mkdir build - cd build - cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX - ninja -v - ctest - popd - ./ops/script/verify_link.sh ./demo/c-api/build/basic/api-demo - ./ops/script/verify_link.sh ./demo/c-api/build/external-memory/external-memory-demo + - name: Build and install XGBoost shared library + run: | + cd build + cmake .. -DBUILD_STATIC_LIB=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja -DPLUGIN_FEDERATED=ON -DGOOGLE_TEST=ON + ninja -v install + ./testxgboost + cd - + - name: Build and run C API demo with shared + run: | + pushd . + cd demo/c-api/ + mkdir build + cd build + cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX + ninja -v + ctest + popd + ./ops/script/verify_link.sh ./demo/c-api/build/basic/api-demo + ./ops/script/verify_link.sh ./demo/c-api/build/external-memory/external-memory-demo diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index c43d8b056c8d..344e2f276b22 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -22,28 +22,28 @@ jobs: matrix: os: [ubuntu-latest] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: sdist_test - environment-file: ops/conda_env/sdist_test.yml - use-mamba: true - - name: Display Conda env - run: | - conda info - conda list - - name: Build and install XGBoost - run: | - cd python-package - python --version - python -m build --sdist - pip install -v ./dist/xgboost-*.tar.gz --config-settings use_openmp=False - cd .. - python -c 'import xgboost' + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: sdist_test + environment-file: ops/conda_env/sdist_test.yml + use-mamba: true + - name: Display Conda env + run: | + conda info + conda list + - name: Build and install XGBoost + run: | + cd python-package + python --version + python -m build --sdist + pip install -v ./dist/xgboost-*.tar.gz --config-settings use_openmp=False + cd .. + python -c 'import xgboost' python-sdist-test: # Use system toolchain instead of conda toolchain for macos and windows. @@ -56,33 +56,33 @@ jobs: os: [macos-13, windows-latest] python-version: ["3.10"] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Install osx system dependencies - if: matrix.os == 'macos-13' - run: | - brew install ninja libomp - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - activate-environment: test - - name: Install build - run: | - conda install -c conda-forge python-build - - name: Display Conda env - run: | - conda info - conda list - - name: Build and install XGBoost - run: | - cd python-package - python --version - python -m build --sdist - pip install -v ./dist/xgboost-*.tar.gz - cd .. - python -c 'import xgboost' + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Install osx system dependencies + if: matrix.os == 'macos-13' + run: | + brew install ninja libomp + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + activate-environment: test + - name: Install build + run: | + conda install -c conda-forge python-build + - name: Display Conda env + run: | + conda info + conda list + - name: Build and install XGBoost + run: | + cd python-package + python --version + python -m build --sdist + pip install -v ./dist/xgboost-*.tar.gz + cd .. + python -c 'import xgboost' python-tests-on-macos: name: Test XGBoost Python package on ${{ matrix.os }} @@ -94,48 +94,48 @@ jobs: os: [macos-13] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: macos_cpu_test - environment-file: ops/conda_env/macos_cpu_test.yml - use-mamba: true - - - name: Display Conda env - run: | - conda info - conda list - - - name: Build XGBoost on macos - run: | - brew install ninja - - mkdir build - cd build - # Set prefix, to use OpenMP library from Conda env - # See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228 - # to learn why we don't use libomp from Homebrew. - cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON - ninja - - - name: Install Python package - run: | - cd python-package - python --version - pip install -v . - - - name: Test Python package - run: | - pytest -s -v -rxXs --durations=0 ./tests/python - - - name: Test Dask Interface - run: | - pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_dask + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: macos_cpu_test + environment-file: ops/conda_env/macos_cpu_test.yml + use-mamba: true + + - name: Display Conda env + run: | + conda info + conda list + + - name: Build XGBoost on macos + run: | + brew install ninja + + mkdir build + cd build + # Set prefix, to use OpenMP library from Conda env + # See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228 + # to learn why we don't use libomp from Homebrew. + cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON + ninja + + - name: Install Python package + run: | + cd python-package + python --version + pip install -v . + + - name: Test Python package + run: | + pytest -s -v -rxXs --durations=0 ./tests/python + + - name: Test Dask Interface + run: | + pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_dask python-system-installation-on-ubuntu: name: Test XGBoost Python package System Installation on ${{ matrix.os }} diff --git a/.github/workflows/python_wheels_macos.yml b/.github/workflows/python_wheels_macos.yml index a4cff8eb0e6f..f0f5042660df 100644 --- a/.github/workflows/python_wheels_macos.yml +++ b/.github/workflows/python_wheels_macos.yml @@ -30,26 +30,26 @@ jobs: - os: macos-14 platform_id: macosx_arm64 steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Set up homebrew - uses: Homebrew/actions/setup-homebrew@13341b4d5e459a98bbe0b122b12c11bf90518cc8 - - name: Install libomp - run: brew install libomp - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - python-version: "3.10" - use-mamba: true - - name: Build wheels - run: bash ops/pipeline/build-python-wheels-macos.sh ${{ matrix.platform_id }} ${{ github.sha }} - - name: Upload Python wheel - # if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') - run: | - python -m pip install awscli - python -m awscli s3 cp wheelhouse/*.whl s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/ --acl public-read --region us-west-2 - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Set up homebrew + uses: Homebrew/actions/setup-homebrew@13341b4d5e459a98bbe0b122b12c11bf90518cc8 + - name: Install libomp + run: brew install libomp + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + python-version: "3.10" + use-mamba: true + - name: Build wheels + run: bash ops/pipeline/build-python-wheels-macos.sh ${{ matrix.platform_id }} ${{ github.sha }} + - name: Upload Python wheel + # if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') + run: | + python -m pip install awscli + python -m awscli s3 cp wheelhouse/*.whl s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/ --acl public-read --region us-west-2 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }} diff --git a/.github/workflows/r_nold.yml b/.github/workflows/r_nold.yml index 4b506927e06c..6ff4aa079e95 100644 --- a/.github/workflows/r_nold.yml +++ b/.github/workflows/r_nold.yml @@ -22,23 +22,23 @@ jobs: container: image: rhub/debian-gcc-devel-nold steps: - - name: Install git and system packages - shell: bash - run: | - apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y - - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - with: - submodules: 'true' - - - name: Install dependencies - shell: bash -l {0} - run: | - /tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')" - - - name: Run R tests - shell: bash - run: | - cd R-package && \ - /tmp/R-devel/bin/R CMD INSTALL . && \ - /tmp/R-devel/bin/R -q -e "library(testthat); setwd('tests'); source('testthat.R')" + - name: Install git and system packages + shell: bash + run: | + apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y + + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + submodules: 'true' + + - name: Install dependencies + shell: bash -l {0} + run: | + /tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')" + + - name: Run R tests + shell: bash + run: | + cd R-package && \ + /tmp/R-devel/bin/R CMD INSTALL . && \ + /tmp/R-devel/bin/R -q -e "library(testthat); setwd('tests'); source('testthat.R')" diff --git a/.github/workflows/r_tests.yml b/.github/workflows/r_tests.yml index 3885c126f11e..f5e5152fa29a 100644 --- a/.github/workflows/r_tests.yml +++ b/.github/workflows/r_tests.yml @@ -32,47 +32,47 @@ jobs: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true steps: - - name: Install system dependencies - run: | - sudo apt update - sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev - if: matrix.os == 'ubuntu-latest' - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - - uses: r-lib/actions/setup-r@v2.11.0 - with: - r-version: ${{ matrix.r }} - - - name: Cache R packages - uses: actions/cache@v4.1.2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} - - - uses: actions/setup-python@v5.3.0 - with: - python-version: "3.10" - architecture: 'x64' - - - uses: r-lib/actions/setup-tinytex@v2 - - - name: Install dependencies - shell: Rscript {0} - run: | - source("./R-package/tests/helper_scripts/install_deps.R") - - - name: Test R - run: | - python ops/script/test_r_package.py --compiler='${{ matrix.compiler }}' --build-tool="${{ matrix.build }}" --task=check - if: matrix.compiler != 'none' - - - name: Test R - run: | - python ops/script/test_r_package.py --build-tool="${{ matrix.build }}" --task=check - if: matrix.compiler == 'none' + - name: Install system dependencies + run: | + sudo apt update + sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev + if: matrix.os == 'ubuntu-latest' + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + + - uses: r-lib/actions/setup-r@v2.11.0 + with: + r-version: ${{ matrix.r }} + + - name: Cache R packages + uses: actions/cache@v4.1.2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} + restore-keys: ${{ runner.os }}-r-${{ matrix.r }}-7-${{ hashFiles('R-package/DESCRIPTION') }} + + - uses: actions/setup-python@v5.3.0 + with: + python-version: "3.10" + architecture: 'x64' + + - uses: r-lib/actions/setup-tinytex@v2 + + - name: Install dependencies + shell: Rscript {0} + run: | + source("./R-package/tests/helper_scripts/install_deps.R") + + - name: Test R + run: | + python ops/script/test_r_package.py --compiler='${{ matrix.compiler }}' --build-tool="${{ matrix.build }}" --task=check + if: matrix.compiler != 'none' + + - name: Test R + run: | + python ops/script/test_r_package.py --build-tool="${{ matrix.build }}" --task=check + if: matrix.compiler == 'none' test-R-on-Debian: name: Test R package on Debian @@ -81,38 +81,38 @@ jobs: image: rhub/debian-gcc-release steps: - - name: Install system dependencies - run: | - # Must run before checkout to have the latest git installed. - # No need to add pandoc, the container has it figured out. - apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y - - - name: Trust git cloning project sources - run: | - git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - - name: Install dependencies - shell: bash -l {0} - run: | - Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')" - - - name: Test R - shell: bash -l {0} - run: | - python3 ops/script/test_r_package.py --r=/usr/bin/R --build-tool=autotools --task=check - - - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - r_package: - - 'R-package/**' - - - name: Run document check - if: steps.changes.outputs.r_package == 'true' - run: | - python3 ops/script/test_r_package.py --r=/usr/bin/R --task=doc + - name: Install system dependencies + run: | + # Must run before checkout to have the latest git installed. + # No need to add pandoc, the container has it figured out. + apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y + + - name: Trust git cloning project sources + run: | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + + - name: Install dependencies + shell: bash -l {0} + run: | + Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')" + + - name: Test R + shell: bash -l {0} + run: | + python3 ops/script/test_r_package.py --r=/usr/bin/R --build-tool=autotools --task=check + + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + r_package: + - 'R-package/**' + + - name: Run document check + if: steps.changes.outputs.r_package == 'true' + run: | + python3 ops/script/test_r_package.py --r=/usr/bin/R --task=doc diff --git a/.github/workflows/sycl_tests.yml b/.github/workflows/sycl_tests.yml index b317050fc652..467734607ea6 100644 --- a/.github/workflows/sycl_tests.yml +++ b/.github/workflows/sycl_tests.yml @@ -62,34 +62,34 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' - - uses: conda-incubator/setup-miniconda@v3.1.0 - with: - miniforge-variant: Miniforge3 - miniforge-version: latest - activate-environment: linux_sycl_test - environment-file: ops/conda_env/linux_sycl_test.yml - use-mamba: true + - uses: conda-incubator/setup-miniconda@v3.1.0 + with: + miniforge-variant: Miniforge3 + miniforge-version: latest + activate-environment: linux_sycl_test + environment-file: ops/conda_env/linux_sycl_test.yml + use-mamba: true - - name: Display Conda env - run: | - conda info - conda list - - name: Build XGBoost on Ubuntu - run: | - mkdir build - cd build - cmake .. -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -GNinja - ninja - - name: Install Python package - run: | - cd python-package - python --version - pip install -v . - - name: Test Python package - run: | - pytest -s -v -rxXs --durations=0 ./tests/python-sycl/ + - name: Display Conda env + run: | + conda info + conda list + - name: Build XGBoost on Ubuntu + run: | + mkdir build + cd build + cmake .. -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -GNinja + ninja + - name: Install Python package + run: | + cd python-package + python --version + pip install -v . + - name: Test Python package + run: | + pytest -s -v -rxXs --durations=0 ./tests/python-sycl/ diff --git a/.github/workflows/update_rapids.yml b/.github/workflows/update_rapids.yml index 636661db46b8..03a39f72b660 100644 --- a/.github/workflows/update_rapids.yml +++ b/.github/workflows/update_rapids.yml @@ -25,20 +25,20 @@ jobs: name: Check latest RAPIDS runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.2.2 - with: - submodules: 'true' - - name: Check latest RAPIDS and update conftest.sh - run: | - bash tests/buildkite/update-rapids.sh - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - if: github.ref == 'refs/heads/master' - with: - add-paths: | - tests/buildkite - branch: create-pull-request/update-rapids - base: master - title: "[CI] Update RAPIDS to latest stable" - commit-message: "[CI] Update RAPIDS to latest stable" + - uses: actions/checkout@v4.2.2 + with: + submodules: 'true' + - name: Check latest RAPIDS and update conftest.sh + run: | + bash tests/buildkite/update-rapids.sh + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + if: github.ref == 'refs/heads/master' + with: + add-paths: | + tests/buildkite + branch: create-pull-request/update-rapids + base: master + title: "[CI] Update RAPIDS to latest stable" + commit-message: "[CI] Update RAPIDS to latest stable"