-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Upgrade Decision engine incorporated into reconciliation logic #270
Conversation
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
…n PipelineRollout Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
if err != nil { | ||
return err | ||
} | ||
return 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.
by calling UpdateCR()
here, we get the latest pipeline
with the revised ResourceVersion from K8S, so any subsequent call to do an update within this reconcile call will use the latest ResourceVersion and won't result in a conflict error.
Signed-off-by: Julie Vogelman <[email protected]>
internal/controller/config/config.go
Outdated
DataLossPrevention bool `json:"dataLossPrevention" mapstructure:"dataLossPrevention"` | ||
// If user's config doesn't exist or doesn't specify strategy, this is the default | ||
// TODO: should we put this here or in usde config? | ||
DefaultUpgradeStrategy USDEUserStrategy `json:"defaultUpgradeStrategy" mapstructure:"defaultUpgradeStrategy"` |
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.
yeah, it is better to move to USDE config so that we have all upgrade related config in one place
verifyPipelineRolloutDeployed(pipelineRolloutName) | ||
|
||
// Give it a little while to get to Paused and then verify that it stays that way | ||
// TODO: add back after Numaflow fixes this to not go from Paused to Pausing |
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.
which numaflow issue is tracking the bug?
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.
Sidhant actually fixed it here - I just need for us to incorporate it, which I will do shortly so as to get a few fixes at once
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Julie Vogelman <[email protected]>
case config.NoStrategyID: | ||
return true, apiv1.UpgradeStrategyApply, 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.
This block of code according to the comment at L59 should only return PPND or Progressive
?
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.
Good catch that that's a mismatch. I am going to change the comment. Perhaps in the future, those would be the only strategies allowed, but for now "no strategy" is also allowed.
if err := json.Unmarshal(existingPipelineDef.Spec.Raw, &existingPipelineSpec); err != nil { | ||
return fmt.Errorf("failed to convert existing Pipeline spec %q into PipelineSpec type, err=%v", string(existingPipelineDef.Spec.Raw), err) | ||
// what is the preferred strategy for this namespace? | ||
userPreferredStrategy, err := usde.GetUserStrategy(ctx, newPipelineDef.Namespace) |
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.
I feel the logic from L443 to L528 to determine which strategy to be used is too interleaved between code blocks and be further condensed. But I'm good to leave it to a follow up.
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.
can you clarify what you mean by "interleaved between code blocks"?
I specifically wanted to design the overall flow as:
- figure out what "In progress strategy" should be and set it if it's not set
- Do whatever the "In progress strategy" is
Do you disagree with that approach?
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.
Feel free to refactor if you see a potential improvement
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.
Okay, I thought about this a little more, and I can kind of see what you're saying. I think I can see keep the PPND logic collocated, and keep the Progressive logic collocated.
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.
On second thought, I started to do this and it didn't seem to be better with what I was doing so I decided not to spend time on it. But do feel free to refactor it if you want to. :)
Signed-off-by: Julie Vogelman <[email protected]>
Fixes #228, #239
Modifications
From PipelineRollout Reconciler, if user has set a preference for PPND, we determine which strategy we need to do based on 1. whether/which fields changed, 2. was there an external request to pause from NumaflowController or ISBService? If so, we put ourselves in the PPND InProgressStrategy and set that value in memory and in the Rollout Status.
From NumaflowControllerRO Reconciler and ISBServiceRO reconciler, if user has set a preference for PPND, we perform the PPND strategy always (later we will make it dependent on which isbsvc fields changed).
Verification
Added unit test for PPND to PipelineRollout, testing many different cases, including whether the InProgressStrategy is set correctly.
Enhanced e2e test to include verification of InProgressStrategy, and also now includes verification of the cases of:
desiredPhase=Paused
desiredPhase=Running
when it was previously pausedTo Do