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 = {
"Azure": None,
"Azure": ["Base", "LVM"],
"Container": ["Base", "Minimal", "UBI"],
"EC2": None,
"GenericCloud": None,
"EC2": ["Base", "LVM"],
"GenericCloud": ["Base", "LVM"],
"Vagrant": ["Libvirt", "Vbox"],
"OCP": None
}

View File

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

View File

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