Skip to content

Conversation

agullon
Copy link
Contributor

@agullon agullon commented May 13, 2025

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 13, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 13, 2025

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2025
Copy link
Contributor

openshift-ci bot commented May 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2025
@@ -119,13 +120,22 @@ download_brew_rpms() {
mkdir -p "${BREW_RPM_SOURCE}"
if "${SCRIPTDIR}/manage_brew_rpms.sh" access ; then
Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@ggiguash ggiguash Jun 13, 2025

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}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agullon agullon marked this pull request as ready for review June 17, 2025 11:12
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2025
@openshift-ci openshift-ci bot requested review from ggiguash and pmtk June 17, 2025 11:13
@agullon
Copy link
Contributor Author

agullon commented Jun 17, 2025

/retest-required

2 similar comments
@agullon
Copy link
Contributor Author

agullon commented Jun 17, 2025

/retest-required

@agullon
Copy link
Contributor Author

agullon commented Jun 17, 2025

/retest-required

echo "ERROR: Cannot find MicroShift '${ver}' packages in brew"
exit 1
echo "WARNING: Cannot find MicroShift '${ver}' packages in brew"
exit 0
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done it in 2de69c5 commit
Also, added skip for released brew version here: 1b9f044

if [ -z "${ver_type}" ] ; then
adir="${dir}/${arch}"
else
adir="${dir}/$(echo "${package}" | sed 's/.*microshift-\([^-]*\).*/\1/')/${arch}"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

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}"
Copy link
Contributor

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}?

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

@ggiguash ggiguash Jun 19, 2025

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.

Copy link
Contributor Author

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.


# Upload released RPM from brew
pushd "${src_base}"
released_brew_rpms_dirs="$(find "brew-rpms-released" -maxdepth 1 -type d | tail -n +2)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why can't we add brew-rpms-released to the loop above?
  2. We also need to implement download operation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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.

  2. Yes, my idea was to do it on another PR. Because this PR should only focus on the build phase.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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]-')"
Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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
;;
*)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in c54d483 commit

@ggiguash
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2025
Copy link
Contributor

openshift-ci bot commented Jun 19, 2025

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agullon
Copy link
Contributor Author

agullon commented Jun 19, 2025

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 1fdfec0 and 2 for PR HEAD 86b9afe in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b72066d and 1 for PR HEAD 86b9afe in total

@agullon
Copy link
Contributor Author

agullon commented Jun 20, 2025

/retest-required

2 similar comments
@agullon
Copy link
Contributor Author

agullon commented Jun 20, 2025

/retest-required

@agullon
Copy link
Contributor Author

agullon commented Jun 20, 2025

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b72066d and 2 for PR HEAD 86b9afe in total

@ggiguash
Copy link
Contributor

The failures have nothing to do with the changes. Saving on CI cycles.
/override ci/prow/e2e-aws-tests-bootc-periodic ci/prow/test-unit ci/prow/verify

Copy link
Contributor

openshift-ci bot commented Jun 21, 2025

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

The failures have nothing to do with the changes. Saving on CI cycles.
/override ci/prow/e2e-aws-tests-bootc-periodic ci/prow/test-unit ci/prow/verify

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.

Copy link
Contributor

openshift-ci bot commented Jun 21, 2025

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

@openshift-merge-bot openshift-merge-bot bot merged commit 844791b into openshift:main Jun 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants