-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from openstack-k8s-operators/zuul/validate-al…
…l-scenarios Generate build jobs for all automations This patch provides a script generating all of the zuul.d content, based on the automation files. Each scenario will get its own job definition, and will be triggered only when its files are changed. Note that common files, such as "lib", will trigger all the jobs. This patch also introduces a new github workflow, to ensure all of the automation scenarios have a job, by re-running the script and ensuring no chance happened in zuul.d directory. Depends-On: openstack-k8s-operators/ci-framework#1742 Reviewed-by: Cédric Jeanneret Reviewed-by: Pragadeeswaran Sathyanarayanan <[email protected]> Reviewed-by: Andrew Bays <[email protected]>
- Loading branch information
Showing
9 changed files
with
240 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
extends: default | ||
ignore: | ||
- '*.md' | ||
- 'zuul.d/' | ||
|
||
rules: | ||
line-length: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ovs-dpdk-sriov.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ovs-dpdk-sriov.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import yaml | ||
|
||
_AUTO_PATH = 'automation/vars/' | ||
_JOBS = [] | ||
_PROJECTS = ['noop'] | ||
_BASE_TRIGGER_FILES = [ | ||
'lib', | ||
] | ||
|
||
def create_job(name, data): | ||
j_name = 'rhoso-architecture-validate-{}'.format(name) | ||
_paths = [p['path'] for p in data['stages']] + _BASE_TRIGGER_FILES | ||
for i in ['va', 'dt']: | ||
if os.path.exists(os.path.join(i, name)): | ||
_paths.append(os.path.join(i, name)) | ||
_mock = os.path.join('automation', 'mocks', '{}.yaml'.format(name)) | ||
if os.path.exists(_mock): | ||
_paths.append(_mock) | ||
_paths.sort() | ||
job = { | ||
'job': { | ||
'name': j_name, | ||
'parent': 'rhoso-architecture-base-job', | ||
'vars': { | ||
'cifmw_architecture_scenario': name, | ||
}, | ||
'files': _paths, | ||
} | ||
} | ||
_JOBS.append(job) | ||
_PROJECTS.append(j_name) | ||
|
||
|
||
for fname in [f for f in os.listdir(_AUTO_PATH) if f.endswith('.yaml')]: | ||
with open(os.path.join(_AUTO_PATH, fname), 'r') as y_file: | ||
scenarios = yaml.safe_load(y_file) | ||
for scenario, stages in scenarios['vas'].items(): | ||
create_job(scenario, stages) | ||
|
||
_sorted_jobs = sorted(_JOBS, key= lambda d: d['job']['name']) | ||
with open('./zuul.d/validations.yaml', 'w+') as zuul_jobs: | ||
yaml.dump(_sorted_jobs, zuul_jobs) | ||
|
||
_PROJECTS.sort() | ||
with open('./zuul.d/projects.yaml', 'w+') as zuul_projects: | ||
struct = [{'project': {'github-check': {'jobs': _PROJECTS}, | ||
'github-gate': {'jobs': _PROJECTS} | ||
} | ||
} | ||
] | ||
yaml.dump(struct, zuul_projects) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
--- | ||
- project: | ||
github-check: | ||
jobs: | ||
- noop | ||
- rhoso-architecture-validate-hci | ||
- rhoso-architecture-validate-ovs-dpdk-sriov | ||
jobs: &id001 | ||
- noop | ||
- rhoso-architecture-validate-bgp | ||
- rhoso-architecture-validate-hci | ||
- rhoso-architecture-validate-ovs-dpdk | ||
- rhoso-architecture-validate-ovs-dpdk-sriov | ||
- rhoso-architecture-validate-sriov | ||
- rhoso-architecture-validate-uni01alpha | ||
- rhoso-architecture-validate-uni02beta | ||
- rhoso-architecture-validate-uni04delta | ||
- rhoso-architecture-validate-uni06zeta | ||
github-gate: | ||
jobs: | ||
- noop | ||
- rhoso-architecture-validate-hci | ||
- rhoso-architecture-validate-ovs-dpdk-sriov | ||
jobs: *id001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
- job: | ||
files: | ||
- dt/bgp | ||
- examples/dt/bgp/control-plane | ||
- examples/dt/bgp/control-plane/nncp | ||
- examples/dt/bgp/edpm/deployment | ||
- examples/dt/bgp/edpm/nodeset | ||
- lib | ||
name: rhoso-architecture-validate-bgp | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: bgp | ||
- job: | ||
files: | ||
- examples/va/hci | ||
- examples/va/hci/control-plane | ||
- examples/va/hci/control-plane/nncp | ||
- examples/va/hci/deployment | ||
- examples/va/hci/edpm-pre-ceph/deployment | ||
- examples/va/hci/edpm-pre-ceph/nodeset | ||
- lib | ||
- va/hci | ||
name: rhoso-architecture-validate-hci | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: hci | ||
- job: | ||
files: | ||
- automation/mocks/ovs-dpdk.yaml | ||
- examples/va/nfv/ovs-dpdk | ||
- examples/va/nfv/ovs-dpdk/edpm/deployment | ||
- examples/va/nfv/ovs-dpdk/edpm/nodeset | ||
- examples/va/nfv/ovs-dpdk/nncp | ||
- lib | ||
name: rhoso-architecture-validate-ovs-dpdk | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: ovs-dpdk | ||
- job: | ||
files: | ||
- automation/mocks/ovs-dpdk-sriov.yaml | ||
- examples/va/nfv/ovs-dpdk-sriov | ||
- examples/va/nfv/ovs-dpdk-sriov/edpm/deployment | ||
- examples/va/nfv/ovs-dpdk-sriov/edpm/nodeset | ||
- examples/va/nfv/ovs-dpdk-sriov/nncp | ||
- lib | ||
name: rhoso-architecture-validate-ovs-dpdk-sriov | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: ovs-dpdk-sriov | ||
- job: | ||
files: | ||
- automation/mocks/sriov.yaml | ||
- examples/va/nfv/sriov | ||
- examples/va/nfv/sriov/edpm/deployment | ||
- examples/va/nfv/sriov/edpm/nodeset | ||
- examples/va/nfv/sriov/nncp | ||
- lib | ||
name: rhoso-architecture-validate-sriov | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: sriov | ||
- job: | ||
files: | ||
- dt/uni01alpha | ||
- examples/dt/uni01alpha | ||
- examples/dt/uni01alpha/control-plane | ||
- examples/dt/uni01alpha/control-plane/nncp | ||
- examples/dt/uni01alpha/networker | ||
- lib | ||
name: rhoso-architecture-validate-uni01alpha | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: uni01alpha | ||
- job: | ||
files: | ||
- dt/uni02beta | ||
- examples/dt/uni02beta | ||
- examples/dt/uni02beta/control-plane | ||
- examples/dt/uni02beta/control-plane/nncp | ||
- lib | ||
name: rhoso-architecture-validate-uni02beta | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: uni02beta | ||
- job: | ||
files: | ||
- dt/uni04delta | ||
- examples/dt/uni04delta | ||
- examples/dt/uni04delta/control-plane | ||
- examples/dt/uni04delta/control-plane/nncp | ||
- examples/dt/uni04delta/deployment | ||
- examples/dt/uni04delta/edpm-pre-ceph | ||
- examples/dt/uni04delta/edpm-pre-ceph/nodeset | ||
- lib | ||
name: rhoso-architecture-validate-uni04delta | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: uni04delta | ||
- job: | ||
files: | ||
- dt/uni06zeta | ||
- examples/dt/uni06zeta | ||
- examples/dt/uni06zeta/control-plane | ||
- examples/dt/uni06zeta/control-plane/nncp | ||
- lib | ||
name: rhoso-architecture-validate-uni06zeta | ||
parent: rhoso-architecture-base-job | ||
vars: | ||
cifmw_architecture_scenario: uni06zeta |