diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 27195b379a61..24124593337b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -568,36 +568,20 @@ jobs: permissions: actions: read contents: read + id-token: write packages: read + pull-requests: read + secrets: inherit # zizmor: ignore[secrets-inherit] + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main strategy: fail-fast: false matrix: ${{ fromJSON(needs.java-build-matrix.outputs.matrix) }} - runs-on: linux-${{ matrix.ARCH }}-gpu-l4-latest-1 - container: - image: rapidsai/ci-wheel:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }} # zizmor: ignore[unpinned-images] - env: - NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - persist-credentials: false - - name: Download java-build artifact - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: cudf_java_${{ matrix.ARCH }}_cu${{ matrix.CUDA_MAJOR }} - path: java_pkg - - name: Run Java tests - env: - LIBCUDF_LARGE_STRINGS_ENABLED: "0" - run: | - . java/ci/java_classifier.sh - JAVA_JAR="$(cudf_java_resolve_artifact_jar java_pkg)" - export JAVA_JAR - ci/test_packaged_java.sh + with: + build_type: pull-request + arch: ${{ matrix.ARCH }} + node_type: "gpu-l4-latest-1" + container_image: "rapidsai/ci-wheel:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}" + script: "ci/test_packaged_java.sh" conda-notebook-tests: needs: [conda-python-build, conda-python-build-noarch, changed-files] permissions: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9ef2847a6dc2..1aaf1bdecda0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -161,6 +161,37 @@ jobs: arch: "amd64" container_image: "rapidsai/ci-conda:26.10-latest" script: "ci/test_java.sh" + # Test the packaged cuDF Java JAR built by build.yaml java-build for every Maven classifier. + java-build-matrix: + permissions: + contents: read + uses: rapidsai/shared-workflows/.github/workflows/compute-matrix.yaml@main + with: + build_type: ${{ inputs.build_type }} + matrix_name: conda-cpp-build + matrix_filter: 'map(. + {CUDA_MAJOR: (.CUDA_VER | split(".") | .[0])})' + java-tests: + needs: [java-build-matrix] + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read + secrets: inherit # zizmor: ignore[secrets-inherit] + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.java-build-matrix.outputs.matrix) }} + with: + build_type: ${{ inputs.build_type }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + arch: ${{ matrix.ARCH }} + node_type: "gpu-l4-latest-1" + container_image: "rapidsai/ci-wheel:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}" + script: "ci/test_packaged_java.sh" conda-notebook-tests: permissions: actions: read diff --git a/ci/test_packaged_java.sh b/ci/test_packaged_java.sh index dd5c1394413f..22d8f2738b76 100755 --- a/ci/test_packaged_java.sh +++ b/ci/test_packaged_java.sh @@ -5,11 +5,15 @@ # Run the Java tests against an already-packaged classifier JAR. # # Activates -Ppackaged-jar-tests so the surefire classpath uses the JAR at -# JAVA_JAR instead of a locally compiled target/classes tree. Caller places -# the JAR (e.g. via actions/download-artifact) before invoking this script. +# JAVA_JAR instead of a locally compiled target/classes tree. +# +# When JAVA_JAR is unset, download the java-build artifact via +# rapids-download-from-github (pr.yaml for PRs, build.yaml otherwise). # # Inputs (environment variables): -# JAVA_JAR Absolute path to the classifier JAR (required). +# JAVA_JAR Optional. Absolute path to the classifier JAR. +# If unset, the JAR is downloaded from the +# matching java-build artifact. # LIBCUDF_LARGE_STRINGS_ENABLED Optional; defaults to 0 (same as ci/test_java.sh). set -euo pipefail @@ -17,8 +21,34 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "${REPO_ROOT}" -if [[ -z ${JAVA_JAR:-} || ! -f ${JAVA_JAR} ]]; then - echo "Error: JAVA_JAR must point to an existing classifier JAR" >&2 +# shellcheck disable=SC1091 +. "${REPO_ROOT}/java/ci/java_classifier.sh" + +if [[ -z ${JAVA_JAR:-} ]]; then + if [[ -z ${RAPIDS_CUDA_VERSION:-} ]]; then + echo "Error: RAPIDS_CUDA_VERSION must be set when JAVA_JAR is unset" >&2 + exit 1 + fi + cuda_major="${RAPIDS_CUDA_VERSION%%.*}" + + # matrix.ARCH values are amd64/arm64; $(arch) / uname -m return x86_64/aarch64. + case "$(uname -m)" in + x86_64) java_arch=amd64 ;; + aarch64|arm64) java_arch=arm64 ;; + *) + echo "Error: unsupported host arch '$(uname -m)'" >&2 + exit 1 + ;; + esac + + rapids-logger "Downloading cudf_java_${java_arch}_cu${cuda_major}" + JAVA_PKG="$(rapids-download-from-github "cudf_java_${java_arch}_cu${cuda_major}")" + JAVA_JAR="$(cudf_java_resolve_artifact_jar "${JAVA_PKG}")" + export JAVA_JAR +fi + +if [[ ! -f ${JAVA_JAR} ]]; then + echo "Error: JAVA_JAR='${JAVA_JAR}' does not point to an existing file" >&2 exit 1 fi