From 6dab604706b73fb1fee09aa4a1cfaeaa50fbba95 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 13 Aug 2024 09:50:50 -0700 Subject: [PATCH] Add a diskimage-builder job This uses the new roles. Change-Id: I047f0ab0eb784b1d3dd9384a4e96e2119d5b2580 --- doc/source/dib-jobs.rst | 4 ++ doc/source/jobs.rst | 1 + playbooks/build-diskimage/pre.yaml | 3 ++ playbooks/build-diskimage/run.yaml | 3 ++ zuul.d/dib-jobs.yaml | 59 ++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 doc/source/dib-jobs.rst create mode 100644 playbooks/build-diskimage/pre.yaml create mode 100644 playbooks/build-diskimage/run.yaml create mode 100644 zuul.d/dib-jobs.yaml diff --git a/doc/source/dib-jobs.rst b/doc/source/dib-jobs.rst new file mode 100644 index 000000000..beaddac89 --- /dev/null +++ b/doc/source/dib-jobs.rst @@ -0,0 +1,4 @@ +Diskimage-Builder Jobs +======================= + +.. zuul:autojob:: build-diskimage diff --git a/doc/source/jobs.rst b/doc/source/jobs.rst index e2029ccdd..42e190b93 100644 --- a/doc/source/jobs.rst +++ b/doc/source/jobs.rst @@ -7,6 +7,7 @@ Jobs general-jobs python-jobs js-jobs + dib-jobs docker-jobs container-jobs go-jobs diff --git a/playbooks/build-diskimage/pre.yaml b/playbooks/build-diskimage/pre.yaml new file mode 100644 index 000000000..d8e68aee7 --- /dev/null +++ b/playbooks/build-diskimage/pre.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - ensure-dib diff --git a/playbooks/build-diskimage/run.yaml b/playbooks/build-diskimage/run.yaml new file mode 100644 index 000000000..88573bd9c --- /dev/null +++ b/playbooks/build-diskimage/run.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - build-diskimage diff --git a/zuul.d/dib-jobs.yaml b/zuul.d/dib-jobs.yaml new file mode 100644 index 000000000..7f04fe37b --- /dev/null +++ b/zuul.d/dib-jobs.yaml @@ -0,0 +1,59 @@ +# Jobs listed in dib-jobs.rst. + +- job: + name: build-diskimage + description: | + Build an image using diskimage-builder + + Note that this job does not perform any actions with the image + after building it. In particular, due to the typical sizes of + diskimages, it does not move the image artifact to the executor + or prepare it to be uploaded to log storage. + + .. zuul:jobvar:: build_diskimage_image_name + + Name of the image to build. + + .. zuul:jobvar:: build_diskimage_formats + :type: list + :default: ['qcow2'] + + List of image types to generate. + + .. zuul:jobvar:: build_diskimage_elements + :type: list + :default: ['ubuntu', 'vm'] + + List of elements that should be used when creating the disk image. + + .. zuul:jobvar:: build_diskimage_environment + :type: dict + + Environment variables for the diskimage builder command may be + supplied using this variable (or by directly using the Ansible + ``environment`` argument). + + .. zuul:jobvar:: build_diskimage_image_root + :default: "{{ ansible_user_dir }}/dib-images" + + Directory to store the build images. + + .. zuul:jobvar:: build_diskimage_logs_dir + :default: {{ ansible_user_dir }}/zuul-output/logs + + The path where the log output of the diskimage-builder shall be written to + + .. zuul:jobvar:: build_diskimage_retry_limit + :default: 0 + + The number of times the build-diskimage command shall be retried until + successful. + + .. zuul:jobvar:: build_diskimage_retry_delay + :default: 120 + + The number of seconds to wait between retries of the build-diskimage + command. + + pre-run: playbooks/dib-image/pre.yaml + run: playbooks/dib-image/run.yaml