Pulp Automation Services » History » Sprint/Milestone 2
semyers, 11/04/2016 06:59 PM
preview fail on previous edit
1 | 1 | semyers | # Pulp Automation Services |
---|---|---|---|
2 | |||
3 | **This is not an exhaustive list.** If any services are missing, please add them as needed. |
||
4 | |||
5 | ## The "automation" VM |
||
6 | |||
7 | Some of our automated services live on the "automation" VM, which currently resides in the Openstack tenancy provided by Red Hat Central CI. Being provided by Central CI, this system is only accessible if you have the Red Hat corporate network, similar to our Jenkins instance itself. Access to this VM is freely provided as-needed to Red Hat Pulp team members. |
||
8 | |||
9 | ## nodepool |
||
10 | |||
11 | Nodepool is a service created by the Openstack project, and is responsible for creating Jenkins slave nodes for our Jenkins master. Nodepool periodically inspects the jenkins job queue, and spawns nodes matching the node label require by jobs in that queue. Once a job completes, nodepool destroys that slave node. In this way, nodepool is able to efficiently utilize the resource quotas in our Openstack tenancy by ensuring that only nodes actually needed by Jenkins are online at any given time. |
||
12 | |||
13 | 2 | semyers | ### Instance Types |
14 | 1 | semyers | |
15 | Replace \<dist\> in the list below with an identifier that obviously represents a given OS distribution. For example, f24-np would be based off of a Fedora 24 Cloud image, and rhel7-vanilla-np would be based off of a RHEL 7 Cloud image. |
||
16 | |||
17 | Common node labels available to Jenkins jobs: |
||
18 | |||
19 | - \<dist\>-vanilla-np: A node type with minimal changes from its base image, useful for most tasks not involving an installation of Pulp that are run on that node. |
||
20 | - \<dist\>-np: A node type pre-loaded with dependenc.es needed to facilitate installing any version of Pulp on that node. |
||
21 | - pulp-smash-np: A node type specifically for installing and running the pulp-smash test suite. |
||
22 | |||
23 | ### Holding Instances |
||
24 | |||
25 | It is occasionally useful, when debugging or reproducing issues, to hold a nodepool instance. Holding an instance prevents nodepool from destroying it, allowing use to get on the held instance and inspect/interact with that node. |
||
26 | |||
27 | Upon logging into the pulp automation VM, you can run the "nodepool" command. To list instances, run "nodepool list". To hold an instance, run "nodepool hold \<instance id\>". To log in to an instance, ssh to that instance by IP address from the automation VM. The automation VM's ssh client config will ensure that you are able log into the node with the correct user ID. Both the instance ID and IP Address are listed in the output of "nodepool list". Futhermore, the instance label and ID are both included in the instance's name, which can be seen in Jenkins itself when viewing the "Build Executor Status" block, found on the left side of Jenkins dashboard pages. the node name template is \<label\>-\<provider\>-\<id\>. Provider is always a single word, so a node named "rhel7-vanilla-np-cios-54482" means the node label is "rhel7-vanilla-np", and the node ID is 54482. |
||
28 | |||
29 | ### Rebuilding images |
||
30 | |||
31 | Nodepool rebuilds images nightly for each node label. Nodepool also keeps the previous image for a given node label, so under normal circumstances there will be two images for a label. Older images are deleted at the end of nodepool's nightly image rebuild. |
||
32 | |||
33 | Occasionally, nodepool's automated image build fails. If this happens, we normally do one of two things. We either delete the most recently created image for the affected label and fall back on the previous image, or we rebuild the image. |
||
34 | |||
35 | To delete the most recently created image, run "nodepool image-list" to get the list of images. Find the image(s) matching the affected label, and then delete the most recent image. You can see which is most recent by looking at the "Age" column and picking the one with a smaller duration, or looking at the "Version" column and deleting the one with a higher version. |
||
36 | |||
37 | To rebuild an image for a label, run "nodepool image-update \<provider\> \<label\>". The provider for an image can been seen in the output of "nodepool image-list". |
||
38 | |||
39 | Once a new image is available (either by deleting the most recent image or building a new one), any current instances running the failing image should be destroyed. It's not very easy to cross-reference images with the instances running them, so the simplest thing to do is delete all instances that appear in "nodepool list" in the "ready" state for the affected label. |