images should be pulled based on format and name

This commit is contained in:
Louis Abel 2022-07-08 09:54:43 -07:00
parent 4c426ca1e3
commit a4ee9ecc02
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
8 changed files with 108 additions and 87 deletions

View File

@ -1,12 +1,21 @@
# iso
## Setup / Install
1. Install [Poetry](https://python-poetry.org/docs/)
2. Setup: `poetry install`
3. Install dependencies: `dnf install podman mock`
3. Have fun
## Reliance on podman and mock
### Why podman?
Podman is a requirement for performing reposyncs. This was done because it was found to be easier to spin up several podman containers than several mock chroots and it was faster than doing one at a time in a loop. Podman is also used to parallelize ISO builds.
### Why mock?
There are cases where running `mock` is the preferred go-to: For example, building lorax images. Since you cannot build a lorax image for an architecture your system does not support, trying to "parallelize" it was out of the question. Adding this support in was not only for local testing without podman, it was also done so it can be run in our peridot kube cluster for each architecture.
## Updating dependencies
@ -16,9 +25,8 @@ Changes to the poetry.lock should be commited if dependencies are added or updat
## TODO
Verbose mode should exist to output everything that's being called or ran.
There should be additional logging regardless, not just to stdout, but also to a file.
* Verbose mode should exist to output everything that's being called or ran.
* There should be additional logging regardless, not just to stdout, but also to a file.
## scripts
@ -27,6 +35,10 @@ There should be additional logging regardless, not just to stdout, but also to a
* sync_sig -> Syncs SIG repositories from Peridot
* build-iso -> Builds initial ISO's using Lorax
* build-iso-extra -> Builds DVD's and other images based on Lorax data
* build-iso-live -> Builds live images
* pull-unpack-tree -> Pulls the latest lorax data from an S3 bucket and configures treeinfo
* pull-cloud-image -> Pulls the latest cloud images from an S3 bucket
* finalize_compose -> Finalizes a compose with metadata and checksums, as well as copies images
* launch-builds -> Creates a kube config to run build-iso
* build-image -> Runs build-iso
```

View File

@ -86,11 +86,10 @@
- 'xorriso'
cloudimages:
images:
- EC2
- GenericCloud
formats:
- qcow2
- raw
EC2:
format: raw
GenericCloud:
format: qcow2
livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'r9'

View File

@ -74,11 +74,10 @@
- 'xorriso'
cloudimages:
images:
- EC2
- GenericCloud
formats:
- qcow2
- raw
EC2:
format: raw
GenericCloud:
format: qcow2
livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'r9-beta'

View File

@ -74,11 +74,10 @@
- 'xorriso'
cloudimages:
images:
- EC2
- GenericCloud
formats:
- qcow2
- raw
EC2:
format: raw
GenericCloud:
format: qcow2
livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'r9'

View File

@ -74,11 +74,10 @@
- 'xorriso'
cloudimages:
images:
- EC2
- GenericCloud
formats:
- qcow2
- raw
EC2:
format: raw
GenericCloud:
format: qcow2
livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'r9lh'

View File

@ -74,11 +74,10 @@
- 'xorriso'
cloudimages:
images:
- EC2
- GenericCloud
formats:
- qcow2
- raw
EC2:
format: raw
GenericCloud:
format: qcow2
livemap:
git_repo: 'https://git.resf.org/sig_core/kickstarts.git'
branch: 'rln'

Binary file not shown.

View File

@ -1329,13 +1329,13 @@ class IsoBuild:
for imagename in self.cloudimages['images']:
self.log.info(Color.INFO + 'Determining the latest images for ' + imagename + ' ...')
formattype = self.cloudimages['images'][imagename]['format']
for formattype in self.cloudimages['formats']:
if self.s3:
latest_artifacts = Shared.s3_determine_latest(
self.s3_bucket,
self.release,
self.arches,
arches_to_unpack,
formattype,
imagename,
self.log
@ -1345,7 +1345,7 @@ class IsoBuild:
latest_artifacts = Shared.reqs_determine_latest(
self.s3_bucket_url,
self.release,
self.arches,
arches_to_unpack,
formattype,
imagename,
self.log
@ -1374,6 +1374,11 @@ class IsoBuild:
drop_name
)
checksum_drop = '{}/{}.CHECKSUM'.format(
image_arch_dir,
drop_name
)
if not os.path.exists(image_arch_dir):
os.makedirs(image_arch_dir, exist_ok=True)
@ -1395,6 +1400,15 @@ class IsoBuild:
self.log
)
self.log.info('Creating checksum ...')
checksum = Shared.get_checksum(full_drop, self.checksum, self.log)
if not checksum:
self.log.error(Color.FAIL + full_drop + ' not found! Are you sure we copied it?')
continue
with open(checksum_drop, 'w+') as c:
c.write(checksum)
c.close()
self.log.info(Color.INFO + 'Image download phase completed')