We have jenkins configured with aws ecs fargate agents. We defined a template and within the nodes/cloud configuration we try “retain agents” and increasing the number of executors but so far we’re unable to reuse our agents whereas we have a critical need to speed up the process of kicking off our jobs.
As of today we invoke our ecs agents in our pipelines with agent { inheritFrom ecs }. It seems like removing the inheritFrom just doesn’t work. The issue is whenever the agent is started, it generates a label that looks like “aws-ecs-fargate-scorpio-frontend-7-64mdr-pml6t”, with scorpio being the name of the job and besides also the name of the repo. When trying to reuse that in another job, jenkins checks some agents are still up but can’t use that agent because it was reserved for “scorpio”.
So how can we define the label that will be generated by ecs and prevent any reservation for a type of job. And secondly, how can we require our pipelines to use a retained agent when one is available or create one when there ain’t any?
Gregory Anne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.