beginning work on downloading variant images

This commit is contained in:
Neil Hanlon 2022-11-12 12:04:52 -05:00
parent 605cc1fdc3
commit d028b28d63
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
3 changed files with 45 additions and 27 deletions

View File

@ -103,10 +103,10 @@ for conf in glob.iglob(f"{_rootdir}/sig/*.yaml"):
ALLOWED_TYPE_VARIANTS = { ALLOWED_TYPE_VARIANTS = {
"Azure": None, "Azure": ["Base", "LVM"],
"Container": ["Base", "Minimal", "UBI"], "Container": ["Base", "Minimal", "UBI"],
"EC2": None, "EC2": ["Base", "LVM"],
"GenericCloud": None, "GenericCloud": ["Base", "LVM"],
"Vagrant": ["Libvirt", "Vbox"], "Vagrant": ["Libvirt", "Vbox"],
"OCP": None "OCP": None
} }

View File

@ -74,10 +74,20 @@
- 'xorriso' - 'xorriso'
cloudimages: cloudimages:
images: images:
Azure:
format: vhd
variants: [Base, LVM]
EC2: EC2:
format: raw format: raw
variants: [Base, LVM]
GenericCloud: GenericCloud:
format: qcow2 format: qcow2
variants: [Base, LVM]
Container:
format: tar.xz
variants: [Base, Minimal, UBI]
OCP:
format: qcow2
livemap: livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git' git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'r8' branch: 'r8'

View File

@ -1361,29 +1361,37 @@ class IsoBuild:
unpack_single_arch = True unpack_single_arch = True
arches_to_unpack = [self.arch] arches_to_unpack = [self.arch]
for imagename in self.cloudimages['images']: for name, extra in self.cloudimages['images'].items():
self.log.info(Color.INFO + 'Determining the latest images for ' + imagename + ' ...') self.log.info(Color.INFO + 'Determining the latest images for ' + name + ' ...')
formattype = self.cloudimages['images'][imagename]['format'] formattype = extra['format']
if self.s3: variants = extra['variants'] if 'variants' in extra.keys() else [None] # need to loop once
latest_artifacts = Shared.s3_determine_latest( latest_artifacts = []
self.s3_bucket,
self.release,
arches_to_unpack,
formattype,
imagename,
self.log
)
else: for variant in variants:
latest_artifacts = Shared.reqs_determine_latest( if variant:
self.s3_bucket_url, name = f"{name}-{variant}"
self.release, if self.s3:
arches_to_unpack, latest_artifacts.append(Shared.s3_determine_latest(
formattype, self.s3_bucket,
imagename, self.release,
self.log arches_to_unpack,
) formattype,
name,
self.log
))
else:
latest_artifacts.append(Shared.reqs_determine_latest(
self.s3_bucket_url,
self.release,
arches_to_unpack,
formattype,
name,
self.log
))
# latest_artifacts should have at least 1 result if has_variants, else == 1
if not len(latest_artifacts) > 0: if not len(latest_artifacts) > 0:
self.log.warn(Color.WARN + 'No images found.') self.log.warn(Color.WARN + 'No images found.')
@ -1397,7 +1405,7 @@ class IsoBuild:
) )
if arch not in latest_artifacts.keys(): if arch not in latest_artifacts.keys():
self.log.warn(Color.WARN + 'Artifact for ' + imagename + self.log.warn(Color.WARN + 'Artifact for ' + name +
' ' + arch + ' (' + formattype + ') does not exist.') ' ' + arch + ' (' + formattype + ') does not exist.')
continue continue
@ -1449,7 +1457,7 @@ class IsoBuild:
image_arch_dir, image_arch_dir,
self.shortname, self.shortname,
self.major_version, self.major_version,
imagename, name,
arch, arch,
formattype formattype
) )
@ -1458,7 +1466,7 @@ class IsoBuild:
image_arch_dir, image_arch_dir,
self.shortname, self.shortname,
self.major_version, self.major_version,
imagename, name,
arch, arch,
formattype formattype
) )