env:
  DOCKER_CACHE_ECR_ID: "492475357299"
  DOCKER_CACHE_ECR_REGION: "us-west-2"
  DISABLE_RELEASE: "1"
    # Skip uploading artifacts to S3 bucket
    # Also, don't build all CUDA archs; just build sm_75
steps:
  - label: ":moneybag: Enforce daily budget"
    command: "tests/buildkite/enforce_daily_budget.sh"
    key: enforce-daily-budget
    agents:
      queue: pipeline-loader
  - wait
  - block: ":rocket: Run this test job"
    if: build.pull_request.id != null || build.branch =~ /^dependabot\//
  #### -------- CONTAINER BUILD --------
  - label: ":docker: Build containers"
    commands:
      - "tests/buildkite/build-containers.sh gpu"
      - "tests/buildkite/build-containers.sh gpu_build_rockylinux8"
      - "tests/buildkite/build-containers.sh jvm_gpu_build"
    key: build-containers
    agents:
      queue: linux-amd64-cpu
  - wait
  #### -------- BUILD --------
  - label: ":console: Build CUDA"
    command: "tests/buildkite/build-cuda.sh"
    key: build-cuda
    agents:
      queue: linux-amd64-cpu
  - label: ":console: Build and test JVM packages with CUDA"
    command: "tests/buildkite/build-jvm-packages-gpu.sh"
    key: build-jvm-packages-gpu
    agents:
      queue: linux-amd64-mgpu
  - wait
  #### -------- TEST --------
  - label: ":console: Run Google Tests"
    command: "tests/buildkite/test-cpp-mgpu.sh"
    key: test-cpp-mgpu
    agents:
      queue: linux-amd64-mgpu
  - label: ":console: Test Python package, 4 GPUs"
    command: "tests/buildkite/test-python-gpu.sh mgpu"
    key: test-python-mgpu
    agents:
      queue: linux-amd64-mgpu
