-
Notifications
You must be signed in to change notification settings - Fork 349
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
Scripts for local boot.iso updates workflow #5525
Scripts for local boot.iso updates workflow #5525
Conversation
04af764
to
8061204
Compare
This PR is stale because it has been open 60 days with no activity. |
8061204
to
42063a8
Compare
42063a8
to
1e22203
Compare
1e22203
to
2664976
Compare
We should start using directory structure to show which tools are usable in the installed environment or used for development on the dev machine. |
2664976
to
9cbdddb
Compare
Seems like a suitable objective for a followup PR. :) |
Updated PR with improvements from @adamkankovsky, such as:
Thanks! :) |
9cbdddb
to
4de43db
Compare
Added simple virt-install support. :) |
4de43db
to
c3abca3
Compare
Please fix the pylint issue:
|
print("** error: could not determine a valid commit id") | ||
sys.exit(1) | ||
|
||
print("** preparing updates image via tag/hash: %s" % git_id) |
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.
Also, don't want to be picky, but looking at the code convention guideline, it states that we should use format()
instead of %s
.
Since this is a script that is mainly intended for development purposes, is it fine if we just ignore that convention?
https://github.com/rhinstaller/anaconda/blob/master/CONTRIBUTING.rst#code-conventions
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.
Oh, I saw that in line 120 you are using f-strings. So maybe this is some older 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.
We have been discussing this recently & we might be changing/cleaning up the guidelines soon. It was quite a while ago, when f-strings were quite new and not that well supported and used everywhere. We will most likely switch to allowing f-strings with some guidelines.
But there are still some issues we will need to look into, that are kinda specific to the tooling Anaconda is using:
- The Python Logging module has its own "% like" syntax for string formatting that does not behave the same as regular Python strings formatted in the same manner & prevented use from using
format()
for logged strings. - For f-strings, there are some issues with translated strings (IIRC we might end up with f-strings after the substitution being done marked for translation, which is wrong. 📦
So we might end up with:
%
syntax for logging%
orformat()
for translated strings- f-strings elsewhere
Should be fixed now. :) |
1049348
to
488da58
Compare
uses the Anaconda updates image mechanism together with the ``mkksiso`` command provided by the Lorax project to very quickly | ||
create an updated version of the boot.iso when Anaconda code is changed. The updated boot.iso can then be booted on a VM or bare metal. | ||
|
||
The ``rebuild_boot_iso`` 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 would prefer that the script explanation is inside the script on the top.
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've added a small note to each script noting what it does & where to find more. I kinda like to have both scripts documented in a single place to which I can direct people to.
|
||
The script also has a few command line options that might come handy: | ||
|
||
* ``-b, --boot-options`` makes it possible to add additional boot options to the boot.iso boot menu |
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.
Similarly I think if the script has help proper implemented I dont think we need to document this extra 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.
I think it is beneficial to be able to see the argument at a glance without having to execute the script first - kinda like a man file. Also it is possible to be more verbose here, if necessary, than in the limited environment of the --help
option.
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 see CONTRIBUTING file getting tidied up, but I am ok to unblock this.
A set of two script for easy local Anaconda development and debugging. Can be also used to easily create bootable installation images for demonstration purposes or for easy creation of bug reproducer images. The first script - rebuild_boot_iso - builds an Anaconda boot.iso from the current branch + distro packages. The script also stores the git revision of Anaconda branch at that time - which becomes important later. Expected is about 15 minutes on modern hardware with good connectivity for package download. The second script - update_boot_iso - works with the image generated by the first script. It adds changes present in the current working directory to an updates image, then appends this updates image to the boot.iso via the wonderful mkksiso tool. This takes a couple seconds on modern hardware. By default the scripts work automatically as git revision for the boot.iso at build time is stored & anything added since the revision will be added automatically via the updates image. Note that the script also adds a dummy boot option that records when the updated image has been built. This way it is possible to easily check what version of the image you re actually running, just by looking at /proc/cmdline from inside of the VM. The end result are two bootable installation images in the result/iso directory: - boot.iso - the "clean" generated installation image - updated_boot.iso - updated boot iso with baked-in updates image The idea behind this is, that during regular development, the rebuild_boot_iso script will be run infrequently (eq. when changing Anaconda dependencies) & the fast update_boot_iso will be run every time a code change is to be tested, booting it in a VM afterwards. This way it should be possible to avoid using big and fragile updates images as well as making the change-debug cycle as fast as possible, all without depending on external infrastructure.
Thanks for the improvements! :) Co-authored-by: Rodolfo Olivieri <[email protected]>
488da58
to
b1c09f4
Compare
A couple scripts for easily building a boot.iso from Anaconda source code & then using that as a base image for creating another boot.iso wit updates image, for fast debug iteration.
The general idea is to build (or download) a boot.iso first with any of the invasive changes (eq. added/removed packages) and then putting any ongoing changes to the "updated" boot.iso & periodically booting it in a VM.
The boot.iso update script also makes it possible to easily inject any additional boot options & automatically includes a timestamp via dummy boot option, so you can easily check which version of the image you are actually running.
NOTE: pretty much under heavy development & not final just yet.
TODO: