jenkinsci / docker-swarm-plugin

Jenkins plugin which allows to add a Docker Swarm as a cloud agent provider
https://plugins.jenkins.io/docker-swarm/
MIT License
55 stars 47 forks source link

Adding features for supporting multi-architecture swarms. #51

Closed ATRG closed 4 years ago

ATRG commented 4 years ago

I added three features to fix issues found when spinning up containers on multi-architecture/operating system swarms: 1 - Add the ability to specify the target Architecture and Operating System under the placement section of a Docker Agent Template. This is then passed to docker as a Platforms object under the Placement object as per https://docs.docker.com/engine/api/v1.40/#operation/ServiceCreate 2 - Add the option to the host binds list that checks how many colons have been supplied, so that, if you are creating a Windows container with host binds, paths containing [Drive Name]:/ still work. E.g. D:\host\dir:C:\container\dir needs to evaluate as D:\host\dir mapped to C:\container\dir. 3 - Add a variable that lets you vary the refresh timeout for 'stuck' containers. This was necessary when deploying particularly large images to Windows Containers, where it could sometimes take in excess of 15 minutes for a new image to be downloaded. Due to my limited understanding of Jenkins internals, I did not find a way to have this specified on a per agent template basis, so this is currently configured for the entire swarm.

Roemer commented 4 years ago

Wow this looks great. I will review this in more detail and maybe even test it as well.

ATRG commented 4 years ago

Thanks, if you need anything from me please let me know.

ATRG commented 4 years ago

Hey @Roemer - I can see that this PR failed the build, as a Windows build failed to delete the directory (after the maven build worked and passed all tests), is there anything I can do from my end to make this work?

Roemer commented 4 years ago

Can you fix the small conflict please? It will start a new ci build then anyway.

ATRG commented 4 years ago

Fixed and merged :)

sebthom commented 4 years ago

@Roemer Hey Roman, are you still maintaining the docker-swarm-plugin? I am also very interested in this feature.

Roemer commented 4 years ago

Yes I am still here, although not that active. But I try to get a new release ready.

Roemer commented 4 years ago

I merged the change, thanks for your contribution!