-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
Linux installation. jenkins version 2.303.1 docker plugin version 1.2.3
I have several cloud templates defined, each pointing to a different physical node that can run our build containers. I have several templates defined under each cloud. I have a common label defined on each template across the clouds. I have defined a node preference score on each template. However, now matter what I set the preference score to, Jenkins always uses the first cloud and template defined. it will use that template until it reaches the instance cap. then moves to the next one. This is not good utilization of the resources.
Should the node preference score be working? is there any other way to control how Jenkins utilizes the container templates?
I'm not sure what you mean by a "node preference score" - the docker-plugin code has no such concept (or any field of that name) as far as I am aware.
FYI, as you've already determined, Jenkins asks each defined Cloud (in turn) if it can satisfy a demand and, if the answer is yes, Jenkins will ask it to do so. That'll mean that if you've got N physical machines which are each pointed at by one Cloud definition, the first physical machine will get fully loaded before Jenkins considers asking the next one to do anything.
...and that's how the Jenkins core code works when it has more than one Cloud defined; it isn't code within the docker-plugin that decides that.
As for "good utilization of resources", that's a matter of opinion. Opinions will differ depending on the circumstance, e.g. someone who's paying by usage time may well be happier if they fully use the first node before starting to pay for usage on the second.
If you want workload to be distributed as evenly as possible across the hardware (for maxiumum hardware utilisation rather than efficiency) that you possess then I suspect that you're going to need to do that yourself.
e.g. define an old-fashioned "swarm" to make your 4 nodes look like 1 big docker daemon and set the swarm's load-balancer to distribute evenly. Note: the docker-plugin doesn't support the newer docker swarm API; it only copes with the "old" swarm.