Rework jobs so failed devstack does not retry the job

Per clarkb, should any step in pre.yaml fail, zuul presently retries
the entire job up to the built in retry limit which cannot be changed
or disabled on a job basis. In the terms of setting up devstack, this
is not ideal as devstack is not perfect and can often fail for unrelated
reasons such as package mirrors being updated or even another project
or component failing to setup properly.

As such, in order to be good neighbors and minimize the amount of
time it takes to troubleshoot such issues, we need to move the
devstack setup into the main part of the CI job.

Change-Id: I08d6f3132ebc045ba7e2d1295efe39af7c57187c
This commit is contained in:
Julia Kreger 2020-09-03 08:01:02 -07:00
parent 97099bc0ff
commit e0ed4d2dee
4 changed files with 131 additions and 119 deletions

View File

@ -3,7 +3,6 @@
description: | description: |
Base job for devstack-based metalsmith jobs. Base job for devstack-based metalsmith jobs.
parent: devstack-minimal parent: devstack-minimal
pre-run: playbooks/integration/pre.yaml
post-run: playbooks/integration/post.yaml post-run: playbooks/integration/post.yaml
run: playbooks/integration/run.yaml run: playbooks/integration/run.yaml
irrelevant-files: irrelevant-files:
@ -120,7 +119,6 @@
Integration job using Glance as image source and CentOS7 with local boot. Integration job using Glance as image source and CentOS7 with local boot.
parent: metalsmith-integration-base parent: metalsmith-integration-base
timeout: 7200 timeout: 7200
pre-run: playbooks/integration/centos-image.yaml
vars: vars:
devstack_localrc: devstack_localrc:
# NOTE(dtantsur): we need to use streaming, otherwise the image won't # NOTE(dtantsur): we need to use streaming, otherwise the image won't

View File

@ -1,16 +1,12 @@
--- ---
- hosts: all - name: Set facts for centos image builds
environment: set_fact:
OS_CLOUD: devstack-admin
vars:
centos_image_file: ~/centos-download.qcow2 centos_image_file: ~/centos-download.qcow2
centos_initramfs_file: ~/centos.initramfs centos_initramfs_file: ~/centos.initramfs
centos_kernel_file: ~/centos.kernel centos_kernel_file: ~/centos.kernel
centos_partition_file: ~/centos-root.qcow2 centos_partition_file: ~/centos-root.qcow2
centos_image_url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz centos_image_url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz
tasks:
- name: Install guestfish - name: Install guestfish
package: package:
name: libguestfs-tools name: libguestfs-tools
@ -41,6 +37,8 @@
openstack image create --disk-format qcow2 openstack image create --disk-format qcow2
--public --file {{ centos_image_file }} --public --file {{ centos_image_file }}
{{ centos_glance_whole_disk_image }} {{ centos_glance_whole_disk_image }}
environment:
OS_CLOUD: devstack-admin
when: centos_glance_whole_disk_image is defined when: centos_glance_whole_disk_image is defined
- name: Create a temporary directory for extraction - name: Create a temporary directory for extraction
@ -61,6 +59,8 @@
{{ centos_glance_kernel_image }} {{ centos_glance_kernel_image }}
register: centos_kernel_id register: centos_kernel_id
failed_when: centos_kernel_id.stdout == "" failed_when: centos_kernel_id.stdout == ""
environment:
OS_CLOUD: devstack-admin
when: centos_glance_kernel_image is defined when: centos_glance_kernel_image is defined
- name: Upload the CentOS initramfs image - name: Upload the CentOS initramfs image
@ -70,6 +70,8 @@
{{ centos_glance_initramds_image }} {{ centos_glance_initramds_image }}
register: centos_initramfs_id register: centos_initramfs_id
failed_when: centos_initramfs_id.stdout == "" failed_when: centos_initramfs_id.stdout == ""
environment:
OS_CLOUD: devstack-admin
when: centos_glance_initramds_image is defined when: centos_glance_initramds_image is defined
- name: Delete the kernel and ramdisk image files - name: Delete the kernel and ramdisk image files
@ -137,6 +139,8 @@
--property kernel_id={{ centos_kernel_id.stdout }} --property kernel_id={{ centos_kernel_id.stdout }}
--property ramdisk_id={{ centos_initramfs_id.stdout }} --property ramdisk_id={{ centos_initramfs_id.stdout }}
{{ centos_glance_root_image }} {{ centos_glance_root_image }}
environment:
OS_CLOUD: devstack-admin
when: centos_glance_root_image is defined when: centos_glance_root_image is defined
- name: Remove the partition image file - name: Remove the partition image file

View File

@ -1,4 +1,7 @@
--- ---
- name: Perform initial setup
include: initial-setup.yaml
- hosts: all - hosts: all
environment: environment:
OS_CLOUD: devstack-admin OS_CLOUD: devstack-admin
@ -6,8 +9,15 @@
tasks: tasks:
- include_tasks: ssh-key.yaml - include_tasks: ssh-key.yaml
- include_tasks: centos-image.yaml
when:
- metalsmith_whole_disk_image is defined
- metalsmith_partition_image is defined
- include_tasks: cirros-image.yaml - include_tasks: cirros-image.yaml
when: metalsmith_whole_disk_image is not defined when:
- metalsmith_whole_disk_image is undefined
- metalsmith_partition_image is undefined
- name: Test a whole-disk image - name: Test a whole-disk image
include_tasks: exercise.yaml include_tasks: exercise.yaml