From 84b3182ba4f780c6fa380d94c162fc79c810d9be Mon Sep 17 00:00:00 2001
From: "James E. Blair" <jeblair@openstack.org>
Date: Thu, 5 Dec 2013 12:38:31 -0800
Subject: [PATCH] Switch some infra jobs to use bare precise nodes

Rename the jjb file to be less anachronistic.

Make these jobs mark their nodes as single-use.

Make sure there are at least enough nodes ready to fully test
one change.

Change-Id: I9bbb7cebf8f3a7b9e69d77f691505efd88972dc5
---
 .../config/{openstack-ci-puppet.yaml => infra.yaml} |  8 ++++----
 modules/openstack_project/files/zuul/layout.yaml    |  7 +++++++
 .../templates/nodepool/nodepool.yaml.erb            | 13 ++++++++++++-
 3 files changed, 23 insertions(+), 5 deletions(-)
 rename modules/openstack_project/files/jenkins_job_builder/config/{openstack-ci-puppet.yaml => infra.yaml} (92%)

diff --git a/modules/openstack_project/files/jenkins_job_builder/config/openstack-ci-puppet.yaml b/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml
similarity index 92%
rename from modules/openstack_project/files/jenkins_job_builder/config/openstack-ci-puppet.yaml
rename to modules/openstack_project/files/jenkins_job_builder/config/infra.yaml
index 721996ed41..1da2306d22 100644
--- a/modules/openstack_project/files/jenkins_job_builder/config/openstack-ci-puppet.yaml
+++ b/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml
@@ -1,6 +1,6 @@
 - job:
     name: config-compare-xml
-    node: precise
+    node: bare-precise
 
     builders:
       - gerrit-git-prep
@@ -12,7 +12,7 @@
 
 - job:
     name: gate-config-layout
-    node: precise
+    node: bare-precise
 
     builders:
       - gerrit-git-prep
@@ -27,7 +27,7 @@
 # This is a non-standard docs job because it uses SCP instead of FTP
 - job:
     name: ci-docs
-    node: precise
+    node: bare-precise
 
     builders:
       - gerrit-git-prep
@@ -47,7 +47,7 @@
 
 - job:
     name: gate-ci-docs
-    node: precise
+    node: bare-precise
 
     builders:
       - gerrit-git-prep
diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml
index 0875d59b6a..e03ab1a7b8 100644
--- a/modules/openstack_project/files/zuul/layout.yaml
+++ b/modules/openstack_project/files/zuul/layout.yaml
@@ -109,6 +109,12 @@ jobs:
     parameter-function: set_log_url
   - name: ^.*(dsvm|devstack-vm).*$
     parameter-function: single_use_node
+  - name: gate-config-layout
+    parameter-function: single_use_node
+  - name: ci-docs
+    parameter-function: single_use_node
+  - name: gate-ci-docs
+    parameter-function: single_use_node
   - name: ^(gate|check)-tempest-dsvm-neutron-pg$
     branch: ^(?!stable/grizzly).*$
   - name: ^(gate|check)-tempest-dsvm-neutron-isolated$
@@ -197,6 +203,7 @@ jobs:
     voting: false
     failure-message: Jenkins XML output has changed.
     success-message: Jenkins XML output is unchanged.
+    parameter-function: single_use_node
 # Continous publishing from master of the following documentation targets:
   - name: openstack-admin-guide-cloud
     branch: ^master$
diff --git a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb
index 836139e63c..175421d9bb 100644
--- a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb
+++ b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb
@@ -75,6 +75,13 @@ providers:
         setup: prepare_node_devstack.sh
         username: jenkins
         private-key: /home/nodepool/.ssh/id_rsa
+      - name: bare-precise
+        base-image: 'Ubuntu 12.04 LTS (Precise Pangolin)'
+        min-ram: 8192
+        name-filter: 'Standard'
+        setup: prepare_node_bare.sh
+        username: jenkins
+        private-key: /home/nodepool/.ssh/id_rsa
   - name: hpcloud-az1
     region-name: 'az-1.region-a.geo-1'
     service-type: 'compute'
@@ -186,7 +193,7 @@ targets:
       credentials-id: '<%= jenkins_credentials_id %>'
     images:
       - name: bare-precise
-        min-ready: 2
+        min-ready: 3
         providers:
           - name: rax-ord
       - name: devstack-precise
@@ -213,6 +220,10 @@ targets:
       apikey: '<%= jenkins_api_key %>'
       credentials-id: '<%= jenkins_credentials_id %>'
     images:
+      - name: bare-precise
+        min-ready: 3
+        providers:
+          - name: rax-ord
       - name: devstack-precise
         min-ready: 20
         providers: