pkg-build: verbose and dry flag#4160
pkg-build: verbose and dry flag#4160christoph-zededa wants to merge 3 commits intolinuxkit:masterfrom
Conversation
`dry` does everything but not the build `verbose` prints out useful information like automatically generated build-args; this is also useful for programmatic output Signed-off-by: Christoph Ostarek <christoph@zededa.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
|
Hi @christoph-zededa thanks for this. For For With that in place, help me understand the implementation? Why are there now two distinct build cmds, I also am trying to understand why the properties of |
|
So I want to solve this problem: lf-edge/eve#5190 (comment)
I need it programmatically readable.
Sure
How would you want to invoke
Otherwise All in all, I see 3 ways to solve the problem (lf-edge/eve#5190 (comment) ):
|
I don't quite get what you are trying to do. Is it the equivalent of |
|
Or is it more than that? |
Some parts of EVE are not using linuxkit to build containers. F.e. when we want to run the go tests of pillar, we call of course |
|
I still am not 100% sure. If I read your message correctly (and I am trying to translate it out of "EVE-specific" and into "linuxkit generic"), you are trying to:
You want to build the container the same way you do when running Assuming I understand I see a few approaches to this. One is what you are proposing, which is to have a command variant that outputs, "this is what I would run to build it". Actually, But I think the simplest is just to build it. Why don't you do |
I prefer the latter method, too. How would it look like? |
As in multistage builds? No, I don't think so. That doesn't quite fit with the linuxkit model. But you could control it with build-args and have a separate build.yml that has different build args. |
That's a bit cumbersome, isn't there an easier way? |
I don't find it so (but personal opinions and all that). The linuxkit philosophy is built around the assumption that it is almost completely reproducible. That means things like build args are stored on disk, hence multiple build.yml if you want to change them. EVE itself does this in a few locations: nvidia, fw, pillar. I don't object per se to having an option that says, "hey linuxkit, tell me what command you would run if I did But for your issue, where you actually are trying to do use what |
|
I did something of a dry-run implementation, more as a proof of concept, in #4163; maybe try that branch and see what you think? Pay close attention to the comment on that issue; it doesn't exactly replicate the build process for reasons listed. |
Okay, let me try to trick you. What about:
No? (2) goes to far? What about allowing |
you are not allowed to have that much fun! |
For multistage builds? I can see that. I cannot see why it might violate the philosophy. I would want to think it through a bit, but I think it would be fine. It is a bit strange, in that this always is the whole thing, but I can see it work.
For some of them, yes; for others, no. For those that do not change the reproducibility of the build - like the name of the org, or repo, or tag - that already exists. For others like build args or config, I think I would get pushback on it (justifiably). The list of build.yml config is here |
|
Closing this PR as for now #4163 is good enough. |
drydoes everything but not the buildverboseprints out useful information likeautomatically generated build-args
pkg build-argsprints out the build-args- What I did
introduce
dryandverboseflag for pkg-build- How I did it
using cobra.Flats
- How to verify it
f.e. run:
in lf-edge/eve#5190
you should see the automatically generated build args
- Description for the changelog
allow more verbose output for debugging and programmatic use
- A picture of a cute animal (not mandatory but encouraged)