[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Using a Jenkins Slave in openshift

On Thu, Aug 11, 2016 at 11:10 AM, Akshaya Khare <khare ak husky neu edu> wrote:

Thanks for the detailed explanation, and I did get far but got stuck again.
So I was able to build a slave Jenkins image and created a buildconfig.
After updating the Kubernetes plugin configurations, I was able to spawn a new pod, but the pod fails with the error "ContainerCannotRun".
On seeing the logs of the pod, it shows:
exec: "/var/lib/jenkins/run-jnlp-client": permission denied

​sounds like /var/lib/jenkins/run-jnlp-client ​ doesn't have the right read/execute permissions set.  How are you building the slave image?


I tried giving admin privileges to my user, and also edit privileges to the serviceaccount in my project:
oc policy add-role-to-group edit system:serviceaccounts -n jenkinstin2

How can I make sure that the pod runs without any permissions issues?

On Mon, Aug 8, 2016 at 3:55 PM, Ben Parees <bparees redhat com> wrote:
The sample defines a buildconfig which ultimately uses this directory as the context for a docker build:

it does that by pointing the buildconfig to this repo:

and the context directory named "slave" within that repo:

If you are trying to build your own slave image, you need to point to a repo (and optionally a contextdir within that repo) that contains an appropriate Dockerfile, as the example does.

On Mon, Aug 8, 2016 at 2:43 PM, Akshaya Khare <khare ak husky neu edu> wrote:
Hi Ben,

So after making changes to the imagestream, I wasn't able to get the build running initially.
But that was because already there were failed builds and buildconfigs which were preventing the build to run successfully.

Once I deleted the old failed builds, I was able to get the new build running, but it failed once I tried running my Jenkins job.
I gave my github repository as the repository url for the build, and this is the log i get for the failed pod:

I0808 14:06:51.779594       1 source.go:96] git ls-remote https://github.com/akshayakhare/ims/ --heads
I0808 14:06:51.779659       1 repository.go:275] Executing git ls-remote https://github.com/akshayakhare/ims/ --heads
I0808 14:07:06.989568       1 source.go:189] Cloning source from https://github.com/akshayakhare/ims/
I0808 14:07:06.989649       1 repository.go:275] Executing git clone --recursive https://github.com/akshayakhare/ims/ /tmp/docker-build543901321
I0808 14:07:35.174676       1 repository.go:300] Out: Merge pull request #28 from chemistry-sourabh/Logging
I0808 14:07:35.174708       1 common.go:78] Setting build revision to &api.GitSourceRevision{Commit:"79ed71a8470c973c6f6cad380657c2df93948345", Author:api.SourceControlUser{Name:"Akshaya Khare", Email:"akshayakhare gmail com"}, Committer:api.SourceControlUser{Name:"GitHub", Email:"noreply github com"}, Message:"Merge pull request #28 from chemistry-sourabh/Logging"}
F0808 14:07:35.200435       1 builder.go:185] Error: build error: open /tmp/docker-build543901321/Dockerfile: no such file or directory

Do i need to create a docker file in my repository to run successfully?
You mentioned that the sample git given in the blog uses a "slave" sub directory, will I have to create a similar structure in my repository?

Looking at the sample Docker file given in the blog below, makes me believe that it copies the workspace from the current image to its own container and then runs it:

Is my understanding correct?

On Fri, Aug 5, 2016 at 4:39 PM, Ben Parees <bparees redhat com> wrote:
You'll need to define the imagestream you've got the build pushing to, the sample does that here:

you'll need to name the imagestream "jdk8-jenkins-slave" in your case.

On Fri, Aug 5, 2016 at 4:06 PM, Akshaya Khare <khare ak husky neu edu> wrote:
I've attached the buildconfig, and the project name is "jenkinstin2"...

On Fri, Aug 5, 2016 at 2:38 PM, Ben Parees <bparees redhat com> wrote:

On Fri, Aug 5, 2016 at 2:28 PM, Akshaya Khare <khare ak husky neu edu> wrote:

I have a project configured in jenkins container(thanks to Ben Parees for suggesting s2i, it works like a charm) running on openshiift which I need to test every time there is a pull request from github.

And we are planning to run those test cases on a separate node, since the environment is ideal for testing.
I was following this blog by Siamak Sadeghianfar which seems to do exactly the thing which I'm expecting it to do.


Now whenever I try creating the slave image from the UI, I get an error saying:

"build failed 44 hours ago - 29d91a3: added metadata to Dockerfile (Siamak Sadeghianfar <ssadeghi redhat com>)"

"bc/jenkins is pushing to imagestreamtag/jenkins:latest that is using is/jenkins, but that image stream does not exist"

​can you share your buildconfig definition (json or yaml) and the name of the project you've defined it in?


I can see the docker image :-> <local-ip>:5000/jenkinstin2/jenkins without any tags.

What have I messed up here?

And what should be the repository URL for this jenkins-slave-builder, I tried giving my github project url and also the sample jenkins-s2i-example.git url, both end up giving the same error.

​the repository the buildconfig references?  depends what you want to build, but it doesn't sound like that is your current issue.​

the example i think you're following uses this repository as the source repo input for the slave image build:


but it uses a context subdirectory of "slave".

you can see the build config definition (and relevant parameters) here:


Also I got the master image running, but apparently the configuration doesn't have the one field it certainly needs to have...
Restrict where this project can be run

​sorry, not sure what you're referring to here or where you expect this to be configured?


Is this a bug of some sort?
Thanks & Regards,

users mailing list
users lists openshift redhat com

Ben Parees | OpenShift

Thanks & Regards,
Akshaya Khare

Ben Parees | OpenShift

Thanks & Regards,
Akshaya Khare

Ben Parees | OpenShift

Thanks & Regards,
Akshaya Khare

Ben Parees | OpenShift

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]