From 9f1507eabc4552b370963042ec6c5f2f2ac38176 Mon Sep 17 00:00:00 2001
From: Luigi Toscano <ltoscano@redhat.com>
Date: Fri, 5 May 2017 15:15:27 +0200
Subject: [PATCH] sahara: refactor image building, new builders

Generalize the existing image building jobs and distinguish
the repository (sahara-image-elements for the existing
build system, sahara for the new build/validation method).

Right now only two new jobs are defined for sahara (based on
sahara-image-pack). This matches the current status of the
almost ready (under review) sahara-image-pack builders.
As the code for the builders are not ready, the new jobs are
only defined in the experimental queue.

The script called by the job has the same name in both
repositories (sahara-image-elements and sahara).

The refactor also consistently changes the name of all non-voting
jobs by adding the -nv suffix (which makes them non-voting by
default with some magic) and removes two non-voting jobs
which should not have been in the gate queue.

Change-Id: I5fc00c4c8f97ecaa9e48e2e76a64ddc6d68d1720
---
 jenkins/jobs/projects.yaml |  9 ++++++++-
 jenkins/jobs/sahara.yaml   |  2 +-
 zuul/layout.yaml           | 35 ++++++++++++++++-------------------
 3 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/jenkins/jobs/projects.yaml b/jenkins/jobs/projects.yaml
index 3fd8f23e25..628b4657b3 100644
--- a/jenkins/jobs/projects.yaml
+++ b/jenkins/jobs/projects.yaml
@@ -13759,6 +13759,12 @@
             - ubuntu-xenial
           suffix: '-nv'
           branch-override: default
+      - 'gate-{name}-buildimages-{plugin}-{node}{suffix}':
+          node: ubuntu-xenial
+          suffix: '-nv'
+          plugin:
+            - cloudera
+            - ambari
 
 - project:
     name: sahara-ci-config
@@ -13804,7 +13810,8 @@
     jobs:
       - python-jobs
       - pypi-jobs
-      - 'gate-sahara-buildimages-{plugin}-{node}':
+      - 'gate-{name}-buildimages-{plugin}-{node}{suffix}':
+          suffix: '-nv'
           node:
             - ubuntu-trusty
             - ubuntu-xenial
diff --git a/jenkins/jobs/sahara.yaml b/jenkins/jobs/sahara.yaml
index 4087ac15dc..b361eac420 100644
--- a/jenkins/jobs/sahara.yaml
+++ b/jenkins/jobs/sahara.yaml
@@ -103,7 +103,7 @@
 
 
 - job-template:
-    name: 'gate-sahara-buildimages-{plugin}-{node}'
+    name: 'gate-{name}-buildimages-{plugin}-{node}{suffix}'
     node: '{node}'
 
     wrappers:
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 32ab9056bc..8c3c956847 100755
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2932,9 +2932,6 @@ jobs:
   - name: ^gate-sahara-pylint.*$
     voting: false
 
-  - name: ^gate-sahara-buildimages.*$
-    voting: false
-
   - name: ^gate-sahara-dsvm-scenario-(nova|neutron)-ubuntu-trusty-nv$
     branch: ^stable/mitaka$
 
@@ -17263,6 +17260,8 @@ projects:
       - sahara-coverage-ubuntu-xenial
     experimental:
       - gate-sahara-dsvm-scenario-multinode-spark-ubuntu-xenial-nv
+      - gate-sahara-buildimages-cloudera-ubuntu-xenial-nv
+      - gate-sahara-buildimages-ambari-ubuntu-xenial-nv
 
   - name: openstack/sahara-ci-config
     template:
@@ -17327,25 +17326,23 @@ projects:
     check:
       - gate-sahara-image-elements-pep8-ubuntu-trusty
       - gate-sahara-image-elements-pep8-ubuntu-xenial
-      - gate-sahara-buildimages-vanilla-ubuntu-trusty
-      - gate-sahara-buildimages-cloudera-ubuntu-trusty
-      - gate-sahara-buildimages-spark-ubuntu-trusty
-      - gate-sahara-buildimages-storm-ubuntu-trusty
-      - gate-sahara-buildimages-mapr-ubuntu-trusty
-      - gate-sahara-buildimages-ambari-ubuntu-trusty
-      - gate-sahara-buildimages-plain-ubuntu-trusty
-      - gate-sahara-buildimages-vanilla-ubuntu-xenial
-      - gate-sahara-buildimages-cloudera-ubuntu-xenial
-      - gate-sahara-buildimages-spark-ubuntu-xenial
-      - gate-sahara-buildimages-storm-ubuntu-xenial
-      - gate-sahara-buildimages-mapr-ubuntu-xenial
-      - gate-sahara-buildimages-ambari-ubuntu-xenial
-      - gate-sahara-buildimages-plain-ubuntu-xenial
+      - gate-sahara-image-elements-buildimages-vanilla-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-cloudera-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-spark-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-storm-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-mapr-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-ambari-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-plain-ubuntu-trusty-nv
+      - gate-sahara-image-elements-buildimages-vanilla-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-cloudera-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-spark-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-storm-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-mapr-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-ambari-ubuntu-xenial-nv
+      - gate-sahara-image-elements-buildimages-plain-ubuntu-xenial-nv
     gate:
       - gate-sahara-image-elements-pep8-ubuntu-trusty
       - gate-sahara-image-elements-pep8-ubuntu-xenial
-      - gate-sahara-buildimages-vanilla-ubuntu-trusty
-      - gate-sahara-buildimages-vanilla-ubuntu-xenial
     post:
       - sahara-image-elements-branch-tarball