Skip to content

doc/ephemeral: Describe how to detect the environment#101

Merged
cgwalters merged 2 commits intobootc-dev:mainfrom
cgwalters:ephemeral-doc
Oct 29, 2025
Merged

doc/ephemeral: Describe how to detect the environment#101
cgwalters merged 2 commits intobootc-dev:mainfrom
cgwalters:ephemeral-doc

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

bcvk to-disk quay.io/fedora/fedora-coreos is broken
because it has a generator that fails in this environment.

TODO: Add a gating CI check for this.
Signed-off-by: Colin Walters <walters@verbum.org>
`bcvk to-disk quay.io/fedora/fedora-coreos` is broken
because it has a generator that fails in this environment.

Signed-off-by: Colin Walters <walters@verbum.org>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation about detecting the bcvk ephemeral environment, which is useful for adapting systemd units. It also documents the --env option for bcvk ephemeral run and bcvk ephemeral run-ssh. The changes are clear and helpful. I've suggested a few minor wording improvements in ephemeral-run.md to enhance clarity and fix some grammatical points.

Comment thread docs/src/ephemeral-run.md
Comment on lines +27 to +41
Conceptually now with `bcvk ephemeral`, there's *four* different ways to run
a bootc container:

- `podman|docker run <image> bash` - directly run a shell (or other process) the container without systemd. Uses the host kernel, not kernel in the container.
- `podman|docker run <image>` - by default runs systemd. See also <https://docs.fedoraproject.org/en-US/bootc/provisioning-container/>. Uses the host kernel, not kernel in the container.
- `bootc install` - Run directly on metal or a virtualized environment. Uses the kernel in the container.
- `bcvk ephemeral` - Run as a virtual machine, but *not* a true "bootc install". Uses the kernel in the container.

Some systemd units may need adaption to work in all of these modes. For example, if you have a systemd generator
which synthesizes mount units for expected partitions, it can use `ConditionVirtualization=!container` to skip
those in the first two cases (ensuring it still runs after a `bootc install`), but that won't be skipped in `bcvk ephemeral`
even though there won't be any block devices (by default).

At the current time there is not a dedicated way to detect `bcvk ephemeral`, but `ConditionKernelCommandLine=!rootfstype=virtiofs`
should work reliably in the future.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This new section is very helpful! I have a few suggestions to improve grammar, spelling, and clarity:

  • On line 27, "there's" should be "there are" since it refers to multiple items.
  • On line 35, "adaption" should be "adaptation".
  • The final sentence on lines 40-41 is a bit tentative ("should work reliably in the future"). If this is the recommended method now, we could phrase it more confidently and explain its purpose.

Here's a suggested revision for the whole section that incorporates these points:

Suggested change
Conceptually now with `bcvk ephemeral`, there's *four* different ways to run
a bootc container:
- `podman|docker run <image> bash` - directly run a shell (or other process) the container without systemd. Uses the host kernel, not kernel in the container.
- `podman|docker run <image>` - by default runs systemd. See also <https://docs.fedoraproject.org/en-US/bootc/provisioning-container/>. Uses the host kernel, not kernel in the container.
- `bootc install` - Run directly on metal or a virtualized environment. Uses the kernel in the container.
- `bcvk ephemeral` - Run as a virtual machine, but *not* a true "bootc install". Uses the kernel in the container.
Some systemd units may need adaption to work in all of these modes. For example, if you have a systemd generator
which synthesizes mount units for expected partitions, it can use `ConditionVirtualization=!container` to skip
those in the first two cases (ensuring it still runs after a `bootc install`), but that won't be skipped in `bcvk ephemeral`
even though there won't be any block devices (by default).
At the current time there is not a dedicated way to detect `bcvk ephemeral`, but `ConditionKernelCommandLine=!rootfstype=virtiofs`
should work reliably in the future.
Conceptually now with `bcvk ephemeral`, there are *four* different ways to run
a bootc container:
- `podman|docker run <image> bash` - directly run a shell (or other process) the container without systemd. Uses the host kernel, not kernel in the container.
- `podman|docker run <image>` - by default runs systemd. See also <https://docs.fedoraproject.org/en-US/bootc/provisioning-container/>. Uses the host kernel, not kernel in the container.
- `bootc install` - Run directly on metal or a virtualized environment. Uses the kernel in the container.
- `bcvk ephemeral` - Run as a virtual machine, but *not* a true "bootc install". Uses the kernel in the container.
Some systemd units may need adaptation to work in all of these modes. For example, if you have a systemd generator
which synthesizes mount units for expected partitions, it can use `ConditionVirtualization=!container` to skip
those in the first two cases (ensuring it still runs after a `bootc install`), but that won't be skipped in `bcvk ephemeral`
even though there won't be any block devices (by default).
At the current time there is not a dedicated way to detect `bcvk ephemeral`, but `ConditionKernelCommandLine=!rootfstype=virtiofs`
should work reliably.

cgwalters added a commit to cgwalters/fedora-coreos-config that referenced this pull request Oct 29, 2025
See bootc-dev/bcvk#101

This also is needed to eventually make FCOS work with `bcvk to-disk`.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters enabled auto-merge (rebase) October 29, 2025 15:03
@cgwalters cgwalters merged commit 181efce into bootc-dev:main Oct 29, 2025
4 checks passed
cgwalters added a commit to coreos/fedora-coreos-config that referenced this pull request Oct 30, 2025
See bootc-dev/bcvk#101

This also is needed to eventually make FCOS work with `bcvk to-disk`.

Signed-off-by: Colin Walters <walters@verbum.org>
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.

2 participants