question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Speedup ECS slave provisioning / do not wait for available executor

See original GitHub issue

I’ve been using this plugin for 2 years now, and I still have this issue, and it’s even been reported as ‘getting worse’ by my colleagues. I’m probably missing something here.

Let me explain.

Let’s say I have one job running, in a slave named ‘ecs-slave-1234’ provisioned by ECS plugin, based on the Label ‘slave’. (Label in the sens of ECS plugin configuration, and ‘node’ in the sense of the pipeline)

Then I trigger another job, with the same node(‘slave’)

In the job’s console I see

Waiting for next available executor on ‘ecs-slave-1234’

Then it … waits … as if it anted to reuse the provisioned one, even if it should be a disposable slave.

In jenkins logs it ends up with logs below (with origin slaves name, slightly different than in my explanation here)

Is there a way to tell Jenkins never to reuse an existing executor ?

It sometimes waits up to 3 minutes beofre deciding it sould provision something. A real pain.

I’m using Jenkins LTS 2.176.1 ECS Plugin 1.20

Thank you !

Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Asked to provision 1 agent(s) for: jenkins-slave
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: In provisioning : []
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Excess workload after pending ECS agents: 1
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Will provision ECS Agent jenkins-slave, for label: jenkins-slave
Jul 16, 2019 10:42:41 AM hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
INFO: Started provisioning ECS Agent jenkins-slave from factory-slaves with 1 executors. Remaining excess workload: -0.289
Jul 16, 2019 10:42:51 AM hudson.slaves.NodeProvisioner$2 run
INFO: ECS Agent jenkins-slave provisioning successfully completed. We have now 3 computer(s)```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
squaloucommented, Jul 16, 2019

I’m currently trying these options :

-Dhudson.slaves.NodeProvisioner.MARGIN=100 -Dhudson.slaves.NodeProvisioner.MARGIN0=1.00 -Dhudson.slaves.NodeProvisioner.MARGIN_DECAY=1.00

it’s over aggressive, allows “calcThresholdMargin” to always return 1 then if (excessWorkload > 1 - m) (where m = calcThresholdMargin ) has maximum chances of being true. Let’s see if no side effects appear, but in my setup with one job = one ecs slave, should work fie enough. Else I’ll revert to the values you provide in the readme.

Thank you again !

0reactions
webratzcommented, Sep 30, 2019

master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spawning multiple agents with Jenkins ECS plugin (Waiting ...
1 Answer 1 ... Consider resources allocation by each running build. If your cluster hasn't enough resources to start more than 1 build...
Read more >
Running Jenkins jobs in AWS ECS with slave agents
In this article we'll cover exactly how to run Jenkins jobs in slave Fargate containers in AWS ECS. Using a worked example that...
Read more >
CHANGELOG - mesos - Git at Google
[MESOS-9536] - Nested container launched with non-root user may not be able ... [MESOS-9847] - Docker executor doesn't wait for status updates to...
Read more >
How To Setup AWS ECS Cluster As Build Slave For Jenkins
This tutorial will guide you to setup and configure AWS ECS cluster as build slave for Jenkins jobs. All the builds will run...
Read more >
Jenkins on AWS - Awsstatic
Although there are many ways to deploy the Jenkins open-source automation server on Amazon Web Services (AWS), this whitepaper focuses on two specific....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found