-
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
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4c2b687
to
9e9d4b4
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.
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 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. |
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.
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.
Signed-off-by: peppi-lotta <[email protected]>
7a7af56
to
27494cb
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.
/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). |
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.
# The path to the directory that holds this script | ||
CURRENT_SCRIPT_DIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
BASE_DEBUG_DIR="/tmp/debug-initramfs" | ||
mkdir -p ${BASE_DEBUG_DIR} |
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.
mkdir -p ${BASE_DEBUG_DIR} | |
mkdir -p "${BASE_DEBUG_DIR}" |
build_rpm_list_name_bases=$(mktemp -p "${BASE_HELPER_FILE_DIR}") | ||
master_rpm_list_name_bases=$(mktemp -p "${BASE_HELPER_FILE_DIR}") | ||
|
||
sudo chroot "${build_dir}" rpm -qa | sort > "${build_rpm_list}" |
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.
rpm --root "${build_dir}" -qa
should do the trick without sudo chroot.
This PR introduces a script
ipa_debug_tools.sh
that 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-initramfs
jenkins/scripts/dynamic_worker_workflow/build_ipa.sh
compare_dir_sizes [path]
compare_rpm_packages
clean_up_debug_dirs