Closed plumbuma closed 2 years ago
FYI, This change breaks existing configurations as numExecutors
defaults to 0 when the configuration is loaded back in.
I found this error in my jenkins logs after having to hunt down why my agents were not starting up:
Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@744196d4 failed
java.lang.IllegalArgumentException
at hudson.slaves.NodeProvisioner$PlannedNode.<init>(NodeProvisioner.java:102)
at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud.provision(ECSCloud.java:283)
at com.cloudbees.jenkins.plugins.amazonecs.ECSProvisioningStrategy.apply(ECSProvisioningStrategy.java:65)
at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:325)
I'd recommend updating the usage to initialize private int numExecutors = 1;
or assure the value is always positive when calling the NodeProvisioner constructor using Math.max(1, numExecutors)
I as able to fix this by going back into my cloud configurations, finding the new field for "Number of executors per agent" which is revealed under an Advanced section, and updating the value from 0 to 1.
Removing hardcoded number of executors per agent and adding ability for users to define this via the cloud configuration settings page.
Updated ECS Cloud resource to enable users to define numExecutors value in cloud configuration settings. Defaults to 1 as per existing hardcoded value.
Updated initiation of NodeProvisioner.PlannedNode to pass in new numExecutors value instead of the previously hardcoded one.
Pulled from https://github.com/plumbuma/amazon-ecs-plugin/commit/3ebfefa5b4f1d2e249f147aca6257b83219282dd
Feature request - https://github.com/jenkinsci/amazon-ecs-plugin/issues/265
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[x] Ensure that the pull request title represents the desired changelog entry
[x] Please describe what you did
[x] Link to relevant issues in GitHub or Jira
[x] Link to relevant pull requests, esp. upstream and downstream changes
[x] Ensure you have provided tests - that demonstrates feature works or fixes the issue