jenkinsci / amazon-ecs-plugin

Amazon EC2 Container Service Plugin for Jenkins
https://plugins.jenkins.io/amazon-ecs
MIT License
192 stars 227 forks source link

Add automatic restart of pipeline if agent is terminated (useful for spot instances) #335

Open b-edwin-bianchi opened 9 months ago

b-edwin-bianchi commented 9 months ago

What feature do you want to see added?

It would be great if this plugin supported the ability to automatically restart a pipeline if an agent is terminated. This would be particularly useful in the case of spot instances.

The EC2 Fleet plugin supports this. https://github.com/jenkinsci/ec2-fleet-plugin/blob/903fcfd0a77cd7b46b456e13072a065765085a5e/src/main/java/com/amazon/jenkins/ec2fleet/FleetAutoResubmitComputerLauncher.java#L112

I've been working on trying to get retry working directly in the Jenkinsfile, but it does not seem to initiate when I kill an ECS agent on purpose (only EC2s). Plus there would be dozens of Jenkinsfiles to update should I go this route. https://github.com/jenkins-infra/pipeline-library/blob/4cc2ad5932b1b0eb79ae3bdf9976317630ca5bea/vars/buildPlugin.groovy#L51

If the plugin supported it natively, that would be outstanding.

Thank you.

Upstream changes

No response