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

extensible metadata on deployments #3032

Open
cgwalters opened this issue Sep 6, 2023 · 10 comments
Open

extensible metadata on deployments #3032

cgwalters opened this issue Sep 6, 2023 · 10 comments
Assignees
Labels
area/greenboot Issues related to greenboot integration area/sysroot Issues related to OstreeSysroot enhancement jira

Comments

@cgwalters
Copy link
Member

As prep for #2725 but also in general, I think it'd be useful to have an official "metadata" API for deployments - surfacing things like "did this deployment boot before" in a way indepdenent of the journal.

I think this could be a pretty thin wrapper for extended attributes on the deployment root directory. (Need to verify whether the immutable bit breaks this; if it does we could just document using the origin file for this)

@cgwalters cgwalters added enhancement area/sysroot Issues related to OstreeSysroot area/greenboot Issues related to greenboot integration labels Sep 6, 2023
@jmarrero jmarrero added the jira label Oct 3, 2023
@cgwalters
Copy link
Member Author

BTW if we do this we should also teach the OpenShift MCO to do this, to describe which rendered configs it used for the deployment.

@cgwalters
Copy link
Member Author

One thought related to this is that with composefs, we automatically gain a new .cfs file that would a natural target for xattrs.

@cgwalters
Copy link
Member Author

(And maybe we should just turn on composefs generation unconditionally by default?)

@jmarrero jmarrero self-assigned this Oct 25, 2023
@jmarrero
Copy link
Member

jmarrero commented Nov 6, 2023

we discussed turning composefs for Fedora ELN first.

@cgwalters
Copy link
Member Author

One thing that happened with #3114 is we gained a whole new directory created unconditionally now - so we can trivially drop in a new file there in whatever format we want (but probably gvariant) or xattrs on that directory.

@cgwalters
Copy link
Member Author

This one also tangentially relates to https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ as the success/failure of a boot is something that could make sense here - or in the bootloader configs.

@jmarrero
Copy link
Member

I see that is targeted for kernel-install to start the process. Since we are not doing a kernel install but a deployment, we could:

  • check what kernel is part of the deployment
  • ostree exposes a boot_retry count option
  • ostree creates: /etc/kernel/tries with the boot_retry value.
  • ostree creates: /boot/loader/entries/KERNEL_VER.fc27.x86_64+BOOT_RETRY.conf

Then the process described in the Walkthrough section of https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ will take over. We can embed additional information on /boot/loader/entries/KERNEL_VER.fc27.x86_64+BOOT_RETRY.conf for greenboot to consume either in the file itself as text as long systemd does not care or extended attributes if systemd cares about file content.

@cgwalters
Copy link
Member Author

I think for this the source of truth is the bootloader entry, same with ostree.

ostree exposes a boot_retry count option
ostree creates: /etc/kernel/tries with the boot_retry value.

I think these are the same things? The OS builder wants a way to opt-in to boot counting.

ostree creates: /boot/loader/entries/KERNEL_VER.fc27.x86_64+BOOT_RETRY.conf

This part seems right to me; basically ostree shouldn't care what the contents of the filename is today, so we can add the retry and then our equivalent of systemd-bless-boot.service can update the count.

Something like greenboot (or part of the initrd?) would need to decrement the counter at boot.

Another thing we could do here is do the work to test this w/systemd boot, then port to greenboot/grub.

@cgwalters
Copy link
Member Author

As far as metadata associated with a deployment, one thing I could imagine is that we add a generic metadata key to https://uapi-group.org/specifications/specs/boot_loader_specification/

There's e.g. these recommendations for extending os-release

but nothing similar there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/greenboot Issues related to greenboot integration area/sysroot Issues related to OstreeSysroot enhancement jira
Projects
None yet
Development

No branches or pull requests

2 participants