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

View File

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

View File

@ -1,4 +1,7 @@
---
- name: Perform initial setup
include: initial-setup.yaml
- hosts: all
environment:
OS_CLOUD: devstack-admin
@ -6,8 +9,15 @@
tasks:
- 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
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
include_tasks: exercise.yaml