From b65eeb2d9631c1dc29b0527992aa94d419000053 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 11 Jul 2019 13:21:16 -0700 Subject: [PATCH] Add base-minimal job This is required by zuul-jobs for its testing. We could put it only in the Zuul tenant, but we would need to duplicate the secret, so this is lazier. It shouldn't hurt to have it in all the tenants. We can set allowed-projects so that only zuul-jobs can use it in order to avoid accidental use and confusion. Change-Id: I8966737c580628b4fa097e32594c8a4e99926147 --- playbooks/base-minimal/README.rst | 8 ++++++ playbooks/base-minimal/post-logs.yaml | 10 ++++++++ playbooks/base-minimal/post.yaml | 11 +++++++++ playbooks/base-minimal/pre.yaml | 9 +++++++ zuul.d/jobs.yaml | 35 ++++++++++++++++++++++++--- 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 playbooks/base-minimal/README.rst create mode 100644 playbooks/base-minimal/post-logs.yaml create mode 100644 playbooks/base-minimal/post.yaml create mode 100644 playbooks/base-minimal/pre.yaml diff --git a/playbooks/base-minimal/README.rst b/playbooks/base-minimal/README.rst new file mode 100644 index 0000000..e7756a0 --- /dev/null +++ b/playbooks/base-minimal/README.rst @@ -0,0 +1,8 @@ +base-minimal +------------ + +These playbooks are used to select a minimal subset of the roles included in +the base playbooks. + +It will do nothing else than what is explicitely necessary for any job to run +properly. diff --git a/playbooks/base-minimal/post-logs.yaml b/playbooks/base-minimal/post-logs.yaml new file mode 100644 index 0000000..ff39881 --- /dev/null +++ b/playbooks/base-minimal/post-logs.yaml @@ -0,0 +1,10 @@ +- hosts: localhost + roles: + - role: add-fileserver + fileserver: "{{ site_logs }}" + - role: ara-report + +- hosts: "{{ site_logs.fqdn }}" + roles: + - role: upload-logs + zuul_log_url: "http://logs.openstack.org" diff --git a/playbooks/base-minimal/post.yaml b/playbooks/base-minimal/post.yaml new file mode 100644 index 0000000..c4a139d --- /dev/null +++ b/playbooks/base-minimal/post.yaml @@ -0,0 +1,11 @@ +- hosts: all + roles: + - fetch-output + - merge-output-to-logs + +- hosts: all + # NOTE(pabelanger): We ignore_errors for the following tasks as not to fail + # successful jobs. + ignore_errors: yes + roles: + - remove-build-sshkey diff --git a/playbooks/base-minimal/pre.yaml b/playbooks/base-minimal/pre.yaml new file mode 100644 index 0000000..7748845 --- /dev/null +++ b/playbooks/base-minimal/pre.yaml @@ -0,0 +1,9 @@ +- hosts: all + roles: + - add-build-sshkey + - start-zuul-console + - log-inventory + - role: validate-host + # TODO(mordred) When we have site-local variables, these should go there + zuul_traceroute_host: opendev.org + zuul_image_manifest: /etc/dib-builddate.txt diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index f84c108..8e99f72 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -190,13 +190,40 @@ vars: ara_report_type: database ara_report_path: ara-report - nodeset: - nodes: - - name: ubuntu-bionic - label: ubuntu-bionic + nodeset: ubuntu-bionic secrets: - site_logs +- job: + name: base-minimal + parent: null + abstract: true + description: | + A subset of what the 'base' job provides: the absolute minimum considered + required to run for any one job. + It doesn't set up cached git repositories, will not set up mirrors, + doesn't validate the node, etc. + It is meant to be used, amongst other things, to test roles and + playbooks that would otherwise be included by default as part of the + 'base' job. + These tasks, if required, can be included by the dependant jobs + themselves on a need basis. + pre-run: playbooks/base-minimal/pre.yaml + post-run: + - playbooks/base-minimal/post.yaml + - playbooks/base-minimal/post-logs.yaml + roles: + - zuul: zuul/zuul-jobs + vars: + ara_report_type: database + ara_report_path: ara-report + timeout: 1800 + post-timeout: 1800 + nodeset: ubuntu-bionic + secrets: + - site_logs + allowed-projects: zuul/zuul-jobs + - secret: name: opendev-intermediate-registry data: