Skip to content

feat: Add v1beta1 DGDR API with conversion framework - #6352

Merged
hhzhang16 merged 36 commits into
mainfrom
hannahz/6337-feature-add-conversion-from-dgdr-v1alpha1-to-dgdr-v1beta1
Feb 20, 2026
Merged

feat: Add v1beta1 DGDR API with conversion framework#6352
hhzhang16 merged 36 commits into
mainfrom
hannahz/6337-feature-add-conversion-from-dgdr-v1alpha1-to-dgdr-v1beta1

Conversation

@hhzhang16

@hhzhang16 hhzhang16 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Overview:

This MR adds the v1beta1 DGDR API laid out in ai-dynamo/enhancements#62 with conversion from the v1alpha1 DGDR schema, as well as automatic conversion into a Python Pydantic class for Dynamo Profiler.

Details:

Continuation of #6130, with conversion scripts. Follows k8s convention, with a hub/Spoke pattern: v1beta1 as hub, v1alpha1 as spoke. Most fields are mapped over, with any v1alpha1-specific fields preserved thru annotations. Marked v1alpha1 as deprecated while maintaining full backward compatibility with automatic conversion and user warnings. All fields have comprehensive comments/documentation.

Also added a script for automatic Pydantic model generation from Go types, for the Dynamo Profiler. Handles type mapping and structs/enums. Integrated this generation into build to keep things cohesive/so things don't break -- make generate runs generation + tests automatically.

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • New Features

    • Introduced v1beta1 API version for DynamoGraphDeploymentRequest with structured configuration options for workload specs, SLA targets, hardware specifications, and profiling strategies.
    • Added automatic conversion support between v1alpha1 and v1beta1 for backward compatibility.
  • Deprecation

    • v1alpha1 DynamoGraphDeploymentRequest is now deprecated; users should migrate to v1beta1.
  • Documentation

    • Updated API reference documentation to include v1beta1 type definitions and migration guidance.

Jont828 and others added 14 commits February 9, 2026 18:48
Signed-off-by: Jont828 <jt572@cornell.edu>
Signed-off-by: Jont828 <jt572@cornell.edu>
…conditions, and print cols to DGDR status

Signed-off-by: Jont828 <jt572@cornell.edu>
Signed-off-by: Jont828 <jt572@cornell.edu>
Move the +kubebuilder:storageversion marker from v1alpha1 to v1beta1
for all CRDs and regenerate manifests so v1beta1 is the version
persisted in etcd going forward.

Signed-off-by: Jont828 <jt572@cornell.edu>
Implement the controller-runtime conversion interface for 5 CRDs:
DynamoCheckpoint, DynamoComponentDeployment, DynamoGraphDeployment,
DynamoGraphDeploymentScalingAdapter, and DynamoModel.

v1beta1 is marked as the Hub and v1alpha1 implements ConvertTo/ConvertFrom
with field-by-field mapping. DGDR is excluded because the two versions
have fundamentally different schemas that cannot be losslessly converted.

Signed-off-by: Jont828 <jt572@cornell.edu>
Align the Go CRD types with the Python profiler's pydantic models so
that JSON serialized between operator and profiler is structurally
consistent:

- Introduce ModelSpec (modelName + modelCache) replacing flat model
  string and top-level modelCache field
- Introduce BackendSpec (backend + dynamoImage) replacing flat backend
  enum and top-level image field
- Rename ModelCacheSpec.PVCPath to ModelPathInPVC (json: modelPathInPvc)
- Add WorkloadSpec.Concurrency and RequestRate fields
- Add SLASpec.E2ELatency field
- Replace FeaturesSpec.Planner *bool with *PlannerSpec (enabled,
  plannerPreDeploymentSweeping, plannerArgsList)
- Replace FeaturesSpec.Mocker *bool with *MockerSpec (enabled)
- Add HardwareSpec with gpuSku, vramMb, totalGpus, numGpusPerNode
- Add PlannerPreDeploymentSweepMode enum (none, rapid, thorough)
- Remove OptimizationType "hybrid" value
- Update printcolumn JSONPaths for new nesting
- Update deepcopy methods for new and changed types

Signed-off-by: Jonathan Zhou <hongkuanz@nvidia.com>
Signed-off-by: Jont828 <jt572@cornell.edu>
Add v1alpha1 ↔ v1beta1 conversion for DynamoGraphDeploymentRequest
(DGDR) and split the monolithic conversion.go into per-type files
matching the existing *_types.go naming convention.

Hub marker: add DynamoGraphDeploymentRequest to v1beta1/hub.go.

DGDR conversion handles three categories of field mappings:
- Simple renames (Model, Backend, AutoApply, UseMocker, WorkersImage)
- JSON blob ↔ structured fields (SLA ttft/itl, Workload isl/osl,
  ModelCache) with full-blob annotation for round-trip preservation
- Annotation-based storage for v1alpha1 fields with no v1beta1
  equivalent (ProfilerImage, ConfigMapRef, OutputPVC, etc.)

State ↔ Phase mapping accounts for v1alpha1 "Ready" mapping to either
Ready or Deployed depending on Deployment.Created context.

Signed-off-by: Jont828 <jt572@cornell.edu>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
…add-conversion-from-dgdr-v1alpha1-to-dgdr-v1beta1
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16
hhzhang16 requested a review from a team as a code owner February 18, 2026 01:36
@hhzhang16
hhzhang16 requested a review from a team February 18, 2026 01:36
@hhzhang16
hhzhang16 requested a review from a team as a code owner February 18, 2026 01:36
@copy-pr-bot

copy-pr-bot Bot commented Feb 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added feat documentation Improvements or additions to documentation deployment::k8s Relates to dynamo deployment in kubernetes labels Feb 18, 2026
@coderabbitai

coderabbitai Bot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This change introduces a new v1beta1 API version for DynamoGraphDeploymentRequest with comprehensive profiling and deployment specifications, implements bi-directional conversion between v1alpha1 and v1beta1, generates Python Pydantic models from Go types, marks v1alpha1 as deprecated, and updates documentation accordingly.

Changes

Cohort / File(s) Summary
v1beta1 API Core
deploy/operator/api/v1beta1/dynamographdeploymentrequest_types.go, deploy/operator/api/v1beta1/dynamographdeploymentrequest_conversion.go, deploy/operator/api/v1beta1/groupversion_info.go, deploy/operator/api/v1beta1/zz_generated.deepcopy.go
Introduces complete v1beta1 API schema with lifecycle enums (DGDRPhase, ProfilingPhase), detailed spec/status structures for workload, SLA, hardware, model cache, features, and deployment results. Implements v1beta1 as conversion hub and provides auto-generated deepcopy methods for all types.
v1alpha1 Deprecation & Conversion
deploy/operator/api/v1alpha1/dynamographdeploymentrequest_types.go, deploy/operator/api/v1alpha1/dynamographdeploymentrequest_conversion.go, deploy/operator/api/v1alpha1/dynamo_model_types.go, deploy/operator/api/v1alpha1/dynamocomponentdeployment_types.go
Marks v1alpha1 DynamoGraphDeploymentRequest as deprecated with migration guidance to v1beta1. Implements bi-directional conversion logic handling JSON blob parsing, nested structure translation, annotation-driven field preservation, and phase mapping. Removes storageversion markers from v1alpha1 status types.
Python Pydantic Code Generation
deploy/operator/api/scripts/generate_pydantic_from_go.py, deploy/operator/api/scripts/test_pydantic_models.py
Adds conversion toolchain that parses Go types and generates Python Pydantic models. Includes type mapping, enum/struct parsing, optional field handling, and comprehensive test coverage validating generated models with nested structures and enum representations.
Generated Python Models
components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py
Auto-generated Pydantic models and enums representing v1beta1 DGDR types. Defines WorkloadSpec, SLASpec, ModelCacheSpec, HardwareSpec, FeaturesSpec, and root DynamoGraphDeploymentRequest with full field metadata and type annotations.
Build & Operator Integration
deploy/operator/Makefile, deploy/operator/PROJECT, deploy/operator/cmd/main.go
Updates Makefile with new generate-pydantic target to automate model generation and testing. Modifies PROJECT repo configuration and registers v1beta1 scheme in operator initialization.
API Documentation
docs/kubernetes/api_reference.md, docs/pages/kubernetes/api-reference.md
Adds comprehensive v1beta1 API documentation mirroring v1alpha1 definitions. Includes deprecation notice on v1alpha1 guiding users to migrate to v1beta1.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A new v1beta1 hops into the fold,
Converting old paths with stories retold,
From Go types to Python, the models take flight,
With schemas and deepcopy, everything's bright!
The profiler awakens with specs crystal clear,
v1alpha1 bows down—v1beta1's here! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: adding a v1beta1 DGDR API with conversion framework, which aligns with the primary objective of the changeset.
Description check ✅ Passed The pull request description is mostly complete, with an Overview, Details, and Related Issues sections. However, the 'Where should the reviewer start?' section is empty, missing specific file recommendations for focused review.
Docstring Coverage ✅ Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Signed-off-by: Hannah Zhang <hannahz@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: 9

🧹 Nitpick comments (8)
deploy/operator/api/scripts/generate_pydantic_from_go.py (2)

396-406: Fragile default output path — five parent traversals.

The default --output path climbs five directory levels from the script location and targets components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py. This is brittle; any directory restructuring silently writes to the wrong location. Consider resolving the repo root via git rev-parse --show-toplevel or a sentinel file (e.g., go.mod) instead of hard-coded parent traversals.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/api/scripts/generate_pydantic_from_go.py` around lines 396 -
406, The default for the --output argument in parser.add_argument inside
generate_pydantic_from_go.py is brittle because it uses five successive
Path.parent traversals to reach the repo path; replace this with a robust
repo-root resolution strategy (e.g., call out to git rev-parse --show-toplevel
or walk upward looking for a sentinel like go.mod) and build the output Path
relative to that root instead of chaining parent() calls; add a helper function
(e.g., resolve_repo_root or find_sentinel_root) and use it when constructing the
default for the --output argument so restructuring the repo won’t change where
dgdr_v1beta1_types.py is written.

54-67: Mutable class-level dict flagged by Ruff (RUF012).

TYPE_MAP is a mutable dict as a class attribute. While it's never mutated at runtime, the linter flags it. The simplest fix is to annotate it as ClassVar or use types.MappingProxyType for an immutable view.

Minimal fix using ClassVar annotation
+from typing import ClassVar
 ...
 class GoToPydanticConverter:
     """Converts Go structs to Pydantic models"""

     # Type mapping from Go to Python
-    TYPE_MAP = {
+    TYPE_MAP: ClassVar[dict[str, str]] = {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/api/scripts/generate_pydantic_from_go.py` around lines 54 -
67, TYPE_MAP is a mutable module-level dict flagged by Ruff RUF012; either
annotate it as an immutable ClassVar typing or expose it as an immutable
mapping. Fix by adding a typing annotation (e.g., from typing import ClassVar,
Dict, Any; declare TYPE_MAP: ClassVar[Dict[str, Any]] = {...}) or wrap the
literal with types.MappingProxyType (import types and set TYPE_MAP =
types.MappingProxyType({...})), and update imports accordingly so TYPE_MAP is
read-only at runtime.
deploy/operator/Makefile (1)

143-152: python3 is now a hard dependency for make generate (and transitively for build, test).

Since generate depends on generate-pydantic, any environment without python3 (and pydantic installed) will fail the entire build chain. Consider either:

  1. Making generate-pydantic a separate opt-in target not chained into generate, or
  2. Adding a guard similar to ensure-yq that checks for python3 and pydantic availability.

Also, the test invocation (test_pydantic_models.py) within a generation target is slightly unconventional. If the validation fails, it blocks deepcopy generation (controller-gen object on line 145). If this is intentional (fail-fast), it's fine—just worth noting.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/Makefile` around lines 143 - 152, The generate target
currently depends on generate-pydantic making python3 and pydantic required for
make generate; change this by removing generate-pydantic from the generate
prerequisites and either (A) add a new independent opt-in target (e.g.,
generate-pydantic) users run manually, or (B) introduce a guard target
ensure-python (similar to ensure-yq) that checks for python3 and that pydantic
can be imported (e.g., using command -v python3 and python3 -c "import
pydantic") and make generate-pydantic depend on ensure-python so generation only
fails with a clear message when the optional Python step is requested; keep
controller-gen invocation in the generate target unchanged if deepcopy
generation should remain independent of Python validation.
deploy/operator/api/scripts/test_pydantic_models.py (1)

43-58: Tests use sys.exit(1) on first failure — later tests are never reached.

Each test function calls sys.exit(1) on any exception, which prevents subsequent tests from running and makes it harder to diagnose multiple issues at once. Consider collecting failures and reporting at the end, or using pytest/unittest instead of a custom runner.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/api/scripts/test_pydantic_models.py` around lines 43 - 58,
The test function test_simple_dgdr currently catches all exceptions and calls
sys.exit(1), which aborts the test process and prevents subsequent tests from
running; remove the try/except and sys.exit usage so failures surface normally
(or re-raise the exception) and let the test framework (or a higher-level
runner) report multiple failures, or convert this file to use pytest/unittest
style asserts and test discovery for aggregated reporting; specifically modify
test_simple_dgdr to not call sys.exit(1) on exception and instead allow the
exception to propagate or use standard test framework patterns.
deploy/operator/api/v1beta1/dynamographdeploymentrequest_types.go (2)

547-565: Minor: inconsistent receiver names across helper methods.

SetPhase uses s while GetPhase, SetProfilingPhase, and ClearProfilingPhase use d. Consider unifying to a single name (e.g., d for "dgdr").

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/api/v1beta1/dynamographdeploymentrequest_types.go` around
lines 547 - 565, The receiver name in SetPhase is inconsistent (uses "s")
compared to GetPhase, SetProfilingPhase, and ClearProfilingPhase which use "d";
update the SetPhase method receiver from "s *DynamoGraphDeploymentRequest" to "d
*DynamoGraphDeploymentRequest" so all helper methods use the same receiver
identifier (e.g., d) for DynamoGraphDeploymentRequest to improve consistency and
readability.

569-579: AddStatusCondition reimplements meta.SetStatusCondition without LastTransitionTime tracking.

The standard apimachinery/pkg/api/meta.SetStatusCondition automatically preserves LastTransitionTime when the condition status hasn't changed and updates it when it has. This custom implementation replaces the condition unconditionally, which can cause LastTransitionTime to be reset on every reconcile even when the condition hasn't changed.

Proposed fix: use the standard helper
+import "k8s.io/apimachinery/pkg/api/meta"
+
 // AddStatusCondition adds or updates a condition in the status.
-// If a condition with the same type already exists, it replaces it.
 func (s *DynamoGraphDeploymentRequest) AddStatusCondition(condition metav1.Condition) {
-	if s.Status.Conditions == nil {
-		s.Status.Conditions = []metav1.Condition{}
-	}
-	for i, existing := range s.Status.Conditions {
-		if existing.Type == condition.Type {
-			s.Status.Conditions[i] = condition
-			return
-		}
-	}
-	s.Status.Conditions = append(s.Status.Conditions, condition)
+	meta.SetStatusCondition(&s.Status.Conditions, condition)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deploy/operator/api/v1beta1/dynamographdeploymentrequest_types.go` around
lines 569 - 579, The AddStatusCondition method on DynamoGraphDeploymentRequest
reimplements condition replacement and therefore always overwrites
LastTransitionTime; replace its logic to call the standard
meta.SetStatusCondition helper so LastTransitionTime is preserved/updated
correctly for s.Status.Conditions and metav1.Condition updates—i.e., import
apimachinery/pkg/api/meta (meta) if needed and invoke
meta.SetStatusCondition(&s.Status, condition) inside the AddStatusCondition
method instead of the manual loop and append.
components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py (2)

321-325: Auto-generated docstring contains lifecycle steps instead of type description.

The DynamoGraphDeploymentRequest class docstring is the lifecycle steps from the Go comment block rather than a description of what the class is. Consider improving the generator to extract the main description separately.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py` around lines 321
- 325, The class docstring for DynamoGraphDeploymentRequest currently contains
lifecycle steps (Go comment block) instead of a concise type description; update
the docstring to describe the purpose and contents of the
DynamoGraphDeploymentRequest model (e.g., that it represents a request with
optional spec and status fields), and remove or relocate the lifecycle steps to
a more appropriate place (such as a separate constant, comment above the status
enum/type, or the DynamoGraphDeploymentRequestStatus class) so the generated
docstring is a clear human-readable type description for
DynamoGraphDeploymentRequest (referencing the spec:
DynamoGraphDeploymentRequestSpec and status: DynamoGraphDeploymentRequestStatus
members).

110-113: pvcMountPath default differs from Go type.

The Go type has +kubebuilder:default="/opt/model-cache" but the generated Pydantic model defaults to None. If the profiler relies on this default, objects constructed without pvcMountPath will behave differently depending on whether they're created via Go or Python. Consider aligning the default:

     pvcMountPath: Optional[str] = Field(
-        default=None,
+        default="/opt/model-cache",
         description="PVCMountPath is the mount path for the PVC inside the container.",
     )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py` around lines 110
- 113, The pvcMountPath Field in dgdr_v1beta1_types.py currently defaults to
None but must match the Go kubebuilder default "/opt/model-cache"; update the
pvcMountPath declaration so its Field default is "/opt/model-cache" (i.e.,
change the default parameter on the Field for pvcMountPath) so
Python-constructed objects have the same default as the Go type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py`:
- Around line 1-8: Add the missing copyright/license header to the top of the
generated Pydantic file (dgdr_v1beta1_types.py) so CI's copyright check passes;
update the generator script generate_pydantic_from_go.py to prepend the same
header text it uses for test files (or a shared header template) when emitting
the file, ensuring the header appears before the auto-generated notice and file
content and is applied consistently for all generated outputs.

In `@deploy/operator/api/scripts/generate_pydantic_from_go.py`:
- Around line 1-10: Add the required NVIDIA SPDX copyright header to the top of
generate_pydantic_from_go.py (above the shebang or immediately after it if
policy requires) to satisfy CI; update the file header block so it includes the
standard SPDX-License-Identifier and copyright notice used across the repo,
ensuring the header appears before any module docstring or code in the
generate_pydantic_from_go.py script.
- Around line 190-210: The parser currently skips single-line comments
immediately preceding a field because of the conditional that checks a comment
line whose next line is not a comment; remove that premature skip so single-line
comments are not dropped and let the existing multi-line comment collector (the
while line.startswith("//") loop that fills comment_lines) handle both single-
and multi-line comment blocks for fields. Concretely, remove the entire if
branch that checks line.startswith("//") and i+1... (the guard before the
comment_lines collection) so the code always falls into the comment_lines
collection, and ensure i is still advanced correctly inside the collector to
avoid an infinite loop.

In `@deploy/operator/api/scripts/test_pydantic_models.py`:
- Around line 78-81: The test uses ModelCacheSpec with an invalid field name
pvcPath which Pydantic will ignore; update the instantiation to use the correct
field name pvcModelPath in the ModelCacheSpec call (replace
pvcPath="llama-3.1-405b" with pvcModelPath="llama-3.1-405b"), and add an
assertion like assert spec.modelCache.pvcModelPath == "llama-3.1-405b" to ensure
the value is actually set.
- Line 1: Add the required SPDX copyright header to the top of the script so the
CI copyright check passes: insert the standard SPDX header comment block
immediately after (or on the line following) the existing shebang in
deploy/operator/api/scripts/test_pydantic_models.py; ensure it uses the
project's expected format (e.g., an SPDX-License-Identifier line and copyright
notice) and preserves the shebang and file permissions.

In `@deploy/operator/api/v1alpha1/dynamographdeploymentrequest_conversion.go`:
- Around line 596-607: The fallback that builds a minimal DeploymentStatus when
dst.Deployment is nil and src.DGDName is set should not assume the DGD already
exists; change the constructed DeploymentStatus (currently
DeploymentStatus{Name: src.DGDName, Created: true}) to leave Created false (or
explicitly set Created: false) so the v1alpha1 controller will not skip creating
the DGD; update the block that assigns dst.Deployment when dst.Deployment == nil
&& src.DGDName != "" to use Created: false (or the zero value) and keep the Name
populated.
- Around line 163-164: The annDGDRProfilingJobName constant is declared but
never used, so Status.ProfilingJobName is not preserved across conversions;
update convertDGDRStatusFrom to read ProfilingJobName from the v1beta1 source
object's annotations using annDGDRProfilingJobName and set it into the v1alpha1
Status (or into ObjectMeta annotations on the target if the v1alpha1 Status
lacks the field), and update convertDGDRStatusTo to write ProfilingJobName back
into the v1beta1 target's annotations using annDGDRProfilingJobName when present
in the v1alpha1 source; use the existing annDGDRProfilingJobName symbol and the
convertDGDRStatusFrom/convertDGDRStatusTo functions to locate where to add the
read/write annotation logic so the value round-trips.

In `@deploy/operator/cmd/main.go`:
- Around line 127-128: The DGDR conversion webhook is not registered and the CRD
lacks a .spec.conversion section; update the CRD manifest to include a
.spec.conversion block (strategy: Webhook, webhookClientConfig pointing to the
operator service/URL with caBundle and conversionReviewVersions) and in main.go
register the conversion webhook handler alongside the existing
validation/defaulting webhooks (where
utilruntime.Must(nvidiacomv1beta1.AddToScheme(scheme)) and the
validation/defaulting SetupWebhookWithManager calls live). Ensure the
registration hooks connect to the types that implement Hub(), ConvertTo(), and
ConvertFrom() so the conversion webhook endpoint is exposed to the API server.

In `@docs/pages/kubernetes/api-reference.md`:
- Around line 1169-1176: The v1beta1 section generates headings that duplicate
anchors from v1alpha1 (e.g., DynamoGraphDeploymentRequest,
DynamoGraphDeploymentRequestSpec, DynamoGraphDeploymentRequestStatus) causing
links like [DynamoGraphDeploymentRequest](`#dynamographdeploymentrequest`) to
point to v1alpha1; update the documentation generator/template that emits these
headings so anchors are made unique (for example prepend the API group/version
to headings or anchors such as v1beta1-DynamoGraphDeploymentRequest or include
“v1beta1” in the visible heading text) so references in the v1beta1 block
resolve to the correct section.

---

Nitpick comments:
In `@components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py`:
- Around line 321-325: The class docstring for DynamoGraphDeploymentRequest
currently contains lifecycle steps (Go comment block) instead of a concise type
description; update the docstring to describe the purpose and contents of the
DynamoGraphDeploymentRequest model (e.g., that it represents a request with
optional spec and status fields), and remove or relocate the lifecycle steps to
a more appropriate place (such as a separate constant, comment above the status
enum/type, or the DynamoGraphDeploymentRequestStatus class) so the generated
docstring is a clear human-readable type description for
DynamoGraphDeploymentRequest (referencing the spec:
DynamoGraphDeploymentRequestSpec and status: DynamoGraphDeploymentRequestStatus
members).
- Around line 110-113: The pvcMountPath Field in dgdr_v1beta1_types.py currently
defaults to None but must match the Go kubebuilder default "/opt/model-cache";
update the pvcMountPath declaration so its Field default is "/opt/model-cache"
(i.e., change the default parameter on the Field for pvcMountPath) so
Python-constructed objects have the same default as the Go type.

In `@deploy/operator/api/scripts/generate_pydantic_from_go.py`:
- Around line 396-406: The default for the --output argument in
parser.add_argument inside generate_pydantic_from_go.py is brittle because it
uses five successive Path.parent traversals to reach the repo path; replace this
with a robust repo-root resolution strategy (e.g., call out to git rev-parse
--show-toplevel or walk upward looking for a sentinel like go.mod) and build the
output Path relative to that root instead of chaining parent() calls; add a
helper function (e.g., resolve_repo_root or find_sentinel_root) and use it when
constructing the default for the --output argument so restructuring the repo
won’t change where dgdr_v1beta1_types.py is written.
- Around line 54-67: TYPE_MAP is a mutable module-level dict flagged by Ruff
RUF012; either annotate it as an immutable ClassVar typing or expose it as an
immutable mapping. Fix by adding a typing annotation (e.g., from typing import
ClassVar, Dict, Any; declare TYPE_MAP: ClassVar[Dict[str, Any]] = {...}) or wrap
the literal with types.MappingProxyType (import types and set TYPE_MAP =
types.MappingProxyType({...})), and update imports accordingly so TYPE_MAP is
read-only at runtime.

In `@deploy/operator/api/scripts/test_pydantic_models.py`:
- Around line 43-58: The test function test_simple_dgdr currently catches all
exceptions and calls sys.exit(1), which aborts the test process and prevents
subsequent tests from running; remove the try/except and sys.exit usage so
failures surface normally (or re-raise the exception) and let the test framework
(or a higher-level runner) report multiple failures, or convert this file to use
pytest/unittest style asserts and test discovery for aggregated reporting;
specifically modify test_simple_dgdr to not call sys.exit(1) on exception and
instead allow the exception to propagate or use standard test framework
patterns.

In `@deploy/operator/api/v1beta1/dynamographdeploymentrequest_types.go`:
- Around line 547-565: The receiver name in SetPhase is inconsistent (uses "s")
compared to GetPhase, SetProfilingPhase, and ClearProfilingPhase which use "d";
update the SetPhase method receiver from "s *DynamoGraphDeploymentRequest" to "d
*DynamoGraphDeploymentRequest" so all helper methods use the same receiver
identifier (e.g., d) for DynamoGraphDeploymentRequest to improve consistency and
readability.
- Around line 569-579: The AddStatusCondition method on
DynamoGraphDeploymentRequest reimplements condition replacement and therefore
always overwrites LastTransitionTime; replace its logic to call the standard
meta.SetStatusCondition helper so LastTransitionTime is preserved/updated
correctly for s.Status.Conditions and metav1.Condition updates—i.e., import
apimachinery/pkg/api/meta (meta) if needed and invoke
meta.SetStatusCondition(&s.Status, condition) inside the AddStatusCondition
method instead of the manual loop and append.

In `@deploy/operator/Makefile`:
- Around line 143-152: The generate target currently depends on
generate-pydantic making python3 and pydantic required for make generate; change
this by removing generate-pydantic from the generate prerequisites and either
(A) add a new independent opt-in target (e.g., generate-pydantic) users run
manually, or (B) introduce a guard target ensure-python (similar to ensure-yq)
that checks for python3 and that pydantic can be imported (e.g., using command
-v python3 and python3 -c "import pydantic") and make generate-pydantic depend
on ensure-python so generation only fails with a clear message when the optional
Python step is requested; keep controller-gen invocation in the generate target
unchanged if deepcopy generation should remain independent of Python validation.

Comment thread components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py
Comment thread deploy/operator/api/scripts/generate_pydantic_from_go.py
Comment thread deploy/operator/api/scripts/generate_pydantic_from_go.py
Comment thread deploy/operator/api/scripts/test_pydantic_models.py
Comment thread deploy/operator/api/scripts/test_pydantic_models.py Outdated
Comment thread deploy/operator/cmd/main.go
Comment thread docs/pages/kubernetes/api-reference.md
Comment thread deploy/operator/api/v1alpha1/dynamocomponentdeployment_types.go
Comment thread deploy/operator/api/v1alpha1/dynamo_model_types.go
Comment thread deploy/operator/cmd/main.go
Comment thread docs/pages/kubernetes/api-reference.md
Comment thread components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py Outdated
Comment thread components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py
Comment thread components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py
Comment thread components/src/dynamo/profiler/utils/dgdr_v1beta1_types.py
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test a38e026

Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test 3ff1e32

Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test c51b73c

Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test 3b56cf9

Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test ed1112b

Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
@hhzhang16

Copy link
Copy Markdown
Contributor Author

/ok to test a6d2f5a

@dmitry-tokarev-nv dmitry-tokarev-nv 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.

python 3.11 is a bit behind. We use 3.12. but it works for this job

@hhzhang16
hhzhang16 merged commit ebc6163 into main Feb 20, 2026
130 of 139 checks passed
@hhzhang16
hhzhang16 deleted the hannahz/6337-feature-add-conversion-from-dgdr-v1alpha1-to-dgdr-v1beta1 branch February 20, 2026 07:09
yao531441 pushed a commit to yao531441/dynamo that referenced this pull request May 13, 2026
Signed-off-by: Jont828 <jt572@cornell.edu>
Signed-off-by: Hongkuan Zhou <hongkuanz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Co-authored-by: Jont828 <jt572@cornell.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions deployment::k8s Relates to dynamo deployment in kubernetes documentation Improvements or additions to documentation feat size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants