-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: Enhanced Different TTLSecondsAfterFinished depending on if job is in Succeeded, Failed or Error, Fixes #1883
Conversation
Hi @sarabala1979 I have now made an initial PR with the workflow spec setup. I would be great if you could give some initial feedback. Thoughts:
My thought was that now there is now no change to the current design of TTLSecondsAfterFinished which should improve backward compatibility.
Concerning the configmap for the controller. I have started to look for it, is it correct that what you mean by configmap for the controller is (this)[https://github.com/argoproj/argo/blob/ce78227abe5a3c901e5b7a7dd823fb2551dff584/workflow/config/config.go#L10]. If so how do you think is the base way to pass the information from the configmap object to the ttlcontroller? Atm as I understand the configmap is not passed to the ttlcontroller. Thanks for the feedback! |
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.
Thanks for your PR @NikeNano! A couple of changes needed.
Also, I would suggest including TTLStrategy.SecondsAfterCompleted
to replace TTLSecondsAfterFinished
. This way, we can mark TTLSecondsAfterFinished
as deprecated. To allow for backwards compatibility, we can automatically convert TTLSecondsAfterFinished
to TTLStrategy.SecondsAfterCompleted
during Workflow
creation and provide a warning that it is being deprecated.
Thoughts on this? @sarabala1979 @alexec
Thanks for the feedback @simster7 I Will update based upon your suggestions :) |
Applied the suggestions from review. Co-Authored-By: Simon Behar <simbeh7@gmail.com>
FYI closed this by mistake, thus reopened it! |
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.
Hi @NikeNano, thanks for the chagnes. There are two comments from the previous review that are still unresolved
@simster7 I will fix it, havn't had time to look at it during Christmas:) Where in the code base is the workflow creation? I have looked around in the operation file but not really sure where the changes are needed in order to automatically convert TTLSecondsAfterFinished to TTLStrategy.SecondsAfterCompleted during Workflow creation? Hope you had a great Christamas! |
@simster7 I have now updated and the tests pass locally. However I have some issues understanding how to read the tests from the github action. The "default" gets me to a argo UI where I cant load the results. The Build error gives "No configuration was found in your project. " |
You should be able to fix build we’re by syncing with master. |
The other error maybe a test failure. Run “make test” to check. |
Thanks! I assume you mean locally :) Running it and checking |
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.
Last change, otherwise LGTM!
I updated with the tag |
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.
Almost there! Some new changes are needed based on your last few commits.
Also you will need to update examples/gc-ttl.yaml
to reflect these changes. Please make a note there of all the possible options in TTLStrategy
// Optional duration in seconds relative to the workflow start time which the workflow is | ||
// allowed to run before the controller terminates the workflow. A value of zero is used to | ||
// terminate a Running workflow | ||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"bytes,19,opt,name=activeDeadlineSeconds"` | ||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"bytes,20,opt,name=activeDeadlineSeconds"` |
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.
The protobuf
index numbers are not supposed to change when being updated.
Updating A Message Type
If an existing message type no longer meets all your needs – for example, you'd like the message format to have an extra field – but you'd still like to use code created with the old format, don't worry! It's very simple to update message types without breaking any of your existing code. Just remember the following rules:
- Don't change the field numbers for any existing fields.
Please revert all of the field number changes to what they were and just change the one for ttlStrategy
to the current max + 1 (I think it should be 30). It's okay if the definition is out of order.
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.
Ahh ok, will fix that!
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 updated now, I might be wrong but I think is should be 28, based on that this is that last entry in
type WorkflowSpec struct {
https://github.com/argoproj/argo/blob/94449876f4a571ab279802d5ca4d5e938ca3d44d/pkg/apis/workflow/v1alpha1/workflow_types.go#L237 I am new to go and protobuff so not sure though :) Also thanks for all the feedback!
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.
Removed trailing ":" which will break the unmarshalling, updated after feeback.
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.
Updated to remove trailing ":" after feedback. Will break the unmarshalling
Co-Authored-By: Simon Behar <simbeh7@gmail.com>
Co-Authored-By: Simon Behar <simbeh7@gmail.com>
Co-Authored-By: Simon Behar <simbeh7@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1883 +/- ##
=========================================
Coverage ? 11.12%
=========================================
Files ? 35
Lines ? 23793
Branches ? 0
=========================================
Hits ? 2647
Misses ? 20809
Partials ? 337
Continue to review full report at Codecov.
|
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.
Thanks for all your work @NikeNano!
Checklist:
I've created an enhancement proposal and discussed it with the community.
Comment: This PR is note done but I have added it in order to get some more specific feedback and discuss the implementation.