Address #177 review comments: harden image-template formatting + base-image docs#178
Address #177 review comments: harden image-template formatting + base-image docs#178wyli wants to merge 1 commit into
Conversation
container/core.py:
- _format_image_template: validate HOLOSCAN_CLI_*_IMAGE_FORMAT placeholders
with string.Formatter and fail via fatal() on unknown/missing fields or an
invalid template, instead of a raw KeyError/ValueError traceback. Parsing
the fields (vs. a substring check) also stops escaped braces like
{{sdk_version}} from being mistaken for a real sdk_version placeholder.
(coderabbitai, Copilot)
- default_base_image: compute cuda_tag lazily so the host GPU/driver probe
(and its warning) no longer runs on the branches that return an explicit
image or fatal without using it. (Copilot)
README.md:
- Rewrite the base-image configuration section as three explicit methods
(--base-img flag, fully-qualified HOLOSCAN_CLI_BASE_IMAGE, or repository +
HOLOSCAN_CLI_BASE_SDK_VERSION). (agirault)
tests:
- Cover the new _format_image_template validation paths and the no-host-probe
fatal path in default_base_image.
- Document the stubbed host probes in test_get_cuda_tag_handles_sdk_and_cuda_matrix
(clarifies why a None cuda_version resolves to an igpu tag). (tbirdso)
Follow-up to #177.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PR refactors base image template handling in the Holoscan CLI container module. It improves placeholder validation in image-template formatting, defers CUDA tag computation to only the paths requiring it, and updates documentation to clarify base image configuration options and fallback behavior. ChangesBase image template and configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Follow-up to #177 (merged), addressing its review comments.
Changes
container/core.py_format_image_template: parse theHOLOSCAN_CLI_*_IMAGE_FORMATplaceholders withstring.Formatterandfatal()on unknown/missing fields or an invalid template, instead of letting a mistyped or unset placeholder raise a rawKeyError/ValueErrortraceback. Parsing the fields (rather than a substring check) also fixes"{sdk_version" in templatemisfiring on escaped{{sdk_version}}. — coderabbitai, Copilotdefault_base_image: computecuda_taglazily so the host GPU/driver probe (and its warning) no longer runs on the branches that return an explicit image orfatal()without using it. — CopilotREADME.md--base-imgflag, fully-qualifiedHOLOSCAN_CLI_BASE_IMAGE, or repository +HOLOSCAN_CLI_BASE_SDK_VERSION). — agiraulttests
test_container_core.pycases for the_format_image_templatevalidation paths and the no-host-probefatalpath indefault_base_image.test_get_cuda_tag_handles_sdk_and_cuda_matrixexplaining the stubbed host probes (why aNonecuda_version resolves to an igpu tag). — tbirdsoTesting
black --check+isort --checkclean;pytest tests/unitgreen (the wheel-install console-script test requires an installed dist, unrelated to this change).🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
holoscan-cliversion alignment doesn't require matching Holoscan SDK runtime or container image--base-imgflag,HOLOSCAN_CLI_BASE_IMAGEenvironment variable, and dynamic CUDA version detectionBug Fixes