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:
- Agent to master security subsystem is currently off: Check the box saying "Enable Agent → Master Access Control"
- Jenkins instance uses deprecated protocols: JNLP3-connect: Uncheck the box "Java Web Start Agent Protocol/3" in "Agent Protocols"
Save the configuration and you should be all set.
Installing the Jenkins Jobs
Clone the repo containing the jobs, input your credentials (username and Jenkins API Token) in :First, you need to find your API token in Jenkins. That's done by clicking on your username (top right corner) > Configure > API Token > Show API Token.
This will show your user ID and token. That token is what below is referenced as APITOKEN.
Create the authorisation files
hpc_lab_jenkins/vars/jenkins_cred.yml.secret:
No Format |
---|
user: user@linaro.org password: APITOKEN url: http://10.40.0.12:8080 |
...
hpc_lab_jenkins/files/jenkins_jobs.ini.secret:
No Format |
---|
[jenkins] user=user@linaro.org password=APITOKEN url=http://10.40.0.12:8080 |
NOTE: The APITOKEN is the one from the admin user, not regular users.run the hpc_jobs_deploy.yml playbook:
Run the playbook
Code Block | ||||
---|---|---|---|---|
| ||||
root@hpc-admin # git clone https://github.com/Linaro/hpc_lab_jenkins.git root@hpc-admin # cd hpc_lab_jenkins root@hpc-admin # ansible-playbook -vvv -u root hpc_jobs_deploy.yml |
Create the users accounts in the provisioner
Now the slaves and jobs are setup. Now you need to create their accounts by hand in MrP, add their ssh keys and generate their MrP token.
Then add those tokens to the list in hpc_lab_job_deploy/vars/jslave_tokens.yml.secret in the following format :
...
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.
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_deploy.yml |
...