Repository navigation
Conversation
Defaulting and validation for native v1beta2 DynamoGraphDeploymentRequests, on top of the conversion API (#13744). Admission runs through the shared v1beta1 webhooks (matchPolicy: Equivalent) and is routed by the original request's API version: a native v1beta2 request is decoded from spec.v1beta2, defaulted, validated and re-encoded; a foreign-version carrier is never mutated, direct carrier creates are rejected, and an unchanged foreign view can still be updated. Defaults: backends, workload (static ISL 1024, OSL 128, concurrency 10), objective (Optimize, Throughput), recommendation (maxCandidates 1), hardware discovery on CREATE only, and the operator's AISimulate image. The structural defaults are applied in admission, not the CRD schema, because a schema default would also be applied to an object that carries spec.v1beta1 and conversion would then reject it; only nested defaults stay in the schema. Explicit empty objects (workload.static: {}, objective.sla: {}) are kept. The AISimulate input is derived from the typed spec with derived defaults (request_count, sweep.max_trials, strict_sla) computed first and spec.aisimulate.parameters merged last, once. The base's early returns for requests carrying spec.v1beta2 are removed so those requests are validated. internal/runtimeversion is renamed internal/versionoverride. Tests: defaulting and routing unit tests, a CRD drift test (no top-level defaults; nested defaults equal the webhook's), admission envtest rows, an API-server test that carrier objects stay writable through every served version, and a Helm unit test for matchPolicy. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…unchanged carrier Objective.metric: the Optimize default is Throughput, not ThroughputPerGPU. Workload: the fixed-concurrency default creates neither sweep.max_trials nor a KV-load ratio search. The carrier test now also writes the unchanged foreign view back with a full update and requires the spec to be byte-stable and the generation unchanged, in both directions. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…ssion Validate the lowered input, so hardware given only in spec.aisimulate.parameters counts and a null that deletes discovered hardware does not. Updates validate only when the spec changed. Rewrite the aisimulate package contract to match. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…dline Split the flag description (lll). Drop the constant kind parameter of the test helper (unparam). Match the lowercased error text for the DCGM-not-enabled reason, which never matched. Give the DCGM phase of GPU discovery half of the remaining deadline so the node-label fallback keeps time to run. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…a deadline The DCGM phase reserved time for the fallback by calling NodeLabels() before DCGM ran. Callers without a deadline, such as the v1beta1 reconciler, never needed that and could hit a callback that was not configured for them. Evaluate it only when there is a deadline to share, and test that it is not asked otherwise. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
…ssion Admission validates the typed spec and the image/version selection only. Drop the parameters object check and the effective-hardware validation; hardware discovery reads spec.hardware alone. A Request whose discovery fails is admitted and reported as Accepted=False/InvalidSpec by the Request controller. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…aults
Remove the +kubebuilder:default markers for workload.static, objective.mode
and recommendation.maxCandidates, and the test that compared them with the
webhook constants. Default in the order of the Go API types: each parent
creates its documented default child and fills its own scalars, and
workload.static: {} stays an opt-out.
Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…ange spec.hardware Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…re the GPU discoverer Default through the NativeSpec and NativeSearchInput types in declaration order. Make the aisimulate native paths package-private and drop the unused ones. HardwareDiscoverer now has the signature of gpu.Discoverer, so the shared discoverer satisfies it directly and the catalog mapping lives in resolveHardware. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…nd CEL Backend uniqueness is +listType=set and the kvLoadRatio range order is CEL on the type. Native model presence and the model name length were already enforced by the representation CEL and MinLength, so the webhook no longer repeats any of them. The operatorenv table covers the exact error paths. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…ssion table Move the externally observable defaulting cases into the admission table and delete v1beta2SchemaDefaulted and the direct-function matrix. The unit tests that remain cover resolver and envelope internals. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
…dary Resolve the admission request once in Validate and ValidateUpdate and fail when it is absent. Compare the requested version with the spec.v1beta2 carrier directly and drop RequestUsesV1Beta2, RequestIsNative and requestIsNative. The mutating handler returns the missing-request error instead of skipping defaulting. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
An operator-configured default image whose tag is not a semantic version was admitted without a versionOverride, and validation then rejected every Request that received it. Add --dgdr-aisimulate-default-version-override and the matching Helm value, and persist the pair together: the override follows the image, so a caller's own image derives its own version or brings its own override. Reject at startup a default image that validation would always reject. Also register the v1beta2 types once, make the versionoverride comments domain-neutral, and regenerate the API reference. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
Admission now guarantees complete typed hardware for a v1beta2 Request instead of leaving gaps for AISimulate's implicit defaults. An omitted SKU is discovered, an omitted budget becomes min(matching GPUs, 32), and an explicit budget is authoritative and never capped. A failed discovery, a GPU model the AISimulate catalog does not know, no GPU of the pinned SKU, and an omitted SKU in a cluster with several GPU types are rejected on the field that fixes them. gpu.GPUInfo reports the models unfiltered discovery left out so that case can be detected. spec.aisimulate.parameters stays opaque. Signed-off-by: devivasudevan <49675305+devivasudevan@users.noreply.github.com>
Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe pull request adds v1beta2 Request admission defaults, GPU hardware discovery, and API-version-aware webhook routing and validation. It also adds AISimulate input lowering and merge-patch handling, updates Helm configuration and API references, and changes the shared compatibility-version package name. ChangesDGDR v1beta2 Request flow
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~50 minutes Merge Risk: ⚪ Minimal · up to
|
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
Squashed from #17191. Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
This PR is blocked by the admission PR #16661.
Summary
Document the complete
nvidia.com/v1beta2DGDR admission contract at the Go API types that generate the CRD and Kubernetes API reference. This also aligns the implemented model-only objective with the accepted API contract:Optimize/ThroughputPerGPUwithttftMs: 2000anditlMs: 30.Admission remains the single owner of Request defaults. The CRD carries their descriptions but no duplicate default markers. The comments now specify:
workload.static: {}/objective.sla: {}opt-outs;versionOverrideownership as one operator-provided pair; andspec.aisimulate.parametersas the opaque, final RFC 7386 Merge Patch over the typed and derived underlay.This PR is stacked on #16661 and includes its current commits so the resulting API contract can be reviewed now. Once #16661 merges, this PR reduces to commit
9e0c1ed7e5.Relates to #13545 and DGH-1426.
API examples
A model-only Request remains the minimal input:
Admission persists a resolved Request with this shape. The hardware and AISimulate artifact values depend on the cluster and operator configuration:
The nested empty objects opt out of only their whole-object defaults.
objectivestill receives its mode and metric defaults:Hardware fields are independently optional:
On update, unchanged hardware is not rediscovered. A hardware-changing update resolves only newly missing fields. Admission rejects discovery failures, unknown or ambiguous GPU types, and a missing budget when no matching GPUs exist. Native
parametersremains opaque during admission and may override the persisted typed hardware during controller lowering.The API field shapes are unchanged, so conversion code and conversion tests are unaffected. CRDs and both committed Kubernetes API references are regenerated from the Go comments.
Validation
go test ./internal/webhook/defaulting -count=1KUBEBUILDER_ASSETS=<repo-pinned-1.30.0-assets> go test ./internal/webhook/validation -run '^TestDynamoGraphDeploymentRequestValidator_Validate$' -count=1make -C deploy/operator manifestsmake -C deploy/operator generate-api-docspython3 docs/fern/scripts/gen_kubernetes_api.py --checkSummary by CodeRabbit
New Features
Bug Fixes
Documentation