From 1f9468092453d9025fe57b570c615617f1904f0e Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sun, 10 Jul 2022 21:56:52 -0400 Subject: [PATCH] compress genericcloud and vagrant images by default * add azure support * use download.r.o url --- iso/empanadas/Containerfile.imagefactory | 2 +- iso/empanadas/empanadas/scripts/build_image.py | 8 ++++---- iso/empanadas/empanadas/templates/icicle/tdl.xml.tmpl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iso/empanadas/Containerfile.imagefactory b/iso/empanadas/Containerfile.imagefactory index aa34ac2..d6b4aca 100644 --- a/iso/empanadas/Containerfile.imagefactory +++ b/iso/empanadas/Containerfile.imagefactory @@ -57,7 +57,7 @@ RUN rm -rf /etc/yum.repos.d/*.repo /get_arch RUN pip install awscli -ENV BRANCH r9 +ARG BRANCH r9 RUN git clone https://git.resf.org/sig_core/kickstarts.git --branch $BRANCH /kickstarts RUN pip install 'git+https://git.resf.org/sig_core/toolkit.git@devel#egg=empanadas&subdirectory=iso/empanadas' diff --git a/iso/empanadas/empanadas/scripts/build_image.py b/iso/empanadas/empanadas/scripts/build_image.py index 2f4b846..b4a6c97 100644 --- a/iso/empanadas/empanadas/scripts/build_image.py +++ b/iso/empanadas/empanadas/scripts/build_image.py @@ -100,7 +100,7 @@ class ImageBuild: ] if self.image_type in ["GenericCloud"]: self.stage_commands = [ - ["qemu-img", "convert", "-f", "raw", "-O", "qcow2", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.qcow2"] + ["qemu-img", "convert", "-c", "-f", "raw", "-O", "qcow2", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.qcow2"] ] if self.image_type in ["EC2"]: self.stage_commands = [ @@ -120,7 +120,7 @@ class ImageBuild: } output = f"{_map[self.variant]}" #type: ignore self.stage_commands = [ - ["qemu-img", "convert", "-f", "raw", "-O", output, lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.{output}"] + ["qemu-img", "convert", "-c", "-f", "raw", "-O", output, lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.{output}"] ] @@ -174,7 +174,7 @@ class ImageBuild: args = [] if self.image_type == "Container": args = ["--parameter", "offline_icicle", "true"] - if self.image_type in ["GenericCloud", "EC2"]: + if self.image_type in ["GenericCloud", "EC2", "Vagrant", "Azure"]: args = ["--parameter", "generate_icicle", "false"] return args @@ -354,7 +354,7 @@ class ImageBuild: log_lines("Command STDERR", stderr) def fix_ks(self): - self.runCmd(["sed", "-i", f"s,$basearch,{self.architecture.name},", self.kickstart_arg[-1]]) + self.runCmd(["sed", "-i", f"s,$basearch,{self.architecture.name},", self.kickstart_arg[-1]], search=False) def render_kubernetes_job(self): commands = [self.build_command(), self.package_command(), self.copy_command()] diff --git a/iso/empanadas/empanadas/templates/icicle/tdl.xml.tmpl b/iso/empanadas/empanadas/templates/icicle/tdl.xml.tmpl index 900c17d..cec6642 100644 --- a/iso/empanadas/empanadas/templates/icicle/tdl.xml.tmpl +++ b/iso/empanadas/empanadas/templates/icicle/tdl.xml.tmpl @@ -5,7 +5,7 @@ {{minor}} {{architecture}} - https://dl.rockylinux.org/stg/rocky/{{major}}/BaseOS/{{architecture}}/{{installdir}} + https://download.rockylinux.org/pub/rocky/{{major}}/BaseOS/{{architecture}}/{{installdir}} rpm -qa --qf '%{NAME},%{VERSION},%{RELEASE},%{ARCH},%{EPOCH},%{SIZE},%{SIGMD5},%{BUILDTIME}