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

[JENKINS-26324] Add configurable bridged network mode for Docker containers #75

Merged
merged 1 commit into from
May 6, 2015
Merged

Conversation

ederst
Copy link
Contributor

@ederst ederst commented Jan 7, 2015

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.106
  • HOST and BRIDGE networking for docker containers can now be configured
  • Port mappings for those are also possible (if Host Port is left empty, a random Port on the host is used)

Snuck 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 slave
  • An Exception is now logged if something happens in createMesosTask()
  • HUDSON_HOME changed from jenkins to /home/jenkins at SLAVE_COMMAND_FORMAT

Also: 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.

@jenkinsadmin
Copy link
Member

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>
Copy link
Member

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.

Copy link
Contributor Author

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.

@KostyaSha
Copy link
Member

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" +
Copy link
Contributor

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.

Copy link
Contributor Author

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...

@vinodkone
Copy link
Contributor

Have all the comments raised so far been addressed? Also, can you please rebase?

@ederst
Copy link
Contributor Author

ederst commented Feb 6, 2015

@vinodkone Hi, will address the comments (and clean the pull request) when I have some spare time. Right now I'm quite busy.

@ederst
Copy link
Contributor Author

ederst commented Mar 30, 2015

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.

@maselvaraj
Copy link
Contributor

@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
@ederst
Copy link
Contributor Author

ederst commented Apr 24, 2015

@maselvaraj Squashed

maselvaraj added a commit that referenced this pull request May 6, 2015
[JENKINS-26324] Add configurable bridged network mode for Docker containers
@maselvaraj maselvaraj merged commit 677a14b into jenkinsci:master May 6, 2015
@jeschkies jeschkies mentioned this pull request Nov 1, 2019
jeschkies added a commit that referenced this pull request Nov 1, 2019
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
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.

6 participants