Avoid .from_pandas classmethod constructor in tests #15094
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: JVM Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'release_*' | |
| pull_request: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| BRANCH_NAME: >- | |
| ${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }} | |
| jobs: | |
| ci-configure: | |
| name: Configure variables for CI | |
| runs-on: | |
| - runs-on=${{ github.run_id }} | |
| - runner=linux-amd64-cpu | |
| - tag=jvm-tests-ci-configure | |
| steps: | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/[email protected] | |
| with: | |
| mask-password: 'false' | |
| registries: '492475357299' | |
| - uses: actions/[email protected] | |
| - name: Get image tag | |
| id: get-image-tag | |
| run: | | |
| source ops/pipeline/get-image-tag.sh | |
| echo "Using image tag $IMAGE_TAG" | |
| echo "image_tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT" | |
| outputs: | |
| docker_registry: ${{ steps.login-ecr.outputs.registry }} | |
| docker_username: ${{ steps.login-ecr.outputs.docker_username_492475357299_dkr_ecr_us_west_2_amazonaws_com }} | |
| docker_password: ${{ steps.login-ecr.outputs.docker_password_492475357299_dkr_ecr_us_west_2_amazonaws_com }} | |
| image_tag: ${{ steps.get-image-tag.outputs.image_tag }} | |
| build-jvm-manylinux2014: | |
| name: >- | |
| Build libxgboost4j.so targeting glibc 2.17 | |
| (arch ${{ matrix.arch }}, runner ${{ matrix.runner }}) | |
| runs-on: | |
| - runs-on | |
| - runner=${{ matrix.runner }} | |
| - run-id=${{ github.run_id }} | |
| - tag=jvm-tests-build-jvm-manylinux2014-${{ matrix.arch }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: aarch64 | |
| runner: linux-arm64-cpu | |
| - arch: x86_64 | |
| runner: linux-amd64-cpu | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - name: Log into Docker registry (AWS ECR) | |
| run: bash ops/pipeline/login-docker-registry.sh | |
| - run: bash ops/pipeline/build-jvm-manylinux2014.sh ${{ matrix.arch }} | |
| build-jvm-gpu: | |
| name: Build libxgboost4j.so with CUDA | |
| needs: ci-configure | |
| runs-on: | |
| - runs-on=${{ github.run_id }} | |
| - runner=linux-amd64-cpu | |
| - tag=jvm-tests-build-jvm-gpu | |
| - extras=s3-cache | |
| container: | |
| image: ${{ needs.ci-configure.outputs.docker_registry }}/xgb-ci.jvm_gpu_build:${{ needs.ci-configure.outputs.image_tag }} | |
| credentials: | |
| username: ${{ needs.ci-configure.outputs.docker_username }} | |
| password: ${{ needs.ci-configure.outputs.docker_password }} | |
| steps: | |
| - uses: runs-on/action@v2 | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - uses: dmlc/xgboost-devops/actions/sccache@main | |
| - name: Build libxgboost4j.so with CUDA | |
| run: bash ops/pipeline/build-jvm-gpu.sh | |
| - run: sccache --show-stats | |
| - name: Stash files | |
| run: | | |
| python3 ops/pipeline/manage-artifacts.py upload \ | |
| --s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \ | |
| --prefix cache/${{ github.run_id }}/build-jvm-gpu \ | |
| lib/libxgboost4j.so | |
| build-jvm-mac: | |
| name: "Build libxgboost4j.dylib for ${{ matrix.description }}" | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - description: "MacOS (Apple Silicon)" | |
| libname: libxgboost4j_m1.dylib | |
| runner: macos-14 | |
| - description: "MacOS (Intel)" | |
| libname: libxgboost4j_intel.dylib | |
| runner: macos-15-intel | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - uses: dmlc/xgboost-devops/actions/sccache@main | |
| with: | |
| cache-key-prefix: ${{ github.job }}-${{ matrix.runner }} | |
| - run: bash ops/pipeline/build-jvm-macos.sh | |
| - run: sccache --show-stats | |
| - name: Upload libxgboost4j.dylib | |
| if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_') | |
| run: | | |
| mv -v lib/libxgboost4j.dylib ${{ matrix.libname }} | |
| python3 ops/pipeline/manage-artifacts.py upload \ | |
| --s3-bucket xgboost-nightly-builds \ | |
| --prefix ${{ env.BRANCH_NAME }}/${{ github.sha }} --make-public \ | |
| ${{ matrix.libname }} | |
| 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-test-jvm-packages-linux: | |
| name: Build and test JVM packages (Linux, Scala ${{ matrix.scala_version }}) | |
| needs: ci-configure | |
| runs-on: | |
| - runs-on=${{ github.run_id }} | |
| - runner=linux-amd64-cpu | |
| - tag=jvm-tests-build-test-jvm-packages-scala${{ matrix.scala_version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| scala_version: ["2.12", "2.13"] | |
| container: | |
| image: ${{ needs.ci-configure.outputs.docker_registry }}/xgb-ci.jvm:${{ needs.ci-configure.outputs.image_tag }} | |
| credentials: | |
| username: ${{ needs.ci-configure.outputs.docker_username }} | |
| password: ${{ needs.ci-configure.outputs.docker_password }} | |
| env: | |
| SCALA_VERSION: ${{ matrix.scala_version }} | |
| steps: | |
| - uses: runs-on/action@v2 | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - name: Build and test JVM packages (Scala ${{ matrix.scala_version }}) | |
| run: bash ops/pipeline/build-test-jvm-packages.sh | |
| - name: Stash files | |
| run: | | |
| python3 ops/pipeline/manage-artifacts.py upload \ | |
| --s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \ | |
| --prefix cache/${{ github.run_id }}/build-test-jvm-packages \ | |
| lib/libxgboost4j.so | |
| if: matrix.scala_version == '2.13' | |
| build-test-jvm-packages-other-os: | |
| name: Build and test JVM packages (${{ matrix.os }}) | |
| timeout-minutes: 30 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-15-intel] | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: 'true' | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '8' | |
| - uses: dmlc/xgboost-devops/actions/miniforge-setup@main | |
| with: | |
| environment-name: minimal | |
| environment-file: ops/conda_env/minimal.yml | |
| - name: Cache Maven packages | |
| uses: actions/[email protected] | |
| 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) on macos | |
| if: matrix.os == 'macos-15-intel' | |
| run: | | |
| cd jvm-packages | |
| mvn test -B -pl :xgboost4j_2.12 -Duse.openmp=OFF | |
| - name: Test XGBoost4J (Core) on windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| cd jvm-packages | |
| mvn test -B -pl :xgboost4j_2.12 | |
| - name: Publish artifact xgboost4j.dll to S3 | |
| run: | | |
| python ops/pipeline/manage-artifacts.py upload ` | |
| --s3-bucket xgboost-nightly-builds ` | |
| --prefix ${{ env.BRANCH_NAME }}/${{ github.sha }} --make-public ` | |
| lib/xgboost4j.dll | |
| 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 (Scala ${{ matrix.scala_version }}) | |
| needs: [ci-configure, build-jvm-gpu] | |
| runs-on: | |
| - runs-on=${{ github.run_id }} | |
| - runner=linux-amd64-mgpu | |
| - tag=jvm-tests-test-jvm-packages-gpu-scala${{ matrix.scala_version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| scala_version: ["2.12", "2.13"] | |
| container: | |
| image: ${{ needs.ci-configure.outputs.docker_registry }}/xgb-ci.jvm_gpu_build:${{ needs.ci-configure.outputs.image_tag }} | |
| credentials: | |
| username: ${{ needs.ci-configure.outputs.docker_username }} | |
| password: ${{ needs.ci-configure.outputs.docker_password }} | |
| options: --gpus all --shm-size=4g --privileged | |
| env: | |
| SCALA_VERSION: ${{ matrix.scala_version }} | |
| USE_CUDA: "1" | |
| SKIP_NATIVE_BUILD: "1" | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - name: Unstash files | |
| run: | | |
| python3 ops/pipeline/manage-artifacts.py download \ | |
| --s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \ | |
| --prefix cache/${{ github.run_id }}/build-jvm-gpu \ | |
| --dest-dir lib \ | |
| libxgboost4j.so | |
| - name: Test JVM packages with CUDA | |
| run: bash ops/pipeline/build-test-jvm-packages.sh | |
| deploy-jvm-packages: | |
| name: Deploy JVM packages to S3 (${{ matrix.variant.name }}, Scala ${{ matrix.scala_version }}) | |
| needs: [ci-configure, build-jvm-gpu, build-test-jvm-packages-linux, test-jvm-packages-gpu] | |
| runs-on: | |
| - runs-on=${{ github.run_id }} | |
| - runner=linux-amd64-cpu | |
| - tag=jvm-tests-deploy-jvm-packages-${{ matrix.variant.name }}-scala${{ matrix.scala_version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| variant: | |
| - name: cpu | |
| image_repo: xgb-ci.jvm | |
| artifact_from: build-test-jvm-packages | |
| - name: gpu | |
| image_repo: xgb-ci.jvm_gpu_build | |
| artifact_from: build-jvm-gpu | |
| scala_version: ['2.12', '2.13'] | |
| container: | |
| image: ${{ needs.ci-configure.outputs.docker_registry }}/${{ matrix.variant.image_repo }}:${{ needs.ci-configure.outputs.image_tag }} | |
| credentials: | |
| username: ${{ needs.ci-configure.outputs.docker_username }} | |
| password: ${{ needs.ci-configure.outputs.docker_password }} | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: "true" | |
| - name: Unstash files | |
| run: | | |
| python3 ops/pipeline/manage-artifacts.py download \ | |
| --s3-bucket ${{ env.RUNS_ON_S3_BUCKET_CACHE }} \ | |
| --prefix cache/${{ github.run_id }}/${{ matrix.variant.artifact_from }} \ | |
| --dest-dir lib \ | |
| libxgboost4j.so | |
| ls -lh lib/libxgboost4j.so | |
| - name: Deploy JVM packages to S3 | |
| run: bash ops/pipeline/deploy-jvm-packages.sh ${{ matrix.variant.name }} ${{ matrix.scala_version }} | |
| if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release_') |