Support overlay.d (and symlinks) #639
Conversation
|
I think the idea makes sense, though it seems odd to me that we're automatically handling the parent overlay, but letting the parent manifest be "manually integrated". Given that we support multiple includes now, I think we could just make coreos-assembler generate a tmp manifest like: include:
- parent-config/manifest.yaml
- manifest.yaml? |
Yeah.
But you're conflating rpm-ostree inheritance with cosa's extensions. Or are you thinking that cosa would parse the rpm-ostree manifests and if any in the chain have an |
I assume you mean users adding it themselves, not as a part of this repo? Taking a step back, maybe we shouldn't encourage either. What if we just said "bind in your config repo at |
"This repo" is cosa, and right, I don't think we should add fedora-coreos-config here.
Isn't that how it works today? We support that. To clarify what I'm doing, see https://github.com/cgwalters/fedora-silverblue-config/tree/f30-coreos-based And notice the |
I guess that's what I mean. If we introduce a concept like "parent configs", I'd expect the child configs to inherit everything by default. Having it just inherit the overlay seems arbitrary to me. The manifests and overlays were written to work together.
Hmm, that doesn't have a
Not sure if I follow why it'd need to parse the manifests. It would just accumulate the parent |
|
Maybe a simpler approach here is to fold the |
Right...a lot more work in rpm-ostree for that though. And so far rpm-ostree is relatively "un-opinionated" about things, including whether or not you e.g. store the configs in git. Whereas cosa is much more so, including convention over configuration exactly like this |
This wouldn't require rpm-ostree to know about git, though right? It could just be like an
Right, that was my take on the unopinionated approach. My opinionated cosa-level take is #639 (comment). I guess I don't see why cosa can't generate a manifest that essentially does what you're doing there: https://github.com/cgwalters/fedora-silverblue-config/blob/e20821d64ed67dc86827561574296dc28e4c1b10/fedora-common-ostree.yaml#L8. |
But what about e.g. the git timestamp thing? |
The problem is right now we don't want to inherit all of the manifest necessarily. E.g. RHCOS doesn't want |
I think we could just canonicalize the commit timestamp to epoch too? Actually, we could do that here too.
Right, gotcha. So we want to inherit some things but not some other things. To me, that reinforces making it part of the treefile itself where you can better define the exact semantics you want. E.g. this patch is making I guess we can add more "layers/tiers/ Anyway, no issues getting this in to play with it for now! Though maybe let's address #639 (comment)? |
What I more mean is that today rpm-ostree doesn't try at all to detect if the manifests are in git.
Yeah...there are two things here. First, in practice most of the stuff in the overlay is "infrastructure". The second is that it's not too hard to e.g. If we go this route...we could try to extract a |
|
Though, recursive git submodules get hairy, maybe that's too much overhead... Another short-term approach may be to have Or to rephrase this, in fedora-coreos-config we'd have
|
|
For now I added the missing |
|
Hmm, Travis doesn't look happy:
I'm good with just merging this for now if it unblocks you, but yeah we should have more design discussions around sharing things with RHCOS, Silverblue, and IoT. (Would be nice if we had an "experimental" mode here, but I guess technically we haven't done a |
parent-config symlink|
OK, rewrote this with a more general |
Hum, I had thought we were actually using the git timestamp, hadn't noticed you'd just set the epoch. I guess...the timestamp doesn't really matter, I can't offhand think of what we'd gain from making it match the git timestamp. |
|
Ooh exciting I broke the new CI. Hmm... |
|
|
|
OK updated and should fix comments and bugs! |
I'd like to encourage the pattern of adding e.g. `fedora-coreos-config` as a git submodule, rather than forking it. There are a lot of subtle things going on here, and in practice no one wants to "own" it. If someone forks it even to do something as simple as add packages, it's easy for things to diverge. For the treefile, I think it works OK to just use `include: parent-config/blah.yaml` in the derived treefile; we always expect people doing derivation to make their own `manifest.yaml` anyways. But I want to inherit from the overlay too. My first idea here was to simply: `ln -sr fedora-coreos-config/overlay overlay` but that failed because (for probably bad reasons) ostree wants a real directory as input. Let's make this a bit more general by first adding support for an `overlay.d` directory. This allows us to "group" overlays by purpose; if it helps you could think of them like "inline packages". Next, explicitly support symlinks here. So for now for Silverblue I'm just doing: ``` mkdir overlay.d ln -sr fedora-coreos-config/overlay overlay.d/fcos ``` But perhaps in the future we'll change the FCOS `overlay` to `overlay.d`, and this would allow us to cherry-pick from that in Silverblue and other derived systems.
|
LGTM |
|
One comment, otherwise LGTM assuming Jenkins CI is happy! |
| echo -n "Committing ${name}: ${path} ... " | ||
| ostree commit --repo="${tmprepo}" --tree=dir="${respath}" -b "${name}" \ | ||
| --owner-uid 0 --owner-gid 0 --no-xattrs --no-bindings --parent=none \ | ||
| --timestamp "${git_timestamp}" |
jlebon
Jul 26, 2019
Member
Hmm, git_timestamp is a local var in the other function though, no? Although ShellCheck isn't complaining; am I missing something?
Hmm, git_timestamp is a local var in the other function though, no? Although ShellCheck isn't complaining; am I missing something?
cgwalters
Jul 26, 2019
Author
Member
On this topic, https://timryan.org/2018/07/02/moving-from-the-shell-to-rust-with-commandspec.html is interesting...
On this topic, https://timryan.org/2018/07/02/moving-from-the-shell-to-rust-with-commandspec.html is interesting...
Make use of the new `overlay.d` model: coreos/coreos-assembler#639 I'm looking at rebasing RHCOS (and Silverblue) on this repo. Of the stuff in `overlay/` today, the thing that immediately stands out as "really FCOS specific" is the experimental motd bit. Move that into `overlay.d/80experimental`; everything else goes into `overlay.d/05core`.
Make use of the new `overlay.d` model: coreos/coreos-assembler#639 I'm looking at rebasing RHCOS (and Silverblue) on this repo. Of the stuff in `overlay/` today, the thing that immediately stands out as "really FCOS specific" is the experimental motd bit. Move that into `overlay.d/80experimental`; everything else goes into `overlay.d/05core`.
|
Some more thoughts on this in coreos/fedora-coreos-config#180 (comment).
Just following up on this, I'm not sure if I understand the concern here, so I might be missing something. I think you're talking about We still retain the advantage of git here by not triggering the pipeline if the git commit of the src config repo didn't change. If it did change, something has to rehash those files to check for a change. Right now, that's cosa via |
Now that we've bumped to the latest FCOS commit for compose tests, one thing that came up was that our compose tests never actually included FCOS overlays in the compose the way cosa does. This then cause compose failures because one of the postprocess scripts expects those files there. Let's just nuke all postprocess scripts here to work around this. I initially wanted to import the overlay logic from cosa, but overlays only work in unified core mode, and sadly we still want some coverage in non-unified mode until that's fully dropped. And anyway, we also already do a proper `cosa build` in the vmcheck branch of CI so it's not like we're losing that coverage. Down the line though, I think this is a good argument for folding the overlay dirs into rpm-ostree more natively as discussed here: coreos/coreos-assembler#639 (comment)
Now that we've bumped to the latest FCOS commit for compose tests, one thing that came up was that our compose tests never actually included FCOS overlays in the compose the way cosa does. This then cause compose failures because one of the postprocess scripts expects those files there. Let's just nuke all postprocess scripts here to work around this. I initially wanted to import the overlay logic from cosa, but overlays only work in unified core mode, and sadly we still want some coverage in non-unified mode until that's fully dropped. And anyway, we also already do a proper `cosa build` in the vmcheck branch of CI so it's not like we're losing that coverage. Down the line though, I think this is a good argument for folding the overlay dirs into rpm-ostree more natively as discussed here: coreos/coreos-assembler#639 (comment)
EDIT: Version 2
I'd like to encourage the pattern of adding e.g.
fedora-coreos-configas a git submodule, rather than forking it. There are a lot
of subtle things going on here, and in practice no one wants to
"own" it. If someone forks it even to do something as simple as add
packages, it's easy for things to diverge.
For the treefile, I think it works OK to just use
include: parent-config/blah.yamlin the derived treefile; we always expect people doing derivation to
make their own
manifest.yamlanyways.But I want to inherit from the overlay too.
My first idea here was to simply:
ln -sr fedora-coreos-config/overlay overlaybut that failed because (for probably bad reasons) ostree wants
a real directory as input.
Let's make this a bit more general by first adding support
for an
overlay.ddirectory. This allows us to "group"overlays by purpose; if it helps you could think of them like
"inline packages".
Next, explicitly support symlinks here. So for now for Silverblue
I'm just doing:
But perhaps in the future we'll change the FCOS
overlaytooverlay.d, andthis would allow us to cherry-pick from that in Silverblue and
other derived systems.