[Support] binhex - Jenkins


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
Link to comment
  • 2 weeks later...

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?

Link to comment
  • 3 months later...

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?

 

 

 

Link to comment

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

 

 

Link to comment

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

 

 

Link to comment
  • 2 months later...
  • 1 month later...

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

 

Link to comment

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

 

 

Link to comment

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

Link to comment
  • 1 month later...

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

Link to comment

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.

Link to comment
  • 2 months later...

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

Link to comment

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/

Link to comment

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

Link to comment
  • 1 month later...

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
Link to comment
  • 2 months later...

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

Link to comment
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.

Link to comment

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?

Link to comment
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.

Link to comment

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.