From e60f6524a22e03ee6799b2828d36656b1a7809be Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 20 Jun 2022 20:12:20 -0400 Subject: [PATCH] Implement a feature to assist in generating various images * use a flag to determine if we want an RC or not * Convert rldict and sigdict to an AttributeDict to allow access via __getattr__ * add fedora_release variable to configs for controlling icicle templates * build_image.py script to generate per-architecture XML files used by imagefactory * refactor time to call utcnow() once * add jinja types to development dependencies until we move past jinja 2.x * Generate TDL templates per architecture for each image variant on demand * Generate imagefactory and copy commands to execute image build * Refactor Kubernetes job template to be generic for all current jobs --- iso/empanadas/empanadas/scripts/build_image.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iso/empanadas/empanadas/scripts/build_image.py b/iso/empanadas/empanadas/scripts/build_image.py index c9f7782..6222253 100644 --- a/iso/empanadas/empanadas/scripts/build_image.py +++ b/iso/empanadas/empanadas/scripts/build_image.py @@ -103,15 +103,14 @@ def generate_imagefactory_commands(tdl_template: Template, architecture: Archite out_type = get_image_format(results.type) package_command = ["imagefactory", "target_image", *args, template_path, - "--id", "$(awk '$1==\"UUID\":{print $NF}'"+f" /tmp/{outname}/base.meta)", + "--id", "$(awk '$1==\"UUID:\"{print $NF}'"+f" /tmp/{outname}/base.meta)", *package_args, "--parameter", "repository", outname, out_type, "|", "tee", "-a", f"{outdir}/base_image-{outname}.out", "|", "tail", "-n4", ">", f"{outdir}/target.meta", "||", "exit", "3" ] - copy_command = (f"aws s3 cp --recursive {outdir}/ s3://resf-empanadas/buildimage-{ outname }/{ BUILDTIME.strftime('%s') }/" - ) + copy_command = (f"aws s3 cp --recursive {outdir}/* s3://resf-empanadas/buildimage-{ outname }/{ BUILDTIME.strftime('%s') }/") commands = [build_command, package_command, copy_command] return commands