From d482019ca5094bf324fe72d5ce2e1f1b79f9b329 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Wed, 6 Jul 2022 23:23:07 -0700 Subject: [PATCH] turn off all repos in container --- iso/empanadas/empanadas/configs/el8.yaml | 95 +++++++-------- iso/empanadas/empanadas/configs/el9-beta.yaml | 8 +- iso/empanadas/empanadas/configs/el9.yaml | 10 +- iso/empanadas/empanadas/configs/el9lh.yaml | 8 +- .../empanadas/templates/reposync.tmpl | 1 + iso/empanadas/empanadas/util/iso_utils.py | 108 +++++++++--------- 6 files changed, 127 insertions(+), 103 deletions(-) diff --git a/iso/empanadas/empanadas/configs/el8.yaml b/iso/empanadas/empanadas/configs/el8.yaml index eb80aff..b04ec82 100644 --- a/iso/empanadas/empanadas/configs/el8.yaml +++ b/iso/empanadas/empanadas/configs/el8.yaml @@ -44,64 +44,69 @@ has_modules: - 'AppStream' - 'PowerTools' - iso_map: - hosts: - x86_64: '' - aarch64: '' - ppc64le: '' - s390x: '' - images: - - dvd1 - - minimal - - boot - repos: - - 'BaseOS' - - 'AppStream' - variant: 'BaseOS' - lorax_removes: - - 'libreport-rhel-anaconda-bugzilla' - required_packages: - - 'lorax' - - 'genisoimage' - - 'isomd5sum' - - 'lorax-templates-rhel' - - 'lorax-templates-generic' structure: packages: 'os/Packages' repodata: 'os/repodata' iso_map: xorrisofs: False iso_level: False - hosts: - x86_64: '' - aarch64: '' images: dvd: + disc: True + variant: 'AppStream' repos: - 'BaseOS' - 'AppStream' - lorax_variants: - - dvd - - minimal - - BaseOS - repos: - - 'BaseOS' - - 'AppStream' - variant: 'BaseOS' - lorax_removes: - - 'libreport-rhel-anaconda-bugzilla' - required_pkgs: - - 'lorax' - - 'genisoimage' - - 'isomd5sum' - - 'lorax-templates-rhel' - - 'lorax-templates-generic' + minimal: + disc: True + isoskip: True + repos: + - 'minimal' + variant: 'minimal' + BaseOS: + disc: False + isoskip: True + variant: 'BaseOS' + repos: + - 'BaseOS' + - 'AppStream' + lorax: + repos: + - 'BaseOS' + - 'AppStream' + variant: 'BaseOS' + lorax_removes: + - 'libreport-rhel-anaconda-bugzilla' + required_pkgs: + - 'lorax' + - 'genisoimage' + - 'isomd5sum' + - 'lorax-templates-rhel' + - 'lorax-templates-generic' + - 'xorriso' + cloudimages: + images: + - EC2 + - GenericCloud + formats: + - qcow2 + - raw + livemap: + git_repo: 'https://git.resf.org/sig_core/kickstarts.git' + branch: 'r9' + ksentry: + Workstation: rocky-live-workstation.ks + Workstation-Lite: rocky-live-workstation-lite.ks + XFCE: rocky-live-xfce.ks + KDE: rocky-live-kde.ks + allowed_arches: + - x86_64 repoclosure_map: arches: - x86_64: '--arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' - aarch64: '--arch=aarch64 --arch=noarch' - ppc64le: '--arch=ppc64le --arch=noarch' - s390x: '--arch=s390x --arch=noarch' + x86_64: '--forcearch=x86_64 --arch=x86_64 --arch=athlon --arch=i686 --arch=i586 --arch=i486 --arch=i386 --arch=noarch' + aarch64: '--forcearch=aarch64 --arch=aarch64 --arch=noarch' + ppc64le: '--forcearch=ppc64le --arch=ppc64le --arch=noarch' + s390x: '--forcearch=s390x --arch=s390x --arch=noarch' repos: BaseOS: [] AppStream: diff --git a/iso/empanadas/empanadas/configs/el9-beta.yaml b/iso/empanadas/empanadas/configs/el9-beta.yaml index 4233da6..f503485 100644 --- a/iso/empanadas/empanadas/configs/el9-beta.yaml +++ b/iso/empanadas/empanadas/configs/el9-beta.yaml @@ -73,8 +73,12 @@ - 'lorax-templates-generic' - 'xorriso' cloudimages: - - EC2 - - GenericCloud + images: + - EC2 + - GenericCloud + formats: + - qcow2 + - raw livemap: git_repo: 'https://git.resf.org/sig_core/kickstarts.git' branch: 'r9-beta' diff --git a/iso/empanadas/empanadas/configs/el9.yaml b/iso/empanadas/empanadas/configs/el9.yaml index 97e6e96..b14dcc6 100644 --- a/iso/empanadas/empanadas/configs/el9.yaml +++ b/iso/empanadas/empanadas/configs/el9.yaml @@ -2,7 +2,7 @@ '9': fullname: 'Rocky Linux 9.0' revision: '9.0' - rclvl: 'RC2' + rclvl: 'RC3' major: '9' minor: '0' profile: '9' @@ -73,8 +73,12 @@ - 'lorax-templates-generic' - 'xorriso' cloudimages: - - EC2 - - GenericCloud + images: + - EC2 + - GenericCloud + formats: + - qcow2 + - raw livemap: git_repo: 'https://git.resf.org/sig_core/kickstarts.git' branch: 'r9' diff --git a/iso/empanadas/empanadas/configs/el9lh.yaml b/iso/empanadas/empanadas/configs/el9lh.yaml index 680d2d5..390da9e 100644 --- a/iso/empanadas/empanadas/configs/el9lh.yaml +++ b/iso/empanadas/empanadas/configs/el9lh.yaml @@ -73,8 +73,12 @@ - 'lorax-templates-generic' - 'xorriso' cloudimages: - - EC2 - - GenericCloud + images: + - EC2 + - GenericCloud + formats: + - qcow2 + - raw livemap: git_repo: 'https://git.resf.org/sig_core/kickstarts.git' branch: 'r9lh' diff --git a/iso/empanadas/empanadas/templates/reposync.tmpl b/iso/empanadas/empanadas/templates/reposync.tmpl index 22f71b4..195ab24 100644 --- a/iso/empanadas/empanadas/templates/reposync.tmpl +++ b/iso/empanadas/empanadas/templates/reposync.tmpl @@ -1,5 +1,6 @@ #!/bin/bash set -o pipefail +sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*.repo {{ import_gpg_cmd }} | tee -a {{ sync_log }} {{ arch_force_cp }} | tee -a {{ sync_log }} {{ dnf_plugin_cmd }} | tee -a {{ sync_log }} diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index bdb6cac..025381e 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -1543,68 +1543,74 @@ class IsoBuild: unpack_single_arch = True arches_to_unpack = [self.arch] - for imagename in self.cloudimages: + for imagename in self.cloudimages['images']: self.log.info(Color.INFO + 'Determining the latest images for ' + imagename + ' ...') - if self.s3: - latest_artifacts = Shared.s3_determine_latest( - self.s3_bucket, - self.release, - self.arches, - 'qcow2', - imagename, - self.log - ) - - else: - latest_artifacts = Shared.reqs_determine_latest( - self.s3_bucket_url, - self.release, - self.arches, - 'qcow2', - imagename, - 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) + for formattype in self.cloudimages['formats']: if self.s3: - Shared.s3_download_artifacts( - self.force_download, + latest_artifacts = Shared.s3_determine_latest( self.s3_bucket, - source_path, - full_drop, + self.release, + self.arches, + formattype, + imagename, self.log ) + else: - Shared.reqs_download_artifacts( - self.force_download, + latest_artifacts = Shared.reqs_determine_latest( self.s3_bucket_url, - source_path, - full_drop, + self.release, + self.arches, + formattype, + imagename, self.log ) + if not len(latest_artifacts) > 0: + self.log.warn(Color.WARN + 'No images found.') + continue + + self.log.info(Color.INFO + 'Attempting to download requested artifacts') + for arch in arches_to_unpack: + image_arch_dir = os.path.join( + self.image_work_dir, + arch + ) + + if arch not in latest_artifacts.keys(): + self.log.warn(Color.WARN + 'Artifact for ' + imagename + + ' ' + arch + ' (' + formattype + ') does not exist.') + continue + + 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')