Skip to content

Use OCR v2 NIM in Helm chart#2239

Open
charlesbluca wants to merge 1 commit into
NVIDIA:mainfrom
charlesbluca:codex/helm-ocr-v2-nim
Open

Use OCR v2 NIM in Helm chart#2239
charlesbluca wants to merge 1 commit into
NVIDIA:mainfrom
charlesbluca:codex/helm-ocr-v2-nim

Conversation

@charlesbluca

Copy link
Copy Markdown
Collaborator

Description

Update the NeMo Retriever Helm chart to deploy the Nemotron OCR v2 NIM by default instead of OCR v1. This changes the OCR NIMService/NIMCache name, image repository, and image tag to nvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0, flips retired-resource pruning to clean up the old v1 service, and keeps the auto-wired service config pointed at the active OCR NIM.

The PR also updates Helm docs, extraction docs, the harness NIM wait-list, and Helm regression tests so rendered manifests assert the v2 NIM image and endpoint.

Validation performed:

  • helm template nrl-ocr-v2 nemo_retriever/helm --set ngcImagePullSecret.create=false --set ngcApiSecret.create=false --set nimOperator.rerankqa.enabled=true --set nimOperator.audio.enabled=true --set nimOperator.nemotron_parse.enabled=true --set nimOperator.nemotron_3_nano_omni_30b_a3b_reasoning.enabled=true --api-versions apps.nvidia.com/v1alpha1
  • .venv/bin/pytest nemo_retriever/tests/test_helm_nimcache_model_profile.py nemo_retriever/tests/test_helm_nimservice_resources.py
  • docker pull nvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0
  • docker run --rm --gpus '"device=0"' nvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0 list-model-profiles

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@charlesbluca charlesbluca changed the title [codex] Use OCR v2 NIM in Helm chart Use OCR v2 NIM in Helm chart Jun 16, 2026
@charlesbluca charlesbluca marked this pull request as ready for review June 16, 2026 16:32
@charlesbluca charlesbluca requested review from a team as code owners June 16, 2026 16:32
@charlesbluca charlesbluca requested a review from jioffe502 June 16, 2026 16:32
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR upgrades the default OCR NIM in the NeMo Retriever Helm chart from nemotron-ocr-v1:1.3.0 to nemotron-ocr-v2:1.4.0, flipping the retired-resource prune list so v1 is cleaned up on next reconcile.

  • Renames the Helm template file, updates values.yaml defaults (service name, image repository, and tag), and adjusts the pruneRetiredNimResources list from v2→v1 so old NIMCache/NIMService CRs are pruned after upgrade.
  • Updates all documentation references, the harness NIM wait-list, and Helm regression tests to assert the v2 image and in-cluster endpoint URL.

Confidence Score: 5/5

The change is a mechanical image bump — every reference to the old v1 NIM has been updated and the prune list correctly targets v1 for cleanup after upgrade.

All ten files are updated consistently: values, template, helpers comment, configmap comment, docs, README, harness wait-list, and both test files all point to the same v2 image and service name. The pruneRetiredNimResources flip (v2→v1) is correct — it ensures the old NIMCache/NIMService CRs are removed on the next reconcile rather than lingering. No logic changes, no API surface changes, no new code paths.

No files require special attention.

Important Files Changed

Filename Overview
nemo_retriever/helm/values.yaml Updates OCR NIM defaults (nimServiceName, repository, tag) from v1→v2 and flips pruneRetiredNimResources to remove stale v1 CRs — all changes are consistent and correct.
nemo_retriever/helm/templates/nims/nemotron-ocr-v2.yaml Renamed from nemotron-ocr-v1.yaml; only the default nimServiceName fallback changed from 'nemotron-ocr-v1' to 'nemotron-ocr-v2'. Template logic unchanged.
nemo_retriever/src/nemo_retriever/harness/helm_manager.py NIM_OPERATOR_RESOURCES tuple updated to reference 'nemotron-ocr-v2' — one-line change, consistent with the rest of the PR.
nemo_retriever/tests/test_helm_nimcache_model_profile.py Adds test_default_render_uses_ocr_v2_nim asserting NIMCache/NIMService name, image, tag, and configmap URL; updates spot-check reference from 'nemotron-ocr-v1' to 'nemotron-ocr-v2'.
nemo_retriever/tests/test_helm_nimservice_resources.py Template filename reference updated from 'nemotron-ocr-v1.yaml' to 'nemotron-ocr-v2.yaml' — correct one-line change.
docs/docs/extraction/prerequisites-support-matrix.md Updates OCR NIM references from v1→v2 throughout; also fixes the Helm README anchor link from the versioned branch (26.05) to main.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[helm install / upgrade] --> B{nimOperator.ocr.enabled?}
    B -- false --> C[Skip OCR NIM]
    B -- true --> D[Render nemotron-ocr-v2.yaml]
    D --> E[NIMCache: nemotron-ocr-v2\nnvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0]
    D --> F[NIMService: nemotron-ocr-v2]
    E --> G[ConfigMap auto-wires\nocr_invoke_url: http://nemotron-ocr-v2:8000/v1/infer]
    F --> G
    A --> H[deploy.sh post-reconcile\npruneRetiredNimResources]
    H --> I[Delete NIMCache nemotron-ocr-v1\nDelete NIMService nemotron-ocr-v1]
    style E fill:#c8f7c5
    style F fill:#c8f7c5
    style I fill:#f7c5c5
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[helm install / upgrade] --> B{nimOperator.ocr.enabled?}
    B -- false --> C[Skip OCR NIM]
    B -- true --> D[Render nemotron-ocr-v2.yaml]
    D --> E[NIMCache: nemotron-ocr-v2\nnvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0]
    D --> F[NIMService: nemotron-ocr-v2]
    E --> G[ConfigMap auto-wires\nocr_invoke_url: http://nemotron-ocr-v2:8000/v1/infer]
    F --> G
    A --> H[deploy.sh post-reconcile\npruneRetiredNimResources]
    H --> I[Delete NIMCache nemotron-ocr-v1\nDelete NIMService nemotron-ocr-v1]
    style E fill:#c8f7c5
    style F fill:#c8f7c5
    style I fill:#f7c5c5
Loading

Reviews (2): Last reviewed commit: "Use OCR v2 NIM in Helm chart" | Re-trigger Greptile

Comment on lines +247 to +260
if doc.get("kind") == "NIMCache"
and doc.get("metadata", {}).get("name") == "nemotron-ocr-v2"
)
self.assertEqual(
ocr_cache["spec"]["source"]["ngc"]["modelPuller"],
"nvcr.io/nim/nvidia/nemotron-ocr-v2:1.4.0",
)

ocr_service = next(
doc
for doc in docs
if doc.get("kind") == "NIMService"
and doc.get("metadata", {}).get("name") == "nemotron-ocr-v2"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Unguarded next() yields opaque StopIteration on test failure

Both next(doc for doc in docs if ...) calls have no default argument. If the rendered manifest does not contain a NIMCache or NIMService named nemotron-ocr-v2 — for example after a future rename or if the OCR NIM is inadvertently disabled — Python propagates StopIteration to the test runner, which reports it as an error rather than a failure. The resulting message ("StopIteration") gives no indication of which document was missing or why. Passing next(..., None) and asserting assertIsNotNone would produce a clear assertion message instead.

Prompt To Fix With AI
This is a comment left during a code review.
Path: nemo_retriever/tests/test_helm_nimcache_model_profile.py
Line: 247-260

Comment:
**Unguarded `next()` yields opaque `StopIteration` on test failure**

Both `next(doc for doc in docs if ...)` calls have no default argument. If the rendered manifest does not contain a `NIMCache` or `NIMService` named `nemotron-ocr-v2` — for example after a future rename or if the OCR NIM is inadvertently disabled — Python propagates `StopIteration` to the test runner, which reports it as an *error* rather than a *failure*. The resulting message ("StopIteration") gives no indication of which document was missing or why. Passing `next(..., None)` and asserting `assertIsNotNone` would produce a clear assertion message instead.

How can I resolve this? If you propose a fix, please make it concise.

@charlesbluca charlesbluca force-pushed the codex/helm-ocr-v2-nim branch from 221fb44 to 1a3745c Compare June 16, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant