-
Notifications
You must be signed in to change notification settings - Fork 238
docs: make Java bindings discoverable, documented, and installable via the selector #1999
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
636c9de
5bd0507
4a41b98
d8ba39b
8a2e9b6
f080e6e
0e64c31
263e09d
7ef2c5c
d6e7dc7
5b4a760
1e7667c
126f1e2
1a9a250
8007ae8
6e2de82
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 |
|---|---|---|
|
|
@@ -36,6 +36,20 @@ | |
| var V_CONDA_NEXT = nextMajor + "." + (nextMinor < 10 ? "0" : "") + nextMinor; | ||
| var V_NEXT = nextMajor + "." + nextMinor; | ||
|
|
||
| function pipInstall(pkg, cudaSuffix, version, nightly) { | ||
| var name = pkg + (cudaSuffix ? "-" + cudaSuffix : ""); | ||
| var flags = nightly | ||
| ? "--pre --extra-index-url=https://pypi.nvidia.com --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/" | ||
| : "--extra-index-url=https://pypi.nvidia.com"; | ||
| return "pip install " + flags + " '" + name + "==" + version + ".*'"; | ||
| } | ||
|
|
||
| function condaInstall(pkg, version, cudaVersion, nightly) { | ||
| var cmd = "conda install -c " + (nightly ? "rapidsai-nightly" : "rapidsai") + | ||
| " -c conda-forge -c nvidia " + pkg + "=" + version + ".*"; | ||
| return cudaVersion ? cmd + " cuda-version=" + cudaVersion : cmd; | ||
| } | ||
|
|
||
| /* Shared Docker image lines: same tags are typically published to Docker Hub and NGC */ | ||
| var CONTAINER_CUOPT_LIB = { | ||
| stable: { | ||
|
|
@@ -243,40 +257,95 @@ | |
| }, | ||
| }, | ||
| }, | ||
| /* Java has no pip/conda package; the Docker images already contain cuopt.jar. */ | ||
| java: { | ||
| container: CONTAINER_CUOPT_LIB, | ||
| /* Marker only -- getCommand() builds the actual pom.xml snippet, since it | ||
| also depends on arch (classifier suffix), not just release/cuda. */ | ||
| maven: { stable: { cu12: true, cu13: true }, nightly: { cu12: true, cu13: true } }, | ||
| }, | ||
| }; | ||
|
|
||
| /* Single-component C API installs: libcuopt still ships everything standalone (pip) or | ||
| depends on all three (conda), so these are for callers who want just one piece. Client | ||
| links no CUDA/rmm, so it has one universal package, no cu12/cu13 split. */ | ||
| var LIBCUOPT_COMPONENTS = { | ||
| client: { | ||
| pip: { | ||
| stable: { default: pipInstall("libcuopt-client", "", V, false) }, | ||
| nightly: { default: pipInstall("libcuopt-client", "", V_NEXT, true) }, | ||
| }, | ||
| conda: { | ||
| stable: { default: condaInstall("libcuopt-client", V_CONDA, "", false) }, | ||
| nightly: { default: condaInstall("libcuopt-client", V_CONDA_NEXT, "", true) }, | ||
| }, | ||
| }, | ||
| mathopt: { | ||
| pip: { | ||
| stable: { cu12: pipInstall("libcuopt-mathopt", "cu12", V, false), cu13: pipInstall("libcuopt-mathopt", "cu13", V, false) }, | ||
| nightly: { cu12: pipInstall("libcuopt-mathopt", "cu12", V_NEXT, true), cu13: pipInstall("libcuopt-mathopt", "cu13", V_NEXT, true) }, | ||
| }, | ||
| conda: { | ||
| stable: { cu12: condaInstall("libcuopt-mathopt", V_CONDA, "12.9", false), cu13: condaInstall("libcuopt-mathopt", V_CONDA, "13.0", false) }, | ||
| nightly: { cu12: condaInstall("libcuopt-mathopt", V_CONDA_NEXT, "12.9", true), cu13: condaInstall("libcuopt-mathopt", V_CONDA_NEXT, "13.0", true) }, | ||
| }, | ||
| }, | ||
| routing: { | ||
| pip: { | ||
| stable: { cu12: pipInstall("libcuopt-routing", "cu12", V, false), cu13: pipInstall("libcuopt-routing", "cu13", V, false) }, | ||
| nightly: { cu12: pipInstall("libcuopt-routing", "cu12", V_NEXT, true), cu13: pipInstall("libcuopt-routing", "cu13", V_NEXT, true) }, | ||
| }, | ||
| conda: { | ||
| stable: { cu12: condaInstall("libcuopt-routing", V_CONDA, "12.9", false), cu13: condaInstall("libcuopt-routing", V_CONDA, "13.0", false) }, | ||
| nightly: { cu12: condaInstall("libcuopt-routing", V_CONDA_NEXT, "12.9", true), cu13: condaInstall("libcuopt-routing", V_CONDA_NEXT, "13.0", true) }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| var SUPPORTED_METHODS = { | ||
| python: ["pip", "conda", "container"], | ||
| c: ["pip", "conda", "container"], | ||
| server: ["pip", "conda", "container"], | ||
| cli: ["pip", "conda", "container"], | ||
| java: ["container", "maven"], | ||
| }; | ||
|
|
||
| function getSelectedValue(name) { | ||
| var el = document.querySelector('input[name="' + name + '"]:checked'); | ||
| return el ? el.value : ""; | ||
| } | ||
|
|
||
| function hasCudaVariants(iface, method) { | ||
| var d = COMMANDS[iface] && COMMANDS[iface][method]; | ||
| if (!d || !d.stable) return false; | ||
| return !!(d.stable.cu12 && d.stable.cu13); | ||
| /* component is only meaningful for iface "c" + method pip/conda; "full" means the | ||
| regular COMMANDS table, anything else looks up LIBCUOPT_COMPONENTS instead. */ | ||
| function resolveData(iface, method, component) { | ||
| if (component && component !== "full") { | ||
| return LIBCUOPT_COMPONENTS[component] && LIBCUOPT_COMPONENTS[component][method]; | ||
| } | ||
| return COMMANDS[iface] && COMMANDS[iface][method]; | ||
| } | ||
|
|
||
| function hasCudaVariants(data) { | ||
| if (!data || !data.stable) return false; | ||
| return !!(data.stable.cu12 && data.stable.cu13); | ||
| } | ||
|
|
||
| function getCommand() { | ||
| var iface = getSelectedValue("cuopt-iface"); | ||
| var method = getSelectedValue("cuopt-method"); | ||
| var release = getSelectedValue("cuopt-release"); | ||
| var cuda = getSelectedValue("cuopt-cuda"); | ||
| var component = iface === "c" ? (getSelectedValue("cuopt-component") || "full") : "full"; | ||
|
|
||
| /* CLI uses libcuopt (c) install; cuopt_cli is shipped with libcuopt. */ | ||
| if (iface === "cli") { | ||
| iface = "c"; | ||
| release = "stable"; | ||
| cuda = "cu12"; | ||
| component = "full"; | ||
| } | ||
| if (method === "container") component = "full"; | ||
|
|
||
| var data = COMMANDS[iface] && COMMANDS[iface][method]; | ||
| var data = resolveData(iface, method, component); | ||
| if (!data || !data[release]) return ""; | ||
|
|
||
| var cmd = ""; | ||
|
|
@@ -321,6 +390,29 @@ | |
| "# Run the container:\n" + | ||
| runLine; | ||
| } | ||
| } else if (method === "maven") { | ||
| var mvnVersion = release === "nightly" ? V_NEXT + ".0-SNAPSHOT" : V; | ||
| var arch = getSelectedValue("cuopt-arch") || "amd64"; | ||
| var classifier = (cuda || "cu12").replace("cu", "cuda") + (arch === "arm64" ? "-arm64" : ""); | ||
| var repoBlock = | ||
| release === "nightly" | ||
| ? "<repositories>\n" + | ||
| " <repository>\n" + | ||
| " <id>sonatype-snapshots</id>\n" + | ||
| " <url>https://central.sonatype.com/repository/maven-snapshots</url>\n" + | ||
| " <releases><enabled>false</enabled></releases>\n" + | ||
| " <snapshots><enabled>true</enabled></snapshots>\n" + | ||
| " </repository>\n" + | ||
| "</repositories>\n\n" | ||
| : ""; | ||
| cmd = | ||
| repoBlock + | ||
| "<dependency>\n" + | ||
| " <groupId>com.nvidia.cuopt</groupId>\n" + | ||
| " <artifactId>cuopt</artifactId>\n" + | ||
| " <version>" + mvnVersion + "</version>\n" + | ||
| " <classifier>" + classifier + "</classifier>\n" + | ||
| "</dependency>"; | ||
|
Comment on lines
+393
to
+415
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. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '510,564p' docs/cuopt/source/_static/install-selector.js
sed -n '8,60p' docs/cuopt/source/cuopt-java/quick-start.rst
sed -n '118,144p' ci/release/update-version.shRepository: NVIDIA/cuopt Length of output: 8615 🏁 Script executed: set -eu
printf '%s\n' '--- selector version and visibility ---'
sed -n '1,55p' docs/cuopt/source/_static/install-selector.js
sed -n '180,270p' docs/cuopt/source/_static/install-selector.js
sed -n '385,420p' docs/cuopt/source/_static/install-selector.js
printf '%s\n' '--- Maven project version and release references ---'
sed -n '1,24p' java/cuopt/pom.xml
rg -n --glob '*.rst' --glob '*.md' --glob '*.xml' --glob '*.js' '26\.10(\.0)?|com\.nvidia\.cuopt|Maven Central|maven' docs/cuopt java README.md | head -120
printf '%s\n' '--- Maven Central metadata ---'
for url in \
'https://repo1.maven.org/maven2/com/nvidia/cuopt/cuopt/maven-metadata.xml' \
'https://repo1.maven.org/maven2/com/nvidia/cuopt/cuopt/26.10.0/cuopt-26.10.0.pom' \
'https://central.sonatype.com/repository/maven-snapshots/com/nvidia/cuopt/cuopt/maven-metadata.xml'
do
printf '\nURL %s\n' "$url"
curl -L --fail --silent --show-error --max-time 20 "$url" | head -80 || true
doneRepository: NVIDIA/cuopt Length of output: 15132 🏁 Script executed: set -eu
printf '%s\n' '--- injected selector version ---'
rg -n -C 3 'CUOPT_INSTALL_VERSION|cuopt-install-version|__version__|version\s*=' docs ci python pyproject.toml setup.py 2>/dev/null | head -160
printf '%s\n' '--- Java/Maven reachability and visibility ---'
sed -n '292,322p' docs/cuopt/source/_static/install-selector.js
sed -n '445,480p' docs/cuopt/source/_static/install-selector.js
sed -n '500,525p' docs/cuopt/source/_static/install-selector.jsRepository: NVIDIA/cuopt Length of output: 16565 🏁 Script executed: set -eu
sed -n '320,405p' docs/cuopt/source/_static/install-selector.js
sed -n '425,465p' docs/cuopt/source/_static/install-selector.jsRepository: NVIDIA/cuopt Length of output: 5596 Do not expose an unpublished Maven coordinate as stable. The Java selector exposes Maven, and its stable branch emits The repository’s Maven convention requires 🤖 Prompt for AI Agents |
||
| } else { | ||
| var key = data[release].cu12 && data[release].cu13 ? cuda : "default"; | ||
| cmd = data[release][key] || data[release].cu12 || data[release].cu13 || data[release].default || ""; | ||
|
|
@@ -337,10 +429,21 @@ | |
| copyBtn.style.display = cmd ? "inline-flex" : "none"; | ||
| } | ||
|
|
||
| var lastMethod = ""; | ||
|
|
||
| function updateVisibility() { | ||
| var method = getSelectedValue("cuopt-method"); | ||
| var iface = getSelectedValue("cuopt-iface"); | ||
| var allowed = SUPPORTED_METHODS[iface] || []; | ||
|
|
||
| /* The published Maven jar's own unclassified default is cuda13 (see | ||
| assemble_maven_repo.sh); default the CUDA radio to match on entering | ||
| this method, without overriding an explicit choice made while still in it. */ | ||
| if (method === "maven" && lastMethod !== "maven") { | ||
| var cu13 = document.querySelector('input[name="cuopt-cuda"][value="cu13"]'); | ||
| if (cu13) cu13.checked = true; | ||
| } | ||
| lastMethod = method; | ||
| var methodInputs = document.querySelectorAll('input[name="cuopt-method"]'); | ||
| methodInputs.forEach(function (input) { | ||
| var enabled = allowed.indexOf(input.value) !== -1; | ||
|
|
@@ -359,10 +462,11 @@ | |
| var releaseRow = document.getElementById("cuopt-release-row"); | ||
| var releaseVisible = iface !== "cli"; | ||
| var ifaceForVariants = iface === "cli" ? "c" : iface; | ||
| var component = iface === "c" && method !== "container" ? (getSelectedValue("cuopt-component") || "full") : "full"; | ||
| var showCuda = | ||
| releaseVisible && | ||
| (method === "pip" || method === "conda" || method === "container") && | ||
| hasCudaVariants(ifaceForVariants, method); | ||
| (method === "pip" || method === "conda" || method === "container" || method === "maven") && | ||
| hasCudaVariants(resolveData(ifaceForVariants, method, component)); | ||
| cudaRow.style.display = showCuda ? "table-row" : "none"; | ||
| releaseRow.style.display = releaseVisible ? "table-row" : "none"; | ||
| var variantRow = document.getElementById("cuopt-variant-row"); | ||
|
|
@@ -373,6 +477,14 @@ | |
| if (registryRow) { | ||
| registryRow.style.display = method === "container" ? "table-row" : "none"; | ||
| } | ||
| var archRow = document.getElementById("cuopt-arch-row"); | ||
| if (archRow) { | ||
| archRow.style.display = iface === "java" && method === "maven" ? "table-row" : "none"; | ||
| } | ||
| var componentRow = document.getElementById("cuopt-component-row"); | ||
| if (componentRow) { | ||
| componentRow.style.display = iface === "c" && (method === "pip" || method === "conda") ? "table-row" : "none"; | ||
| } | ||
| updateOutput(); | ||
| } | ||
|
|
||
|
|
@@ -404,11 +516,19 @@ | |
| '<label class="cuopt-opt"><input type="radio" name="cuopt-iface" value="c"> C (libcuopt)</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-iface" value="server"> Server</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-iface" value="cli"> CLI (cuopt_cli)</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-iface" value="java"> Java (experimental)</label>' + | ||
| '</td></tr>' + | ||
| '<tr><td class="cuopt-opt-label">Method</td><td class="cuopt-opt-group" role="group" aria-label="Method">' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-method" value="pip" checked> pip</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-method" value="conda"> Conda</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-method" value="container"> Container</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-method" value="maven"> Maven</label>' + | ||
| '</td></tr>' + | ||
| '<tr id="cuopt-component-row" style="display:none;"><td class="cuopt-opt-label">Component</td><td class="cuopt-opt-group" role="group" aria-label="Component">' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-component" value="full" checked> Full library</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-component" value="client"> Client only</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-component" value="mathopt"> Mathopt only</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-component" value="routing"> Routing only</label>' + | ||
| '</td></tr>' + | ||
| '<tr id="cuopt-release-row"><td class="cuopt-opt-label">Release</td><td class="cuopt-opt-group" role="group" aria-label="Release">' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-release" value="stable" checked> Current release (' + V_CONDA + ')</label>' + | ||
|
|
@@ -426,13 +546,17 @@ | |
| '<label class="cuopt-opt"><input type="radio" name="cuopt-registry" value="hub" checked> Docker Hub</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-registry" value="ngc"> NVIDIA NGC</label>' + | ||
| '</td></tr>' + | ||
| '<tr id="cuopt-arch-row" style="display:none;"><td class="cuopt-opt-label">Arch</td><td class="cuopt-opt-group" role="group" aria-label="Architecture">' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-arch" value="amd64" checked> amd64</label>' + | ||
| '<label class="cuopt-opt"><input type="radio" name="cuopt-arch" value="arm64"> arm64</label>' + | ||
| '</td></tr>' + | ||
| "</table>" + | ||
| '<div class="cuopt-install-output">' + | ||
| '<textarea id="cuopt-cmd-out" class="cuopt-install-cmd-out" readonly rows="6" style="display:none;"></textarea>' + | ||
| '<div class="cuopt-install-copy-wrap"><button type="button" id="cuopt-copy-btn" class="cuopt-install-copy-btn" style="display:none;">Copy command</button></div>' + | ||
| "</div></div>"; | ||
|
|
||
| ["cuopt-iface", "cuopt-method", "cuopt-release", "cuopt-cuda", "cuopt-variant", "cuopt-registry"].forEach( | ||
| ["cuopt-iface", "cuopt-method", "cuopt-release", "cuopt-cuda", "cuopt-variant", "cuopt-registry", "cuopt-arch", "cuopt-component"].forEach( | ||
| function (name) { | ||
| var inputs = document.querySelectorAll('input[name="' + name + '"]'); | ||
| inputs.forEach(function (input) { | ||
|
|
@@ -444,7 +568,7 @@ | |
| updateVisibility(); | ||
|
|
||
| var defaultIface = root.getAttribute("data-default-iface"); | ||
| if (defaultIface && ["python", "c", "server", "cli"].indexOf(defaultIface) !== -1) { | ||
| if (defaultIface && ["python", "c", "server", "cli", "java"].indexOf(defaultIface) !== -1) { | ||
| var radio = document.querySelector('input[name="cuopt-iface"][value="' + defaultIface + '"]'); | ||
| if (radio) { | ||
| radio.checked = true; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.