Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple swarms #104

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

michaelPf85
Copy link

@michaelPf85 michaelPf85 commented Feb 5, 2021

Working on #90
Currently the plugin seems to consider the Docker Swarm cloud as a singleton, so there are several places in the code that would need to be changed to work with a list of items, instead of a single default one.

  • ApiRequest changed to take SwarmName as a parameter, to get both Docker host URI and configured CredentialsId
  • Only PingRequest does not provide a SwarmName, since it is used before saving the configuration
  • DockerSwarmCloud.get() has been changed to take a swarm name parameter, so all code relying on this singleton has been modified to handle multiple swarms
  • Code managing dynamic nodes has been changed too, and needs some cleanup
  • The dashboard page kind of works but only displays the first swarm found, for now

QueueListener failed while processing hudson.model.Queue$BuildableItem:hudson.model.FreeStyleProject@4a8b292c[docker_builder_windows]:4
java.lang.NullPointerException
	at org.jenkinsci.plugins.docker.swarm.DockerSwarmAgent.<init>(DockerSwarmAgent.java:31)
	at org.jenkinsci.plugins.docker.swarm.BuildScheduler.scheduleBuild(BuildScheduler.java:27)
	at org.jenkinsci.plugins.docker.swarm.OneShotProvisionQueueListener.onEnterBuildable(OneShotProvisionQueueListener.java:29)
	at hudson.model.Queue$BuildableItem.enter(Queue.java:2716)
	at hudson.model.Queue$BuildableRunnable.run(Queue.java:3018)
	at hudson.model.Queue.maintain(Queue.java:1578)
	at hudson.model.Queue$1.call(Queue.java:335)
	at hudson.model.Queue$1.call(Queue.java:332)
	at jenkins.util.AtmostOneTaskExecutor$1.call(AtmostOneTaskExecutor.java:108)
	at jenkins.util.AtmostOneTaskExecutor$1.call(AtmostOneTaskExecutor.java:98)
	at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:118)
	at java.lang.Thread.run(Unknown Source)
@emilsniadach
Copy link

Hi Michael, do you have this review rebased to latest plugin version and compiled ?
I'm interrested in this feature as we would like to have multiple swarm in Jenkins.

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.

2 participants