Skip to content

chore(rest-api): enable rest api use of local core for local dev env#3371

Open
pbreton wants to merge 4 commits into
NVIDIA:mainfrom
pbreton:chore/enable-rest-api-use-of-local-core
Open

chore(rest-api): enable rest api use of local core for local dev env#3371
pbreton wants to merge 4 commits into
NVIDIA:mainfrom
pbreton:chore/enable-rest-api-use-of-local-core

Conversation

@pbreton

@pbreton pbreton commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Enhance REST API local stack launched by make kind-reset to enable the use of a local nico-api core instead of a mock.

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

pbreton added 2 commits July 10, 2026 09:44
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
@pbreton pbreton requested review from a team and shayan1995 as code owners July 10, 2026 17:34
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ccd880e3-778a-41f2-935b-0d568365d58c

📥 Commits

Reviewing files that changed from the base of the PR and between 22be36b and 3accfbc.

📒 Files selected for processing (1)
  • dev/mac-local-dev/run-nico-api.sh

Summary by CodeRabbit

  • New Features
    • Added support for running the REST API with a locally hosted Core service (via a LOCAL_CORE setup).
    • Added a macOS end-to-end REST integration smoke test covering auth, sites, IP blocks, allocations, and VPCs.
  • Improvements
    • Updated site-agent Core gRPC configuration to use CORE_GRPC_* settings (including security mode and certificate paths).
    • Improved local-vs-mock Core deployment/bootstrapping behavior and status messaging.
  • Documentation
    • Refreshed the macOS local development README and REST installation guide with the new Core gRPC configuration keys.

Walkthrough

Adds local NICo Core support for REST deployments, standardizes site-agent Core gRPC settings and certificate paths, updates macOS local-development documentation and startup handling, and introduces an end-to-end REST/Core smoke-test script.

Changes

Local Core REST Integration

Layer / File(s) Summary
Core gRPC configuration contract
helm-prereqs/values/nico-site-agent.yaml, helm/rest/nico-rest-site-agent/values.yaml, rest-api/deploy/kustomize/base/site-agent/configmap.yaml, rest-api/deploy/kustomize/base/site-agent/statefulset.yaml, rest-api/deploy/INSTALLATION.md
Replaces legacy NICO_* settings with CORE_GRPC_* endpoint, security, and certificate-path configuration, and mounts certificates under /etc/core-grpc.
Local Core deployment wiring
rest-api/Makefile
Adds LOCAL_CORE settings, conditionally omits mock-core resources, configures local Core TLS connectivity, and waits for the site-agent rollout.
REST integration smoke test and local tooling
dev/mac-local-dev/check-rest-core-integration.sh, dev/mac-local-dev/README.md, dev/mac-local-dev/run-nico-api.sh
Adds an authenticated smoke test covering tenant, site, IP block, allocation, and VPC operations; documents local Core usage; and avoids macOS temporary-file naming collisions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Makefile
  participant Kind
  participant SiteAgent
  participant LocalNicoCore
  participant RESTAPI
  Developer->>Makefile: Run LOCAL_CORE REST setup
  Makefile->>Kind: Configure certificates and CORE_GRPC endpoint
  Kind->>SiteAgent: Restart and await rollout
  SiteAgent->>LocalNicoCore: Establish mTLS connection
  Developer->>RESTAPI: Run integration smoke test
  RESTAPI->>LocalNicoCore: Execute VPC operation
  LocalNicoCore-->>RESTAPI: Return operation status
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: enabling the REST API to use a local core for local development.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the local-core REST API stack update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-07-10 17:37:51 UTC | Commit: 563856d

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 271 13 34 91 7 126
machine-validation-runner 804 40 237 296 36 195
machine_validation 804 40 237 296 36 195
machine_validation-aarch64 804 40 237 296 36 195
nvmetal-carbide 804 40 237 296 36 195
TOTAL 3493 173 982 1281 151 906

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
rest-api/deploy/INSTALLATION.md (1)

719-723: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Stale mount path in "Secrets mounted at runtime" table.

core-grpc-client-site-agent-certs is documented as mounted at /etc/nico (line 722), but the accompanying statefulset.yaml change in this same cohort moves that mount to /etc/core-grpc. This table wasn't updated to match.

📝 Proposed fix
-| `core-grpc-client-site-agent-certs` | `/etc/nico` | SPIFFE cert for gRPC to NICo core (optional, issued by cert-manager) |
+| `core-grpc-client-site-agent-certs` | `/etc/core-grpc` | SPIFFE cert for gRPC to NICo core (optional, issued by cert-manager) |

As per path instructions, rest-api/deploy/** manifests should be reviewed for "service wiring, environment variables, and secret/config references" — this table entry no longer reflects the actual mount path wired in statefulset.yaml.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rest-api/deploy/INSTALLATION.md` around lines 719 - 723, Update the “Secrets
mounted at runtime” table entry for core-grpc-client-site-agent-certs to use
/etc/core-grpc instead of /etc/nico, matching the mount configured in
statefulset.yaml.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dev/mac-local-dev/check-rest-core-integration.sh`:
- Around line 173-181: Prevent strict-mode pipeline failure from bypassing the
intended validation: update the UPDATE_TAG assignment in the current database
update step and the equivalent assignment in step 3c to neutralize grep’s
non-match status with `|| true` (or an equivalent guarded pipeline). Preserve
the existing empty-output and zero-row checks so they invoke `die` with the
intended messages.

In `@dev/mac-local-dev/README.md`:
- Line 14: Update the documentation sentence describing the integration test to
hyphenate the compound adjective, changing “full stack integration” to
“full-stack integration.”

---

Outside diff comments:
In `@rest-api/deploy/INSTALLATION.md`:
- Around line 719-723: Update the “Secrets mounted at runtime” table entry for
core-grpc-client-site-agent-certs to use /etc/core-grpc instead of /etc/nico,
matching the mount configured in statefulset.yaml.
🪄 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: 032391b6-f136-447b-8e7a-ca346a242c4a

📥 Commits

Reviewing files that changed from the base of the PR and between bd72756 and 563856d.

📒 Files selected for processing (8)
  • dev/mac-local-dev/README.md
  • dev/mac-local-dev/check-rest-core-integration.sh
  • helm-prereqs/values/nico-site-agent.yaml
  • helm/rest/nico-rest-site-agent/values.yaml
  • rest-api/Makefile
  • rest-api/deploy/INSTALLATION.md
  • rest-api/deploy/kustomize/base/site-agent/configmap.yaml
  • rest-api/deploy/kustomize/base/site-agent/statefulset.yaml

Comment thread dev/mac-local-dev/check-rest-core-integration.sh
Comment thread dev/mac-local-dev/README.md Outdated
Signed-off-by: Patrice Breton <pbreton@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dev/mac-local-dev/run-nico-api.sh`:
- Around line 175-177: Preserve uniqueness when creating the final TOML
configuration path: update the temporary-file setup around NICO_TMP_CONFIG to
use a private temporary directory, track it as NICO_TMP_DIR, and ensure cleanup
removes that directory. Do not rely on mv to a suffixed path, since it may
overwrite an existing file; update the associated cleanup handling accordingly.
🪄 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: dfaf0fb8-cb29-48f4-8f95-034028e376ac

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4b485 and 22be36b.

📒 Files selected for processing (1)
  • dev/mac-local-dev/run-nico-api.sh

Comment thread dev/mac-local-dev/run-nico-api.sh Outdated
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
@pbreton pbreton force-pushed the chore/enable-rest-api-use-of-local-core branch from 22be36b to 3accfbc Compare July 10, 2026 20:59
# NICo Core configuration
NICO_ADDRESS: "nico-rest-mock-core:11079"
NICO_SEC_OPT: "0"
CORE_GRPC_ADDRESS: "nico-rest-mock-core:11079"

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.

We can have cluster name or domain name for core server?

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.

2 participants