Jump to content
binhex

[Support] binhex - Jenkins

26 posts in this topic Last Reply

Recommended Posts

Overview: Support for Docker image arch-jenkins in the binhex repo.

Application: Jenkins - https://jenkins-ci.org/

Docker Hub: https://hub.docker.com/r/binhex/arch-jenkins/

GitHub: https://github.com/binhex/arch-jenkins

Documentationhttps://github.com/binhex/documentation

 

If you appreciate my work, then please consider buying me a beer  :D

 

btn_donate_SM.gif

 

For other Docker support threads and requests, news and Docker template support for the binhex repository please use the "General" thread here

Edited by binhex

Share this post


Link to post

Is there a way to set the vars used in /home/nobody/jenkins.sh?

 

I did it by changing that file in the container (set JAVA_OPTS=-Dhudson.security.csrf.requestfield=X-Jenkins-Crumb).

 

Could jenkins.sh include a script from /config which would be able override those settings?

 

I also needed to install git and jdk8-openjdk using pacman, then set up user.email and user.name with git config. How do I make those changes persistent?

Share this post


Link to post

Hey binhex

 

How would I go about adding a python runtime to this app?

 

My tasks are basically python (2) scripts that should run like cron jobs, and on changes to my repos, but this container does not include python, so my jobs fail.

 

Can somebody help?

 

 

 

Share this post


Link to post

Hey binhex

 

How would I go about adding a python runtime to this app?

 

My tasks are basically python (2) scripts that should run like cron jobs, and on changes to my repos, but this container does not include python, so my jobs fail.

 

Can somebody help?

Two options, wait for me to include Python support :-) or deploy Jenkins slave (node) and run your jobs on the node with Python installed.

 

Sent from my LG-V500 using Tapatalk

 

 

Share this post


Link to post

Thanks for the answer.

 

Unless a jenkins+python docker is something that is right around the corner from you, I think I will try option 3, and mess about with making my own docker based on yours.

Teach a man to fish, and all that.

Share this post


Link to post

Thanks for the answer.

 

Unless a jenkins+python docker is something that is right around the corner from you, I think I will try option 3, and mess about with making my own docker based on yours.

Teach a man to fish, and all that.

Sounds good, I would encourage you to look into option 2 if your serious about using Jenkins, running jobs on the master is not really the done thing.

 

Sent from my SM-G900F using Tapatalk

 

 

Share this post


Link to post

Hi, I've installed Jenkins into my Unraid 6.2.0-rc4 and when launch I get an execution error/Server Error

 

Sep 3 11:27:22 850Server kernel: device vethb7a41a4 entered promiscuous mode

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered forwarding state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered forwarding state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

Sep 3 11:27:22 850Server kernel: device vethb7a41a4 left promiscuous mode

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

 

I suspect that by just accepting the defaults maybe I am not setting something up right (?).  I'm both a fairly new Unraid user but also learning Jenkins.

 

Any assist is appreciated or I can post on forum as needed.

 

It was suggested that I attach the supervisord.log file, however I have not been able to locate this file.

 

Screenshot of my configuration:

http://screencast.com/t/tAdT1tJ1f

 

Share this post


Link to post

Hi, I've installed Jenkins into my Unraid 6.2.0-rc4 and when launch I get an execution error/Server Error

 

Sep 3 11:27:22 850Server kernel: device vethb7a41a4 entered promiscuous mode

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered forwarding state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered forwarding state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

Sep 3 11:27:22 850Server kernel: device vethb7a41a4 left promiscuous mode

Sep 3 11:27:22 850Server kernel: docker0: port 1(vethb7a41a4) entered disabled state

 

I suspect that by just accepting the defaults maybe I am not setting something up right (?).  I'm both a fairly new Unraid user but also learning Jenkins.

 

Any assist is appreciated or I can post on forum as needed.

 

It was suggested that I attach the supervisord.log file, however I have not been able to locate this file.

 

Screenshot of my configuration:

http://screencast.com/t/tAdT1tJ1f

Your config looks fine but without the log file I can't really help much more. You should find the supervisord.log file in the root of the path defined for /config, please post this so I can take a look.

 

Sent from my SM-G900F using Tapatalk

 

 

Share this post


Link to post

Just spotted this in the log for Jenkins:

 

usermod: no changes

[info] Env var PUID defined as 99

[info] Env var PGID defined as 100

[info] Permissions already set for /config

chown: cannot access '/var/cache/jenkins/': No such file or directory

Share this post


Link to post

Just spotted this in the log for Jenkins:

 

usermod: no changes

[info] Env var PUID defined as 99

[info] Env var PGID defined as 100

[info] Permissions already set for /config

chown: cannot access '/var/cache/jenkins/': No such file or directory

 

This particular issue has now been resolved, please force update to grab the latest image. Please also note this is now built with the latest version of jenkins (v2.20 at this time).

Share this post


Link to post

Hi binheh,

nice job on this one. I am running into a small issues with remote repo connections as I keep getting "stderr: Could not create directory '/.ssh' when setting up source code management portion of a job. " in any configuration. I'm sure it's a small issue but as I don't have time to investigate today, I thought I would ask if you know of the top of your head.

 

Thanks

Share this post


Link to post

Hi binheh,

nice job on this one. I am running into a small issues with remote repo connections as I keep getting "stderr: Could not create directory '/.ssh' when setting up source code management portion of a job. " in any configuration. I'm sure it's a small issue but as I don't have time to investigate today, I thought I would ask if you know of the top of your head.

 

Thanks

 

 

Hey binhex, ignore my question. It was most likely mistake on my part. Readding SSH credentials solved all connectivity issues.

Share this post


Link to post

Hi, Im wondering where should I put my Jenkins Args...

I want to run my jenkins docker through reverse proxy from a folder (devel.xyz.com/jenkins/) and as per jenkins docks I need to edit file ( /etc/default/jenkins) by adding a line:

JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"

 

Can you please advise how / where should I find the file?

Thank you

Share this post


Link to post

Hi, Im wondering where should I put my Jenkins Args...

I want to run my jenkins docker through reverse proxy from a folder (devel.xyz.com/jenkins/) and as per jenkins docks I need to edit file ( /etc/default/jenkins) by adding a line:

JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"

 

Can you please advise how / where should I find the file?

Thank you

 

take a look here for an example jenkins argument:- https://hub.docker.com/r/binhex/arch-jenkins/

Share this post


Link to post

Hi, Im wondering where should I put my Jenkins Args...

I want to run my jenkins docker through reverse proxy from a folder (devel.xyz.com/jenkins/) and as per jenkins docks I need to edit file ( /etc/default/jenkins) by adding a line:

JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"

 

Can you please advise how / where should I find the file?

Thank you

 

take a look here for an example jenkins argument:- https://hub.docker.com/r/binhex/arch-jenkins/

 

 

Thanks, but could you be more specific please? I can see there Java Opts but no Jenkins... and I dont see there written how to change the original etc/default/jenkins file.

Thanks

Share this post


Link to post

How can I log into this container after I install it? I tried admin / admin but that didn't work and I don't see default credentials listed anywhere.

 

Edit: I found the file.

 

For anyone who's also struggling, the password can be found in the initialAdminPassword file located in /config/secrets folder.

Edited by Ezro

Share this post


Link to post

Hey, thanks for yet another great plugin!

OK, so after many hours on Google, I have been unable to find the answer to my question, so my apologies if I just failed to enter the correct search string!

I have an UnRaid server (6.5.1) which runs both Docker and KVM. One of my Dockerized (is that a word?) applications is binhex-Jenkins. I want to run my build / test agent(s) as VMs within KVM (since some of them are Windows-based). So far, so good.

I would, however, like Jenkins to be able to start the VM, execute the job, then shut the VM down again afterwards. To do this, I need to use the Libvirt slaves plugin (I think). One of the requirements for that is that the libvirt library is installed on the Jenkins machine.

This is where I am stuck. Can anyone point me at documentation of how to do this? Everything I can find either assumes Jenkins is running directly on the host, as opposed to in Docker, or that the base OS is Ubuntu, not UnRaid.
Alternatively, would it be a big job (and popular, perhaps) to pre-add this library to the main Docker image?

Of course, I am assuming that so I guess an alternative approach would be to allow the container to access the host OS's copy of the library? Needless to say, I don't know where to start with this, either!

TIA

Share this post


Link to post
15 hours ago, wierdbeard65 said:

Hey, thanks for yet another great plugin!

OK, so after many hours on Google, I have been unable to find the answer to my question, so my apologies if I just failed to enter the correct search string!

I have an UnRaid server (6.5.1) which runs both Docker and KVM. One of my Dockerized (is that a word?) applications is binhex-Jenkins. I want to run my build / test agent(s) as VMs within KVM (since some of them are Windows-based). So far, so good.

I would, however, like Jenkins to be able to start the VM, execute the job, then shut the VM down again afterwards. To do this, I need to use the Libvirt slaves plugin (I think). One of the requirements for that is that the libvirt library is installed on the Jenkins machine.

This is where I am stuck. Can anyone point me at documentation of how to do this? Everything I can find either assumes Jenkins is running directly on the host, as opposed to in Docker, or that the base OS is Ubuntu, not UnRaid.
Alternatively, would it be a big job (and popular, perhaps) to pre-add this library to the main Docker image?

Of course, I am assuming that so I guess an alternative approach would be to allow the container to access the host OS's copy of the library? Needless to say, I don't know where to start with this, either!

TIA

 

whilst installing libvirt directly on the master would most probably give you a solution to your problem, your best course of action is to instead spin up a docker container dynamically and install libvirt in this instead, then get this to do the controlling of the vm. in short you want to try and keep the jenkins master as clean as possible, in theory the master should do nothing else other than orchestrate slaves to run the builds (possibly with the exception of archives and other build artifacts).

 

so my advice take a look at the jenkins docker plugin:-

 

https://wiki.jenkins.io/display/JENKINS/Docker+Plugin

 

get some dynamic slaves going and then use those for control.

Share this post


Link to post

First up, thanks for the prompt response!

I completely understand the theory of what you suggest, as well as the logic behind it, however I am not sure how to proceed in order to make it happen!

The plugin for Jenkins that allows me to control KVM does not, as far as I am aware, support this kind of "one step removed" process, unless I am missing something? The plugin you referenced is pretty cool and, if I am reading it correctly, does with Docker what I am trying to do with KVM (i.e. allows a Jenkins job to dynamically provision a Docker container). I guess my question is, how would I then make the library installed in the second container available to the first (Jenkins) one? Or am I missing something here?

Share this post


Link to post
19 minutes ago, wierdbeard65 said:

as far as I am aware, support this kind of "one step removed" process, unless I am missing something?

 

yes you are quite right, however once you know the commands to issue it shouldn't be too hard to create a simple jenkins job with 'build steps' to create, start, run, shutdown, delete a vm, of course it would be infinitely easier and MUCH faster to do this using the docker plugin i linked to (in my experience less than a 1/4 of the time to spin up windows kvm), there ar also canned jenkins slave docker images you can pull down, so you dont even need to go through the hassle of configuring the slave (which of course you would for a windows vm).

 

i am using vsphere, openstack and docker jenkins plugins at work in a CI env so i have hands on experience of each of these, docker is by far the fastest solution we have running, with over 60 containers running concurrently on only 8 very modest linux hosts.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.