Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c156526
Make cuopt_static buildable for packaging, and add a scoped static build
ramakrishnap-nv Aug 27, 2026
bdb8905
Load the native library from the JAR, and package classifier JARs
ramakrishnap-nv Aug 27, 2026
e521ce7
Produce a working self-contained classifier JAR
ramakrishnap-nv Aug 27, 2026
2f626af
Build and verify the classifier JAR in CI
ramakrishnap-nv Aug 27, 2026
a0816cb
Run java-static-build on pull requests
ramakrishnap-nv Aug 27, 2026
87b17bb
Upload the classifier JARs as one Maven-repository-layout artifact
ramakrishnap-nv Aug 27, 2026
6df31e9
Build every classifier and gather them, following cuDF's layout
ramakrishnap-nv Aug 27, 2026
a4219ed
Run the whole Java suite against each classifier JAR
ramakrishnap-nv Aug 27, 2026
a623cc4
Add java-static-build-matrix to the pr-builder aggregator
ramakrishnap-nv Aug 27, 2026
78822d7
Route the new Maven calls through the retry wrapper
ramakrishnap-nv Aug 28, 2026
0c0fceb
Route Java console logging through System.out instead of native stdout
ramakrishnap-nv Aug 28, 2026
74325ec
Fix pre-commit findings: copyright year and clang-format alignment
ramakrishnap-nv Aug 28, 2026
9722612
Merge branch 'main' into java-static-classifiers
ramakrishnap-nv Aug 28, 2026
0bfbf4d
Patch vendored PSLP to respect verbose=false for its infeasible message
ramakrishnap-nv Aug 28, 2026
9558f83
Strip trailing whitespace from the PSLP patch file (pre-commit)
ramakrishnap-nv Aug 28, 2026
1ee37cb
Drop the trailing blank context line from the PSLP patch (pre-commit)
ramakrishnap-nv Aug 28, 2026
072308e
Pin PSLP past v0.0.11 to the merged fix commit instead of patching
ramakrishnap-nv Aug 31, 2026
59cc144
Merge the duplicate maven-surefire-plugin declaration into one
ramakrishnap-nv Aug 31, 2026
6f37f3d
Add console-log-sink diagnostics; temporarily skip non-Java CI for fa…
ramakrishnap-nv Aug 31, 2026
4bc2d27
Package cuDSS's OpenMP threading-layer plugin; dump Surefire fork-cra…
ramakrishnap-nv Aug 31, 2026
d468b48
Remove debug instrumentation and pr.yaml CI trimming used to root-cau…
ramakrishnap-nv Aug 31, 2026
fc6443a
Drop stale "Exploratory" framing; fix a misplaced job comment in buil…
ramakrishnap-nv Sep 1, 2026
88b49bd
Add java/cuopt/.mvn/maven.config to reduce Maven Central rate-limiting
ramakrishnap-nv Sep 1, 2026
2dad31c
Move java-static-test off conda onto rapidsai/ci-wheel; temporarily t…
ramakrishnap-nv Sep 1, 2026
f373279
Only attach source/javadoc jars when actually packaging, not on every…
ramakrishnap-nv Sep 1, 2026
458b062
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 1, 2026
c1f9a15
Fix arm64 libcublas UnsatisfiedLinkError; correct the Maven retry pro…
ramakrishnap-nv Sep 1, 2026
0002a06
Thread matrix.CUDA_VER into java-static-build's container env
ramakrishnap-nv Sep 1, 2026
ee920a8
Use a CUDA-version-pinned ci-conda image tag instead of an env-var ov…
ramakrishnap-nv Sep 1, 2026
ed2fc5e
Prefer the GCS Maven Central mirror over repo.maven.apache.org
ramakrishnap-nv Sep 2, 2026
c57b227
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 2, 2026
2101490
Clean up leftover debug/duplicate content from the merge
ramakrishnap-nv Sep 2, 2026
651e791
Address CodeRabbit review findings
ramakrishnap-nv Sep 2, 2026
073d518
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 2, 2026
b7497f1
Simplify NativeLibraryLoader's cache-reuse check back to a size compa…
ramakrishnap-nv Sep 2, 2026
050be90
Remove a stray duplicate console-log-callback declaration in logger.hpp
ramakrishnap-nv Sep 8, 2026
d55136d
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 11, 2026
662f2a3
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 15, 2026
6c4dfe2
Install a JDK 17 in java-static-test, matching pom.xml's release target
ramakrishnap-nv Sep 15, 2026
8b1e84d
Embed Google Highway's static archive into the Java classifier JAR
ramakrishnap-nv Sep 16, 2026
edcb475
Move the static Java build off ci-conda and rework dependency sourcing
ramakrishnap-nv Sep 16, 2026
9f1eddd
pr.yaml: switch java-static-build to ci-wheel; temporarily trim other CI
ramakrishnap-nv Sep 16, 2026
a2e0d39
Fix shellcheck, harden cuDSS companion resolution, add crash diagnostics
ramakrishnap-nv Sep 16, 2026
e703efb
Build cuOpt's own cuDSS threading-layer plugin against a modern libgomp
ramakrishnap-nv Sep 17, 2026
2ab52f9
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 17, 2026
3f03753
Regenerate conda environment files for the libgomp >=9 floor
ramakrishnap-nv Sep 17, 2026
4659c9a
Merge remote-tracking branch 'origin/main' into java-static-classifie…
ramakrishnap-nv Sep 18, 2026
6d3ace1
Retry the Maven tarball download on transient network failures
ramakrishnap-nv Sep 18, 2026
bc64107
Fetch Maven from dlcdn.apache.org instead of archive.apache.org
ramakrishnap-nv Sep 18, 2026
27afd1f
pr.yaml: revert the TEMP DEBUG CI trim now that CI is green
ramakrishnap-nv Sep 18, 2026
50b1469
Add Java -SNAPSHOT versioning; drop java-static-gather from pr.yaml
ramakrishnap-nv Sep 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,104 @@ jobs:
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/build_cpp.sh
java-static-build-matrix:
permissions:
contents: read
uses: rapidsai/shared-workflows/.github/workflows/compute-matrix.yaml@main
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
with:
build_type: ${{ inputs.build_type || 'branch' }}
matrix_name: conda-cpp-build
matrix_filter: 'map(. + {CUDA_MAJOR: (.CUDA_VER | split(".") | .[0])}) | unique_by([.ARCH, .CUDA_MAJOR])'

java-static-build:
needs: [build-details, java-static-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-static-build-matrix.outputs.matrix) }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
node_type: "cpu16"
arch: ${{ matrix.ARCH }}
# Must be CUDA-version-pinned, not the bare "26.10-latest" tag: custom-job.yaml has no
# per-matrix env passthrough, so an untagged image would leave RAPIDS_CUDA_VERSION at
# that image's single baked-in default for every matrix entry.
# ci/build_java_static.sh reads it to pick the conda CUDA toolkit, so every "cuN" classifier
# JAR would actually be built against the same CUDA version and just mislabeled. Matches
# the pattern conda-cpp-build.yaml itself uses for this image family.
container_image: "rapidsai/ci-conda:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be using the wheel/Rocky 8 image here in order to avoid issues like this: NVIDIA/cudf#23753

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — switched to rapidsai/ci-wheel (Rocky 8) here, matching cuDF's own fix for this exact issue (NVIDIA/cudf#23766). See the comment just above this line for the full reasoning, and setup_java_static_env.sh for how every C++ build dependency (Boost/TBB/cuDSS via dnf, rmm/rapids_logger via prebuilt wheels, Maven) is sourced without conda in this environment.

script: "ci/build_java_static.sh"
artifact-name: "cuopt_java_${{ matrix.ARCH }}_cu${{ matrix.CUDA_MAJOR }}"
file_to_upload: "java/cuopt/classifier-jars/"

# Runs the full Java suite against each classifier JAR on a GPU, with no libcuopt installed,
# so a JAR that loads but computes wrong answers fails here rather than at a user.
java-static-test:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the general pattern is to have the (nightly) test job be defined in the test.yaml file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — java-static-test now lives in test.yaml, dispatched from build.yaml's tests job the same way the other nightly test jobs are, with its own matrix recomputed there since a separate workflow run can't read build.yaml's job outputs directly.

needs: [java-static-build, java-static-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-static-build-matrix.outputs.matrix) }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
node_type: "gpu-l4-latest-1"
arch: ${{ matrix.ARCH }}
# A plain CUDA-devel + dnf environment rather than rapidsai/ci-conda: see the matching
# comment in pr.yaml.
container_image: "rapidsai/ci-wheel:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}"
script: "ci/test_java_static.sh"

# Combines every classifier into one Maven-repository-layout artifact, which is the form a
# publishing workflow consumes. See rapidsai/build-infra#379.
java-static-gather:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artifact from the last PR job run: https://github.com/NVIDIA/cuopt/actions/runs/35367985039/job/105683600034 has the following directory layout: com/nvidia/cuopt/cuopt/26.10.0/. cuopt is repeated twice. Also, I noticed that there is no -SNAPSHOT suffix for these builds.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two separate things here:

  1. cuopt repeated twice in the path — that's expected Maven convention, not a bug: groupId is com.nvidia.cuopt, artifactId is cuopt, and a standard repo layout is <groupId-as-path>/<artifactId>/<version>/, so the last groupId segment and the artifactId legitimately collide here (same as e.g. Guava's com/google/guava/guava/<version>/).
  2. Missing -SNAPSHOT — this one's real. Fixed: pom.xml now carries 26.10.0-SNAPSHOT, and update-version.sh appends -SNAPSHOT on every bump, matching cuDF's java/pom.xml convention (always a snapshot in the source tree; only an actual Maven Central release would strip it as a separate step). This was pre-existing on main, not introduced by this PR — just newly visible since this is the first thing to actually assemble a Maven repo layout. Also had to fix assemble_maven_repo.sh's version-extraction regex, which split on the first hyphen in the JAR filename and would've truncated at -SNAPSHOT; it now anchors on the classifier's own fixed shape (cuda<major>[-arm64]) instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding 1 above, the path is valid for com.nvidia.cuopt:cuopt, but com.nvidia:cuopt is more consistent with long-standing RAPIDS Java projects such as com.nvidia:spark-rapids-jni, com.nvidia:rapids-4-spark_2.13, ai.rapids:cudf, etc. Guava is structured differently. com.google.guava contains related artifacts such as guava-testlib, guava-gwt, etc. Is com.nvidia.cuopt intended as a namespace for multiple artifacts (or separately delegated ownership)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we might have multiple packages under cuopt namespace, so I think other option is better. Is there a particular reason for RAPIDS to adhere to that standard ?

needs: [java-static-build]
runs-on: linux-amd64-cpu4
permissions:
contents: read
steps:
- name: Checkout code repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ inputs.sha }}
persist-credentials: false
- name: Download per-classifier JAR artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: cuopt_java_*
path: ${{ runner.temp }}/jars
merge-multiple: true
- name: Assemble Maven repository layout
run: |
./java/cuopt/ci/assemble_maven_repo.sh \
--jars-dir "${RUNNER_TEMP}/jars" \
--output-dir "${RUNNER_TEMP}/maven-repo"
- name: Upload combined Maven repository artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cuopt_java_maven_repo
path: ${{ runner.temp }}/maven-repo
if-no-files-found: error

java-build:
needs: cpp-build
permissions:
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
- conda-cpp-build
- conda-cpp-tests
- java-build
- java-static-build-matrix
- java-static-build
- java-static-test
- java-static-gather
- conda-python-build
- conda-python-tests
- docs-build
Expand Down Expand Up @@ -113,6 +117,7 @@ jobs:
- '!SECURITY.md'
- '!ci/build_wheel*.sh'
- '!ci/build_java.sh'
- '!ci/build_java_static.sh'
- '!ci/check_style.sh'
- '!ci/docker/**'
- '!ci/release/**'
Expand Down Expand Up @@ -178,6 +183,7 @@ jobs:
- '!agents/**'
- '!ci/build_docs.sh'
- '!ci/build_java.sh'
- '!ci/build_java_static.sh'
- '!ci/build_python.sh'
- '!ci/build_wheel*.sh'
- '!ci/check_style.sh'
Expand Down Expand Up @@ -213,6 +219,7 @@ jobs:
test_java:
- 'java/**'
- 'ci/build_java.sh'
- 'ci/build_java_static.sh'
- 'ci/test_java.sh'
- 'dependencies.yaml'
- '.github/workflows/pr.yaml'
Expand Down Expand Up @@ -262,6 +269,7 @@ jobs:
- '!agents/**'
- '!ci/build_docs.sh'
- '!ci/build_java.sh'
- '!ci/build_java_static.sh'
- '!ci/build_wheel*.sh'
- '!ci/check_style.sh'
- '!ci/docker/**'
Expand Down Expand Up @@ -337,6 +345,7 @@ jobs:
- '!ci/build_docs.sh'
- '!ci/build_python.sh'
- '!ci/build_java.sh'
- '!ci/build_java_static.sh'
- '!ci/check_style.sh'
- '!ci/docker/**'
- '!ci/release/**'
Expand Down Expand Up @@ -477,6 +486,112 @@ jobs:
artifact-name: "cuopt_docs"
container_image: "rapidsai/ci-conda:26.10-latest"
script: "ci/build_docs.sh"
# Compiles libcuopt from source (one self-contained classifier JAR per CUDA major and
# architecture), so this does not need conda-cpp-build. See #1817.
java-static-build-matrix:
needs: changed-files
permissions:
contents: read
uses: rapidsai/shared-workflows/.github/workflows/compute-matrix.yaml@main
if: >-
fromJSON(needs.changed-files.outputs.changed_file_groups).test_java ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
matrix_name: conda-cpp-build
matrix_filter: 'map(. + {CUDA_MAJOR: (.CUDA_VER | split(".") | .[0])}) | unique_by([.ARCH, .CUDA_MAJOR])'

java-static-build:
needs: [java-static-build-matrix, changed-files]
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-static-build-matrix.outputs.matrix) }}
if: >-
fromJSON(needs.changed-files.outputs.changed_file_groups).test_java ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
node_type: "cpu16"
arch: ${{ matrix.ARCH }}
# Must be CUDA-version-pinned, not the bare "26.10-latest" tag: custom-job.yaml has no
# per-matrix env passthrough, so an untagged image would leave RAPIDS_CUDA_VERSION at
# that image's single baked-in default for every matrix entry.
# ci/build_java_static.sh reads it to pick the conda CUDA toolkit, so every "cuN" classifier
# JAR would actually be built against the same CUDA version and just mislabeled. Matches
# the pattern conda-cpp-build.yaml itself uses for this image family.
container_image: "rapidsai/ci-conda:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about using the wheel/Rocky 8 image here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — same switch to rapidsai/ci-wheel here as build.yaml/test.yaml.

script: "ci/build_java_static.sh"
artifact-name: "cuopt_java_${{ matrix.ARCH }}_cu${{ matrix.CUDA_MAJOR }}"
file_to_upload: "java/cuopt/classifier-jars/"

# Runs the full Java suite against each classifier JAR on a GPU, with no libcuopt installed,
# so a JAR that loads but computes wrong answers fails here rather than at a user.
java-static-test:
needs: [java-static-build, java-static-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-static-build-matrix.outputs.matrix) }}
with:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: ${{ matrix.ARCH }}
# A plain CUDA-devel + dnf environment rather than rapidsai/ci-conda: the packaged JAR
# only needs a JDK, Maven and the CUDA runtime (libcublas/libcusparse, already in this
# image) to test, and a fresh `conda create` every run was slow enough that concurrent
# matrix jobs' cold Maven Central resolution reliably lined up and triggered 429s.
container_image: "rapidsai/ci-wheel:26.10-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}"
script: "ci/test_java_static.sh"
# Surefire fork-crash diagnostics (dumpstream/hs_err files) are also printed inline by
# the script on failure, but keep the raw reports downloadable too -- the JVM sometimes
# crashes without a clean dumpstream, and per-matrix-entry artifacts survive independently
# of how much of the console log GitHub keeps.
artifact-name: "cuopt_java_static_test_${{ matrix.ARCH }}_cu${{ matrix.CUDA_MAJOR }}"
file_to_upload: "java/cuopt/target/surefire-reports/"

java-static-gather:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job can be temporarily added for testing but should not be part of pr.yaml/run for every PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed java-static-gather from pr.yaml (job and its pr-builder needs entry). It already exists in build.yaml for nightly/branch-push, and doesn't validate anything java-static-build/java-static-test don't already cover, so it had no reason to run on every PR.

needs: [java-static-build]
runs-on: linux-amd64-cpu4
permissions:
contents: read
steps:
- name: Checkout code repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Download per-classifier JAR artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: cuopt_java_*
path: ${{ runner.temp }}/jars
merge-multiple: true
- name: Assemble Maven repository layout
run: |
./java/cuopt/ci/assemble_maven_repo.sh \
--jars-dir "${RUNNER_TEMP}/jars" \
--output-dir "${RUNNER_TEMP}/maven-repo"
- name: Upload combined Maven repository artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cuopt_java_maven_repo
path: ${{ runner.temp }}/maven-repo
if-no-files-found: error

java-build:
needs: [conda-cpp-build, changed-files]
permissions:
Expand Down
70 changes: 70 additions & 0 deletions ci/build_java_static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Builds a self-contained Java classifier JAR and checks that it is actually self-contained.
#
# Unlike ci/build_java.sh, which installs a prebuilt libcuopt and links it as a shared library,
# this compiles libcuopt from source as a static archive and embeds it, so the JAR is the only
# thing a consumer installs. See #1817.

set -euo pipefail

if [[ -e /opt/conda/etc/profile.d/conda.sh ]]; then
. /opt/conda/etc/profile.d/conda.sh
fi

rapids-logger "Configuring conda strict channel priority"
conda config --set channel_priority strict

rapids-logger "Generating Java static build dependencies"
ENV_YAML_DIR=$(mktemp -d)
rapids-dependency-file-generator \
--output conda \
--file-key java_static \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee "${ENV_YAML_DIR}/env.yaml"

rapids-mamba-retry env create --yes -f "${ENV_YAML_DIR}/env.yaml" -n java_static

# Temporarily allow unbound variables for conda activation.
set +u
conda activate java_static
set -u

rapids-print-env

export CUOPT_PREFIX="${CONDA_PREFIX}"
STATIC_BUILD_DIR="${PWD}/cpp/build-static"
JNI_BUILD_DIR="${PWD}/java/cuopt/build/native-static"
JAR_OUTPUT_DIR="${PWD}/java/cuopt/classifier-jars"

rapids-logger "Building the scoped static libcuopt"
BUILD_DIR="${STATIC_BUILD_DIR}" bash java/cuopt/ci/build_static_libcuopt.sh

rapids-logger "Linking libcuopt into cuopt_jni"
cmake -S java/cuopt -B "${JNI_BUILD_DIR}" -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCUOPT_PREFIX="${CUOPT_PREFIX}" \
-DCUOPT_STATIC_BUILD_DIR="${STATIC_BUILD_DIR}" \
-DCUOPT_EXTRA_INCLUDE_DIRS="${PWD}/cpp/include;${STATIC_BUILD_DIR}/include"
cmake --build "${JNI_BUILD_DIR}" --parallel "${PARALLEL_LEVEL:-$(nproc)}"

rapids-logger "Packaging the classifier JAR"
bash java/cuopt/ci/build_cuopt_java_jar.sh \
--native-lib "${JNI_BUILD_DIR}/libcuopt_jni.so" \
--cuda-version "${RAPIDS_CUDA_VERSION}" \
--output-dir "${JAR_OUTPUT_DIR}"

# The JAR looking fine on this machine proves nothing: the build environment supplies every
# dependency by construction. This resolves them the way a consumer's machine would.
rapids-logger "Verifying the JAR is self-contained"
CLASSIFIER_JAR=$(find "${JAR_OUTPUT_DIR}" -name 'cuopt-*.jar' \
! -name '*-sources.jar' ! -name '*-javadoc.jar' -print -quit)
bash java/cuopt/ci/verify_jar_dependencies.sh --jar "${CLASSIFIER_JAR}"

# The gather job combines the classifier directories from every matrix entry into one Maven
# repository layout; this job uploads its own directory as-is.
rapids-logger "Result"
du -h "${CLASSIFIER_JAR}" | sed 's/^/ /'
find "${JAR_OUTPUT_DIR}" -type f | sed "s|^${JAR_OUTPUT_DIR}/| |" | sort
Loading
Loading