nvcf / nvca
AGENTS.md261 starsChanged 9 days agoApache-2.0View on GitHub
Quick reference for working with NVCA (NVIDIA Cloud Functions Agent), a Kubernetes agent and operator (Go) that manages NVCF Bring-Your-Own-Compute (BYOC) clusters. This monorepo contains both the NVCA agent and the NVCA Operator (formerly a separate repository). Use standard Go tooling by default: Repository structure: Quick check before commit: Run specific tests: Running tests in AI agents / IDEs: When running go test directly (not via make test), you must pass ldflags to set the DRA driver version, otherwise tests…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository133 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-tooling/AGENTS.mdAGENTS.md
- deploy/helm/cassandra/AGENTS.mdAGENTS.md
- deploy/helm/cert-manager/AGENTS.mdAGENTS.md
- deploy/helm/cloud-functions/AGENTS.mdAGENTS.md
- deploy/helm/cloud-tasks/AGENTS.mdAGENTS.md
- deploy/helm/encrypted-secret-store/AGENTS.mdAGENTS.md
- deploy/helm/icms/AGENTS.mdAGENTS.md
- deploy/helm/llm-request-router/AGENTS.mdAGENTS.md
- deploy/helm/nats/AGENTS.mdAGENTS.md
- deploy/helm/notary/AGENTS.mdAGENTS.md
- deploy/helm/nvcf-pki/AGENTS.mdAGENTS.md
- deploy/helm/openbao/AGENTS.mdAGENTS.md
- deploy/helm/vanity-gateway/AGENTS.mdAGENTS.md
- deploy/releases/AGENTS.mdAGENTS.md
- deploy/stacks/AGENTS.mdAGENTS.md
- deploy/stacks/observability/AGENTS.mdAGENTS.md
- deploy/stacks/stargate-dev/AGENTS.mdAGENTS.md
- deploy/stacks/stargate-dev/benchmark/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- docs/overview/samples/scripts/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- infra/cassandra/AGENTS.mdAGENTS.md
- infra/openbao/AGENTS.mdAGENTS.md
- infra/openbao/plugins/vault-plugin-secrets-jwt/AGENTS.mdAGENTS.md
- infra/openbao/tests/AGENTS.mdAGENTS.md
- migrations/cassandra/AGENTS.mdAGENTS.md
- migrations/openbao/AGENTS.mdAGENTS.md
- src/compute-plane-services/byoo-otel-collector/AGENTS.mdAGENTS.md
- src/compute-plane-services/ess-agent/AGENTS.mdAGENTS.md
- src/compute-plane-services/image-credential-helper/AGENTS.mdAGENTS.md
- src/compute-plane-services/nvsnap/docs/AGENTS.mdAGENTS.md
- src/compute-plane-services/nvstor/AGENTS.mdAGENTS.md
- src/compute-plane-services/request-trace-uploader/AGENTS.mdAGENTS.md
- src/control-plane-services/admin-token-issuer-proxy/AGENTS.mdAGENTS.md
- src/control-plane-services/api-keys/AGENTS.mdAGENTS.md
- src/control-plane-services/cloud-functions/AGENTS.mdAGENTS.md
- src/control-plane-services/cloud-tasks/AGENTS.mdAGENTS.md
- src/control-plane-services/encrypted-secret-store/AGENTS.mdAGENTS.md
- src/control-plane-services/function-autoscaler/AGENTS.mdAGENTS.md
- src/control-plane-services/function-autoscaler/local_env/AGENTS.mdAGENTS.md
- src/control-plane-services/instance-cluster-management/AGENTS.mdAGENTS.md
- src/control-plane-services/nats-auth-callout/AGENTS.mdAGENTS.md
- src/control-plane-services/notary/AGENTS.mdAGENTS.md
- src/invocation-plane-services/grpc-proxy/AGENTS.mdAGENTS.md
- src/invocation-plane-services/http-invocation/AGENTS.mdAGENTS.md
- src/invocation-plane-services/llm-api-gateway/AGENTS.mdAGENTS.md
- src/invocation-plane-services/ratelimiter/AGENTS.mdAGENTS.md
- src/invocation-plane-services/vanity-gateway/AGENTS.mdAGENTS.md
- src/libraries/go/lib/AGENTS.mdAGENTS.md
- src/libraries/go/worker/AGENTS.mdAGENTS.md
- src/libraries/java/nv-boot-parent/AGENTS.mdAGENTS.md
- src/libraries/python/nv-cloud-function-helpers/AGENTS.mdAGENTS.md
- src/libraries/rust/nvcf-info/AGENTS.mdAGENTS.md
- src/libraries/rust/stargate/AGENTS.mdAGENTS.md
- src/uis/nvcf-ui/AGENTS.mdAGENTS.md
- src/uis/nvcf-ui/helm/AGENTS.mdAGENTS.md
- tests/bdd/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- tools/docs-version-sync/AGENTS.mdAGENTS.md
- The first 60 shown.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
51 rules. About 1 is common, 30 are distinctive, and 20 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈30
Distinctive · estimate
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 7
Use standard Go tooling by default:
- Very specific: line 36
Use the direct go test pattern below, including -ldflags, to run a single test
- Very specific: line 37
Run make test-e2e for full end-to-end validation
- Very specific: line 60
When running go test directly (not via make test), you must pass ldflags to set the DRA driver version, otherwise tests will panic with …
- Distinctive: line 119
Use table-driven tests for multiple scenarios
- Very specific: line 120
Test naming: TestFunctionName or TestStructName_MethodName
- Very specific: line 121
Test data in pkg/nvca/testdata/, internal/*/testdata/
- Distinctive: line 157
Prefer small, explicit changes over broad refactors
- Distinctive: line 158
Keep code idempotent and defensive when working on controllers, reconcilers, queue handlers, or release tooling
- Distinctive: line 160
Add or update tests when behavior changes
- Distinctive: line 161
Avoid placeholders, speculative abstractions, and unnecessary indirection
- Distinctive: line 163
If a task is not HTTP/API work, do not force API patterns into the implementation
- Distinctive: line 167
All exported symbols need godoc comments
- Very specific: line 168
Use logrus for app logging, klog for K8s logging
- Distinctive: line 170
Follow standard Go formatting (gofmt, goimports - enforced by CI)
- Distinctive: line 176
Use context for cancellation and timeouts
- Distinctive: line 183
Always update status separately from spec
- Distinctive: line 184
Use finalizers for cleanup
- Distinctive: line 186
Keep webhook logic fast and deterministic
- Very specific: line 190
Use k8sutil.IsTransientK8sError(err) (internal/util/k8sutil/errors.go) to classify K8s API errors before deciding how to handle them.
- Very specific: line 193
Never return both Requeue: true and an error .
- Very specific: line 194
Use reconcile.TerminalError() for truly unrecoverable errors to prevent retries
- Distinctive: line 197
Keep NotFound handling scoped to resource discovery and Kubernetes API errors that can recover on retry.
- Very specific: line 224
Use the local PR template shape with Customer Summary, TL;DR, Additional Details, For the Reviewer, For QA, and Tickets
- Distinctive: line 229
Commit format (Conventional Commits v1.0.0 required):
- Distinctive: line 262
Before committing (CRITICAL - prevents CI failures):
- Distinctive: line 286
All fixes and changes must be made in non-vendor files only
- Very specific: line 288
If you encounter issues in vendor code, update dependencies in go.mod and run go mod vendor
- Distinctive: line 293
Add tests for your changes (aim for >73% coverage)
- Very specific: line 295
Run all checks: make test && make lint
- Very specific: line 296
Run make codegen-update if you touched pkg/apis/
- Distinctive: line 297
Verify clean working directory: git diff --exit-code
- Distinctive: line 298
Commit with conventional format
- Distinctive: line 299
Create PR to main branch
- Distinctive: line 301
Wait for CI to pass
- Common: line 314
NEVER commit credentials, API keys, or secrets (use K8s secrets, inject at runtime)
- Very specific: line 316
Check go.mod replace directives for security patches
- Distinctive: line 317
Run containers as non-root when possible
- Distinctive: line 327
Use standard Go tooling for GitHub-facing work - only use internal dev shells when explicitly available
- Distinctive: line 362
Update all generated code:
- Very specific: line 378
After adding/removing/updating dependencies in go.mod
- Very specific: line 473
Do not create a bare vMAJOR.MINOR.PATCH tag.
- Distinctive: line 500
Keep GitHub-facing documentation free of internal CI pipeline commands and generated pipeline artifacts.
- Very specific: line 544
Before making cross-repo assumptions, consult nvcf-agentic-dev first.
- Distinctive: line 550
Do not assume a specific forge host.
- Very specific: line 551
Start with workspaces/self-hosted-nvcf/repos.yaml to confirm repo ownership and nearby repos.
- Very specific: line 552
When topology or rollout ordering matters, also read workspaces/self-hosted-nvcf/docs/deployment-sequence.md and …
- Very specific: line 553
Treat nvcf-agentic-dev as the routing layer: use it to identify the owning repo and dependencies, then do the implementation in the correct …
- Distinctive: line 563
Keep changes scoped to this repo unless the task explicitly requires coordinated edits elsewhere.
- Distinctive: line 564
If the work really belongs in another repo, say so clearly and move there instead of forcing the change here.
- Distinctive: line 565
Check for existing local changes before editing, and do not overwrite user work or generated artifacts without confirming the need.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - Guide for AI Coding Agents
Quick reference for working with NVCA (NVIDIA Cloud Functions Agent), a Kubernetes agent and operator (Go) that manages NVCF Bring-Your-Own-Compute (BYOC) clusters. This monorepo contains both the NVCA agent and the NVCA Operator (formerly a separate repository).
Quick Start
Use standard Go tooling by default:
go test ./internal/miniservice/... \
-ldflags '-X github.com/NVIDIA/k8s-dra-driver-gpu/internal/info.version=v25.8.0'Repository structure:
cmd/nvca/- Main NVCA agent binarycmd/webhook-server/- Admission webhook servercmd/discover-gpus/- GPU discovery toolcmd/nvca-operator/- NVCA Operator binary (manages agent lifecycle)cmd/nvca-self-managed/- Self-managed cluster setup binarycmd/nvca-mirror/- Image mirroring binarypkg/nvca/- Core agent logic (queue processing, workload management)pkg/webhook/- Webhook handlerspkg/storage/- Storage request controllerpkg/operator/- Operator reconciliation logic (NVCFBackend lifecycle)pkg/apis/- CRD definitions (triggers codegen)pkg/apis/nvcf/v1/- NVCFBackend CRD types (operator)internal/miniservice/- MiniService controllerinternal/gc/- Garbage collection cleanersinternal/metrics/- Prometheus metrics- Operator Helm chart:
deploy/helm/nvca-operator/nvca-operator/ test/- E2E and integration tests
Dev Environment Tips
- Use the direct
go testpattern below, including-ldflags, to run a single test - Run
make test-e2efor full end-to-end validation - Set
KUBEBUILDER_ASSETSfor VSCode/Cursor to run envtest tests in-editor (see README.md)
Build & Test Commands
Quick check before commit:
make test # Unit tests (excludes generated code)
make lint # golangci-lint + helm lintRun specific tests:
go test ./pkg/nvca -run TestBackend \
-ldflags '-X github.com/NVIDIA/k8s-dra-driver-gpu/internal/info.version=v25.8.0'
go test -v ./pkg/storage \
-ldflags '-X github.com/NVIDIA/k8s-dra-driver-gpu/internal/info.version=v25.8.0'Running tests in AI agents / IDEs:
When running go test directly (not via make test), you must pass ldflags to set the DRA driver version, otherwise tests will panic with could not parse "unknown" as version:
go test ./internal/miniservice/... -v \
-ldflags '-X github.com/NVIDIA/k8s-dra-driver-gpu/internal/info.version=v25.8.0'This is automatically handled by make test, but required when using go test directly.
Build artifacts:
mkdir -p _output/bin
go build -o _output/bin/nvca ./cmd/nvca
go build -o _output/bin/nvca-operator ./cmd/nvca-operator
go build -o _output/bin/webhook-server ./cmd/webhook-serverCode generation (MUST run after CRD changes):
make codegen-update # Generate clientsets, informers, listers, DeepCopy
make openapigen-update # Update OpenAPI schema
make testdata-update # Regenerate test data
make docs-update # Regenerate docsLocal E2E tests:
make test-e2eTesting Instructions
Before committing:
# Format YOUR code only (DO NOT run gofmt on vendor/)
gofmt -w $(find . -name '*.go' -not -path './vendor/*')
# Run all CI checks locally
make test # Must pass (>73% coverage target)
make lint # Must pass (golangci-lint)
# Verify vendor check will pass (no uncommitted changes)
git diff --exit-codeQuick pre-commit validation:
# Run all checks in one go
gofmt -w $(find . -name '*.go' -not -path './vendor/*') && make test && make lint && git diff --exit-codeTest structure:
- Tests live next to code:
foo.go->foo_test.go - Use table-driven tests for multiple scenarios
- Test naming:
TestFunctionNameorTestStructName_MethodName - Test data in
pkg/nvca/testdata/,internal/*/testdata/ - E2E tests in
test/e2e/(run withmake test-e2e)
Envtest setup (for K8s controller tests):
# Automatically handled by make test, but for IDE:
source <(./scripts/setup_envtest)
echo $KUBEBUILDER_ASSETSExample test pattern:
func TestQueueMessageProcessing(t *testing.T) {
tests := []struct {
name string
message *QueueMessage
wantErr bool
}{
{name: "valid creation", message: &QueueMessage{...}, wantErr: false},
{name: "nil message", message: nil, wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test implementation
})
}
}Code Style
General implementation guidance (applies to AI agents too):
- Match the existing package structure, naming, logging, and error-handling conventions in the repo instead of imposing a new framework or style
- Prefer small, explicit changes over broad refactors
- Keep code idempotent and defensive when working on controllers, reconcilers, queue handlers, or release tooling
- Handle errors explicitly and return context-rich errors when that helps the caller or operator
- Add or update tests when behavior changes
- Avoid placeholders, speculative abstractions, and unnecessary indirection
- Comment only when the logic is non-obvious
- If a task is not HTTP/API work, do not force API patterns into the implementation
Go standards:
- All exported symbols need godoc comments
- Use
logrusfor app logging,klogfor K8s logging - Handle all errors explicitly
- Follow standard Go formatting (gofmt, goimports - enforced by CI)
- 120 char line limit
NVCA-specific patterns:
- Queue message handlers must be idempotent
- Use context for cancellation and timeouts
- Separate storage controller reconciliation from main agent loop
- MiniService controller handles Helm chart lifecycle
Operator-specific patterns:
- Reconciliation must be idempotent
- Always update status separately from spec
- Use finalizers for cleanup
- Set owner references on managed resources
- Keep webhook logic fast and deterministic
Reconcile error handling:
- Use
k8sutil.IsTransientK8sError(err)(internal/util/k8sutil/errors.go) to classify K8s API errors before deciding how to handle them. Packages that must stay small, such as the cluster-validator, callk8serr.IsTransient(err)(internal/util/k8serr), which holds the classification - Transient errors (timeouts, 429, 503, 500, conflicts, network errors) -> return
reconcile.Result{Requeue: true}, nil(silent requeue, no error metric) - Non-transient errors (Forbidden, Unauthorized, Invalid, Gone) -> return
reconcile.Result{}, err(surfaces as reconcile failure) - Never return both
Requeue: trueand an error ; returning an error already triggers automatic requeue with exponential backoff - Use
reconcile.TerminalError()for truly unrecoverable errors to prevent retries - For batch error collections (cleanup paths), use
k8sutil.AnyNonTransientK8sError(errs)to check if any error is non-transient - Log transient errors at
log.V(1).Info(), non-transient atlog.Error() - Keep NotFound handling scoped to resource discovery and Kubernetes API errors that can recover on retry.
Package structure:
cmd/ - Binary entry points (nvca, webhook-server, nvca-operator, nvca-self-managed, nvca-mirror)
pkg/apis/ - CRD definitions (triggers codegen)
pkg/apis/nvcf/v1/ - NVCFBackend CRD types
pkg/nvca/ - Core agent logic
pkg/storage/ - StorageRequest controller
pkg/webhook/ - Admission webhooks
pkg/queue/ - SQS/NATS queue clients
pkg/featureflag/ - Feature flag management
pkg/operator/ - Operator reconciliation logic
pkg/operator/types/ - Operator-specific types
internal/ - Private packages
miniservice/ - MiniService controller
gc/ - Garbage collection
metrics/ - Prometheus metrics
util/ - Shared utilities
(chart lives in deploy/helm/nvca-operator/nvca-operator/)Commit & PR Instructions
General PR authoring guidance (applies to AI agents too):
- Use the local PR template shape with
Customer Summary,TL;DR,Additional Details,For the Reviewer,For QA, andTickets - For
feat,fix, andperfPRs, makeCustomer Summarycustomer-facing because it is used in release notes - In
For QA, list the exact checks or commands you ran and state whether QA is needed - Reference the relevant ticket when one exists; use
NO-REFonly when that is acceptable for the change
Commit format (Conventional Commits v1.0.0 required):
<type>(<scope>): <short description>
[optional body]
Closes NVCFCLUST-XXXX # or use NO-REF if no ticketTypes:
- Customer (in release notes):
feat,fix,perf- scope required - Foundational (not in release notes):
docs,build,test,refactor,ci,chore,style,revert
Examples:
feat(queue): add support for batch message processing
fix(storage): handle PVC deletion race condition
test(miniservice): add unit tests for chart reconciliationBreaking changes - add to footer:
feat(api): change MiniService status structure
BREAKING CHANGE: The status.conditions field has been restructured.
Closes NVCFCLUST-1234Before committing (CRITICAL - prevents CI failures):
# 1. Format YOUR Go code only (NOT vendor/)
gofmt -w $(find . -name '*.go' -not -path './vendor/*')
# 2. Run tests
make test # All unit tests must pass
# 3. Run linters
make lint # All linters must pass
# 4. Run codegen if needed
make codegen-update # If you changed CRDs in pkg/apis/
# 5. Verify no uncommitted changes (vendor check)
git diff --exit-code
# Quick one-liner to run all checks:
gofmt -w $(find . -name '*.go' -not -path './vendor/*') && make test && make lint && git diff --exit-codeIMPORTANT: Never modify vendor files
- All fixes and changes must be made in non-vendor files only
- Vendor files are managed by
go mod vendorand should not be edited directly - If you encounter issues in vendor code, update dependencies in
go.modand rungo mod vendor
PR checklist:
- Fork repo, create feature branch
- Add tests for your changes (aim for >73% coverage)
- Format YOUR code only:
gofmt -w $(find . -name '*.go' -not -path './vendor/*') - Run all checks:
make test && make lint - Run
make codegen-updateif you touchedpkg/apis/ - Verify clean working directory:
git diff --exit-code - Commit with conventional format
- Create PR to
mainbranch - Fill in PR template (Customer Summary for feat/fix/perf, TL;DR, ticket number)
- Wait for CI to pass
- Address review feedback
Branch strategy:
main- development branch, target for new featuresrelease-src/compute-plane-services/nvca/vX.Y- component maintenance branches; follow the release workflow.
Security Considerations
Critical rules:
- NEVER commit credentials, API keys, or secrets (use K8s secrets, inject at runtime)
- Validate all webhook inputs, use TLS, implement timeouts
- Check
go.modreplace directives for security patches - Run containers as non-root when possible
Reporting vulnerabilities - DO NOT use public issue trackers:
- Web: https://www.nvidia.com/object/submit-security-vulnerability.html
- Email: psirt@nvidia.com
- Include: product/version, vulnerability type, repro steps, PoC code, impact
Common Gotchas
- Use standard Go tooling for GitHub-facing work - only use internal dev shells when explicitly available
- CRD changes = run codegen - after touching
pkg/apis/, MUST runmake codegen-updateandmake openapigen-update - Dependency changes = update vendor + LICENSE - run
go mod tidyandgo mod vendorafter changinggo.mod, then update the THIRD-PARTY LICENSES section inLICENSEfile - Envtest required - some tests need
KUBEBUILDER_ASSETSset (handled bymake test) - Local vs CI - local tests may pass but CI may have additional checks
- Queue message idempotency - handlers may receive duplicate messages
- Storage controller timing - PVC operations are async, handle races carefully
- MiniService chartcache key must include namespace - The
chartcache.ChartCacheInputstruct (ininternal/miniservice/chartcache/) is used to generate cache keys for rendered Helm charts. Any field that affects the Helm template output (e.g.,.Release.Namespace) MUST be included in this struct. If namespace is missing from the cache key, cached output from namespace A can be incorrectly returned for namespace B. When adding new fields toHelmReValRenderInputthat affect rendering, also add them toChartCacheInputand updategetCacheKey()inreconcile.go.
Code Generation Triggers
Modified CRD types in pkg/apis/? Run:
make codegen-update # Generates clientsets, informers, listers, DeepCopy
make openapigen-update # Updates OpenAPI schemaModified test data templates? Run:
make testdata-updateChanged dependencies (go.mod)? Run:
go mod tidy
go mod vendor
# Then update LICENSE file with new third-party licenses:
find vendor -name "LICENSE*" -type f | sort
# Copy the output to the THIRD-PARTY LICENSES section in LICENSEUpdate all generated code:
make codegen-update
make openapigen-update
make testdata-update
make docs-updateLICENSE File Maintenance
The LICENSE file contains the NVIDIA Apache 2.0 license and a complete list of third-party licenses from vendored dependencies.
When to update:
- After running
go mod vendor - After adding/removing/updating dependencies in
go.mod
How to update:
# Generate the list of third-party licenses
find vendor -name "LICENSE*" -type f | sort
# Copy the output to the THIRD-PARTY LICENSES section in LICENSE fileWhy this matters:
- Legal compliance requires accurate attribution of third-party code
- The LICENSE file must reflect current vendored dependencies
Metrics Initialization
Counter metrics are pre-initialized to zero in internal/metrics/metrics.go so they appear on the first Prometheus scrape. When adding new label values, update the initialization code.
Files to update:
internal/metrics/metrics.go- Add new values to the initialization loops inNewDefaultMetrics()internal/metrics/metrics_test.go- Add new values toTestMetricsInitializedToZero
Currently initialized metrics:
| Metric | Label | Values to maintain |
K8sAPISuccessTotal / K8sAPIFailureTotal | resource | K8s resource types used in TrackK8sAPICall() calls |
MiniServiceEventErrorTotal | event_kind | Event constants in internal/miniservice/ |
OrphanedResourceCleanupTotal | resource_type | Constants in internal/metrics/gctypes/types.go |
OrphanedResourceCleanupTotal | status | success, failure |
GCCleanerRunTotal | cleaner_name | Name() methods in internal/gc/*/cleaner.go |
GCCleanerRunTotal | status | success, failure |
KataRuntimeIsolationEnabled | (default labels only) | Initialized to 0; set via SetKataRuntimeIsolationEnabled() in pkg/nvca/agent.go |
MaintenanceModeState | mode | MaintenanceMode enum in pkg/types/types.go (AllMaintenanceModes); one-hot, set via SetMaintenanceModeState() / WithMaintenanceMode() |
BYOOPlatformMetricsFederationState | state | AllBYOOPlatformMetricsFederationStates in internal/metrics/metrics.go; one-hot, starts at not_checked, set by pkg/nvca/byoofederation |
WorkloadResultTotal | workload_type | container, helm (defined in AllWorkloadTypes) |
WorkloadResultTotal | workload_kind | Constants in internal/metrics/workloadtypes/types.go (AllWorkloadKinds) |
WorkloadResultTotal | workload_status | success, failure |
WorkloadResultTotal | failure_category | FailureCategory enum in internal/metrics/workloadtypes/types.go (AllFailureCategories) |
UpstreamRequestTotal | operation | UpstreamOperationHeartbeat, UpstreamOperationRegister, UpstreamOperationCredentials in internal/metrics/metrics.go (AllUpstreamOperations) |
SchedulerWorkloadCount | scheduler_name | default-scheduler, kai-scheduler (constants in internal/metrics/metrics.go) |
SchedulerWorkloadCount | workload_kind | Constants in internal/metrics/workloadtypes/types.go (AllWorkloadKinds) |
When to update:
- Adding a new K8s resource type to
TrackK8sAPICall()calls - Adding a new GC cleaner in
internal/gc/ - Adding a new resource type constant in
internal/metrics/gctypes/ - Adding a new MiniService event error type
- Adding a new failure category or workload type/kind in
internal/metrics/workloadtypes/ - Adding a new upstream operation constant to
AllUpstreamOperationsininternal/metrics/metrics.go - Adding a new maintenance mode to
AllMaintenanceModesinpkg/types/types.go
Why this matters:
- Prometheus
absent()alerts fail on non-existent metrics rate()calculations give unexpected results if metrics appear mid-scrape- Dashboards show gaps instead of zeros
OTel client metrics (outbound dependencies)
Outbound dependency clients are instrumented with OpenTelemetry metrics following
the OpenTelemetry Semantic Conventions, separate from the client_golang metrics
above. This path does not use the manual zero-init loops: instruments come from an
OTel MeterProvider and are exported through the OTel to Prometheus bridge onto the
same /metrics endpoint. It is gated by the ClientMetrics feature flag.
- Pipeline:
internal/otel/meter.go. Recording:internal/metrics/clientmetrics/. Labels: the semconv helpers ininternal/metrics/semconv/. - Instrumented today: ICMS, ReVal, FNDS, the OAuth token fetchers, and the queue client.
- Declare histogram buckets explicitly and keep label values bounded.
See internal/metrics/METRICS.md for the metric list, the label vocabulary, and
the recipe for adding a new dependency or a new transport type.
Key Environment Variables
Useful local test variables:
NVCF_GOMAXPROCS- max parallel test execution (default: 4)KUBEBUILDER_ASSETS- envtest binaries location
Versioning & Tag Formats
NVCA uses Semantic Versioning. Tags are path-scoped, because every subproject in this monorepo shares one tag namespace:
src/compute-plane-services/nvca/vMAJOR.MINOR.PATCHDo not create a bare vMAJOR.MINOR.PATCH tag. That was the convention in the
standalone NVCA repository and it collides with every other subproject here.
Supported tag formats:
| Format | Description | Example |
<path>/vMAJOR.MINOR.PATCH | Release version | src/compute-plane-services/nvca/v3.4.0 |
<path>/vMAJOR.MINOR.PATCH-rc.N | Release candidate | src/compute-plane-services/nvca/v3.4.0-rc.1 |
Version precedence, lowest to highest: 3.4.0-rc.1 < 3.4.0.
Creating tags on main: do not. Release automation cuts the tag when a
feat, fix, or perf commit touching this subtree merges to main.
On a release-* maintenance branch there is no automation, so a maintainer
does create and push the patch tag by hand. See
RELEASE.md at the repository root for that procedure
and the full model.
NVCA previously cut -dev.N prereleases from a VERSION file on every push
to main. That model is retired: the VERSION file is gone and the existing
-dev.N tags remain only as history.
CI behavior:
- Tags trigger release validation in the hosting environment.
- Keep GitHub-facing documentation free of internal CI pipeline commands and generated pipeline artifacts.
Observability
- Metrics: Prometheus metrics in
internal/metrics/- see METRICS.md for full documentation - Tracing: OpenTelemetry via
internal/otel/ - Logging: Structured logging with logrus
- Profiling: pprof endpoints available - use
./scripts/users/nvca-pprof.sh heap
Debugging NVCA
# Profile NVCA heap
./scripts/users/nvca-pprof.sh heap
# Profile CPU
./scripts/users/nvca-pprof.sh profile
# View goroutines
./scripts/users/nvca-pprof.sh goroutineFeature Flags & Attributes
For cluster-wide attributes and feature flags documentation, see:
- Feature Flags Doc
Quick Links
- CONTRIBUTING.md
- Metrics Documentation
- Feature Flags
- NVIDIA Cloud Functions Docs
- Conventional Commits
- Maintainers: nvidia/nvca-dev
NVCF Workspace Routing
- Team:
@dsx-ai-factory/nvcf-dev. - This repo is part of the
self-hosted-nvcfworkspace innvcf-agentic-dev. - Manifest tier:
image-source. - Default owner:
@dsx-ai-factory/nvcf-dev. - Manifest description: NVCA worker agent application source (owned by EGX intelligent-infra team).
- Before making cross-repo assumptions, consult
nvcf-agentic-devfirst. - Preferred local sibling path:
../nvcf-agentic-devif it exists. - Resolve
nvcf-agentic-devin this order:- local sibling checkout
../nvcf-agentic-dev - workspace checkout named
nvcf-agentic-dev - the current
originURL of a localnvcf-agentic-devclone
- local sibling checkout
- Do not assume a specific forge host.
- Start with
workspaces/self-hosted-nvcf/repos.yamlto confirm repo ownership and nearby repos. - When topology or rollout ordering matters, also read
workspaces/self-hosted-nvcf/docs/deployment-sequence.mdandworkspaces/self-hosted-nvcf/docs/deployment-dependencies-with-links.yaml. - Treat
nvcf-agentic-devas the routing layer: use it to identify the owning repo and dependencies, then do the implementation in the correct repo.
Repo-Specific Routing Guidance
- This repo owns NVCA worker/agent logic. Deployment packaging usually lives in
nvca-operator-deploy; SBOM consumers may involvesbom-templatesandmanifests. - Closely related repos:
nvca-operator,nvca-operator-deploy,sbom-templates,manifests.
Agent Expectations for Workspace Routing
- Summarize the route you chose before substantial edits: why this repo is the owner, what sibling repos are relevant, and whether
nvcf-agentic-devdocs influenced the plan. - Keep changes scoped to this repo unless the task explicitly requires coordinated edits elsewhere.
- If the work really belongs in another repo, say so clearly and move there instead of forcing the change here.
- Check for existing local changes before editing, and do not overwrite user work or generated artifacts without confirming the need.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

