Skip to content

Conversation

cavedon
Copy link

@cavedon cavedon commented Nov 13, 2024

When multiple Docker clouds are defined, the plugin will always create agents from the first available cloud, not allowing to distribute the load on all the clouds that are defined.

Possible solutions to this issue are:

  • Docker Swarm Standalone, which is deprecated
  • Docker Engine Swarm API, which is not supported by docker-plugin.

This changes adds a setting that enables randomizing the order in which Docker clouds are tried when creating a new agent.

Testing done

Tested on a Jenkins instance with two Docker clouds defined, with the setting enabled and disables.
I did not find existing unit tests coverage for FastNodeProvisionerStrategy where to add my tests...

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@cavedon cavedon requested a review from a team as a code owner November 13, 2024 19:19
When multiple Docker clouds are defined, the plugin will always create
agents from the first available cloud, not allowing to distribute the
load on all the clouds that are defined.

Possible solutions to this issue are:
- Docker Swarm Standalone, which is deprecated
- Docker Engine Swarm API, which is not supported by docker-plugin.

This changes adds a setting that enables randomizing the order in which
Docker clouds are tried when creating a new agent.
@MarkEWaite
Copy link
Contributor

I configured two Docker clouds, one a copy of the other, and watched the allocation. As far as I could tell, it was always choosing the first cloud, whether or not the randomization checkbox was enabled.

@dhs-rec
Copy link

dhs-rec commented Aug 5, 2025

We're observing the same behavior with 4 Docker clouds configured. Any chance to get this merged (and released) in the near future?

@krisstern
Copy link
Member

@dhs-rec Have you tried this PR in your case and it worked?

@dhs-rec
Copy link

dhs-rec commented Aug 5, 2025

No, I didn't.

@cavedon
Copy link
Author

cavedon commented Aug 5, 2025

I configured two Docker clouds, one a copy of the other, and watched the allocation. As far as I could tell, it was always choosing the first cloud, whether or not the randomization checkbox was enabled.

Sorry, I would like to get back to this and re-test it, but I am not able to get to it in the short term. It was working for me when I uploaded the PR.

@krisstern
Copy link
Member

No worries @cavedon it looks like there is a SpotBugs issue with your code though which needs fixing before we can review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants