-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add new ex initramfs-etc
command
#2170
Conversation
Skipping CI for Draft Pull Request. |
Requires: ostreedev/ostree#2155 Still need to write tests for this. |
How often do we expect this stuff to change? Following up to ostreedev/ostree#2155 (comment) - what if all we did is support multiple initrds. Then the CoreOS code might generate a secondary initramfs (in the initramfs!) and install it as The experience for the administrator of "I want to update my rootmap" is certainly uglier but then it's clear - the "source of truth" is that file in |
c166bb1
to
6fe3364
Compare
Rebased! Going to reply to this comment and ostreedev/ostree#2155 (comment) here. Let's approach this from the other side. I.e. what do we want the UX to look like? The major goals I'm trying to meet are the following:
Do you agree with the above? Implementation-wise, I agree with you generating a new commit isn't ideal. Actually, my first approach at this was to extend the staging API to take additional initrds, so then e.g. rpm-ostree would create the initrd somewhere in Re. the overlay not changing often, yeah it's tempting to try to make optimizations on that assumption. OTOH, the sizes we're talking about are minuscule in comparison to the initrd itself. One thought I had on this topic was it'd be interesting to have another OSTree repo in I think if we're in agreement on the wanted UX, we could land this (once we add tests) and iterate on the implementation? Though there's no real rush either. I'll brush up the alternative libostree patch I had which will avoid having to generate a new commit. |
6fe3364
to
de26f73
Compare
Updated as per ostreedev/ostree#2155 (comment)! Now with 100% less OSTree commit operations. (You can see in the updated sample output in #2170 (comment) that we just go straight to staging the deployment.) |
de26f73
to
6a013dc
Compare
We aren't doing change detection, right? IOW:
And when I reboot, I'll have the old config until at some point something else changed, right? I'd be OK if we added
Which would be a really thin wrapper around the libostree API (in fact, we should probably expose that via I am still skeptical that these initramfs overlays will need to be updated often; if we discover later that we need to make it more ergonomic to do so, we could add (Implicit a bit in this is the idea there's at most one overlay, which seems fine to me; supporting multiple makes everything messy) |
} | ||
|
||
static gboolean | ||
generate_initramfs_overlay (GHashTable *initramfs_etc_files, |
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.
Just a note/optional: Feels like we could move some of this into Rust.
Right, though that's a bug IMO. With dracut that's hard to do because we have no insight in what files get picked up. But for
I don't disagree that in the common case they wouldn't be updated often. The new model in libostree reflects that (by not making it part of the bootcsum).
Hmm, perhaps. Though just directly pointing rpm-ostree at the files in |
One personal UX/design doubt on this point:
I feel that the rest of the ecosystem is going in a direction where part of the source of truth (user overrides) lives in |
6a013dc
to
795746b
Compare
I think if an app wants to rely on its |
This is a basic `.packit.yaml` integration file which will allow us have continuous builds of OSTree in cosa and upstream CI. If things go well, we'll likely deploy this in other build tools like rpm-ostree. Prompted by wanting to get ostreedev#2155 out to unblock coreos/rpm-ostree#2170.
This is a basic `.packit.yaml` integration file which will allow us have continuous builds of OSTree in cosa and upstream CI. If things go well, we'll likely deploy this in other build tools like rpm-ostree. Prompted by wanting to get ostreedev#2155 out to unblock coreos/rpm-ostree#2170.
Get this in now so we get some early testing before releases next week. Also because it unblocks coreos/rpm-ostree#2170.
795746b
to
4a37d24
Compare
Rebased this and restarted CI on it. Keeping as draft for now until I add tests, but the rest of the code should be ready for review! |
4a37d24
to
7ba80d5
Compare
Now ready for review and with a test! |
7ba80d5
to
d5bd323
Compare
It looks like this would fix the most common case for #1930. |
This command allows users to cheaply inject configuration files in the initramfs stage without having to regenerate the whole initramfs (or even a new OSTree commit). This will be useful for configuring services involved in bringing up the root block device. ``` $ echo 'hello world' > /etc/foobar $ rpm-ostree ex initramfs-etc --track /etc/foobar Staging deployment... done Run "systemctl reboot" to start a reboot $ rpm-ostree status State: idle Deployments: ostree://fedora:fedora/x86_64/coreos/testing-devel Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z) Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b GPGSignature: (unsigned) InitramfsEtc: /etc/foobar ● ostree://fedora:fedora/x86_64/coreos/testing-devel Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z) Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b GPGSignature: (unsigned) $ reboot (boot into rd.break) sh-5.0# cat /etc/foobar hello world ``` See the libostree side of this at: ostreedev/ostree#2155 Lots more discussions in: coreos/fedora-coreos-tracker#94 Closes: coreos#1930
d5bd323
to
139cc28
Compare
🎉 |
Two high level questions:
|
Yes, exactly. We can refer users who need it to the new command and gather feedback there. Just playing it safe in case the UX shows clunkiness when used in more realistic situations.
Yeah, it's not great, but I think it fills a UX need. Let's say you use You'd have to do some artificial operation just to create a deployment (e.g. doing |
|
||
GInputStream *cpio_output = g_subprocess_get_stdout_pipe (cpio); | ||
GOutputStream *gzip_input = g_subprocess_get_stdin_pipe (gzip); | ||
g_output_stream_splice_async (gzip_input, cpio_output, |
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.
It'd be more efficient and simpler to just pass cpio's stdout as gzip's stdin, right?
|
||
const char *cpio_argv[] = {"cpio", "--create", "--format", "newc", "--quiet", | ||
"--reproducible", "--null", NULL}; | ||
g_autoptr(GSubprocess) cpio = g_subprocess_newv ((const char *const*)cpio_argv, |
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.
https://developer.gnome.org/gio/stable/GSubprocess.html#g-subprocess-communicate also takes stdin as a buffer, so we wouldn't need to splice anything in combination with the below.
} | ||
|
||
static gboolean | ||
initramfs_etc_transaction_execute (RpmostreedTransaction *transaction, |
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 thought we'd been trending a bit towards glomming everything into Deploy
so it could be done in one go? I guess it doesn't much matter for this case, just curious if you had a reason to make this separate. (It is clearer to read separately, but more duplicated code)
OK I restarted CI on this and am OK merging as is, since it's |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Get this in now so we get some early testing before releases next week. Also because it unblocks coreos/rpm-ostree#2170.
This command allows users to cheaply inject configuration files in the
initramfs stage without having to regenerate the whole initramfs (or
even a new OSTree commit). This will be useful for configuring services
involved in bringing up the root block device.
See the libostree side of this at:
ostreedev/ostree#2155
Lots more discussions in:
coreos/fedora-coreos-tracker#94