-
Notifications
You must be signed in to change notification settings - Fork 216
USHIFT-5397: [QE] Replace MicroShift build images phase with dev scripts #4900
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
Conversation
@agullon: This pull request references USHIFT-5397 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target either version "4.20." or "openshift-4.20.", but it targets "openshift-4.19" instead. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Skipping CI for Draft Pull Request. |
test/bin/build_rpms.sh
Outdated
@@ -119,13 +120,22 @@ download_brew_rpms() { | |||
mkdir -p "${BREW_RPM_SOURCE}" | |||
if "${SCRIPTDIR}/manage_brew_rpms.sh" access ; then |
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.
@ggiguash This block is not accessible from CI on cache-nightly runs, see this log:
+ 00:55:44.906969816 ./bin/build_rpms.sh:130 echo 'WARNING: The Brew Hub site is not accessible, skipping the download'
For that reason, I also implemented this logic in the CI script, see openshift/release#66024 PR
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.
I suggest we should extract the block to download RPMs from brew into a separate function and use it here and on release repo instead of duplicating the code.
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.
You are right. Sorry for misleading you.
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.
There is no need to extract it into separate function.
Just add the necessary version downloads in the release repo
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.
I'm sorry, I don't understand what you mean by necessary version downloads
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.
I meant adding the following commands here - pseudo code:
bash -x ./test/bin/manage_brew_rpms.sh download "${ocpversion}" "${out_path}"
bash -x ./test/bin/manage_brew_rpms.sh download "${ocpversion}" - 1 "${out_path}"
bash -x ./test/bin/manage_brew_rpms.sh download "${ocpversion}" - 2 "${out_path}"
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.
… into AWS S3 bucket
… into AWS S3 bucket
/retest-required |
2 similar comments
/retest-required |
/retest-required |
test/bin/manage_brew_rpms.sh
Outdated
echo "ERROR: Cannot find MicroShift '${ver}' packages in brew" | ||
exit 1 | ||
echo "WARNING: Cannot find MicroShift '${ver}' packages in brew" | ||
exit 0 |
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.
Why do we need this to be a non-fatal exit?
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.
Because of the automation from CI job when running for latest non released versions like 4.20. For example, when ER or RC don't exist, the script must continue running.
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.
I would like to make this conditional then. We should not allow failure to fetch main packages.
Let's issue a warning and skip for specific package types (exception), or fail as a rule?
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.
test/bin/manage_brew_rpms.sh
Outdated
if [ -z "${ver_type}" ] ; then | ||
adir="${dir}/${arch}" | ||
else | ||
adir="${dir}/$(echo "${package}" | sed 's/.*microshift-\([^-]*\).*/\1/')/${arch}" |
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.
Can we split this expression into another var?
Please, explain in the comment what we're trying to extract.
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.
Split into an extra var in c05d860 commit.
The reason I extract it is to have this dir structure:
$ tree -L 2 _output/test-images/brew-rpms-released
_output/test-images/brew-rpms-released
├── 4.16.41
│ ├── aarch64
│ └── x86_64
├── 4.17.27
│ ├── aarch64
│ └── x86_64
├── 4.18.0~0.nightly_2025_06_16_132618
│ ├── aarch64
│ └── x86_64
├── 4.18.0~ec.4
│ ├── aarch64
│ └── x86_64
├── 4.18.0~rc.10
│ ├── aarch64
│ └── x86_64
└── 4.18.11
├── aarch64
└── x86_64
instead of this:
$ tree -L 2 _output/test-images/brew-rpms-released
_output/test-images/brew-rpms-released
├── microshift-4.16.41-202505260636.p0.g789ff62.assembly.4.16.41.el9
│ ├── aarch64
│ └── x86_64
├── microshift-4.17.27-202504251637.p0.ge4822bf.assembly.4.17.27.el9
│ ├── aarch64
│ └── x86_64
├── microshift-4.18.0~0.nightly_2025_06_16_132618-202506170128.p0.gbc96f1d.assembly.microshift.el9
│ ├── aarch64
│ └── x86_64
├── microshift-4.18.0~ec.4-202411221636.p0.gbfd3ba1.assembly.ec.4.el9
│ ├── aarch64
│ └── x86_64
├── microshift-4.18.0~rc.10-202502170426.p0.g84f67ec.assembly.rc.10.el9
│ ├── aarch64
│ └── x86_64
└── microshift-4.18.11-202504281317.p0.g48a03d6.assembly.4.18.11.el9
├── aarch64
└── x86_64
What do you think? to be honest not sure if it's worth it.
test/bin/build_rpms.sh
Outdated
@@ -126,6 +126,14 @@ download_brew_rpms() { | |||
# Run the download procedure | |||
bash -x "${SCRIPTDIR}/../../scripts/fetch_tools.sh" brew | |||
bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" | |||
|
|||
out_path="${IMAGEDIR}/released-brew-rpms" |
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.
Do we have to put those in a separate directory?
Nit: if we have to, can we use brew-rpms-released
name so that they are sorted together in the output?
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.
We do not have to, no needed it. But I did it this way to change as less as possible the rest of the code on manage_build_cache.sh
script when uploading the RPMs into S3 bucket.
I agree to rename it to brew-rpms-released
, done in 615fc4e commit.
test/bin/manage_brew_rpms.sh
Outdated
else | ||
# remove date and commit id from package name and use it in dir name | ||
version=$(echo "${package}" | sed 's/.*microshift-\([^-]*\).*/\1/') | ||
adir="${dir}/${version}/${arch}" |
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.
Can we simplify this and just use ${version_type}
instead of ${version}
?
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.
I think it's not a good idea. I prefer a directory explicitly pointing to the version:
$ ls -1d *
4.16.41
4.17.27
4.18.0~0.nightly_2025_06_18_163729
4.18.0~ec.4
4.18.0~rc.10
4.18.11
instead of:
$ ls -1d *
ec
nightly
rc
zstream
or
$ ls -1d *
4.16-zstream
4.17-zstream
4.18-ec
4.18-nightly
4.18-rc
4.18-zstream
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.
Can you explain why?
Having floating top-level names also makes is more difficult to automate the usage of those.
With the <version>-<version_type>
naming, you can just point to a version and its type in the automation and run with whatever is there. Note that the actual versions are still present, but inside the directory.
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.
Not sure if we are both in the same page here. I'll try to explain myself better.
For me, the final goal of this PR is to have a database/repository (S3 bucket in this case, which is perfect) from where I can fetch any given MicroShift version (RPMs, images or refs) to deploy a MicroShift cluster and run release regression testing.
So my idea/proposal is to put all those artifacts (RPMs, images and refs) in a S3 bucket directory to point to them when triggering the release regression testing. By using the naming approach, 4.18-zstream
I find it difficult to know beforehand which version is that: 4.18.2
? 4.18.11
?
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.
For what you were trying to achieve, the versioning makes sense. I missed that point, so thank you for explaining.
As I commented in another thread, changing release-specific storage of artifacts is not what we do and I'm not sure it's a way to go.
I would suggest to continue with storing the artifacts under a given release because all the system is written to work like this. Then, I suppose, we can use more generic names, like 4.18-zstream
, etc.
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.
I'm thinking about this regarding the images, how to build them pointing to the right parent version for upgrades, and I convinced myself we should follow the current approach. Otherwise, I foresee another complete and different approach for parent images, which I think it's not a good idea at all.
So, I change it to follow current approach.
test/bin/manage_build_cache.sh
Outdated
|
||
# Upload released RPM from brew | ||
pushd "${src_base}" | ||
released_brew_rpms_dirs="$(find "brew-rpms-released" -maxdepth 1 -type d | tail -n +2)" |
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.
- Why can't we add brew-rpms-released to the loop above?
- We also need to implement download operation
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.
-
Because I think it's better to put the artifacts (RPMs, images and refs) in a separate S3 bucket directory. With this approach, we won't have them duplicated for every directory branch, and we save resources by uploading them for every directory branch.
-
Yes, my idea was to do it on another PR. Because this PR should only focus on the build phase.
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.
This requires a discussion. We do not store version collection of data without a release tag at this time. I do not think we should change this approach.
The disk space (duplication) is not a problem. We need to manage release-specific information in the buckets. This script is release specific and it should only manipulate release-specific data.
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.
I see, no problem then.
Co-authored-by: Gregory Giguashvili <[email protected]>
Co-authored-by: Gregory Giguashvili <[email protected]>
test/bin/manage_build_cache.sh
Outdated
@@ -102,7 +102,10 @@ action_upload() { | |||
run_aws_cli s3 sync --quiet --include '*.iso' "${iso_base}" "${iso_dest}" | |||
|
|||
# Upload mirror-registry, brew-rpms and repo archives | |||
for dir in mirror-registry brew-rpms repo ; do | |||
pushd "${src_base}" | |||
brew_rpms_dirs="$(find "brew-rpms" -maxdepth 1 -type d | grep '4..[0-9]-')" |
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.
Output example from these lines to understand dir structure:
$ pushd _output/test-images/
~/microshift/_output/test-images ~/microshift
$ find "brew-rpms" -maxdepth 1 -type d | grep '4..[0-9]-'
brew-rpms/4.18-nightly
brew-rpms/4.18-zstream
brew-rpms/4.17-zstream
brew-rpms/4.16-zstream
brew-rpms/4.18-rc
brew-rpms/4.18-ec
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.
The download should be relatively fast for RPMs. Let's try not to optimize upfront. We can start from a simple on tar and optimize if necessary in the future.
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.
This way, we should also get upload and download without changes in this script.
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.
I agree, remove changes from manage_build_cache.sh
on this PR.
rc|ec) | ||
package=$(brew list-builds --quiet --package=microshift --state=COMPLETE | grep "^microshift-${ver}.0~${ver_type}." | tail -1) || true | ||
;; | ||
*) |
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.
If version_type is not specified, let's use nightly by default.
We also need to produce an error in case ver_type is not one of the supported strings.
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.
done in c54d483 commit
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: agullon, ggiguash The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required |
/retest-required |
2 similar comments
/retest-required |
/retest-required |
The failures have nothing to do with the changes. Saving on CI cycles. |
@ggiguash: Overrode contexts on behalf of ggiguash: ci/prow/e2e-aws-tests-bootc-periodic, ci/prow/test-unit, ci/prow/verify In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@agullon: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
No description provided.