-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add cuDF JAR build support for all Maven classifiers #23261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
66e67c6
4e8d9db
f6b02ea
0014c45
0a36e2f
c96d3b6
04f7316
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,100 @@ | ||
| # Build Jar artifact of cuDF | ||
|
|
||
| ## Build the docker image | ||
| ## Recommended: self-contained release build scripts | ||
|
|
||
| ### Prerequisite | ||
| The scripts under `java/ci/` build the cuDF Java JAR for every Maven classifier the | ||
| same way locally and in CI (GitHub Actions is only a thin wrapper that adds | ||
| artifact upload/download). Each script pulls the RAPIDS `ci-conda` build image, | ||
| runs the build in a throwaway container, and writes its output to a host | ||
| directory. No local `docker build` is required, and no GPU is required to build. | ||
|
|
||
| 1. Docker should be installed. | ||
| 2. [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) should be installed. | ||
| ### Prerequisites | ||
|
|
||
| 1. Docker is installed and the current user can run `docker`. | ||
| 2. Network access to pull `rapidsai/ci-conda:<rapids_version>-latest`. | ||
|
|
||
| ### Local one-command shortcut | ||
|
|
||
| For local testing only, `java/ci/test_java_build_local.sh` runs Steps 1-3 end-to-end for both CUDA 12 and CUDA 13 on the host architecture. | ||
|
|
||
| ```bash | ||
| ./java/ci/test_java_build_local.sh --work-dir /tmp/java-build-test | ||
| ``` | ||
|
|
||
| ### Step 1 - Build the static libcudf install tree | ||
|
|
||
| ```bash | ||
| ./java/ci/build_static_libcudf.sh --output-dir /tmp/libcudf-cuda12 --cuda-version 12.9 | ||
| ``` | ||
|
|
||
| This produces a static libcudf install tree (`lib/libcudf.a` plus its static | ||
| dependencies) under the given output directory. Build outputs are host-user-owned | ||
| so plain `rm -rf` works. | ||
|
|
||
| ### Step 2 - Package the cuDF Java JAR for one classifier | ||
|
|
||
| ```bash | ||
| ./java/ci/build_cudf_java_jar.sh \ | ||
| --libcudf-dir /tmp/libcudf-cuda12 \ | ||
| --output-dir /tmp/jars \ | ||
| --cuda-version 12.9 | ||
| ``` | ||
|
|
||
| This compiles the JNI layer against the static libcudf from Step 1 and emits a | ||
| single classifier JAR (e.g. `cudf-26.08.0-SNAPSHOT-cuda12.jar`) plus its POM | ||
| into a classifier-named subdirectory under `--output-dir`: | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Label the directory-tree code fences.
Also applies to: 75-75 🧰 Tools🪛 markdownlint-cli2 (0.23.0)[warning] 47-47: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| /tmp/jars/cuda12/ | ||
| cudf-26.08.0-SNAPSHOT-cuda12.jar | ||
| cudf-26.08.0-SNAPSHOT.pom | ||
| ``` | ||
|
|
||
| The classifier is derived from `--cuda-version` (major) + host arch (`uname | ||
| -m`): `cuda12` / `cuda13` on `x86_64`, `cuda12-arm64` / `cuda13-arm64` on | ||
| `aarch64`. Producing the ARM classifiers requires a real `aarch64` host. | ||
| Repeat Step 2 for each classifier, pointing `--libcudf-dir` at the matching | ||
| static libcudf tree and using the same `--output-dir` (each classifier lands | ||
| in its own subdirectory). Concurrent invocations for different classifiers | ||
| are safe because each nests its own bind-mount over `/repo/java/target` | ||
| inside the container. | ||
|
|
||
| ### Step 3 - Assemble the Maven repository layout | ||
|
|
||
| ```bash | ||
| ./java/ci/assemble_maven_repo.sh \ | ||
| --jars-dir /tmp/jars \ | ||
| --output-dir /tmp/maven-repo | ||
| ``` | ||
|
|
||
| This walks every subdirectory of `--jars-dir` (each subdir name IS the | ||
| classifier), gathers the per-classifier JAR and shared POM, derives the | ||
| artifact version from the JAR filenames (requiring a single unique version | ||
| across subdirs), and lays them out as: | ||
|
|
||
| ``` | ||
| /tmp/maven-repo/ai/rapids/cudf/26.08.0-SNAPSHOT/ | ||
| cudf-26.08.0-SNAPSHOT-cuda12.jar | ||
| cudf-26.08.0-SNAPSHOT-cuda13.jar | ||
| cudf-26.08.0-SNAPSHOT.pom | ||
| ``` | ||
|
|
||
| The set of classifiers is whatever subdirectories are present under | ||
| `--jars-dir`. For a local `x86_64`-only run, populate `/tmp/jars/cuda12/` | ||
| and `/tmp/jars/cuda13/`. For the full four-way release build, add | ||
| `/tmp/jars/cuda12-arm64/` and `/tmp/jars/cuda13-arm64/`. | ||
|
|
||
| In GitHub Actions (`.github/workflows/build.yaml`), the `java-build` matrix job | ||
| runs Steps 1-2 per (CUDA x arch) entry and uploads each classifier subdir as a | ||
| per-entry artifact. The separate `java-gather` job downloads them (with | ||
| `merge-multiple: true`, so all subdirs land in a single parent dir), runs | ||
| Step 3, and uploads the combined `cudf_java_maven_repo` artifact. | ||
|
|
||
| ## Legacy: manual Dockerfile.rocky build (obsolete) | ||
|
|
||
| > The `java/ci/Dockerfile.rocky` + `java/ci/build-in-docker.sh` flow below is the | ||
| > old build path. It is retained for reference but superseded by the | ||
| > self-contained scripts above. | ||
|
|
||
| ### Build the docker image | ||
|
|
||
|
|
@@ -20,32 +109,24 @@ The following CUDA versions are supported w/ CUDA Enhanced Compatibility: | |
| Change the --build-arg CUDA_VERSION to what you need. | ||
| You can replace the tag "cudf-build:12.9.1-devel-rocky8" with another name you like. | ||
|
|
||
| ## Start the docker then build | ||
|
|
||
| ### Start the docker | ||
| ### Start the docker then build | ||
|
|
||
| Run below command to start a docker container with GPU. | ||
| ```bash | ||
| nvidia-docker run -it cudf-build:12.9.1-devel-rocky8 bash | ||
| ``` | ||
|
|
||
| ### Download the cuDF source code | ||
|
|
||
| You can download the cuDF repo in the docker container or you can mount it into the container. | ||
| Here I choose to download again in the container. | ||
| ```bash | ||
| git clone --recursive https://github.com/rapidsai/cudf.git -b main | ||
| ``` | ||
|
|
||
| ### Build cuDF jar with devtoolset | ||
|
|
||
| ```bash | ||
| cd cudf | ||
| export WORKSPACE=`pwd` | ||
| source java/ci/env.sh | ||
| ${sclCMD} "java/ci/build-in-docker.sh" | ||
| ``` | ||
|
|
||
| ### The output | ||
|
|
||
| You can find the cuDF jar in java/target/ like cudf-26.08.0-SNAPSHOT-cuda12.jar. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Shared argparse helpers for the java/ci/ host orchestrator scripts. | ||
| # Meant to be sourced, not executed: | ||
| # . "${SCRIPT_DIR}/argparse.sh" | ||
|
|
||
| # require_value <flag_name> <value> | ||
| # Check: exit 1 when <value> is empty (i.e. the flag was passed | ||
| # without its argument, or was the last token on the command line). | ||
| require_value() { | ||
| local flag=$1 | ||
| local value=$2 | ||
| if [[ -z ${value} ]]; then | ||
| echo "Error: ${flag} requires a value" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| # require_arg <flag_name> <value> | ||
| # Check: assert that a required flag was actually supplied by the | ||
| # caller. Prints the script's print_help (if defined) then exits 1 on failure. | ||
| # Preserves the existing behavior of showing help after a "required flag missing" | ||
| # error. | ||
| require_arg() { | ||
| local flag=$1 | ||
| local value=$2 | ||
| if [[ -z ${value} ]]; then | ||
| echo "Error: ${flag} is required." >&2 | ||
| if declare -F print_help > /dev/null; then | ||
| print_help | ||
| fi | ||
| exit 1 | ||
| fi | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.