Skip to content
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

Create MicroShift iso using image mode and bootc image builder #999

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

praveenkumar
Copy link
Member

With 4.18 microshift removed the steps of creating the iso using image builder and there is no more build.sh script which is consumed by mircoshift.sh script to create it. This PR use the image mode and bootc image builder (BIB) to create the iso which is now microshift team also pushing forward.

Copy link

openshift-ci bot commented Jan 10, 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

@praveenkumar praveenkumar force-pushed the issue_998 branch 4 times, most recently from 6ab8c1e to c074a21 Compare January 13, 2025 05:40
@praveenkumar
Copy link
Member Author

/test all

@praveenkumar praveenkumar marked this pull request as ready for review January 13, 2025 05:41
@openshift-ci openshift-ci bot requested review from anjannath and gbraad January 13, 2025 05:41
@praveenkumar praveenkumar force-pushed the issue_998 branch 2 times, most recently from 125c5ac to 83bd510 Compare January 13, 2025 08:09
@praveenkumar
Copy link
Member Author

/test e2e-microshift

@praveenkumar praveenkumar force-pushed the issue_998 branch 6 times, most recently from 3610d4d to fd6b49f Compare January 14, 2025 04:09
@praveenkumar
Copy link
Member Author

/test e2e-microshift

@praveenkumar praveenkumar changed the title [WIP] Create MicroShift iso using image mode and bootc image builder Create MicroShift iso using image mode and bootc image builder Jan 15, 2025
@praveenkumar
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@praveenkumar: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.18

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.

@praveenkumar
Copy link
Member Author

/hold

@praveenkumar
Copy link
Member Author

/unhold

@praveenkumar praveenkumar self-assigned this Feb 5, 2025
microshift.sh Outdated Show resolved Hide resolved
image-mode/microshift/config/Containerfile.bootc-rhel9 Outdated Show resolved Hide resolved
image-mode/microshift/config/Containerfile.bootc-rhel9 Outdated Show resolved Hide resolved
firewall-offline-cmd --zone=trusted --add-source=169.254.169.1


# Configure systemd journal service to persist logs between boots and limit their size to 1G
Copy link
Contributor

Choose a reason for hiding this comment

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

1G is quite big.

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you think would be best 200M ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or we could set the storage as persistent but keep the default values?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

the comment is now outdated though.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed this complete section because we don't need to persist logs between the boots since, this is something required for prod kind of setup.

image-mode/microshift/config/config.toml.template Outdated Show resolved Hide resolved
image-mode/microshift/config/config.toml.template Outdated Show resolved Hide resolved
image-mode/microshift/build.sh Outdated Show resolved Hide resolved
image-mode/microshift/build.sh Show resolved Hide resolved
# This is required to update the gpgcheck for repoID
repoID=$(echo "${MIRROR_REPO#*://}" | tr '/:' '_'); \
dnf config-manager --add-repo "${MIRROR_REPO}" \
--add-repo "https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/dependencies/rpms/${USHIFT_VER}-el9-beta" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this https://mirror.openshift.com/pub/openshift-v4/... repo need to be hardcoded in addition to the user-specified "${MIRROR_REPO}"?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes this is dependency repo and it is different from mirror repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even with --use-mirror-repo documentation (Use mirror repo to get release candidate and engineering preview rpms) it's not immediatly obvious to me why we would force the use of ${USHIFT_VER}-el9-beta instead of a non-beta repo.
Side-note, if --use-mirror-repo is only meant for release candidate and engineering preview, the name is not great as it's too generic.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't find a good name around but adding the comment why this dependencies repo is required.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe unreleased-mirror or such? I'm worried the use of -beta is unexpected in some cases, and is really non obvious from the option name.

Copy link
Member Author

Choose a reason for hiding this comment

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

Used unreleased-mirror as environment variable to avoid confusion.

createdisk.sh Outdated Show resolved Hide resolved
RUN firewall-offline-cmd --zone=public --add-port=80/tcp && \
firewall-offline-cmd --zone=public --add-port=443/tcp && \
firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \
firewall-offline-cmd --zone=public --add-port=30000-32767/udp
Copy link
Contributor

Choose a reason for hiding this comment

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

we disable firewall in createdisk.sh for microshift bundles, this seems redundant?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, removing this from container file.

firewall-offline-cmd --zone=trusted --add-source=169.254.169.1


# Configure systemd journal service to persist logs between boots and limit their size to 1G
Copy link
Contributor

Choose a reason for hiding this comment

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

the comment is now outdated though.

@praveenkumar praveenkumar force-pushed the issue_998 branch 4 times, most recently from dcac478 to febf74c Compare February 10, 2025 11:47
ci_microshift.sh Outdated
@@ -5,6 +5,10 @@ set -exuo pipefail
sudo yum install -y make golang

./shellcheck.sh
ARCH=$(uname -m)
if [[ "$ARCH" == "aarch64" ]]; then
export SNC_NON_FATAL_PREFLIGHT_CHECKS=1
Copy link
Contributor

Choose a reason for hiding this comment

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

it would make more sense to fix the capabilities check on aarch64. I don't think this is directly related to this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not directly related to this PR but I wanted to make sure both arm and amd build succeed before merge it.

fix the capabilities check on aarch64.

Yes, I think GCP doesn't allow native nested virtualization for arm64 and current job is using emulation only and it is slow but at least we are getting bundle build for arm64, will check if some different cloud provider can be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to allow emulation on a specific platform, it should be the script starting snc on this platform which sets this variable. Ideally we'd have a way to only disable the "kvm" check there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally we'd have a way to only disable the "kvm" check there.

@cfergeau yes, something like SNC_DISABLE_KVM_CHECK ?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah

Copy link
Member Author

Choose a reason for hiding this comment

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

Dropping this commit as of now and going with merge, will create follow up PR for it.

Copy link

openshift-ci bot commented Feb 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

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

@praveenkumar
Copy link
Member Author

/retest

1 similar comment
@praveenkumar
Copy link
Member Author

/retest

Copy link

openshift-ci bot commented Feb 11, 2025

@praveenkumar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-microshift-arm febf74c link true /test e2e-microshift-arm

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.

With 4.18 microshift removed the steps of creating the iso using
image builder and there is no more `build.sh` script which is consumed
by mircoshift.sh script to create it. This PR use the image mode
and bootc image builder (BIB) to create the iso which is now microshift
team also pushing forward.
Copy link

openshift-ci bot commented Feb 11, 2025

New changes are detected. LGTM label has been removed.

@praveenkumar praveenkumar merged commit 1fb32f8 into crc-org:master Feb 11, 2025
0 of 4 checks passed
@praveenkumar
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@praveenkumar: #999 failed to apply on top of branch "release-4.18":

Applying: microshift: Use config.d directory for drop-in config directory
Applying: Create MicroShift iso using image mode and bootc image builder
Using index info to reconstruct a base tree...
M	microshift.sh
Falling back to patching base and 3-way merge...
Removing podman_changes.ks
Auto-merging microshift.sh
CONFLICT (content): Merge conflict in microshift.sh
Removing 00-microshift-dns.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Create MicroShift iso using image mode and bootc image builder

In response to this:

/cherry-pick release-4.18

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.

@openshift-cherrypick-robot

@praveenkumar: #999 failed to apply on top of branch "release-4.18":

Applying: microshift: Use config.d directory for drop-in config directory
Applying: Create MicroShift iso using image mode and bootc image builder
Using index info to reconstruct a base tree...
M	microshift.sh
Falling back to patching base and 3-way merge...
Removing podman_changes.ks
Auto-merging microshift.sh
CONFLICT (content): Merge conflict in microshift.sh
Removing 00-microshift-dns.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Create MicroShift iso using image mode and bootc image builder

In response to this:

/cherry-pick release-4.18

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants