diff --git a/.zuul.yaml b/.zuul.yaml index 2b59d79ed..a68099ed3 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -25,7 +25,7 @@ - treasuremap-airsloop-site-lint - treasuremap-aiab-site-lint - treasuremap-airskiff-deployment-ubuntu - # - treasuremap-airskiff-deployment-suse + - treasuremap-airskiff-multinode-full-site gate: jobs: - treasuremap-seaworthy-site-lint @@ -56,6 +56,104 @@ label: ubuntu-focal +- nodeset: + name: treasuremap-airskiff-3nodes-ubuntu_focal + nodes: + - name: primary + label: ubuntu-focal + - name: node-1 + label: ubuntu-focal + - name: node-2 + label: ubuntu-focal + groups: + - name: primary + nodes: + - primary + - name: nodes + nodes: + - node-1 + - node-2 + +- job: + name: treasuremap-airskiff-infra-deploy + abstract: true + roles: + - zuul: openstack/openstack-helm-infra + - zuul: zuul/zuul-jobs + required-projects: + - openstack/openstack-helm + - openstack/openstack-helm-infra + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ + - ^site/seaworthy/.*$ + - ^site/airsloop/.*$ + - ^site/aiab/.*$ + timeout: 10800 + pre-run: + - tools/gate/playbooks/prepare-hosts.yaml + - tools/gate/playbooks/mount-volumes.yaml + - tools/gate/playbooks/git-config.yaml + post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml + run: + - tools/gate/playbooks/deploy-env.yaml + - tools/gate/playbooks/git-config.yaml + - tools/gate/playbooks/airskiff-reduce-site.yaml + - tools/gate/playbooks/run-scripts.yaml + vars: + extra_volume: + size: 80G + type: Linux + mount_point: /opt/ext_vol + docker: + root_path: "/opt/ext_vol/docker" + containerd: + root_path: "/opt/ext_vol/containerd" + kubeadm: + pod_network_cidr: "10.244.0.0/24" + service_cidr: "10.96.0.0/16" + loopback_setup: true + loopback_device: /dev/loop100 + loopback_image: "/opt/ext_vol/openstack-helm/ceph-loop.img" + ceph_osd_data_device: /dev/loop100 + kube_version: "1.28.4-1.1" + calico_version: "v3.27.0" + helm_version: "v3.6.3" + yq_version: "v4.6.0" + crictl_version: "v1.26.1" + zuul_osh_infra_relative_path: ../openstack-helm-infra + gate_scripts_relative_path: ../openstack-helm-infra + run_helm_tests: "no" + +- job: + name: treasuremap-airskiff-multinode-full-site + parent: treasuremap-airskiff-infra-deploy + nodeset: treasuremap-airskiff-3nodes-ubuntu_focal + description: | + Deploy Openstack using Airskiff and latest Treasuremap changes. + Airskiff is using latest Airship v1.x based on Airflow-2.6.2 + voting: true + vars: + site: airskiff + HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz + HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f + OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f + OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7 + gate_scripts_relative_path: . + gate_scripts: + - ./tools/deployment/airskiff/developer/000-prepare-k8s.sh + - ./tools/deployment/airskiff/developer/000-clone-dependencies.sh + - ./tools/deployment/airskiff/developer/020-setup-client.sh + - ./tools/deployment/airskiff/developer/015-make-all-charts.sh + - ./tools/deployment/airskiff/developer/025-start-artifactory.sh + - ./tools/deployment/airskiff/developer/026-reduce-site.sh + - ./tools/deployment/airskiff/developer/030-armada-bootstrap.sh + - ./tools/deployment/airskiff/developer/100-deploy-osh.sh + - ./tools/deployment/airskiff/common/os-env.sh + - ./tools/gate/wait-for-shipyard.sh + - ./tools/deployment/airskiff/common/sleep.sh + - job: name: treasuremap-site-lint description: @@ -181,7 +279,7 @@ post-run: tools/gate/playbooks/debug-report.yaml vars: site: airskiff - HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.12.2-linux-amd64.tar.gz + HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7 diff --git a/tools/deployment/airskiff/common/sleep.sh b/tools/deployment/airskiff/common/sleep.sh new file mode 100755 index 000000000..e379bf927 --- /dev/null +++ b/tools/deployment/airskiff/common/sleep.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +while true; do sleep 10; done diff --git a/tools/deployment/airskiff/developer/000-prepare-k8s.sh b/tools/deployment/airskiff/developer/000-prepare-k8s.sh new file mode 100755 index 000000000..4cbb7f3ef --- /dev/null +++ b/tools/deployment/airskiff/developer/000-prepare-k8s.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# 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. + +set -ex + +# Add labels to the core namespaces & nodes +kubectl label --overwrite namespace default name=default +kubectl label --overwrite namespace kube-system name=kube-system +kubectl label --overwrite namespace kube-public name=kube-public +kubectl label --overwrite nodes --all openstack-control-plane=enabled +kubectl label --overwrite nodes --all openstack-compute-node=enabled +kubectl label --overwrite nodes --all openvswitch=enabled +kubectl label --overwrite nodes --all linuxbridge=enabled +kubectl label --overwrite nodes --all ceph-mon=enabled +kubectl label --overwrite nodes --all ceph-osd=enabled +kubectl label --overwrite nodes --all ceph-mds=enabled +kubectl label --overwrite nodes --all ceph-rgw=enabled +kubectl label --overwrite nodes --all ceph-mgr=enabled +# We deploy l3 agent only on the node where we run test scripts. +# In this case virtual router will be created only on this node +# and we don't need L2 overlay (will be implemented later). +kubectl label --overwrite nodes -l "node-role.kubernetes.io/control-plane" l3-agent=enabled + +for NAMESPACE in ceph mariadb-operator openstack osh-infra; do +tee /tmp/${NAMESPACE}-ns.yaml << EOF +apiVersion: v1 +kind: Namespace +metadata: + labels: + kubernetes.io/metadata.name: ${NAMESPACE} + name: ${NAMESPACE} + name: ${NAMESPACE} +EOF + +kubectl apply -f /tmp/${NAMESPACE}-ns.yaml +done + +# make all diff --git a/tools/deployment/airskiff/developer/015-make-all-charts.sh b/tools/deployment/airskiff/developer/015-make-all-charts.sh index da0d1c333..354953df2 100755 --- a/tools/deployment/airskiff/developer/015-make-all-charts.sh +++ b/tools/deployment/airskiff/developer/015-make-all-charts.sh @@ -20,7 +20,7 @@ set -xe CURRENT_DIR="$(pwd)" : "${INSTALL_PATH:="../"}" : "${ARTIFACTS_PATH:="../artifacts"}" -: "${HTK_COMMIT:="ae91cf3fc3f288b6d92ace4a3a405606a653638f"}" +: "${HTK_COMMIT:="cfff60ec10a6c386f38db79bb9f59a552c2b032f"}" : "${MAKE_CHARTS_OPENSTACK_HELM:=true}" : "${MAKE_CHARTS_OSH_INFRA:=true}" : "${MAKE_CHARTS_ARMADA:=true}" diff --git a/tools/deployment/airskiff/developer/025-start-artifactory.sh b/tools/deployment/airskiff/developer/025-start-artifactory.sh new file mode 100755 index 000000000..fc7228779 --- /dev/null +++ b/tools/deployment/airskiff/developer/025-start-artifactory.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +# start http server with artifacts +docker rm artifacts --force || true +docker run --name artifacts -p 8282:80 -v $(pwd)/../artifacts:/usr/share/nginx/html -d nginx +sleep 10 +curl --verbose -I http://control-plane.minikube.internal:8282/memcached.tgz \ No newline at end of file diff --git a/tools/deployment/airskiff/developer/026-reduce-site.sh b/tools/deployment/airskiff/developer/026-reduce-site.sh new file mode 100755 index 000000000..a9072da5a --- /dev/null +++ b/tools/deployment/airskiff/developer/026-reduce-site.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +set -ex +mv tools/gate/manifests/full-site.yaml type/skiff/manifests/full-site.yaml diff --git a/tools/gate/playbooks/airship-run-scripts.yaml b/tools/gate/playbooks/airship-run-scripts.yaml new file mode 100644 index 000000000..6e29edc07 --- /dev/null +++ b/tools/gate/playbooks/airship-run-scripts.yaml @@ -0,0 +1,75 @@ +# 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 + tasks: + - name: Override images + when: buildset_registry is defined + vars: + work_dir: "{{ zuul.project.src_dir }}" + block: + - name: Buildset registry alias + include_role: + name: deploy-env + tasks_from: buildset_registry_alias + + - name: Print zuul + debug: + var: zuul + + - name: Override proposed images from artifacts + shell: > + find {{ override_paths | join(" ") }} -type f -exec sed -Ei + "s#['\"]?docker\.io/({{ repo }}):({{ tag }})['\"]?\$#{{ buildset_registry_alias }}:{{ buildset_registry.port }}/\1:\2#g" {} + + loop: "{{ zuul.artifacts | default([]) }}" + args: + chdir: "{{ work_dir }}" + loop_control: + loop_var: zj_zuul_artifact + when: "'metadata' in zj_zuul_artifact and zj_zuul_artifact.metadata.type | default('') == 'container_image'" + vars: + tag: "{{ zj_zuul_artifact.metadata.tag }}" + repo: "{{ zj_zuul_artifact.metadata.repository }}" + override_paths: + - ../openstack-helm*/*/values* + - ../openstack-helm-infra/tools/deployment/ + + - name: Diff + shell: | + set -ex; + for dir in openstack-helm openstack-helm-infra; do + path="{{ work_dir }}/../${dir}/" + if [ ! -d "${path}" ]; then continue; fi + echo "${dir} diff" + cd "${path}"; git diff; cd -; + done + + - name: "creating directory for run artifacts" + file: + path: "/tmp/artifacts" + state: directory + + - name: Run gate scripts + include_role: + name: "{{ ([item] | flatten | length == 1) | ternary('airship-run-script', 'airship-run-script-set') }}" + vars: + workload: "{{ [item] | flatten }}" + loop: "{{ gate_scripts }}" + + - name: "Downloads artifacts to executor" + synchronize: + src: "/tmp/artifacts" + dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" + mode: pull + ignore_errors: True +... diff --git a/tools/gate/playbooks/airskiff-deploy-gate.yaml b/tools/gate/playbooks/airskiff-deploy-gate.yaml index a0ed725bd..a79eea3ad 100644 --- a/tools/gate/playbooks/airskiff-deploy-gate.yaml +++ b/tools/gate/playbooks/airskiff-deploy-gate.yaml @@ -55,7 +55,7 @@ ./tools/deployment/airskiff/developer/020-setup-client.sh args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Build all charts locally shell: | @@ -67,7 +67,7 @@ ./tools/deployment/airskiff/developer/015-make-all-charts.sh args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Start artifactory shell: | @@ -79,7 +79,7 @@ curl --verbose -I http://control-plane.minikube.internal:8282/memcached.tgz args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Deploy Airship components using Armada shell: | @@ -90,7 +90,7 @@ ./tools/deployment/airskiff/developer/030-armada-bootstrap.sh args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Deploy Software using Airship shell: | @@ -99,7 +99,7 @@ ./tools/deployment/airskiff/developer/100-deploy-osh.sh args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Wait for deployment completion shell: | @@ -108,7 +108,7 @@ ./tools/gate/wait-for-shipyard.sh args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true - name: Stop artifactory shell: | @@ -117,4 +117,4 @@ docker rm artifacts --force || true args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true diff --git a/tools/gate/playbooks/deploy-env.yaml b/tools/gate/playbooks/deploy-env.yaml new file mode 100644 index 000000000..a2dc08d7d --- /dev/null +++ b/tools/gate/playbooks/deploy-env.yaml @@ -0,0 +1,38 @@ +# 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 + become: true + gather_facts: true + + roles: + - role: add-authorized-keys + public_keys: + - public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDA7eM8WFJrqQmki8rR0O3QBHyl8xq42jb1RduwuRwjWoGYJI5cX7Fx+7VR4A9ITCoiqxKS8DMfgKbt5jKC6SmvMALULZsnYlthB34KywurgxsW6fgp68DHWQ7J4CCBhoIpl0W3JW7s6b0vHLhab59r0E+AYemBVuWUqbFEy8nDAHcQv1S/2o1udhmljIN7c2ogO4KAJ7Lge0BoIP9ps4u6AVwyQZixp4anU9DHGNA/UQj4M5UyuALj5buEAuATBe9Vqj4sOvZjObPJAGPUrNRrGEWAFk+lSZHRzKXo0eeWtPqoh5UN9UDb5Pocg1krncMIZwjHKovlD1z/O1y91aY5LM1wxm/7aaIiX8eCihyVZaOuDCLF7WDT2SMs7ABcotX2MDtVQTrNNV3MmMAScFNDflzPKszd7cdjLl6PBq8bvPxmCkLmnitPTGOoh9d8i+JlbINvgx1pguYrpeciIyreCO1rjTW3MgB0tyoMEa31V+7HrauBMeNnE68YTqLTIB0= smarkin@mirantis.com + - ensure-python + - ensure-pip + - ensure-tox + - clear-firewall + - deploy-apparmor + - deploy-selenium + - deploy-env + tasks: + - name: Install Packaging python module for tools/airship + block: + - pip: + name: packaging + version: 23.1 + executable: pip3 + become: True + +... diff --git a/tools/gate/playbooks/generate-certs.yaml b/tools/gate/playbooks/generate-certs.yaml index 3cb26fdea..149b4224a 100644 --- a/tools/gate/playbooks/generate-certs.yaml +++ b/tools/gate/playbooks/generate-certs.yaml @@ -28,4 +28,4 @@ /target/collected/treasuremap.yaml args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true diff --git a/tools/gate/playbooks/mount-volumes.yaml b/tools/gate/playbooks/mount-volumes.yaml new file mode 100644 index 000000000..0049da194 --- /dev/null +++ b/tools/gate/playbooks/mount-volumes.yaml @@ -0,0 +1,17 @@ +# 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 + roles: + - mount-extra-volume +... 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 000000000..83e768877 --- /dev/null +++ b/tools/gate/playbooks/osh-infra-collect-logs.yaml @@ -0,0 +1,43 @@ +# 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('') }}" + logs_dir: "/tmp/logs" + roles: + - gather-host-logs + tags: + - gather-host-logs + +- hosts: primary + vars_files: + - vars.yaml + vars: + work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" + logs_dir: "/tmp/logs" + roles: + - helm-release-status + - describe-kubernetes-objects + - gather-pod-logs + - gather-prom-metrics + - gather-selenium-data + tags: + - helm-release-status + - describe-kubernetes-objects + - gather-pod-logs + - gather-prom-metrics + - gather-selenium-data +... diff --git a/tools/gate/playbooks/prepare-hosts.yaml b/tools/gate/playbooks/prepare-hosts.yaml new file mode 100644 index 000000000..c64aa0d65 --- /dev/null +++ b/tools/gate/playbooks/prepare-hosts.yaml @@ -0,0 +1,17 @@ +# 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 + roles: + - start-zuul-console +... diff --git a/tools/gate/playbooks/roles/airship-run-script-set/defaults/main.yaml b/tools/gate/playbooks/roles/airship-run-script-set/defaults/main.yaml new file mode 100644 index 000000000..0567c8aa7 --- /dev/null +++ b/tools/gate/playbooks/roles/airship-run-script-set/defaults/main.yaml @@ -0,0 +1,26 @@ +# 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. + +--- +ceph_osd_data_device: "/dev/loop0" +kubeadm: + pod_network_cidr: "10.244.0.0/24" +osh_params: + container_distro_name: ubuntu + container_distro_version: focal + # feature_gates: +site: airskiff +HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz +HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f +OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f +OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7 +... diff --git a/tools/gate/playbooks/roles/airship-run-script-set/tasks/main.yaml b/tools/gate/playbooks/roles/airship-run-script-set/tasks/main.yaml new file mode 100644 index 000000000..35795d9c9 --- /dev/null +++ b/tools/gate/playbooks/roles/airship-run-script-set/tasks/main.yaml @@ -0,0 +1,63 @@ +# 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. + +--- +- block: + - name: "Run script set {{ workload }}" + shell: | + set -xe; + {{ gate_script_path }} + loop: "{{ workload }}" + loop_control: + loop_var: gate_script_path + pause: 5 + args: + chdir: "{{ zuul.project.src_dir }}/{{ gate_scripts_relative_path }}" + environment: + CEPH_OSD_DATA_DEVICE: "{{ ceph_osd_data_device }}" + POD_NETWORK_CIDR: "{{ kubeadm.pod_network_cidr }}" + zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}" + OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}" + OSH_PATH: "{{ zuul_osh_relative_path | default('../openstack-helm/') }}" + OSH_INFRA_PATH: "{{ zuul_osh_infra_relative_path | default('../openstack-helm-infra/') }}" + OPENSTACK_RELEASE: "{{ osh_params.openstack_release | default('') }}" + CONTAINER_DISTRO_NAME: "{{ osh_params.container_distro_name | default('') }}" + CONTAINER_DISTRO_VERSION: "{{ osh_params.container_distro_version | default('') }}" + FEATURE_GATES: "{{ osh_params.feature_gates | default('') }}" + RUN_HELM_TESTS: "{{ run_helm_tests | default('yes') }}" + PL_SITE: "{{ site | default('airskiff') }}" + HELM_ARTIFACT_URL: "{{ HELM_ARTIFACT_URL | default('https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz') }}" + HTK_COMMIT: "{{ HTK_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}" + OSH_INFRA_COMMIT: "{{ OSH_INFRA_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}" + OSH_COMMIT: "{{ OSH_COMMIT | default('2d9457e34ca4200ed631466bd87569b0214c92e7') }}" + # NOTE(aostapenko) using bigger than async_status timeout due to async_status issue with + # not recognizing timed out jobs: https://github.com/ansible/ansible/issues/25637 + async: 3600 + poll: 0 + register: async_results + + - name: Wait for script set to finish + async_status: + jid: '{{ item.ansible_job_id }}' + register: jobs + until: jobs.finished + delay: 5 + retries: 360 + loop: "{{ async_results.results }}" + + always: + - name: Print script set output + shell: | + # NOTE(aostapenko) safely retrieving items for the unlikely case if jobs timed out in async_status + echo 'STDOUT:\n{{ item.get("stdout") | regex_replace("\'", "") }}\nSTDERR:\n{{ item.get("stderr") | regex_replace("\'", "") }}' + loop: "{{ jobs.results }}" +... diff --git a/tools/gate/playbooks/roles/airship-run-script/defaults/main.yaml b/tools/gate/playbooks/roles/airship-run-script/defaults/main.yaml new file mode 100644 index 000000000..0567c8aa7 --- /dev/null +++ b/tools/gate/playbooks/roles/airship-run-script/defaults/main.yaml @@ -0,0 +1,26 @@ +# 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. + +--- +ceph_osd_data_device: "/dev/loop0" +kubeadm: + pod_network_cidr: "10.244.0.0/24" +osh_params: + container_distro_name: ubuntu + container_distro_version: focal + # feature_gates: +site: airskiff +HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz +HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f +OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f +OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7 +... diff --git a/tools/gate/playbooks/roles/airship-run-script/tasks/main.yaml b/tools/gate/playbooks/roles/airship-run-script/tasks/main.yaml new file mode 100644 index 000000000..096b5c7eb --- /dev/null +++ b/tools/gate/playbooks/roles/airship-run-script/tasks/main.yaml @@ -0,0 +1,39 @@ +# 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. + +--- +- name: "Run script {{ workload[0] }}" + shell: | + set -xe; + {{ gate_script_path }} + vars: + gate_script_path: "{{ workload[0] }}" + args: + chdir: "{{ zuul.project.src_dir }}/{{ gate_scripts_relative_path }}" + environment: + CEPH_OSD_DATA_DEVICE: "{{ ceph_osd_data_device }}" + POD_NETWORK_CIDR: "{{ kubeadm.pod_network_cidr }}" + zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}" + OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}" + OSH_PATH: "{{ zuul_osh_relative_path | default('../openstack-helm/') }}" + OSH_INFRA_PATH: "{{ zuul_osh_infra_relative_path | default('../openstack-helm-infra/') }}" + OPENSTACK_RELEASE: "{{ osh_params.openstack_release | default('') }}" + CONTAINER_DISTRO_NAME: "{{ osh_params.container_distro_name | default('') }}" + CONTAINER_DISTRO_VERSION: "{{ osh_params.container_distro_version | default('') }}" + FEATURE_GATES: "{{ osh_params.feature_gates | default('') }}" + RUN_HELM_TESTS: "{{ run_helm_tests | default('yes') }}" + PL_SITE: "{{ site | default('airskiff') }}" + HELM_ARTIFACT_URL: "{{ HELM_ARTIFACT_URL | default('https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz') }}" + HTK_COMMIT: "{{ HTK_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}" + OSH_INFRA_COMMIT: "{{ OSH_INFRA_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}" + OSH_COMMIT: "{{ OSH_COMMIT | default('2d9457e34ca4200ed631466bd87569b0214c92e7') }}" +... diff --git a/tools/gate/playbooks/roles/disable-systemd-resolved/tasks/disable-systemd-resolved.yaml b/tools/gate/playbooks/roles/disable-systemd-resolved/tasks/disable-systemd-resolved.yaml index 0eda1fbf6..99475be5f 100644 --- a/tools/gate/playbooks/roles/disable-systemd-resolved/tasks/disable-systemd-resolved.yaml +++ b/tools/gate/playbooks/roles/disable-systemd-resolved/tasks/disable-systemd-resolved.yaml @@ -19,14 +19,14 @@ masked: yes daemon_reload: yes name: systemd-resolved - become: yes + become: true - name: Remove local stub dns from resolv.conf, if it exists lineinfile: path: /etc/resolv.conf state: absent regexp: '^nameserver.*127.0.0.1' - become: yes + become: true - name: Add upstream nameservers in resolv.conf blockinfile: @@ -34,4 +34,4 @@ block: | nameserver 8.8.8.8 nameserver 8.8.4.4 - become: yes + become: true diff --git a/tools/gate/playbooks/site-lint.yaml b/tools/gate/playbooks/site-lint.yaml index 78a187042..38fa49951 100644 --- a/tools/gate/playbooks/site-lint.yaml +++ b/tools/gate/playbooks/site-lint.yaml @@ -20,4 +20,4 @@ ./tools/gate/lint-site.sh "{{ site }}" args: chdir: "{{ zuul.project.src_dir }}" - become: yes + become: true