Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/src/ephemeral-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ bcvk ephemeral run-ssh quay.io/fedora/fedora-bootc:42
bcvk ephemeral run --memory 4096 --cpus 4 --name myvm quay.io/fedora/fedora-bootc:42
```

## Detecting an ephemeral environment

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.
Comment on lines +27 to +41
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.


## Use Cases

- Quick testing of bootc images
Expand Down
4 changes: 4 additions & 0 deletions docs/src/man/bcvk-ephemeral-run-ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ Run ephemeral VM and SSH into it

Add metadata to the container in key=value form

**-e**, **--env**=*ENV*

Set environment variables in the container (key=value)

**--bind**=*HOST_PATH[:NAME]*

Bind mount host directory (RW) at /run/virtiofs-mnt-<name>
Expand Down
4 changes: 4 additions & 0 deletions docs/src/man/bcvk-ephemeral-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ This design allows bcvk to provide VM-like isolation and boot behavior while lev

Add metadata to the container in key=value form

**-e**, **--env**=*ENV*

Set environment variables in the container (key=value)

**--bind**=*HOST_PATH[:NAME]*

Bind mount host directory (RW) at /run/virtiofs-mnt-<name>
Expand Down