Skip to content

Add cuOpt devcontainer configuration#1168

Open
bdice wants to merge 7 commits intoNVIDIA:mainfrom
bdice:devcontainer-config
Open

Add cuOpt devcontainer configuration#1168
bdice wants to merge 7 commits intoNVIDIA:mainfrom
bdice:devcontainer-config

Conversation

@bdice
Copy link
Copy Markdown
Contributor

@bdice bdice commented Apr 30, 2026

Summary

  • Add CUDA 12.9 and CUDA 13.1 devcontainer configurations for both conda and pip workflows.
  • Add PR CI coverage using the RAPIDS devcontainer build workflow with the cuOpt benchmark builds enabled.
  • Update the release version script so devcontainer image tags, feature versions, and container names are advanced with releases.

@bdice bdice requested a review from a team as a code owner April 30, 2026 20:19
@bdice bdice requested a review from jakirkham April 30, 2026 20:19
@bdice bdice added feature request New feature or request non-breaking Introduces a non-breaking change labels Apr 30, 2026
@bdice bdice requested a review from trxcllnt April 30, 2026 20:21
Comment thread .github/workflows/pr.yaml
uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@main
with:
arch: '["amd64", "arm64"]'
cuda: '["12.9", "13.1"]'
Copy link
Copy Markdown
Contributor Author

@bdice bdice Apr 30, 2026

Choose a reason for hiding this comment

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

We only test one CUDA version for devcontainers in CI for other libraries. This is temporarily including 12.9 for testing, but we'll remove it before merging to keep CI runtime down.

Suggested change
cuda: '["12.9", "13.1"]'
cuda: '["13.1"]'

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

Failed to post review comments

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds devcontainer Dockerfile, README and four CUDA devcontainer configs; CI job to build/test in devcontainers and exclude devcontainer-only changes; extends release-version bumps to devcontainer files; updates test discovery/registration (rapids-test), CMake build/test wiring, small test fixes, and dataset extraction logic.

Changes

Devcontainer + CI

Layer / File(s) Summary
Container definition
.devcontainer/Dockerfile
Adds multi-stage Dockerfile with BuildKit syntax, pip/conda base stages, system deps for Boost/gRPC/Protobuf, RAPIDS/CUDA build args, sccache/sccache-dist env defaults, CUDA arch/version handling, and Python runtime defaults.
Configs
.devcontainer/cuda12.9-pip/devcontainer.json, .devcontainer/cuda12.9-conda/devcontainer.json, .devcontainer/cuda13.1-pip/devcontainer.json, .devcontainer/cuda13.1-conda/devcontainer.json
Adds four devcontainer JSONs: build args (CUDA, package manager, base), features (CUDA/UCX/rapids-build-utils), forced feature install order, init commands to create host dirs, workspace/persistent bind mounts, optional GPU runtime, Codespaces post-attach handling, and recommended VS Code extensions.
Docs / Usage
.devcontainer/README.md
Adds usage README describing launching/rebuilding container, mounts, env setup, conda/pip env creation from cuopt/dependencies.yaml, and helper scripts for cleaning/configuring/building.
CI wiring
.github/workflows/pr.yaml
Adds devcontainer job using shared build-in-devcontainer workflow (multi-arch, CUDA 12.9/13.1), collects sccache stats and build logs, adds devcontainer to pr-builder.needs, and excludes .devcontainer/** from changed-file groups to avoid triggering full matrix for devcontainer-only changes.
Release tooling
ci/release/update-version.sh
Extends version-bump script to update embedded image/feature version references inside .devcontainer/**/devcontainer.json files (base image tag, CUDA/rapids-build-utils feature versions, and repo-tag segments).

Build / Test infrastructure & small fixes

Layer / File(s) Summary
Test discovery / execution script
ci/run_ctests.sh
Adds script_dir/repo_dir resolution; exports RAPIDS_DATASET_ROOT_DIR and CUOPT_HOME; adjusts devcontainer test location to repo_dir/cpp/build/latest/gtests/libcuopt/; selects first existing test directory and cd into it before running tests.
Top-level test init & install wiring
cpp/tests/CMakeLists.txt
Adds enable_testing()/rapids_test_init() at top-level; replaces add_test/per-target install() with rapids_test_add(...) and a single rapids_test_install_relocatable for testing component.
Per-suite test wiring
cpp/tests/linear_programming/CMakeLists.txt, cpp/tests/linear_programming/grpc/CMakeLists.txt, other cpp/tests/.../CMakeLists.txt
Replaces add_test and manual install rules with rapids_test_add calls (adds GPUS 1, INSTALL_COMPONENT_SET testing), removes standalone install(...) blocks, and adds a CPU-mem variant test via environment/GTEST_FILTER.
Enable testing for parser tests
cpp/libmps_parser/tests/CMakeLists.txt
Adds enable_testing() so libmps_parser tests are registered with CTest.
Papilo FetchContent and test flags
cpp/CMakeLists.txt
Saves user BUILD_TESTING to CUOPT_BUILD_TESTING, forces BUILD_TESTING=OFF during Papilo FetchContent and restores it afterward; appends --output-on-failure to CMAKE_CTEST_ARGUMENTS when tests enabled; links argparse::argparse privately to solve_MIP and solve_LP.
Test env & hygiene fixes
cpp/tests/utilities/CMakeLists.txt, cpp/tests/mip/doc_example_test.cu
Sets ENVIRONMENT property for CLI_TEST to prepend cuopt_cli binary dir to PATH; deletes temporary MPS files before existence checks and before reusing settings to ensure clean state.
Dataset extraction logic
datasets/get_test_data.sh
Replaces MIME-type-based extraction with filename-suffix-based logic: assigns archive, verifies file exists, and chooses extraction command (tar xvzf, unzip, or tar xvf) based on suffix.
Python CMake rpath guard
python/cuopt/cuopt/linear_programming/CMakeLists.txt
Guards rapids_cython_add_rpath_entries and INSTALL_RPATH to run only when mps_parser target exists and cython_lib_dir is defined.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add cuOpt devcontainer configuration' clearly and concisely summarizes the main change in the PR, which adds new devcontainer files (.devcontainer/Dockerfile and configuration files for CUDA 12.9/13.1 with conda/pip).
Description check ✅ Passed The description is directly related to the changeset, covering the three main aspects: adding CUDA 12.9/13.1 devcontainer configurations for conda/pip, adding PR CI coverage with devcontainer builds, and updating the release script for devcontainer version management.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/README.md:
- Line 34: The inline image tag lacks alt text, so update the <img> element in
the README line that shows the "Reopen in Container" screenshot to include a
descriptive alt attribute (e.g., alt="VS Code window with 'Reopen in Container'
button highlighted" or similar) so screen readers have context; locate the <img
src="https://user-images.githubusercontent.com/..."/> tag and add an appropriate
alt="..." value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7c6a2dc5-2800-49f1-ac8d-ec00eb6a7443

📥 Commits

Reviewing files that changed from the base of the PR and between e47fab0 and f5c6fbd.

📒 Files selected for processing (8)
  • .devcontainer/Dockerfile
  • .devcontainer/README.md
  • .devcontainer/cuda12.9-conda/devcontainer.json
  • .devcontainer/cuda12.9-pip/devcontainer.json
  • .devcontainer/cuda13.1-conda/devcontainer.json
  • .devcontainer/cuda13.1-pip/devcontainer.json
  • .github/workflows/pr.yaml
  • ci/release/update-version.sh

Comment thread .devcontainer/README.md
@bdice bdice requested a review from a team as a code owner April 30, 2026 20:39
@bdice bdice requested a review from Iroy30 April 30, 2026 20:39
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@datasets/get_test_data.sh`:
- Around line 231-235: The archive extraction in the case handling for variable
tfname is swallowing failures with "|| true", which lets corrupt/unsupported
archives pass silently; update the extraction commands (the tar/unzip lines that
reference archive and DESTDIRS[$index]) to fail loudly instead of using "||
true"—either remove the "|| true" so the shell exits on error (ensure set -e is
enabled) or replace it with an explicit check that exits non‑zero (e.g., test
the command's return and call exit 1) so extraction errors propagate and stop
the script.

In `@python/cuopt/cuopt/linear_programming/CMakeLists.txt`:
- Around line 66-68: The set_property call for the TARGET mps_parser is using
the wrong argument order so APPEND is being treated as a value; update the
set_property invocation referencing target mps_parser and property INSTALL_RPATH
so the APPEND modifier appears before PROPERTY (i.e., use APPEND PROPERTY
INSTALL_RPATH ${rpaths}) to ensure rpaths are appended rather than replaced or
mis-parsed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de8a2e28-4772-45df-bade-2f75ecf0778a

📥 Commits

Reviewing files that changed from the base of the PR and between ce8e987 and d5142a4.

📒 Files selected for processing (8)
  • ci/run_ctests.sh
  • cpp/CMakeLists.txt
  • cpp/libmps_parser/tests/CMakeLists.txt
  • cpp/tests/CMakeLists.txt
  • cpp/tests/linear_programming/CMakeLists.txt
  • cpp/tests/linear_programming/grpc/CMakeLists.txt
  • datasets/get_test_data.sh
  • python/cuopt/cuopt/linear_programming/CMakeLists.txt
✅ Files skipped from review due to trivial changes (1)
  • cpp/libmps_parser/tests/CMakeLists.txt

Comment thread datasets/get_test_data.sh
Comment on lines +231 to +235
case "${tfname}" in
*.tar.gz|*.tgz) tar xvzf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
*.zip) unzip "${archive}" -d "${DESTDIRS[$index]}" || true ;;
*) tar xvf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
esac
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Propagate archive extraction failures.

Line 232-Line 234 still mask tar/unzip errors with || true. A corrupt or unsupported archive can leave partial dataset directories behind and let the script continue as if setup succeeded.

Suggested fix
-        *.tar.gz|*.tgz) tar xvzf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
-        *.zip) unzip "${archive}" -d "${DESTDIRS[$index]}" || true ;;
-        *) tar xvf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
+        *.tar.gz|*.tgz) tar xvzf "${archive}" -C "${DESTDIRS[$index]}" ;;
+        *.zip) unzip "${archive}" -d "${DESTDIRS[$index]}" ;;
+        *) tar xvf "${archive}" -C "${DESTDIRS[$index]}" ;;
As per coding guidelines "`datasets/**/*.sh`: ... Exit on failure; no silent download errors".
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case "${tfname}" in
*.tar.gz|*.tgz) tar xvzf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
*.zip) unzip "${archive}" -d "${DESTDIRS[$index]}" || true ;;
*) tar xvf "${archive}" -C "${DESTDIRS[$index]}" || true ;;
esac
case "${tfname}" in
*.tar.gz|*.tgz) tar xvzf "${archive}" -C "${DESTDIRS[$index]}" ;;
*.zip) unzip "${archive}" -d "${DESTDIRS[$index]}" ;;
*) tar xvf "${archive}" -C "${DESTDIRS[$index]}" ;;
esac
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@datasets/get_test_data.sh` around lines 231 - 235, The archive extraction in
the case handling for variable tfname is swallowing failures with "|| true",
which lets corrupt/unsupported archives pass silently; update the extraction
commands (the tar/unzip lines that reference archive and DESTDIRS[$index]) to
fail loudly instead of using "|| true"—either remove the "|| true" so the shell
exits on error (ensure set -e is enabled) or replace it with an explicit check
that exits non‑zero (e.g., test the command's return and call exit 1) so
extraction errors propagate and stop the script.

Comment on lines +66 to +68
if(TARGET mps_parser)
set_property(TARGET mps_parser PROPERTY INSTALL_RPATH ${rpaths} APPEND)
endif()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify incorrect set_property(APPEND) ordering in CMake files.
# Expected now: one match at python/cuopt/cuopt/linear_programming/CMakeLists.txt:67
# Expected after fix: zero matches.
rg -nP --type=cmake 'set_property\(\s*TARGET[\s\S]*?\bPROPERTY\b[\s\S]*?\bAPPEND\b' -g '**/CMakeLists.txt'

Repository: NVIDIA/cuopt

Length of output: 505


Fix set_property argument order: APPEND must come before PROPERTY.

In CMake, the APPEND modifier must appear before the PROPERTY keyword, not after the property values. The current ordering may cause CMake to parse APPEND as a literal string value for INSTALL_RPATH, breaking the intended append behavior.

Suggested fix
 if(TARGET mps_parser)
-  set_property(TARGET mps_parser PROPERTY INSTALL_RPATH ${rpaths} APPEND)
+  set_property(TARGET mps_parser APPEND PROPERTY INSTALL_RPATH ${rpaths})
 endif()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(TARGET mps_parser)
set_property(TARGET mps_parser PROPERTY INSTALL_RPATH ${rpaths} APPEND)
endif()
if(TARGET mps_parser)
set_property(TARGET mps_parser APPEND PROPERTY INSTALL_RPATH ${rpaths})
endif()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@python/cuopt/cuopt/linear_programming/CMakeLists.txt` around lines 66 - 68,
The set_property call for the TARGET mps_parser is using the wrong argument
order so APPEND is being treated as a value; update the set_property invocation
referencing target mps_parser and property INSTALL_RPATH so the APPEND modifier
appears before PROPERTY (i.e., use APPEND PROPERTY INSTALL_RPATH ${rpaths}) to
ensure rpaths are appended rather than replaced or mis-parsed.

@bdice bdice requested a review from a team as a code owner May 3, 2026 17:53
@bdice bdice requested review from Bubullzz and rg20 May 3, 2026 17:53
Comment thread .github/workflows/pr.yaml
with:
build_type: pull-request
script: ci/test_self_hosted_service.sh
devcontainer:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it possible to skip devcontainer build if there no changes required for the build or test ?

Copy link
Copy Markdown
Contributor

@aliceb-nv aliceb-nv left a comment

Choose a reason for hiding this comment

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

Approving engine-side

@anandhkb anandhkb added this to the 26.06 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants