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

Move build from positional args to named. #31

Open
supakeen opened this issue Dec 20, 2024 · 5 comments
Open

Move build from positional args to named. #31

supakeen opened this issue Dec 20, 2024 · 5 comments
Labels
🪄 enhancement New feature or request

Comments

@supakeen
Copy link
Member

It'd be nicer if the image-builder build subcommand takes named arguments instead of positional arguments. Currently it looks like this:

image-builder build --distro fedora-41 minimal-raw blueprint.toml

I propose:

image-builder build --distro fedora-41 --type minimal-raw --blueprint blueprint.toml

This would allow for multi-type builds (a very strong advantage of the osbuild system):

image-builder build --distro fedora-41 --type iso --type qcow2 --blueprint blueprint.toml

And would allow us to in the future have other inputs except the built-in image types such as a custom YAML file for custom images.

@supakeen supakeen added the 🪄 enhancement New feature or request label Dec 20, 2024
@mvo5
Copy link
Collaborator

mvo5 commented Dec 20, 2024

Fwiw, I like that it's more "uniform" this way, i.e. to me it feels a bit unbalanced that we currently have "--distro centos-9" but type is just an positional argument and has no --type. But then its a bit more typing for our users.

We should probably have a brainstorm again in the new year.

@achilleas-k
Copy link
Member

I agree, there's a convenience to positional args, but I think once you go beyond 3, it starts becoming easier to forget which is which. I think the extra typing is an acceptable tradeoff for explicitness. I wouldn't be against going that way.

@mvo5
Copy link
Collaborator

mvo5 commented Jan 13, 2025

@ondrejbudai Any (strong) opinions here?

@ondrejbudai
Copy link
Member

I only have one strong opinion: the user experience for the first time users must be as simple as possible. I like that positional arguments is all you need to get an image, I find it extremely user-friendly: image-builder build qcow2.

Requiring a named argument makes the command longer, and imo slightly harder to document.


Would it make sense to split these use-cases into 2 subcommands? One very simple one (build) for the masses, one complex one for people that need the complexity to succeed. I'm even thinking that the complex command shouldn't accept arguments, but rather a file (might be an overkill?):

$ cat fedora-iot.yaml
ostree-url: example.com/fedora
ostree-ref: fedora/rawhide
types:
  - iot-installer
  - iot-simplified-installer
  - iot-raw
  - iot-container
distro: fedora-rawhide
$ image-builder-cli multi-build fedora-iot.yaml

@supakeen
Copy link
Member Author

supakeen commented Jan 14, 2025

I'm fine with either approach; I created a quick PR to have --type because it was very little work to have it.

I'll add an opinion that if we do what @ondrejbudai proposes to please call these commands build-multi (so the reverse) so they sort correctly (all under build :)).

Perhaps we can rename build to something else, e.g. build-koji so we can provide a (for now) approach I can implement while we think about what other cases exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪄 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants