-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add rfc for script run stage #4603
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4603 +/- ##
=========================================
Coverage ? 29.99%
=========================================
Files ? 221
Lines ? 25937
Branches ? 0
=========================================
Hits ? 7781
Misses ? 17510
Partials ? 646 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
c03f147
to
7476dd2
Compare
@ffjlabo Will the custom sync be removed after this feature is released? |
@kentakozuka Yes, I think it will be deprecated and removed in the future. |
@ffjlabo 👌
What do you mean by this? Maybe I miss something 🤔 |
Oh, I'm sorry. I don't understand about custom sync correctly. custom sync can be used at any other stage. 🙏 But this stage is for sync. In custom sync, the defined command will execute the same command when rollback. By the script run stage, I want to realize the demand to just execute commands before or after other stages. |
@ffjlabo Thanks! It is clear to me now. |
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@kentakozuka Thank you for your advise! I added it 🙏 5f74cfd |
- It might be better to add `runsOnRollback` on each sync stage if users want to control when rollback. | ||
This is a just idea. |
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 don't get this part, do you mean in case of multiple script_run stages are combined, we should add runsOnRollback
to each? And is this runsOnRollback
is same as onRollback
(the one used in the example above)?
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.
@khanhtc1202
This means It might be a way to add onRollback
to each stage, not to create a new stage.
e.g. K8S_CANARY_ROLLOUT
pipeline:
stages:
- name: K8S_CANARY_ROLLOUT
with:
replicas: 10%
onRollback: "curl -X POST -H 'Content-type: application/json' --data '{"text":"failed to deploy: rollback"}' $SLACK_WEBHOOK_URL"
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.
Why does it come to this place 🤔 And also, how do we combine your idea with the current rollback logic? Do we have any plans for this?
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.
Why does it come to this place 🤔 And also, how do we combine your idea with the current rollback logic? Do we have any plans for this?
It is a just idea, so I have no idea to realize it 🙇
But I thought it might be more useful to be able to set onRollback
on each stages than set a stage to execute any command.
onRollback: | ||
- "curl -X POST -H 'Content-type: application/json' --data '{"text":"failed to deploy: rollback"}' $SLACK_WEBHOOK_URL" | ||
``` | ||
|
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.
Some other questions I think we should define before starting:
- Do we support multi script_run stages combine
- How the user-defined
onRollback
be run in case of multi script_run stages combine - How the user-defined
onRollback
be run in combination with theXXX_ROLLBACK
stage? I mean, if k8s app is rollbacked and the pipeline contains script_run, how do we perform the rollback process? Should it beXXX_ROLLBACK
first thenSCRIPT_RUN_ROLLBACK
?
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.
Thank you for your questions!
I will write about these things on rfc, but in advance, I will write a little bit my opinions on this.
Do we support multi script_run stages combine
Yes, I think so.
How the user-defined onRollback be run in case of multi script_run stages combine
Multi script_run stages can be executed in the order these are set.
How the user-defined onRollback be run in combination with the XXX_ROLLBACK stage? I mean, if k8s app is rollbacked and the pipeline contains script_run, how do we perform the rollback process? Should it be XXX_ROLLBACK first then SCRIPT_RUN_ROLLBACK?
I don't think about it. I will try to check the implementation and propose 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.
Multi script_run stages can be executed in the order these are set.
How about those stages' rollback scripts? Which order should be made, which will we choice? (or neither)
- xxx_canary -> script_run -> script_run -> rollback -> script_rollback (merge all script rollback)
- xxx_canary -> script_run -> script_run -> rollback -> script_rollback -> script_rollback
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 think it will be 2. (But I don't know yet it can be realized technically 🙇 )
xxx_canary -> script_run -> script_run -> rollback -> script_rollback -> script_rollback
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 think it should be better not to merge rollback scripts because it would be easy to handle or log error when to execute each rollback scripts.
📝 How to prepare tools that we want to use There are several ways to realize so.
|
@khanhtc1202 I will describe about the rollback on the original issue and fix the RFC on another PR :) |
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.
Great
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.
Here you go 🚀
* Add rfc for script run stage Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com> * Fix docs Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com> * Fix document Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com> --------- Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part of #4643
Does this PR introduce a user-facing change?: