Modify all Configs and add image puller

* Add livemap and imagemap to configs
* Add cloud image puller to iso_utils (part 1)
* Simplify color logging (potential prep for colorlog)
This commit is contained in:
Louis Abel 2022-07-05 20:42:41 -07:00
parent 6946b737fc
commit b54447571b
Signed by: label
GPG Key ID: B37E62D143879B36
7 changed files with 115 additions and 2 deletions

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -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()

View File

@ -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):
"""

View File

@ -540,6 +540,7 @@ class Shared:
if arch in y:
temps.append(y)
temps.sort(reverse=True)
if len(temps) > 0:
data[arch] = temps[0]
return data
@ -594,6 +595,7 @@ class Shared:
if arch in y:
temps.append(y)
temps.sort(reverse=True)
if len(temps) > 0:
data[arch] = temps[0]
return data

View File

@ -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"]