-
Notifications
You must be signed in to change notification settings - Fork 165
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
[JENKINS-26324] Add configurable bridged network mode for Docker containers #75
Conversation
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
tends to lag behind a bit | ||
--> | ||
<maven-hpi-plugin.version>1.95</maven-hpi-plugin.version> | ||
<maven-hpi-plugin.version>1.106</maven-hpi-plugin.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho you can update jenkins core version to 1.565.3 that is previous LTS branch version and contains exactly the same hpi-plugin version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah. This change was not really meant to be in there as well (sloppy job of me reviewing the changes). I think it is not really necessary for this feature to work. However, I have to test this and clean up my pull request a bit.
Slow logging everywhere. |
@@ -284,6 +308,7 @@ private boolean matches(Offer offer, Request request) { | |||
"\nRequested for Jenkins slave:\n" + | |||
" cpus: " + requestedCpus + "\n" + | |||
" mem: " + requestedMem + "\n" + | |||
" ports: " + hasPortMappings + "\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be more helpful to know what ports are being requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@barkerd427 True that. Realized this when I started a slave with the VNC port exposed and I had no clue to which host port I have to connect. In the meantime I've implemented a feature which shows the (host) ports exposed on the Mesos Slaves on the Jenkins Slave Status page. Still, I have to test this and prepare another pull request...
Have all the comments raised so far been addressed? Also, can you please rebase? |
@vinodkone Hi, will address the comments (and clean the pull request) when I have some spare time. Right now I'm quite busy. |
I'd say all issues are addressed so far, so the pull request can be merged. If not, please tell me why and I'll try to fix it. |
@ederst Can you please squash the commits ? |
This commit adds the possibility to configure the network mode of the containerized Jenkins slaves provisioned by Mesos. For now it is possible to pick "Bridge" or "Host", since these are the two supported modes by Mesos (version 0.21.x). Additionally, in "Bridge" mode it is also possible to define port mappings. Issue: JENKINS-26324
@maselvaraj Squashed |
[JENKINS-26324] Add configurable bridged network mode for Docker containers
Summary: This introduces scheduling metrics that roughly map to the original metrics from 1.x. See d2iq-archive/usi#115 for metrics that moved to USI. Dropped Metrics * `mesos.scheduler.offer.matched` * `mesos.scheduler.offer.unavailable` * `mesos.offer.queue.added` * `mesos.offer.queue.dropped` * `mesos.offer.queue.removed` * `mesos.scheduler.existing.task` * `mesos.cloud.restartMesos`; * `<label>.provision>.scheduler` *`<label>.provision.mesos` JIRA issues: DCOS_OSS-5625
This pull request adds a new feature described in https://issues.jenkins-ci.org/browse/JENKINS-26324
Changes made:
Updated Mesos libs to 0.21.0 and HPI plugin to 1.106Snuck in changes (I tried to keep commits atomic, but this happened anyway):Slave name on Jenkins is now dependent on label (which might not always be good); See: String name = slaveInfo.getLabelString() + "-" + UUID.randomUUID().toString();The hostname of the docker container is set to the name of the slaveAn Exception is now logged if something happens in createMesosTask()HUDSON_HOME changed from jenkins to /home/jenkins at SLAVE_COMMAND_FORMATAlso: The code for the evaluation of the port range received by the offer is a bit dodgy. I'll try to rewrite this if I got some spare time.