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

src/cmd-build: Add ostree target #348

Merged
merged 1 commit into from
Feb 14, 2019
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Feb 12, 2019

I'm often just iterating on the OSTree content itself and don't require
new images. In such cases, it's a waste of time to wait for images to be
generated when all I want is the treecompose. But using
coreos-assembler build is still more convenient than dropping down to
rpm-ostree compose tree, especially with the virtualization wrapper.

Add a new --ostree-only option in which we only generate a commit to
the OSTree repo. This is a natural extension of #302. Crucially though,
we still create a build directory under builds/ with metadata about
the built commit. The only practical difference is that there are no
image files and no subkeys under images in meta.json.

(I didn't bother breaking the idempotency coupling here wrt the
kickstart since (1) it's going away, and (2) this is really just for the
local dev case where you're iterating on the tools, like rpm-ostree, or
the content, like the treefile.)

@cgwalters
Copy link
Member

LGTM!

@dustymabe
Copy link
Member

I almost think this would be better served as part of the [IMAGETYPES] (better name needed maybe).

So we would default to [ostree qemu], but you could specify cosa build ostree to just build the ostree.

@jlebon
Copy link
Member Author

jlebon commented Feb 12, 2019

Hmm yeah, I think I like that.

I'm often just iterating on the OSTree content itself and don't require
new images. In such cases, it's a waste of time to wait for images to be
generated when all I want is the treecompose. But using
`coreos-assembler build` is still more convenient than dropping down to
`rpm-ostree compose tree`, especially with the virtualization wrapper.

Change the concept of `IMAGETYPES` to `TARGETS` and add a new `ostree`
target for which we only generate a commit to the OSTree repo. This is a
natural extension of coreos#302. Crucially though, we still create a build
directory under `builds/` with metadata about the built commit. The only
practical difference is that there are no image files and no subkeys
under `images` in `meta.json`.

(I didn't bother breaking the idempotency coupling here wrt the
kickstart since (1) it's going away, and (2) this is really just for the
local dev case where you're iterating on the tools, like rpm-ostree, or
the content, like the treefile.)
@jlebon
Copy link
Member Author

jlebon commented Feb 12, 2019

Done! (With the tweak that any of the image types automatically implies ostree, so the default internally is still just qemu).

@dustymabe
Copy link
Member

LGTM

@jlebon jlebon changed the title src/cmd-build: Add --ostree-only option src/cmd-build: Add ostree target Feb 13, 2019
@miabbott
Copy link
Member

Ran an unprivileged build of RHCOS for ostree and qemu targets successfully.

One nit: if you run build ostree, then build qemu you have to specify --force. It might be nice to teach build to have some intelligence to recognize an ostree exists and images can be produced from it.

That being said, this WFM, so 👍

@jlebon
Copy link
Member Author

jlebon commented Feb 13, 2019

Awesome, thanks for testing! 👍

It might be nice to teach build to have some intelligence to recognize an ostree exists and images can be produced from it.

Hmm, maybe. Though that would blur the line between build (creates new builds) and buildextend-* (appends to an existing build). Or what we could do is tweak things and just imply --force if the targets are not the same as the last build?

@miabbott
Copy link
Member

Or what we could do is tweak things and just imply --force if the targets are not the same as the last build?

That seems like a good compromise; but let's not hold up merging this on that idea.

@dustymabe dustymabe merged commit 4ffa644 into coreos:master Feb 14, 2019
@jlebon jlebon deleted the pr/ostree-only branch July 6, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants