-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(operator): bind workloads to verified checkpoints #12873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import ( | |
| "fmt" | ||
|
|
||
| nvidiacomv1alpha1 "github.com/ai-dynamo/dynamo/deploy/operator/api/v1alpha1" | ||
| "github.com/ai-dynamo/dynamo/deploy/operator/internal/consts" | ||
| snapshotprotocol "github.com/ai-dynamo/dynamo/deploy/snapshot/protocol" | ||
| "k8s.io/apimachinery/pkg/types" | ||
| "sigs.k8s.io/controller-runtime/pkg/client" | ||
|
|
@@ -38,6 +39,11 @@ type CheckpointInfo struct { | |
| StartupPolicy nvidiacomv1alpha1.CheckpointStartupPolicy | ||
| // Empty means the restore pod targets the default main container. | ||
| RestoreTargetContainers []string | ||
| // AutoBinding binds a generated workload to this checkpoint's exact object. | ||
| AutoBinding string | ||
| // Automatic marks a DGD-managed checkpoint even before the API server has | ||
| // assigned the UID and generation needed to construct AutoBinding. | ||
| Automatic bool | ||
| // RestorePaused keeps restored targets paused for owner election. | ||
| RestorePaused bool | ||
| } | ||
|
|
@@ -47,6 +53,14 @@ func checkpointInfoFromObject(ckpt *nvidiacomv1alpha1.DynamoCheckpoint) (*Checkp | |
| if err != nil { | ||
| return nil, err | ||
| } | ||
| autoBinding := "" | ||
| automatic := ckpt.Annotations[consts.CheckpointAutoAnnotation] == consts.KubeLabelValueTrue | ||
| if automatic && ckpt.UID != "" && ckpt.Generation > 0 { | ||
| autoBinding, err = AutomaticCheckpointBinding(ckpt) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| } | ||
|
Comment on lines
+56
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Binding computation now fails resolution for any automatic checkpoint whose ID label diverges
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| return &CheckpointInfo{ | ||
| Enabled: true, | ||
|
|
@@ -56,6 +70,8 @@ func checkpointInfoFromObject(ckpt *nvidiacomv1alpha1.DynamoCheckpoint) (*Checkp | |
| ArtifactVersion: checkpointArtifactVersion(ckpt), | ||
| CheckpointName: ckpt.Name, | ||
| Ready: ckpt.Status.Phase == nvidiacomv1alpha1.DynamoCheckpointPhaseReady, | ||
| AutoBinding: autoBinding, | ||
| Automatic: automatic, | ||
| }, nil | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 New checkpoint binding test does not narrate its steps as required by the repository test style
The new binding test contains no
t.Logstep headings (TestAutomaticCheckpointBindingatdeploy/operator/internal/checkpoint/checkpoint_test.go:125-243), violating the mandatory Go test style for this module.Impact: Test output does not tell the scenario's story, which the repository requires for reviewability.
Rule reference
deploy/operator/AGENTS.md, "Go Test Style": "Uset.Logto tell the test's story, with one heading before each block that implements a test step." The test has distinct steps (build the expected automatic checkpoint, compute and re-compute the binding, run the mutation table) with no headings. Other new tests added in this PR (for exampleTestValidateGroveCheckpointBindings) do follow the rule.Was this helpful? React with 👍 or 👎 to provide feedback.