← Back to Pull requests

feat(operator): add the AICR Operator and its kind CI lanes #3475

Closed
unknown closed this pull request without merging on Oct 29, 2026 02:13 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 22:58 UTC
Author

Summary

Adds the opt-in AICR Operator accepted in ADR-027: the operator.aicr.run/v1alpha1 API, the controller, its Helm chart, the kubectl aicr plugin and its documentation. It also adds operator- Make targets and a path-filtered Operator E2E workflow that runs the operator's kind suites.

Motivation / Context

ADR-027 brings the day-2 lifecycle (assess, plan, approve, roll out, validate) into the cluster. This PR lands the operator itself; publishing it in AICR's release train is #3469.

Fixes: #3473
Related: #3285

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundler and deployers (pkg/bundler, pkg/component)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: AICR Operator (cmd/aicr-operator, cmd/kubectl-aicr, api/operator, pkg/operator, charts/aicr-operator, tests/operator, tools/operator-) and its CI (.github/workflows/operator-e2e.yaml, .github/actions/operator-kind)
  • Implementation Notes

    Isolation. The operator runs AICR only as pinned images and imports no other AICR package. The operator-boundary depguard rule in .golangci.yaml denies every github.com/NVIDIA/aicr/ import from the operator's trees except their own packages; using any other AICR package needs an explicit allow entry. In the other direction, only the operator's own release tool (tools/operator-release) imports operator packages. The AICR release it runs, and the releases CI tests it against, are pinned under operator: in .settings.yaml: v1.1.2 by default, with v1.0.0 and v1.1.2 in the CI matrix.

    Shared files touched:

  • Makefile: the operator-* targets;

  • .golangci.yaml: the depguard rule;

  • .settings.yaml: the operator: pins;

  • .ko.yaml: an aicr-operator build entry, while the aicr image keeps its defaults;

  • .yamllint.yaml: ignores the chart templates;

  • .gitignore;

  • go.mod: a new direct dependency, aws-sdk-go-v2/service/ecr, for the ECR registry provider, plus several indirect dependencies promoted to direct;

  • DEVELOPMENT.md, .claude/CLAUDE.md and AGENTS.md.
  • CI (Operator E2E, not a required check). It runs when operator paths change:

  • one job checks generated code and runs the CRD and chart suites on the Kubernetes floor (1.34);

  • for each pinned AICR release, on both the floor and the newest Kubernetes, operator-e2e, operator-skeleton and operator-qualify each run on their own kind cluster;

  • operator-qualify builds two release candidates of the commit, installs one and upgrades to the other mid-rollout.

  • a prime-images job loads the registry and Argo CD redis images into the cache the KWOK lanes share (#2483), so the kind jobs do not each pull them from ECR Public, which throttles anonymous pulls per runner IP.
  • The suites install the chart with the commands the docs give users. AICR v1.0.x gets the documented namespace relabel and --force-conflicts. Adoption flags apply only when OPERATOR_ADOPT=1 is set for local cluster reuse.

    Docs are in the tree, not yet published. docs/operator describes installing the chart from oci://ghcr.io/nvidia/charts/aicr-operator and the kubectl-aicr release binaries. No release produces those until #3469, so docs/index.yml does not list docs/operator yet; #3469 adds the navigation together with the artifacts.

    Known gaps, tracked as follow-ups:

  • Operator E2E tests only released AICR images, and core AICR changes do not trigger it, so drift between the operator and unreleased AICR shows up only when a new release is adopted.

  • operator-check-generated runs only in Operator E2E, which is not a required check.

  • operator-release push has no caller yet; it gains SBOM, signature and provenance publishing with #3469.
  • Testing

    make qualify
    make operator-check-generated
    make operator-envtest-floor
    make operator-e2e                                    # AICR v1.1.2
    make operator-skeleton                               # AICR v1.0.0
    CANDIDATE_VERSION=v0.0.0-rc.0 make operator-candidate
    CANDIDATE_DIR=dist/candidate-next CANDIDATE_VERSION=v0.0.0-rc.1 make operator-candidate
    make operator-qualify                                # AICR v1.0.0 and v1.1.2
    golangci-lint run -c .golangci.yaml ./pkg/operator/... ./api/operator/... ./tests/operator/... ./cmd/aicr-operator/... ./cmd/kubectl-aicr/... ./tools/operator-release/...
    

    Results at this PR's tree, run locally on macOS arm64 with kind (Kubernetes 1.37 unless noted):

    | Check | Result |
    |---|---|
    | make qualify (clean worktree) | PASS; total coverage 85.6% (floor 83%) |
    | make operator-check-generated | PASS |
    | make operator-envtest-floor (Kubernetes 1.34) | PASS; fails closed when the floor version is empty or unavailable |
    | make operator-e2e, AICR v1.1.2 | PASS |
    | make operator-skeleton, AICR v1.0.0 | PASS, 25/25 subtests |
    | make operator-qualify, AICR v1.0.0 | PASS, 10/10 subtests |
    | make operator-qualify, AICR v1.1.2 | PASS, 10/10 subtests |
    | golangci-lint on the operator packages | 0 issues; importing pkg/client/v1, pkg/bundler/deployer or pkg/errors from pkg/operator fails the operator-boundary rule |

    Each kind suite ran on a fresh cluster with no adoption flags. The candidate's check that its operator binary refuses development settings runs only on a linux host, so it ran in no local check; the Operator E2E qualify jobs run it. The floor Kubernetes cells and the rest of the AICR × Kubernetes matrix run in Operator E2E on this PR.

    Coverage: the new packages have no baseline on main; per-package numbers come from the coverage report CI posts on this PR.

    Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • The operator is opt-in and isolated: no existing AICR package imports it, and it changes no AICR CLI, API or recipe code. The go.mod changes add modules and promote indirect ones to direct. The only version change is gomodules.xyz/jsonpatch/v2 (v2.4.0 → v2.5.0 in the module graph), and only the operator uses it, through controller-runtime. The size of the change (about 340 files) and the shared build files (Makefile, go.mod, .ko.yaml, .golangci.yaml) are the risk.

    Rollout notes: N/A. Nothing ships until #3469 adds the operator to the release train.

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: yuanchen8911 Review duration: 194m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3475"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository