-
Notifications
You must be signed in to change notification settings - Fork 23
Add tool to compare built ipa and master ipa initramfs #1058
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
base: main
Are you sure you want to change the base?
Conversation
4c2b687 to
9e9d4b4
Compare
Rozzii
left a comment
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.
In general LGTM,
It is a very useful tool as I have mentioned offline.
I have one improvement proposal but it can be a later addition if you don't feel like implementing it now.
hack/ipa_debug_tools.sh
Outdated
| sudo mkdir -p /tmp/debug-initramfs/master-ipa-initramfs | ||
| cd /tmp/debug-initramfs || exit | ||
| sudo wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ipa-centos9-master.tar.gz | ||
| sudo tar -xzf ipa-centos9-master.tar.gz |
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.
It would be nice if the upstream IPA URI and tar file name could be customized same as in IPA downloader, you could actually use IPA downloader here instead of your own download logic to keep it simple .
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 debug tool, it might be good enough to be able to supply the URL. get-resource.sh vs one-liner... I'd go for the latter.
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 am fine either way, but the url and the name of the tar file has to be customizable because otherwise only a specific master on a specific base image can be tested. I suggested to use the downloader because that has all the customization options implemented but I am fine with doing it with the one liners too.
|
/override metal3-ubuntu-e2e-integration-test-main |
|
@Rozzii: Overrode contexts on behalf of Rozzii: metal3-ubuntu-e2e-integration-test-main DetailsIn 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. |
tuminoid
left a comment
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 is great addition to debug tools, thanks @peppi-lotta.
Some cleanup to do, some minor syntax things to fix and some suggestions to make it more readable and maintainable.
hack/ipa_debug_tools.sh
Outdated
| sudo mkdir -p /tmp/debug-initramfs/master-ipa-initramfs | ||
| cd /tmp/debug-initramfs || exit | ||
| sudo wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ipa-centos9-master.tar.gz | ||
| sudo tar -xzf ipa-centos9-master.tar.gz |
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 debug tool, it might be good enough to be able to supply the URL. get-resource.sh vs one-liner... I'd go for the latter.
00054eb to
7a7af56
Compare
| # ----------------------------------------------------------------------------- | ||
| clean_up_debug_dirs() { | ||
| # Clean up debug directories | ||
| sudo rm -rf "${BASE_DEBUG_DIR}" /tmp/dib ipa-file-injector.service 2> /dev/null |
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 get "${BASE_DEBUG_DIR}" and /tmp/dib but how does ipa-file-injector.service end up here?
I don't see any other reference to that file, and AFAIK that is the systemd unit file of the similarly named DIB module. It could be that I am missing something here but looks like this is some leftover reference maybe.
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.
ipa-file-injector.service appears in the /tmp directory after running the build-ip.sh. That is why I've added that to the clean up 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.
okay, that might be then some sort of residue from the template rendering process. I might remove it later, but then it is fine to remove it here.
tuminoid
left a comment
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.
IMO colors are fine, but emojis not.
7a7af56 to
27494cb
Compare
Rozzii
left a comment
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
|
@tuminoid I've addressed all comment can you approve and override test? |
|
It doesn't work? Running the test with using default options (centos10 master, opendev dib url). |
tuminoid
left a comment
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 exactly fond of that it just asks for sudo password and then goes and installs stuff on the system. Installing anything should be another "subcommand" that user must run explicitly.
The sudo usage in general is also very liberal (please don't run sudo wget and sudo tar .... Making a temporary directory with sudo is not typical either.
Sudo chroot also is not needed.
27494cb to
7aa7038
Compare
|
New changes are detected. LGTM label has been removed. |
7aa7038 to
aba76fb
Compare
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.
Pull request overview
This PR adds a comprehensive debugging tool ipa_debug_tools.sh to help developers compare locally built IPA (ironic-python-agent) initramfs images against official master images, particularly useful when troubleshooting size limit issues.
Key changes:
- New shell script with four main functions for IPA initramfs comparison and debugging
- Automated environment setup that builds local IPA and downloads master image
- Visual comparison utilities with color-coded output for size differences and RPM package variations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hack/ipa_debug_tools.sh
Outdated
|
|
||
| # set_up_debug_dirs [file] [url] | ||
| # | ||
| # This ceates a minimal set up in /tmp/debug-initramfs directory for |
Copilot
AI
Dec 12, 2025
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.
Corrected spelling of 'ceates' to 'creates'.
| # This ceates a minimal set up in /tmp/debug-initramfs directory for | |
| # This creates a minimal set up in /tmp/debug-initramfs directory for |
hack/ipa_debug_tools.sh
Outdated
| # ./ipa_debug_tools.sh set_up_debug_dirs ipa-centos10-master.tar.gz | ||
| # ./ipa_debug_tools.sh set_up_debug_dirs ipa-centos10-master.tar.gz https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ | ||
| # | ||
| # - [file]: Name of tar file o be downloaded [default: ipa-centos10-master.tar.gz] |
Copilot
AI
Dec 12, 2025
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.
Corrected spelling of 'o' to 'to'.
| # - [file]: Name of tar file o be downloaded [default: ipa-centos10-master.tar.gz] | |
| # - [file]: Name of tar file to be downloaded [default: ipa-centos10-master.tar.gz] |
hack/ipa_debug_tools.sh
Outdated
| # ./ipa_debug_tools.sh set_up_debug_dirs ipa-centos10-master.tar.gz | ||
| # ./ipa_debug_tools.sh set_up_debug_dirs ipa-centos10-master.tar.gz https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ |
Copilot
AI
Dec 12, 2025
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 documentation examples reference 'ipa-centos10-master.tar.gz', but line 27 uses 'ipa-centos9-master.tar.gz' as the default value. This inconsistency could confuse users. Consider either updating the examples to match the default or updating the default to match the examples.
hack/ipa_debug_tools.sh
Outdated
| export TEST_IN_CI="false" | ||
|
|
||
| # Build ipa with build_ipa.sh. Search for the script in a path that is | ||
| # relative to this files location. |
Copilot
AI
Dec 12, 2025
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.
Corrected spelling of 'files' to 'file's'.
| # relative to this files location. | |
| # relative to this file's location. |
hack/ipa_debug_tools.sh
Outdated
|
|
||
| # After debugging and comparison operations, temporary directories can be cleaned up. | ||
| # This function removes the build and master filesystems. If this operation is run | ||
| # the set_up_debug_dirs needs to be run again to create the compareble filesystems. |
Copilot
AI
Dec 12, 2025
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.
Corrected spelling of 'compareble' to 'comparable'.
| # the set_up_debug_dirs needs to be run again to create the compareble filesystems. | |
| # the set_up_debug_dirs needs to be run again to create the comparable filesystems. |
hack/ipa_debug_tools.sh
Outdated
| } | ||
|
|
||
| # Print a rpm package list. The print omits packages that are identical in both | ||
| #the built ipa and master. |
Copilot
AI
Dec 12, 2025
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.
Missing space after comment marker '#'. Add a space for consistency with other comments in the file.
| #the built ipa and master. | |
| # the built ipa and master. |
tuminoid
left a comment
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.
Just fix the typo nits by the bot.
/approve
/hold
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tuminoid The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: peppi-lotta <[email protected]>
aba76fb to
46501da
Compare
|
/override metal3-ubuntu-e2e-integration-test-main |
|
@tuminoid: Overrode contexts on behalf of tuminoid: metal3-ubuntu-e2e-integration-test-main DetailsIn 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. |
This PR introduces a script
ipa_debug_tools.shthat provides a set of utilities to assist with debugging and comparing IPA (ironic-python-agent) initramfs builds. The script is particularly useful for identifying differences between locally built IPA images and the official master images.This tool is meant especially for situations where built IPA size get over a certain limit limit and two file systems need to be compared.
🛠️ What's Included
set_up_debug_dirs/tmp/debug-initramfsjenkins/scripts/dynamic_worker_workflow/build_ipa.shcompare_dir_sizes [path]compare_rpm_packagesclean_up_debug_dirs