iriusrisk / GoCD-EC2-Elastic-Agent-Plugin

Plugin for GoCD server that will spin up and shut down EC2 instances as its agent workers on demand
Apache License 2.0
12 stars 12 forks source link

Best way to configure "EC2 Elastic agents for a pipeline ...!!!" #26

Open elipesatya opened 5 months ago

elipesatya commented 5 months ago

Hi All

I have the configured the EC2 elastic agents for my GoCD server which runs in ECS.

I have a pipeline with three jobs and all connected so the first job triggers the second and the second triggers the third. (Attached the screenshot of the pipeline for ref).

We have "max elastic agents" count set to be 1.

When I triggered the first job thats "brxt-config-service-build" from the attachment, it in turn triggered the second job "brxt-config-service-deploy-staging" and second triggered the 3rd job "brxt-config-service-deploy-production".

First two passes as they fall on to the one single elastic agent profile. The next job failed as complaining that node max capacity reached and the thing here is that the earlier one did not get terminated.

Wonder what would be right approach here to solve this issue ? I tried with max agents count 2, still the same issue, if the earlier one gets terminated properly then no issue but some time not hence causing the issues.

Some times they stay longer like more than 5 hours.

Would like to know if theres any work around.

Many thanks Satya

pipeline brxt-config-service-deploy-production fails plugin