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

183 Commits

Author SHA1 Message Date
Colin Walters
aa89956301 install: Drop setting immutable bit on physical /
I've gone back and forth on this one over time; lately my
thought is that conceptually `/` is stuff that bootc/ostree doesn't
actually own, and so we shouldn't add this bit.

For a use case of e.g. testing out bootc via an "alongside" install,
we would want to enable rolling back to the non-bootc state
(at some point in the future when we e.g. save the original `/boot`)
and the immutable bit would be a thing we'd then need to undo.

The readonly bind mount over `/sysroot` should be sufficient for
our use cases.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-09 08:58:37 -05:00
Colin Walters
d92bb75eb5 renovate: Group non-major updates
The renovate PR spam we're seeing is too much.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-09 08:22:18 -05:00
Colin Walters
b632a8eec0 ci: Add renovate5
Right now we're not using a `Cargo.lock`, but we should.  Let's
try out renovate like some other Rust containers/ GH repos.

e.g. 67b7da4a89

I commented out the assignee thing as we don't have a dedicated
team yet.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-08 15:36:22 -05:00
Colin Walters
e477e4fc7d install: Add support for --root-ssh-authorized-keys
The current `bootc install` model is VERY opinionated: we install
the running container image to disk, and that is (almost!) it.

The only non-container out of band state that we support injecting right now
is kargs (via `--karg`) - we know we need this for machine local
kernel arguments.

(We do have a current outstanding PR to add a highly generic mechanism
 to inject arbitrary files in `/etc`, but I want to think about that more)

THis current strict stance is quite painful for
a use case like "take a generic container image and bootc install to-filesystem --alongside"
in a cloud environment, because the generic container may not
have cloud-init.

With this change it becomes extremely convenient to:

- Boot generic cloud image (e.g. AMI with apt/dnf + cloud-init)
- cloud-init fetches SSH keys from hypervisor (instance metadata)
- podman run -v /root/.ssh/authorized_keys:/keys:ro <image> bootc install ... --root-ssh-authorized-keys=/keys`

And then the instance will carry forward those hypervisor-provided
keys but without a dependency on cloud-init.

Another use case for this of course is being the backend of things
like Anaconda's kickstart verbs which support injecting SSH keys.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-02 13:42:08 -05:00
Colin Walters
b508e8b670 install: Add BOOTC_SKIP_SELINUX_HOST_CHECK
We're going to investigate supporting installing SELinux-enabled
targets from a SELinux-disabled host.  This environment
variable will allow bypassing the check.

xref https://github.com/ostreedev/ostree/pull/3151

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-31 17:26:54 -05:00
Colin Walters
807483fe45 install: Optionally use host mounted /var/lib/containers
I just keep hitting the host skopeo requirement in corner cases;
it's annoying because *otherwise* the container is self-sufficient.
Change our installation instructions to add a `/var/lib/containers`
bind mount.

For the time being of course we continue to support forking off
`skopeo` on the host.

One thing I still want to investigate is dropping some requirements
here and switch to *dynamically* setting up the mount points
inside the container as is mentioned in https://brauner.io/2023/02/28/mounting-into-mount-namespaces.html
but this currently requires relatively new host kernels.

As far as test coverage, this changes the Github Action that
uses ubuntu and needed to build a newer skopeo to stop doing
that, and in fact we explicitly *remove* skopeo to verify
it's not being used in the install process.

I didn't change the other install tests to verify they keep
working.

Closes: https://github.com/containers/bootc/issues/81
Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-26 15:26:05 -05:00
Colin Walters
e536c9f46d install: Add print-configuration
Even when an external process is creating the disk, we want
it to be able to honor the root filesystem type specified in the container.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-18 17:55:00 -05:00
Colin Walters
7c6b2826ee ci: Build latest skopeo for ubuntu
So that we can drop support for the hacky "copy to temporary OCI"
code.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-17 16:35:52 -05:00
Colin Walters
fddef2e28b labeler: Fix syntax
I broke it earlier.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-05 13:25:00 -05:00
Colin Walters
809e2d26ed ci: Add GH labeler workflow
Because it's useful to track sub-components.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-03 14:39:02 -05:00
John Eckersberg
b6ab090dc1 ci: gate clippy on correctness and suspicious
Per discussion on #236

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2023-12-19 11:35:34 -05:00
Colin Walters
20d2d6cdc1 Don't enforce container sigpolicy by default
Closes: https://github.com/containers/bootc/issues/218

Basically this effort has not been really successful and adds
more pain than it solves.  We need to have a solution that works
for podman too.

In many scenarios, TLS is sufficient - or at least, we're far
from the only thing that if fetched from a compromised server
would result in a compromised system (e.g. privileged containers).

Signed-off-by: Colin Walters <walters@verbum.org>
2023-12-18 16:40:30 -05:00
Colin Walters
b831efbe73 install: Rename install -> install to-disk, peer with to-filesystem
Take the current `install` verb and change it to be
`bootc install to-disk`, and then `install-to-filesystem` becomes
`bootc install to-filesystem` - they are obvious peers.

The main motivation here is that in the end many use cases will
want nontrivial filesystem customization, and while I like having
a fully opinionated builtin flow to write to a target disk,
we should really think of `to-filesystem` as a fully equal peer
of `to-disk`.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-12-15 14:30:04 -05:00
Colin Walters
02804630c1 ci: Add a c9s build
Prep for more testing there.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-12-13 18:49:20 -05:00
Colin Walters
8b55388fb3 ci: Update for another image rename
Signed-off-by: Colin Walters <walters@verbum.org>
2023-12-10 10:47:26 -05:00
Colin Walters
24c897256b tests/install: Switch to -dev base image
Because we'll be relying on newer bootupd bits.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-11-20 09:32:48 -05:00
Micah Abbott
939ab0d314 github: update artifact actions to v3
The upload/download-artifact v2  actions are throwing warnings about using
Node12. The v3 versions are updated to use Node16.

See: https://github.blog/changelog/2021-12-10-github-actions-github-hosted-runners-now-run-node-js-16-by-default/

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2023-11-10 17:24:25 -05:00
Colin Walters
13ca4e564c Update references to centos-boot images
There's a new image location now.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-11-06 15:58:54 -05:00
Colin Walters
bf9969724c ci: Test alongside installation in GH Actions
Having a fast disposable VM is good for this.  Also we are now
verifying that the baseline functionality works to install alongside
an Ubuntu system!

Signed-off-by: Colin Walters <walters@verbum.org>
2023-11-03 16:14:59 -04:00
Colin Walters
b349285675 ci: Drop MSRV, move clippy/fmt into tests
The MSRV is just too much churn to maintain, in practice
let's roll with what's in Fedora.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-08-29 16:38:46 -04:00
Colin Walters
09ce816087 Bump MSRV to 1.64
Because it's needed for more libraries.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-05-20 14:16:16 -04:00
Colin Walters
1c567ea368 ci: Switch to make test-bin-archive
Right now we only install a single binary, but in the future
that will change (e.g. systemd units, config files).

Signed-off-by: Colin Walters <walters@verbum.org>
2023-02-25 08:45:22 -05:00
Colin Walters
76939a7eec Merge pull request #45 from cgwalters/config-install
Add a default-enabled `install` feature
2023-01-27 17:53:45 -05:00
Colin Walters
956d94e5be Add a default-enabled install feature
The install code greatly increases the scope of this project.  Not
every OS/distribution will want it on by default; some may always
want to use their own install code.

Having a feature for this shows that while we're opinionated, we're
also flexible.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-27 17:25:23 -05:00
Colin Walters
5ba1f647de Merge pull request #44 from cgwalters/xtask-lint-dbg
ci: Move lints into xtask
2023-01-27 16:58:21 -05:00
Colin Walters
dd2010e0b2 ci: Move lints into xtask
Honestly just to reduce the code statistics; be nice to have
zero shell script in the repo 😃

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-27 16:36:58 -05:00
Colin Walters
90f601c3eb cli: More gracefully handle client commands in a container
I typed `bootc status` in a container and got an unhelpful error.
Print something more useful and add integration tests for this
scenario.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-27 14:00:04 -05:00
Colin Walters
a9325a4221 docs: Start adding some
Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-25 20:23:01 -05:00
Colin Walters
9e1fbd13cd Add an install command
Usage example with `/dev/vda` being an extra mounted disk:

```
$ podman run --privileged --pid=host --net=none quay.io/cgwalters/c9s-oscore:latest bootc install /dev/vda
```

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-22 14:19:59 -05:00
Colin Walters
b274b315c2 Add cargo xtask and packaging infrastructure
First, this adds `cargo xtask` following
https://github.com/matklad/cargo-xtask/

We use this to write "external glue scripts" in Rust, not bash.
Specifically we now have e.g. `cargo xtask vendor` which just
wraps running `cargo vendor-filterer`.

Then build on that and add `cargo xtask package-srpm` which generates
a `.src.rpm`.

And build on that by adding the requisite glue to have Fedora's COPR
be able to understand it, so that we can get auto-built and shipped
packages there.

This will make trying out bootc a bit easier.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-19 19:52:55 -05:00
Colin Walters
5ddd2e9615 Add an internal-tests run-privileged-integration
Add a feature to enable internal tests.  I originally started
by matching
6543c85558
but since here the binary is really end user facing and not just
a demo, we shouldn't enable the feature by default.

If in the future we split off the tiny CLI bit out of the workspace,
then we could auto-enable but that seems not worth it.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-09 17:46:28 -05:00
Colin Walters
96235751dd Enable cargo vendor-filterer
Add configuration and a GH action post-push which automatically
generates a vendor tar.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-07 11:25:30 -05:00
Colin Walters
3ab28788ce Initial code split from https://github.com/ostreedev/ostree-rs-ext/pull/412
Prep for potentially moving to github.com/containers/bootc
2022-11-30 15:14:04 -05:00