diff --git a/iso/empanadas/empanadas/configs/el9-beta.yaml b/iso/empanadas/empanadas/configs/el9-beta.yaml index 19d6cd5..9d748eb 100644 --- a/iso/empanadas/empanadas/configs/el9-beta.yaml +++ b/iso/empanadas/empanadas/configs/el9-beta.yaml @@ -72,6 +72,19 @@ - 'lorax-templates-rhel' - 'lorax-templates-generic' - 'xorriso' + cloudimages: + - EC2 + - GenericCloud + livemap: + git_repo: 'https://git.resf.org/sig_core/kickstarts.git' + branch: 'r9' + ksentry: + - rocky-live-workstation.ks + - rocky-live-workstation-lite.ks + - rocky-live-xfce.ks + - rocky-live-kde.ks + allowed_arches: + - x86_64 repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/configs/el9.yaml b/iso/empanadas/empanadas/configs/el9.yaml index e53f851..84d5198 100644 --- a/iso/empanadas/empanadas/configs/el9.yaml +++ b/iso/empanadas/empanadas/configs/el9.yaml @@ -75,6 +75,16 @@ cloudimages: - EC2 - GenericCloud + livemap: + git_repo: 'https://git.resf.org/sig_core/kickstarts.git' + branch: 'r9-beta' + ksentry: + - rocky-live-workstation.ks + - rocky-live-workstation-lite.ks + - rocky-live-xfce.ks + - rocky-live-kde.ks + allowed_arches: + - x86_64 repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/configs/el9lh.yaml b/iso/empanadas/empanadas/configs/el9lh.yaml index 4176f66..14ceafb 100644 --- a/iso/empanadas/empanadas/configs/el9lh.yaml +++ b/iso/empanadas/empanadas/configs/el9lh.yaml @@ -72,6 +72,19 @@ - 'lorax-templates-rhel' - 'lorax-templates-generic' - 'xorriso' + cloudimages: + - EC2 + - GenericCloud + livemap: + git_repo: 'https://git.resf.org/sig_core/kickstarts.git' + branch: 'r9lh' + ksentry: + - rocky-live-workstation.ks + - rocky-live-workstation-lite.ks + - rocky-live-xfce.ks + - rocky-live-kde.ks + allowed_arches: + - x86_64 repoclosure_map: arches: x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' diff --git a/iso/empanadas/empanadas/scripts/pull_cloud_image.py b/iso/empanadas/empanadas/scripts/pull_cloud_image.py new file mode 100755 index 0000000..4e175de --- /dev/null +++ b/iso/empanadas/empanadas/scripts/pull_cloud_image.py @@ -0,0 +1,33 @@ +# builds ISO's + +import argparse + +from empanadas.common import * +from empanadas.util import Checks +from empanadas.util import IsoBuild + +parser = argparse.ArgumentParser(description="ISO Artifact Builder") + +parser.add_argument('--release', type=str, help="Major Release Version", required=True) +parser.add_argument('--s3', action='store_true', help="Release Candidate") +parser.add_argument('--arch', type=str, help="Architecture") +parser.add_argument('--local-compose', action='store_true', help="Compose Directory is Here") +parser.add_argument('--force-download', action='store_true', help="Force a download") +parser.add_argument('--logger', type=str) +results = parser.parse_args() +rlvars = rldict[results.release] +major = rlvars['major'] + +a = IsoBuild( + rlvars, + config, + major=major, + s3=results.s3, + arch=results.arch, + force_download=results.force_download, + compose_dir_is_here=results.local_compose, + logger=results.logger, +) + +def run(): + a.run_pull_generic_images() diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index 6c911b9..ff91d99 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -1566,6 +1566,47 @@ class IsoBuild: self.log ) + if not len(latest_artifacts) > 0: + self.log.warn(Color.WARN + 'No images found.') + continue + + self.log.info(Color.INFO + 'Downloading requested artifacts') + for arch in arches_to_unpack: + image_arch_dir = os.path.join( + self.image_work_dir, + arch + ) + + source_path = latest_artifacts[arch] + drop_name = source_path.split('/')[-1] + full_drop = '{}/{}'.format( + image_arch_dir, + drop_name + ) + + if not os.path.exists(image_arch_dir): + os.makedirs(image_arch_dir, exist_ok=True) + + self.log.info('Downloading artifact for ' + Color.BOLD + arch + Color.END) + if self.s3: + Shared.s3_download_artifacts( + self.force_download, + self.s3_bucket, + source_path, + full_drop, + self.log + ) + else: + Shared.reqs_download_artifacts( + self.force_download, + self.s3_bucket_url, + source_path, + full_drop, + self.log + ) + + self.log.info(Color.INFO + 'Image download phase completed') + def run_build_live_iso(self): """ diff --git a/iso/empanadas/empanadas/util/shared.py b/iso/empanadas/empanadas/util/shared.py index 453e33b..191c4b4 100644 --- a/iso/empanadas/empanadas/util/shared.py +++ b/iso/empanadas/empanadas/util/shared.py @@ -540,7 +540,8 @@ class Shared: if arch in y: temps.append(y) temps.sort(reverse=True) - data[arch] = temps[0] + if len(temps) > 0: + data[arch] = temps[0] return data @@ -594,7 +595,8 @@ class Shared: if arch in y: temps.append(y) temps.sort(reverse=True) - data[arch] = temps[0] + if len(temps) > 0: + data[arch] = temps[0] return data diff --git a/iso/empanadas/pyproject.toml b/iso/empanadas/pyproject.toml index b4fa53a..17cca04 100644 --- a/iso/empanadas/pyproject.toml +++ b/iso/empanadas/pyproject.toml @@ -31,6 +31,7 @@ pull-unpack-tree = "empanadas.scripts.pull_unpack_tree:run" launch-builds = "empanadas.scripts.launch_builds:run" build-image = "empanadas.scripts.build_image:run" finalize_compose = "empanadas.scripts.finalize_compose:run" +pull-cloud-image = "empanadas.scripts.pull_cloud_image:run" [build-system] requires = ["poetry-core>=1.0.0"]