ephemeral: Explain when podman can't see bcvk's filesystem - #389
Conversation
|
|
||
| /// Documentation for running bcvk from a toolbox, distrobox or with a remote podman. | ||
| const DOCS_URL: &str = | ||
| "https://github.com/bootc-dev/bcvk/blob/main/docs/src/installation.md#toolbox-distrobox-and-remote-podman"; |
There was a problem hiding this comment.
We can't embed links like this in the code, the docs may change.
Include a brief summary and just mention to look at the man page for more details and btw the man page shuould include this
There was a problem hiding this comment.
Dropped the URL; the code now just says "see bcvk-ephemeral-run(8) for details" and I added the full explanation (including the version-skew note) to that man page.
| let start = line.find(PODMAN_STATFS_PREFIX)? + PODMAN_STATFS_PREFIX.len(); | ||
| let path = line[start..].trim_end().strip_suffix(ENOENT_SUFFIX)?; |
There was a problem hiding this comment.
split_once let's ensure we have that on a review checklsit
There was a problem hiding this comment.
Switched to split_once; added "prefer split_once/structured parsing over manual index/split juggling" to our own commit-review checklist too.
051493d to
8f3f120
Compare
| where podman runs.", | ||
| ) | ||
| .suggestion( | ||
| "Install bcvk on the host alongside podman and QEMU (e.g. `sudo dnf install bcvk`, \ |
There was a problem hiding this comment.
Let's not hardcode dnf there's no preferred package managers here in bootc-dev.
Just say "install bcvk on the host" basically really keep it simple and refer to the manpage for more details
There was a problem hiding this comment.
Done: the hint now just says to install and run bcvk on the host and points at bcvk-ephemeral-run(8); dropped dnf from the man page and installation.md too (sign-off kept on the one commit).
Generated-by: https://github.com/cgwalters/#llms
bcvk bind-mounts its own binary into the container it launches. From a toolbox or distrobox, podman is often forwarded to the host, so that path is resolved on the host. With bcvk installed only in the toolbox this failed with the rather cryptic Podman command failed: Error: statfs /usr/bin/bcvk: no such file or directory Rather than trying to detect a toolbox or distrobox, which can't tell a forwarded podman from one installed in the container, key on the error itself: if podman reports a bind mount source missing that bcvk can see, podman must be looking at a different filesystem. That covers a remote podman client too. Wrap the error with an explanation and a pointer to new docs on how to run bcvk in those setups, with the guidance in color_eyre note and suggestion sections. This only improves the failure; actually supporting bcvk from a toolbox is the larger design question in the issue. `ephemeral run` execs podman directly, so its error stays podman's own. Related: #5 Generated-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
8f3f120 to
f2d421d
Compare
Running bcvk from a toolbox with podman forwarded to the host (e.g. a
flatpak-spawn --host podmanwrapper) fails with a rather crypticbecause bcvk asks podman to bind-mount its own binary into the VM's container, and the host podman resolves that path on the host, where this bcvk doesn't exist. This was reported in #5, which asked for a clearer error and docs for the current expectation. Actually supporting bcvk from a toolbox is the larger design question in that issue and is not attempted here.
Rather than trying to detect a toolbox or distrobox (which can't tell a forwarded podman from one installed in the container, and would fire in setups that work), this keys on the error itself: when podman reports
statfs <path>: no such file or directoryfor a path that bcvk can see, podman must be looking at a different filesystem. That also covers a remote podman client. In that case the error fromrun_detachedis wrapped with a short explanation ("podman could not find PATH, but bcvk can see it: podman is not seeing bcvk's filesystem"), plus a color_eyre note on when this happens and a suggestion on how to run the host's bcvk from a toolbox (flatpak-spawn --host bcvk) or distrobox (distrobox-host-exec bcvk), linking to a new "Toolbox, distrobox and remote podman" section indocs/src/installation.md, which also covers version skew between a toolbox and a host copy of bcvk, and notes that podman inside the toolbox avoids this error but has limitations of its own.ephemeral runexecs podman directly, so its error is unchanged.Tested on a 16-core RHEL 10.2 devspace:
make validateandcargo testpass (84 + 22 unit tests, including table-driven tests for parsing podman's error and for when the hint is added; the note and suggestion sections can't be checked in unit tests, since they're only recorded with color_eyre's handler installed).toolbox create, ubi10 toolbox image) with bcvk installed only in the toolbox's/usr/local/bin:podmanwrapper running the host's podman):bcvk ephemeral run-ssh quay.io/centos-bootc/centos-bootc:stream10 -- truefrom main fails with just thestatfserror; with this change it prints the explanation, and the note and suggestion sections.sudo podman, vfs storage): no hint. podman finds bcvk's binary, and the run gets as far as networking, which fails in this nested setup (netavark: setns: Operation not permitted). A--bind /nonexistent:mntthere gives the plainstatfserror, since that path doesn't exist for bcvk either.run-sshworks as before, and--bind /nonexistent:mntgives the same plain error as main.Related: #5
The
Signed-off-by: Colin Walters <walters@verbum.org>on these commits was added on cgwalters's approval of the review draft: cgwalters-forge#4 (review)Generated-by: https://github.com/cgwalters/#llms