This document is specific to the London RedCentric lab, but should evolve to a more generic setup once we have more labs. For now, there are some hard-coded logic in the wiki as well as the scripts, to make sure we can reproduce at least the one lab we have. Once we have more labs, we'll work to automate that using configuration files, command line options, etc.
...
You may get two warnings when you log in to Jenkins, which can be corrected on the Global Security screen:
- ERROR in config.xml: Jenkins may complain "version 1.1" is not supported, only 1.0. Editing
/var/lib/jenkins/config.xml
and changing that on the first line seems to work. - Agent to master security subsystem is currently off: Go to Security Settings and check the box saying "Enable Agent → Master Access Control"
- Jenkins instance uses deprecated protocols: JNLP3-connect: Go to Security Settings > Agents and clear the box "Java Web Start Agent Protocol/3" in "Agent Protocols"
Themes: Install the Simple Theme Plugin and choose one from the list by updating the theme URL in the general settings.
Save the configuration and you should be all set.
Installing the Jenkins Jobs
...
No Format |
---|
mr_provisioner_auth_token: {TOKEN} |
...
Since we're pushing changes to Mr-Provisioner, we've added it's Ansible as a submodule. So first, you need to update it:
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # git submodule update --init --recursive |
...
Run the Jenkins playbook
The first playbook you need to run is Jenkins:
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # ansible-playbook -vvv -u root hpc_jobs_deployjenkins.yml |
Create the users accounts
This also works to update once there are changed. This playbook will create the nodes, jobs, users, ssh keys, etc.
The Jenkins playbook is a requirement for the other two: MrP and FS.
Create Mr-Provisioner users account
You need to create the Jenkins account by hand in MrPMr-Provisioner, add the ssh SSH keys and generate the MrP token. This requirement will be dropped when bug 102 is fixed.
...
- Log in as "admin"
- Create a user "jenkins", set its password to some random string (use 'pwgen')
- Logout as "admin" - Log in as "jenkins"
- Add the SSH keys of all slaves to it
- Generate a tokenAPITOKEN, copy and paste somewhere
- Log out as "jenkins"
Jenkins
...
Run Mr-Provisioner playbook
Add the APITOKEN generated by the step above, add it to hpc_lab_job_deploy/vars/jslave_tokens.yml.secret
in the following format (same token for all users):
...
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # ansible-playbouok -vvv -u root put_mrp_tokens.yml |
Now that the SSH Keys, Tokens and accounts are in place, all you have to do is assign the slaves to the right machines and ensure that you use the jinja templating in the preseeds in MrP.
File Server
...
Run File Server playbook
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # ansible-playbouok -vvv -u root fs.yml |
Updating Jenkins Jobs
Once the jobs are installed and working, on every change pertaining the Jenkins configuration, you just need to update the repo and run the same playbook again:
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # cd hpc_lab_jenkins root@hpc-admin # git fetch -a & git pull root@hpc-admin # ansible-playbook -vvv -u root hpc_jobs_deployjenkins.yml |