1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00

2833 Commits

Author SHA1 Message Date
John Eckersberg
f4bc20032c Merge pull request #966 from cgwalters/link-container-lint
docs: Link to bootc container lint
v1.1.3
2024-12-12 12:42:11 -05:00
Colin Walters
4583f345b0 docs: Link to bootc container lint
Closes: https://github.com/containers/bootc/issues/962
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-12 16:47:15 +00:00
Colin Walters
90960ace83 Merge pull request #965 from cgwalters/release
Release 1.1.3
2024-12-12 11:19:52 -05:00
Colin Walters
1044a45834 Release 1.1.3
Mostly install time updates in this release; this
fixes Anaconda support, and also makes `bootc install to-existing-root`
significantly more ergonomic.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-12 15:21:09 +00:00
Colin Walters
b1cb5ab152 install: Lift hide=true from install ensure-completion
While this has obscure use cases right now, we will need
to support it for the forseeable future, so just lift
its `hide=true` state so it's clear that it exists.

Update the generated man pages.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-12 15:21:09 +00:00
Colin Walters
785acc9b7d Merge pull request #959 from cgwalters/errcheck-mount
mount: Some error handling fixups
2024-12-11 12:31:19 -05:00
Colin Walters
c783548cfd mount: Some error handling fixups
Motivated by https://github.com/containers/bootc/issues/957
but probably not any kind of fix in reality. Our error handling here
was buggy. What we really should do is avoid `fork()` and do
an execve here, but that's a larger refactor.

- Close the other side of the socket in the forked child so
  the parent doesn't hang indefinitely if the child dies
  before sending
- Change the parent to return a clean error if the child
  doesn't write anything instead of an `assert!`
- Check the exit code of the child

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-11 02:25:05 +00:00
Colin Walters
3b583174ee Merge pull request #930 from cgwalters/tree-wide-security-opt
install: Drop code/test uses of `--security-opt`
2024-12-10 14:41:47 -05:00
Colin Walters
f943d07de4 Merge pull request #951 from cgwalters/filesystem-doc
Filesystem doc
2024-12-10 10:20:07 -05:00
Colin Walters
fa474a9c3f install: Drop code/test uses of --security-opt
We think this is unnecessary now; part of improving
the ergonomics of `bootc install` in general, but
especially with the `to-existing-root` path.

Once this lands, at some point later then we
can also remove it from all of the documentation.
But the most safe thing is to leave it in the
docs for a bit longer.

Closes: https://github.com/containers/bootc/issues/928

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-10 10:02:12 -05:00
Colin Walters
f34e5dd22c Merge pull request #943 from cgwalters/cmd-pdeathsig
Cmd pdeathsig
2024-12-10 09:49:41 -05:00
Colin Walters
be346bc819 docs: Fix "implmentation" typo
My fingers apparently want to do the wrong thing here

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-10 08:55:36 -05:00
Colin Walters
dcd3373a25 Merge pull request #955 from henrywang/remove_ruff
ci: remove python checking and fix labeler action error
2024-12-10 08:51:30 -05:00
Xiaofeng Wang
f8b7e946c7 ci: fix labeler action error
Fix "The configuration file (path: .github/labeler.yml) was not
found locally" error

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-10 17:44:13 +08:00
Xiaofeng Wang
e2d5dd2cfa ci: remove python checking from CI
No python code in the repo any more

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-10 17:38:10 +08:00
Colin Walters
3f5eb52a17 Merge pull request #950 from cgwalters/ci-ostree-deploy
Cover ostree-ext in ci
2024-12-09 18:45:20 -05:00
Colin Walters
c895c61ac1 Merge pull request #953 from omertuc/cli
install: Guide user towards the correct podman flags
2024-12-09 17:04:47 -05:00
Omer Tuchfeld
ba9cfb6a27 install: Guide user towards the correct podman flags
Modified the error / root checking code a bit to better guide the user
towards the correct bootc invocation.

Issue BIFROST-552 [1]

```
[omer@hal9000 ~]$ podman run -it quay.io/otuchfel/bootc:comfy bootc install to-existing-root
ERROR Installing to filesystem: Querying root privilege: The container must be executed with full privileges (e.g. --privileged flag)

[omer@hal9000 ~]$ podman run -it --privileged quay.io/otuchfel/bootc:comfy bootc install to-existing-root
ERROR Installing to filesystem: This command must be run with the podman --pid=host flag

[omer@hal9000 ~]$ podman run -it --pid=host --privileged quay.io/otuchfel/bootc:comfy bootc install to-existing-root
ERROR Installing to filesystem: /proc/1 is owned by 65534, not zero; this command must be run in the root user namespace (e.g. not rootless podman)

[omer@hal9000 ~]$ sudo podman run -it --privileged --pid=host quay.io/otuchfel/bootc:comfy bootc install to-existing-root
Installing image: docker://quay.io/otuchfel/bootc:comfy
...
```

[1] https://issues.redhat.com/browse/BIFROST-552

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-12-09 22:39:22 +01:00
Colin Walters
936e832e75 doc: Expand on prepare-root
Per review.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 16:32:23 -05:00
Colin Walters
6696eb3bec filesystem: Doc etc.transient
I noticed this was missing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 16:32:23 -05:00
Colin Walters
aebb4ad68b filesystem: Doc usr/etc
Came up in review.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 16:32:23 -05:00
Colin Walters
33a361caf3 Merge pull request #954 from omertuc/clippylen
ostree-ext: test: fix clippy warning
2024-12-09 12:36:04 -05:00
Omer Tuchfeld
c60a1fc326 ostree-ext: test: Add a comment to clarify test code
The test code in the fixture module is a bit confusing, as it
arbitrarily gives some files in /etc a label and others another.

Add a comment to clarify this is on purpose.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-12-09 18:19:26 +01:00
Omer Tuchfeld
ac16dbb9ea ostree-ext: test: fix clippy warning
My clippy is complaining about `len()` being disallowed method. No harm
in changing this.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-12-09 18:19:19 +01:00
Platform Engineering Bot
af4d43f93c fix(deps): update auto merged updates (#948)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-12-09 09:26:18 -05:00
Colin Walters
a89fe65aef Merge pull request #944 from cgwalters/lint-usretc
lints: Add check for /usr/etc
2024-12-09 08:05:50 -05:00
Colin Walters
6429eebc61 ci: Run the ostree-ext deploy tests
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 08:05:03 -05:00
Colin Walters
f4e691cb32 build-sys: Also take over ostree hooks in our own CI builds
This helps ensure our CI is covering our copy of ostree-ext, not
the one currently vendored in rpm-ostree.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 08:05:03 -05:00
Colin Walters
55d958e96e ostree-ext: Drop unneeded CI workflow
Part of merging CI.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-09 08:05:03 -05:00
Colin Walters
cb99e152c3 Merge pull request #938 from henrywang/update_integration
test: Remove tmt bootc plugin code and use released bootc plugin
2024-12-07 10:35:03 -05:00
Xiaofeng Wang
3aada94752 test: Remove tmt bootc plugin code and use released bootc plugin
Remove tests-intetration folder because TMT bootc plugin replaces
tests-integration

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-07 14:33:13 +08:00
Colin Walters
b53971a5f5 lints: Add check for /usr/etc
Ref https://github.com/containers/bootc/issues/942

We don't want to support this, lint against it.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 16:51:24 -05:00
Colin Walters
479cbcad65 utils: Use run helper for editor
I just happened to glance at this code, this gives us stderr
in the error, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 16:31:44 -05:00
Colin Walters
af207a0d5c utils: Add a lifecycle_bind helper for Command
In almost all children we fork, we want the child to reliably
exit if we do (e.g. especially if we panic). The Linux
PR_SET_PDEATHSIG is just great for this.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 16:31:44 -05:00
Colin Walters
3ead1457f0 Merge pull request #940 from cgwalters/drop-terminal-size
ext: Replace terminal_size with comfy-table
2024-12-06 14:45:26 -05:00
Colin Walters
32af54de13 ext: Replace terminal_size with comfy-table
I was looking at our vendoring set and while it's not actually
relevant I found myself wondering why we had *three* versions
of `windows-sys`. Having that many crate versions is often a signal
that there's an unmaintained dependency.

And indeed, `terminal_size` is no longer cool. The "in" crowd
has moved on to newer, hipper things. Life moves fast, we need
to keep up.

(OK but yes also this drops some manual column printing code
 we had which is also a win)

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 14:26:33 -05:00
Colin Walters
7f94a7a177 Merge pull request #939 from cgwalters/use-path-booted
Use a shared const and helpers for run/ostree-booted
2024-12-06 10:46:46 -05:00
Colin Walters
d5e0d61397 Use a shared const and helpers for run/ostree-booted
Just a code cleanup.

Closes: https://github.com/containers/bootc/issues/934
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 09:52:37 -05:00
Colin Walters
a2e6dc4b7a Merge pull request #941 from cgwalters/drop-unneeded-table-vecs
Minor fixes
2024-12-06 09:34:47 -05:00
Colin Walters
fbe632efe6 lib: One more clippy fix
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 08:34:49 -05:00
Colin Walters
a3731457a2 tree-wide: Run cargo clippy --fix
Nothing important here but eh, let's quiet it.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 08:34:49 -05:00
Colin Walters
4ab0be977d image: Drop unnecessary vec!
No need to allocate here. Drive by cleanup as I was porting
other code to use comfy-table.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-06 08:34:49 -05:00
Xiaofeng Wang
ff0260a690 Merge pull request #937 from cgwalters/drop-custom-tmt2
tests: Fix lbi test
2024-12-06 07:42:46 +08:00
Colin Walters
3b9f4e401f Merge pull request #915 from cgwalters/install-fixup
install: Add `ensure-completion` verb, wire up ostree-deploy → bootc
v1.1.3-rc.0
2024-12-05 14:15:14 -05:00
Colin Walters
3b61d2cadc Drop copy of tmt bootc plugin
It's now merged and shipped, and us having a copy breaks things.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-05 13:56:36 -05:00
Colin Walters
28e85e6316 tests: Adapt for newer nushell
It looks like the default `column1` became `column0` which
broke this. But really we don't need a table, we just need a list;
and piping to `from csv` was a weird way to go about splitting
lines into a list.

Change the assertion to just expect a list which simplifies
the code.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-05 13:56:36 -05:00
Colin Walters
c5852ad405 install: Add ensure-completion verb, wire up ostree-deploy → bootc
When bootc was created, it started to become a superset of ostree;
in particular things like `/usr/lib/bootc/kargs.d` and logically
bound images.

However...Anaconda today is still invoking `ostree container image deploy`.

Main fix
--------

When bootc takes over the `/usr/libexec/ostree/ext/ostree-container`
entrypoint, make the existing `ostree container image deploy` CLI actually
just call back into bootc to fix things up. No additional work required other
than getting an updated bootc in the Anaconda ISO.

Old Anaconda ISOs
-----------------

But, a further problem here is that Anaconda is only updated once
per OS major+minor - e.g. there won't be an update to it for the lifetime
of RHEL 9.5 or Fedora 41. We want the ability to ship new
features and bugfixes in those OSes (especially RHEL9.5).

So given that we have a newer bootc in the target container, we can
do this:

```
%post --erroronfail
bootc install ensure-completion
%end
```

And will fix things up. Of course there's fun $details here...the
way Anaconda implements `%post` is via a hand-augmented `chroot`
i.e. a degenerate container, and we need to escape that and
fix some things up (such as a missing cgroupfs mount).

Summmary
--------

- With a newer bootc in the ISO, everything just works
- For older ISOs, one can add the `%post` above as a workaround.

Implementation details: Cross-linking bootc and ostree-rs-ext
-------------------------------------------------------------

This whole thing is very confusing because now, the linkage
between bootc and ostree-rs-ext is bidirectional. In the case
of `bootc install to-filesystem`, we end up calling into ostree-rs-ext,
and we *must not* recurse back into bootc, because at least for
kernel arguments we might end up applying them *twice*. We do
this by passing a CLI argument.

The second problem is the crate-level dependency; right now they're
independent crates so we can't have ostree-rs-ext actually
call into bootc directly, as convenient as that would be. So we
end up forking ourselves as a subprocess. But that's not too bad
because we need to carry a subprocess-based entrypoint *anyways*
for the Anaconda `%post` case.

Implementation details: /etc/resolv.conf
----------------------------------------

There's some surprising stuff going on in how Anaconda handles
`/etc/resolv.conf` in the target root that I got burned by. In
Fedora it's trying to query if systemd-resolved is enabled in
the target or something?

I ended up writing some code to just try to paper over this
to ensure we have networking in the `%post` where we need
it to fetch LBIs.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-05 11:17:05 -05:00
Xiaofeng Wang
4690143a80 Merge pull request #933 from henrywang/remove_e2e
test: Remove e2e test
2024-12-05 13:12:37 +08:00
Platform Engineering Bot
208636dccf chore(deps): update auto merged updates (#918)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-12-04 13:40:04 -05:00
John Eckersberg
4e1e3cb3b6 Merge pull request #917 from cgwalters/aleph-refactor
install: Factor out helper to create aleph version
2024-12-04 11:30:29 -05:00