From ab3626190d32206b97183b2d8978b2c5fc6e625a Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 9 Apr 2018 15:45:53 -0500 Subject: [PATCH] osh-gate: Move to use roles from openstack-helm-infra This moves to consume the roles from openstack-helm-infra in the openstack-helm gates Depends-On: https://review.openstack.org/559836 Change-Id: I3ed721333b899f8dde812f1843a9fcb074c63121 --- .zuul.yaml | 36 ++++++----- tools/gate/playbooks/osh-infra-build.yaml | 36 +++++++++++ .../playbooks/osh-infra-collect-logs.yaml | 58 +++++++++++++++++ .../playbooks/osh-infra-deploy-docker.yaml | 43 +++++++++++++ .../gate/playbooks/osh-infra-deploy-k8s.yaml | 44 +++++++++++++ .../playbooks/osh-infra-upgrade-host.yaml | 39 +++++++++++ tools/gate/playbooks/vars.yaml | 64 +++++++++++++++++++ 7 files changed, 305 insertions(+), 15 deletions(-) create mode 100644 tools/gate/playbooks/osh-infra-build.yaml create mode 100644 tools/gate/playbooks/osh-infra-collect-logs.yaml create mode 100644 tools/gate/playbooks/osh-infra-deploy-docker.yaml create mode 100644 tools/gate/playbooks/osh-infra-deploy-k8s.yaml create mode 100644 tools/gate/playbooks/osh-infra-upgrade-host.yaml create mode 100644 tools/gate/playbooks/vars.yaml diff --git a/.zuul.yaml b/.zuul.yaml index e1b3b8b87c..d43e9aadb5 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -133,13 +133,15 @@ - job: name: openstack-helm-dev-deploy + roles: + - zuul: openstack/openstack-helm-infra timeout: 7200 vars: osh_neutron_backend: openvswitch zuul_osh_infra_relative_path: ../openstack-helm-infra/ pre-run: - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-upgrade-host.yaml - post-run: ../openstack-helm-infra/tools/gate/playbooks/osh-infra-collect-logs.yaml + - tools/gate/playbooks/osh-infra-upgrade-host.yaml + post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml required-projects: - openstack/openstack-helm-infra nodeset: openstack-helm-single-node @@ -188,32 +190,36 @@ - job: name: openstack-helm-multinode - timeout: 7200 + roles: + - zuul: openstack/openstack-helm-infra vars: zuul_osh_infra_relative_path: ../openstack-helm-infra/ + timeout: 7200 pre-run: - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-upgrade-host.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-docker.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-build.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-k8s.yaml + - tools/gate/playbooks/osh-infra-upgrade-host.yaml + - tools/gate/playbooks/osh-infra-deploy-docker.yaml + - tools/gate/playbooks/osh-infra-build.yaml + - tools/gate/playbooks/osh-infra-deploy-k8s.yaml run: tools/gate/playbooks/multinode-deploy.yaml - post-run: ../openstack-helm-infra/tools/gate/playbooks/osh-infra-collect-logs.yaml + post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml required-projects: - openstack/openstack-helm-infra - job: timeout: 9600 - vars: - zuul_osh_infra_relative_path: ../openstack-helm-infra/ name: openstack-helm-armada-fullstack-deploy + roles: + - zuul: openstack/openstack-helm-infra + vars: + zuul_osh_infra_relative_path: ../openstack-helm-infra/ pre-run: - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-upgrade-host.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-docker.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-build.yaml - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-k8s.yaml + - tools/gate/playbooks/osh-infra-upgrade-host.yaml + - tools/gate/playbooks/osh-infra-deploy-docker.yaml + - tools/gate/playbooks/osh-infra-build.yaml + - tools/gate/playbooks/osh-infra-deploy-k8s.yaml run: tools/gate/playbooks/armada-fullstack-deploy.yaml post-run: - - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-collect-logs.yaml + - tools/gate/playbooks/osh-infra-collect-logs.yaml - tools/gate/playbooks/gather-armada-manifests.yaml required-projects: - openstack/openstack-helm-infra diff --git a/tools/gate/playbooks/osh-infra-build.yaml b/tools/gate/playbooks/osh-infra-build.yaml new file mode 100644 index 0000000000..d06296c1a3 --- /dev/null +++ b/tools/gate/playbooks/osh-infra-build.yaml @@ -0,0 +1,36 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: True + roles: + - build-helm-packages + tags: + - build-helm-packages + +- hosts: all + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: False + become: yes + roles: + - build-images + tags: + - build-images diff --git a/tools/gate/playbooks/osh-infra-collect-logs.yaml b/tools/gate/playbooks/osh-infra-collect-logs.yaml new file mode 100644 index 0000000000..bcd5c546fe --- /dev/null +++ b/tools/gate/playbooks/osh-infra-collect-logs.yaml @@ -0,0 +1,58 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: all + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - gather-host-logs + tags: + - gather-host-logs + +- hosts: primary + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - helm-release-status + tags: + - helm-release-status + +- hosts: primary + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - describe-kubernetes-objects + tags: + - describe-kubernetes-objects + +- hosts: primary + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - gather-pod-logs + tags: + - gather-pod-logs + +- hosts: primary + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - gather-prom-metrics + tags: + - gather-prom-metrics diff --git a/tools/gate/playbooks/osh-infra-deploy-docker.yaml b/tools/gate/playbooks/osh-infra-deploy-docker.yaml new file mode 100644 index 0000000000..4c54324530 --- /dev/null +++ b/tools/gate/playbooks/osh-infra-deploy-docker.yaml @@ -0,0 +1,43 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: all + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: False + become: yes + roles: + - deploy-python + tags: + - deploy-python + +- hosts: all + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: True + become: yes + roles: + - setup-firewall + - deploy-python-pip + - deploy-docker + - deploy-yq + tags: + - setup-firewall + - deploy-python-pip + - deploy-docker + - deploy-yq diff --git a/tools/gate/playbooks/osh-infra-deploy-k8s.yaml b/tools/gate/playbooks/osh-infra-deploy-k8s.yaml new file mode 100644 index 0000000000..8daa337e31 --- /dev/null +++ b/tools/gate/playbooks/osh-infra-deploy-k8s.yaml @@ -0,0 +1,44 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: True + roles: + - build-helm-packages + tags: + - build-helm-packages + +- hosts: primary + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + roles: + - deploy-kubeadm-aio-master + tags: + - deploy-kube-master + +- hosts: nodes + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + roles: + - deploy-kubeadm-aio-node + tags: + - deploy-kube-nodes diff --git a/tools/gate/playbooks/osh-infra-upgrade-host.yaml b/tools/gate/playbooks/osh-infra-upgrade-host.yaml new file mode 100644 index 0000000000..0e42a8e733 --- /dev/null +++ b/tools/gate/playbooks/osh-infra-upgrade-host.yaml @@ -0,0 +1,39 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: all + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: False + become: yes + roles: + - deploy-python + tags: + - deploy-python + +- hosts: all + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + gather_facts: True + become: yes + roles: + - upgrade-host + - start-zuul-console + tags: + - upgrade-host + - start-zuul-console diff --git a/tools/gate/playbooks/vars.yaml b/tools/gate/playbooks/vars.yaml new file mode 100644 index 0000000000..31ea631dfa --- /dev/null +++ b/tools/gate/playbooks/vars.yaml @@ -0,0 +1,64 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: + kubernetes: v1.9.3 + helm: v2.7.2 + cni: v0.6.0 + +proxy: + http: null + https: null + noproxy: null + +images: + kubernetes: + kubeadm_aio: openstackhelm/kubeadm-aio:dev + + +kubernetes: + network: + default_device: null + cluster: + cni: calico + pod_subnet: 192.168.0.0/16 + domain: cluster.local + +nodes: + labels: + primary: + - name: openstack-helm-node-class + value: primary + nodes: + - name: openstack-helm-node-class + value: general + all: + - name: openstack-control-plane + value: enabled + - name: openstack-compute-node + value: enabled + - name: openvswitch + value: enabled + - name: linuxbridge + value: enabled + - name: ceph-mon + value: enabled + - name: ceph-osd + value: enabled + - name: ceph-mds + value: enabled + - name: ceph-rgw + value: enabled + - name: ceph-mgr + value: enabled