-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework S3 CI cache prefix (HMS-5274) #1130
Conversation
While the arguments parser marked the --distro option as optional, in reality it is always passed when calling the script. Moreover, some of the underlying functions would behave weirdly if `distro` would be set to `None` (e.g. create directories named "None"). Signed-off-by: Tomáš Hozza <[email protected]>
Move the osbuild nevra to the beginning of the image build cache S3 prefix. This is a preparation for not using osbuild NEVRA, but osbuild commit ref and used CI runner distro. The goal is to make it easy to determine the S3 prefix corresponding to checked out branch without the need to setup YUM repo and install RPMs on the CI runner. Signed-off-by: Tomáš Hozza <[email protected]>
Rename the function to have "dir_path" in its name to signal that the returned path has a trailing slash to comply with the S3 convention. Signed-off-by: Tomáš Hozza <[email protected]>
Add a helper function to get the host distro, instead of reading data from the os-release and constructing it in every place. Signed-off-by: Tomáš Hozza <[email protected]>
Add the runner distro version to the image build cache S3 prefix. This is a preparation for not using osbuild NEVRA, but osbuild commit ref and used CI runner distro. The goal is to make it easy to determine the S3 prefix corresponding to checked out branch without the need to setup YUM repo and install RPMs on the CI runner. Signed-off-by: Tomáš Hozza <[email protected]>
Replace the osbuild nevra in the image build cache S3 prefix with osbuild ref and prefix it with "osbuild-ref-" to make the meaning of the SHA clear. The goal is to make it easy to determine the S3 prefix corresponding to checked out branch without the need to setup YUM repo and install RPMs on the CI runner. Signed-off-by: Tomáš Hozza <[email protected]>
The function is no longer used by any code. Signed-off-by: Tomáš Hozza <[email protected]>
Let's unify the generation of build info dir path prefix into one function, instead of generating it in various ways in multiple places. This commit introduces a new function to generate the relative dir path prefix, depending on provided arguments. The existing code that generates the prefix on its own will be replaced in the following commits. Signed-off-by: Tomáš Hozza <[email protected]>
Refactor gen_build_info_s3_dir_path() to call gen_build_info_dir_path_prefix() to generate the S3 path, instead of constructing it on its own. Amend the test coverage accordingly. This will allow to use gen_build_info_s3_dir_path() in all places that construct S3 paths. Signed-off-by: Tomáš Hozza <[email protected]>
Use gen_build_info_s3_dir_path() for generating S3 path, instead of constructing it on its own. Signed-off-by: Tomáš Hozza <[email protected]>
Use gen_build_info_dir_path_prefix() for generating build info dir paths, instead of constructing it on its own. Signed-off-by: Tomáš Hozza <[email protected]>
The function is no longer used by any code, delete it. Signed-off-by: Tomáš Hozza <[email protected]>
The function is no longer used by any code, delete it. Signed-off-by: Tomáš Hozza <[email protected]>
Prefix the manifest_id value in the generated path prefix with "manifest-id-" to make it obvious what the value represents. Signed-off-by: Tomáš Hozza <[email protected]>
Modify `gen_build_info_dir_path_prefix()` and `gen_build_info_s3_dir_path()` functions to not require osbuild_ref and runner_distro to be passed explicitly as arguments. If not provided, the runner_distro defaults to the host distro and the osbuild_ref defaults to the pinned version for the runner_distro. This simplifies all the places which call these functions. Signed-off-by: Tomáš Hozza <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. All LGTM.
Since I was part of the planning, I wont merge yet and wait for others to review as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I'm not sure if the ref-
is really needed as it's pretty obvious and just clutters the name? But works either way, I guess.
To replace the manifest-db in osbuild CI with the images repo image build cache, we will need to be able to easily construct the S3 cache prefix corresponding to a specific commit checkout of this repository.
The current S3 prefix for the image build cache looks like this:
e.g.
The most problematic part of constructing the correct prefix without running scripts on the CI runner is the osbuild NEVRA. The specific NEVRA is an RPM build of a particular osbuild commit for a specific distribution (the CI runner distro). The osbuild commit and the default CI runner distro can be determined from a local copy of the
Schutzfile
. However, getting the NEVRA requires querying a DNF repository for the CI runner distro.After brainstorming with @achilleas-k, we agreed to rework the image build cache prefix by:
The newly proposed S3 prefix for the image build cache looks like this:
e.g.
/jira-epic COMPOSER-2318
JIRA: HMS-5274