Skip to content
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

Introduce script run stage #4643

Open
2 of 7 tasks
ffjlabo opened this issue Oct 31, 2023 · 11 comments
Open
2 of 7 tasks

Introduce script run stage #4643

ffjlabo opened this issue Oct 31, 2023 · 11 comments
Assignees
Labels

Comments

@ffjlabo
Copy link
Member

ffjlabo commented Oct 31, 2023

What would you like to be added:
follow: #1089

implement stage to execute any command.

Why is this needed:

@ffjlabo ffjlabo self-assigned this Oct 31, 2023
@ffjlabo ffjlabo added this to v0.46.0 Oct 31, 2023
@ffjlabo ffjlabo moved this to Todo in v0.46.0 Oct 31, 2023
@ffjlabo ffjlabo moved this from Todo to In Progress in v0.46.0 Nov 17, 2023
@ffjlabo ffjlabo moved this from In Progress to Todo in v0.46.0 Nov 17, 2023
@ffjlabo ffjlabo moved this from Todo to In Progress in v0.46.0 Nov 17, 2023
@ffjlabo ffjlabo moved this from In Progress to Backlog in v0.46.0 Nov 17, 2023
@ffjlabo ffjlabo moved this from Backlog to In Progress in v0.46.0 Nov 17, 2023
This was referenced Dec 8, 2023
@ffjlabo
Copy link
Member Author

ffjlabo commented Dec 18, 2023

TODO

  • just executing commands not considered about rollbacking Add rfc for script run stage #4603
  • consider about rollback (fix rfc and implement)
  • consider about managing commands

@ffjlabo
Copy link
Member Author

ffjlabo commented Dec 18, 2023

📝

  • SCRIPT_RUN stage can cancel on the Web UI
  • commands are executed in the dir for current application

@ffjlabo
Copy link
Member Author

ffjlabo commented Dec 18, 2023

@ffjlabo
Copy link
Member Author

ffjlabo commented Dec 27, 2023

📝 Share my current opinion when to rollback :)

Behavior during rollback of SCRIPT_RUN

  • Execute the command to rollback SCRIPT_RUN to the point where the deployment was canceled or failed.
  • When there are multiple SCRIPT_RUN stages to be rolled back, they are executed in the same order as SCRIPT_RUN on the pipeline.

For example, consider when deployment proceeds in the following order from 1 to 7.

1. K8S_CANARY_ROLLOUT
2. WAIT
3. SCRIPT_RUN
4. K8S_PRIMARY_ROLLOUT
5. SCRIPT_RUN
6. K8S_CANARY_CLEAN
7. SCRIPT_RUN

Then

  • If 4 is canceled or fails while running, only SCRIPT_RUN of 3 will be rolled back.
  • If 6 is canceled or fails while running, only SCRIPT_RUNs 3 and 5 will be rolled back.

How to realize it

We can choose 2 ways to realize the rollback.

  1. execute command on ROLLBACK stage
  2. execute command on another stage e.g. ROLLBACK_SCRIPTRUN

@khanhtc1202
Copy link
Member

khanhtc1202 commented Dec 27, 2023

@ffjlabo I want to vote for (2) We're going to have a plugin for each platform, in such case, each platform ROLLBACK stage implementation would be run/implemented by the plugin author. At the time the plugin is implemented, there would be no way for them to notice that the ROLLBACK stage has to be called the ROLLBACK_SCRIPTRUN. For simplicity, ROLLBACK stage for the platform should only focus on ROLLBACK for platform, ROLLBACK_SCRIPTRUN should be implemented by SCRIPTRUN executor.

@khanhtc1202
Copy link
Member

Another way to think is, if we treat this SCRIPT_RUN as a plugin for piped, then it should provide its ROLLBACK, not rely on other stages/platform ROLLBACK.

@ffjlabo
Copy link
Member Author

ffjlabo commented Dec 27, 2023

Thank you for your opinion :) I got it!
I will try it 👍 At first I will consider how to execute the rollback for each stage because currently, the rollback is for each application kind.

@ffjlabo
Copy link
Member Author

ffjlabo commented Feb 2, 2024

Currently, k8s only. I will apply it to other kind of apps.

@ffjlabo
Copy link
Member Author

ffjlabo commented Feb 9, 2024

📝 It might be nice to have the option to ignore the failure on the stage.

@ffjlabo ffjlabo added this to v0.47.0 Feb 9, 2024
@ffjlabo ffjlabo moved this to In Progress in v0.47.0 Feb 9, 2024
@ffjlabo ffjlabo moved this from In Progress to Todo in v0.47.0 Feb 21, 2024
@ffjlabo ffjlabo removed the status in v0.47.0 Apr 5, 2024
@ffjlabo
Copy link
Member Author

ffjlabo commented Apr 9, 2024

for ECS app request: #4813

@khanhtc1202
Copy link
Member

khanhtc1202 commented Apr 18, 2024

Related issue: #4814
Context: Users want to use deployment information in script which be run in SCRIPT_RUN stage execution

@khanhtc1202 khanhtc1202 removed this from v0.48.0 Jun 17, 2024
@khanhtc1202 khanhtc1202 moved this to 📋 New in ROADMAP Jun 17, 2024
@khanhtc1202 khanhtc1202 moved this from 📋 New to 🏗 Upcoming in ROADMAP Jun 21, 2024
@khanhtc1202 khanhtc1202 removed this from ROADMAP Jul 5, 2024
@khanhtc1202 khanhtc1202 moved this to Todo in v0.49.0 Jul 5, 2024
@t-kikuc t-kikuc removed this from v0.49.0 Sep 27, 2024
@t-kikuc t-kikuc added this to v0.50.0 Sep 27, 2024
@t-kikuc t-kikuc moved this to Todo in v0.50.0 Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: In Progress
Status: No status
Status: Todo
Development

No branches or pull requests

2 participants