Skip to content

Commit

Permalink
Revert "Add details of setting up new Linux containers"
Browse files Browse the repository at this point in the history
This reverts commit 0cc5d2a.
  • Loading branch information
sf1919 committed Apr 25, 2023
1 parent 0cc5d2a commit 61db683
Showing 1 changed file with 2 additions and 48 deletions.
50 changes: 2 additions & 48 deletions Linux/jenkins-node/ansible/readme.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,4 @@
# Ansible Scripts for Mantid Jenkins Agents

New Linux nodes for use on Jenkins are now set up using ansible scripts in this folder.

## Setting up cloud nodes

- Ensure you have activated a conda environment with ansible (you may need to use the conda environment set up for use with the ansible-linode repo)
- set up a new node on Jenkins (this will give you the secret code)
- navigate to the [`Ansible folder`](https://github.com/mantidproject/dockerfiles/tree/main/Linux/jenkins-node/ansible)
- Update the `inventory.txt` file with the IP address, agent name and agent secret (i.e. Jenkins secret code). Be sure to save this file when update complete!
- Run the following command, replacing FedID with your FedID
```
ansible-playbook -i inventory.txt jenkins-agent.yml -u FedID -K
```
- you will be asked for a password - enter your FedID password
- when ansible script is complete check that node is now live on Jenkins with appropriate labels


## Cleaning nodes

Before cleaning any nodes mark them temporarily offline on Jenkins and ensure no jobs are running on them before cleaning.

The easiest way to clean nodes is using a groovy script on Jenkins. Use the links below for guidance
- [`Remove directories across multiple nodes`](https://developer.mantidproject.org/JenkinsConfiguration.html#remove-directories-across-multiple-nodes)
- [`Remove directories from single node`](https://developer.mantidproject.org/JenkinsConfiguration.html#remove-directories-from-single-node)

If this does not work you may need to spin up a new docker container. Use the instructions for Changing docker image below.

## Changing docker image

If you need to update the docker image or spin up a new docker container on a Linux machine - follow these instructions. Before starting mark any nodes you will be changing as temporarily offline on Jenkins and ensure no jobs are running on them.

- ssh into the node
- Stop and remove the container using the following command, replacing machinename with the appropriate name e.g. `isis-cloud-linux-1`
```
docker stop machinename && docker rm machinename
```
- Remove any associated volumes using the following command, again replacing machinename with the appropriate name
```
docker volume rm machinename
```
- for cloud machines, close the ssh connection and follow the instructions for setting up cloud nodes above.
- for physical machines navigate to the folder that contains the `deploy.sh` script. This is normally `dockerfiles/jenkins-node/bin`.
- Run the following command (you may be able to find it using reverse search)
```
./deploy.sh machinename agent_secret "https://builds.mantidproject.org" latest 50G
```
- on success close the ssh connection and check node connects on Jenkins


An ansible playbook for setting up a Jenkins agent to
build Mantid.

0 comments on commit 61db683

Please sign in to comment.