Running build does not provision docker salve

643 views
Skip to first unread message

Markus Fischer

unread,
Jul 18, 2015, 2:58:07 PM7/18/15
to jenkins...@googlegroups.com

I'm running Jenkins 1.609.1 with docker-plugin 0.10.0 to provision jenkins docker slave. Docker is 1.0.1 running on Ubuntu 14.04.

I've created a customized docker images based on evarga/jenkins-slave per instruction on https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin ("Shortcut : Pulling a Docker image").

In my Jenkins configuration I've:

  • added "Docker" to the "Cloud" area
  • pointed to the local docker URL http://localhost:4243/ and also configured docker appropriately (I can run "Test connection" and it reports back "1.0.1")
  • created a custom docker (my/jenkins:0.1) image using supervisord to run SSH, MySQL, Postgres, ElasticSearch, PHP and NodeJS inside
  • manually running the container, I can SSH inside with user jenkins/jenkins
  • I've also given the jenkins user inside the container password-less sudo rights
  • I've added a docker image to the "Docker Template" (as above: my/jenkins:0.1) and provided the launch method via "Docker SSH launcher"

In the job configuration:

  • I've checked "Docker container"
  • added my tag
  • source code is connected via git checkout

When I run the job, only the git checkout is performed, but not on the slave but directly on the host:


Started by user MyUser
Building in workspace /var/lib/jenkins/workspace/Project-Core
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url g...@github.com:MyUser/Project-Core.git # timeout=10
Fetching upstream changes from g...@github.com:MyUser/Project-Core.git
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress g...@github.com:MyUser/Project-Core.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 96dcbc7aa615451448184493c499c14eeb7050cc (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 96dcbc7aa615451448184493c499c14eeb7050cc
 > git rev-list 1405ab6d96a395e53c80f6d7353e11bea93675bc # timeout=10
Finished: SUCCESS


There's no sign of even trying to provision the docker slave.


What am I missing?


thanks in advance,

- Markus

Richard Bywater

unread,
Jul 18, 2015, 6:40:52 PM7/18/15
to jenkins...@googlegroups.com
You'll need to restrict the job to the label you gave in the Image configuration section (mylabel in your case)

I haven't used the "Docker Container" option but I think that is for when you want to save the container for future use after the job run is complete.

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/22326685-942f-49ea-b513-0a14cd98d9bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Markus Fischer

unread,
Jul 19, 2015, 5:43:31 AM7/19/15
to jenkins...@googlegroups.com
Hello Richard,


On Sunday, July 19, 2015 at 12:40:52 AM UTC+2, Richard Bywater wrote:
You'll need to restrict the job to the label you gave in the Image configuration section (mylabel in your case)

I haven't used the "Docker Container" option but I think that is for when you want to save the container for future use after the job run is complete.


thank you so much, that's it!

Within the General Jenkins configuraiton In the "Docker Template" configuration for the "Labels" it says in the help: "Labels (AKA tags) are used for grouping multiple slaves into one logical group..."

In the specific job configuration, as part of the "Docker container" option it also has a "Additional tags to add" field, which I thought was supposed to be this field.

But you're right, it's actually another field: "Restrict where this project can run" which also features an autocomplete, showing my label/tag. I guess my unfamiliarity with this functionality led to my confusion. This now works, thanks!

- Markus


Richard Bywater

unread,
Jul 19, 2015, 6:10:21 AM7/19/15
to jenkins...@googlegroups.com
Great - glad I could help.

Would be interested in your experiences of using the Docker plugin as I've had issues with it not sparking off more than one instance of a particular label at a time (e.g. if there's a build already running with a mylabel build a second build would just sit there and wait for the first one to complete). Interested to hear if this happens with you as well or if its just my setup at fault (as I've been unable to reliably diagnose the issue).

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages