1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-07 03:45:28 +01:00
Commit Graph

31 Commits

Author SHA1 Message Date
Colin Walters
112e36d759 install: Add a generic install finalize
Basically I want to get Anaconda to run this, then we
can perform arbitrary fixups on whatever it did
between the install and reboot without changing Anaconda's
code.

This also applies to user `%post` scripts for example;
maybe those break the bootloader entries in /boot;
we have the opportunity to catch such things here.

Or we may choose to start forcibly relabeling the target
`/etc`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-03-01 13:13:29 -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
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
acff8cc096 install: Drop need for -v /:/target
Build on our new logic for bind mounting from the host mountns
to also drop the need for the `-v /:/target` in the alongside
install code.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-02 18:11:52 -05:00
Colin Walters
99ef63508d Drop test references to /dev and /var/lib/containers mounts
Keep the bind mounts in the docs though for now because many
people will be using the current docs with older bootc.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-02 18:11:52 -05:00
Colin Walters
b32fdf564f Add support for --replace-mode=alongside for ostree target
Ironically our support for `--replace-mode=alongside` breaks
when we're targeting an already extant ostree host, because when
we first blow away the `/boot` directory, this means the ostree
stack loses its knowledge that we're in a booted deployment,
and will attempt to GC it...

8fa019bfa8
is a key part of the fix for that.

However, a notable improvement we can do here is to grow this
whole thing into a real "factory reset" mode, and this will
be a compelling answer to
https://github.com/coreos/fedora-coreos-tracker/issues/399

To implement this though we need to support configuring the
stateroot and not just hardcode `default`.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-11-18 03:37:32 +01:00
Platform Engineering Bot
31a751082b fix(deps): update all dependencies
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-10-05 11:25:16 +00:00
Colin Walters
97692bd1c2 Make lints stricter, apply crate wide
Add `dead_code = "deny"` to our default lints; we had
a compiler warning for this in main.

Fix the warning by moving the human readable test code into
`#[cfg(test)]`.

While we're here, move the other lib.rs lints into the crate;
enforcing docs for *everything* at first I thought might be heavy
handed but actually is fine as it only applies to things that
are `pub`, of which we don't actually have that much so it
mainly forced me to add some stub docs for the modules, which
is probably a good idea.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-09-18 13:10:49 -04:00
Platform Engineering Bot
e6a16e0238 fix(deps): update all dependencies
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-09-16 00:06:24 +00:00
Omer Tuchfeld
d17e471eaa install: Make stateroot configurable
This commit makes it so that the `bootc install` stateroot will be
configurable (it defaults to `default`). For now this is a hidden CLI
option until we decide whether we want to commit to this API.

In the future we also want to make the stateroot of `bootc switch` be
configurable (https://github.com/containers/bootc/pull/617) so that
users can install an image to a new stateroot while they already have an
existing stateroot

Also removed the constant `STATEROOT_DEFAULT`, we're now simply taking
it from the `ostree_ext` crate

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-09-07 10:43:31 +02:00
Omer Tuchfeld
16b194e141 cli: Add new state wipe-ostree subcommand
Solves #776

Right now the integration tests have some hacky code to clear out
`ostree` stateroots  (see `reset_root` function), it would be better if
they could rely on a bootc command to take care of that for them instead

This commit adds a new `state wipe-ostree` subcommand to the CLI that
removes all `ostree` deployments from the system using native ostree
bindings. This makes it easier to later rm -rf the stateroots and have a
clean slate for the next test.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-09-06 09:51:53 +02:00
Colin Walters
f8f434a864 build-sys: Add rustix to workspace deps
Just sharing more.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-08-15 14:46:55 -04:00
Colin Walters
c3bff5ee9f build-sys: Move a few dev-deps to workspace deps
Just to increase sharing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-08-15 14:46:55 -04:00
Colin Walters
0527ca9620 Initialize a containers-storage: owned by bootc, use for bound images
Closes: https://github.com/containers/bootc/issues/721

- Initialize a containers-storage: instance at install time
  (that defaults to empty)
- Open it at the same time we open the ostree repo/sysroot
- Change bound images to use this

We are *NOT* yet changing the base bootc image pull to use this.
That's an obvious next step (xref
https://github.com/containers/bootc/pull/215 ) but will come later.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-30 20:35:12 -04:00
Colin Walters
42412fa8db tests: Add generic post-install verification
Prep for more work.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-30 10:34:27 -04:00
John Eckersberg
f1e6abfb32 build: move needless_borrow lint allows to be global
A new instance of this snuck in under xtask, this will make sure it's
covered everywhere going forward.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2024-07-24 12:18:56 -04:00
Colin Walters
63bcf63868 build: Use workspace global lints
In relatively recent rust there's a nice way to globally
configure clippy lints for the whole workspace. We can
kill the `custom-lints` target because relatively
recently clippy has a lint for `todo!` and `dbg!` itself.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-17 13:48:12 -04:00
Colin Walters
c67b9acb2f build-sys: Switch to workspace dependencies
Prep for addding another crate, where I want to avoid
duplicating all the versions again.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-16 13:41:03 -04:00
Colin Walters
3c7a620bc7 install: Pick up kargs.d kernel arguments too
This was a rather important miss; we need to pick
up the kargs.d files when doing a `bootc install` too.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-27 21:05:11 -04:00
Xiaofeng Wang
a5630ca79d tmt: rename plan files: build.fmf to integration-build.fmf,
integration.fmf to integration-run.fmf

And rename tmt test from build-tmt.fmf to build-image.fmf

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-24 22:33:11 +08:00
Colin Walters
d020238f03 Merge pull request #613 from henrywang/tf_run
test: run tmt integration test on testing farm
2024-06-19 13:34:02 -04:00
Xiaofeng Wang
9a02584c0e test: install some build dependent packages with
dnf builddep bootc

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-19 23:08:32 +08:00
Xiaofeng Wang
f76ade8e74 test: run tmt integration test on testing farm
build.fmf: used to deploy testing farm runner and run
tmt integration on it
build-tmt.fmf: tmt test to work with discover.fmf which is
requited to make .git always present

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-19 15:03:20 +08:00
Colin Walters
0f649ac9ea tests-integration: Optimize rebuilds
- Pass `--timestamp` to podman build to squash timestamps in
  order to gain reproducibilty, working around https://github.com/containers/buildah/issues/5592
- Fix the xattr reading code to correctly skip trailing nils

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-18 17:44:29 -04:00
Colin Walters
36be46a9e3 tests-integration: Add basic local tmt flow
Part of https://github.com/containers/bootc/issues/543

I'm not totally happy with this, but it does demonstrate the basic
wiring flow of:

- `cargo xtask test-tmt`

That will do a container build, make a disk image from it,
and run a "hello world" tmt test.

A lot more to do here including wiring up our existing tests
into this, and deduplicating with the other integration tests.

A key aspect too will be exploring workflows that e.g. expose
a registry locally.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-17 10:37:18 -04:00
Colin Walters
2f6b7ec45e Merge pull request #606 from cgwalters/debug-kargs
install: Fix install config kargs + to-filesystem
2024-06-17 01:13:05 +02:00
Colin Walters
836cdd81bc install: Fix install config kargs + to-filesystem
I think this got broken in a refactoring; add
test coverage.  In general all the heavy
lifting should move out of `baseline.rs`; a
good way to do that is probably to take the
next step of making it its own crate that
doesn't depend on the bootc core logic perhaps.

Closes: https://github.com/containers/bootc/issues/570
Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-16 13:24:10 +00:00
John Eckersberg
27ef06d0df Clippy janitor cleanup
- Allow the needless_borrows in tests-integration
- Remove empty else block

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2024-06-13 11:35:26 -04:00
Colin Walters
0d9338071f ci: Fully test file labeling post-install
Now that we've started to label the last holdout in the `.ostree.cfs`
superblock, let's verify everything is properly labeled.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-04 14:45:59 -04:00
Colin Walters
9be6b5a0b0 tests: Drop internal-testing-api, move to tests-integration
Previous work started moving our tests into an external binary;
this is just cleaner because it can test things how a user
would test.  Also, we started using `libtest-mimic` to
have a "real" test scaffolding that e.g. allows selecting
individual tests to run, etc.

Complete the picture here by moving the remaining bits into
the tests-integration binary.  We now run the `tests-integration`
binary in two ways in e.g. Github Actions:

- It's compiled directly on the Ubuntu runner, and orchestrates
  things itself
- It's built in our default container image (Fedora) but as an external
  `/usr/bin/bootc-integration-tests` binary

Also while we're here, drop the kola tests.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-05-31 17:41:14 -04:00
Colin Walters
65136e03e5 Move install tests shell script into Rust
A few things going on here:

- Rewrite logic from shell script into Rust (using xshell, so
  it's still convenient to fork commands)
- Make the test logic take an externally-built container image
  instead of using a `-v bootc:/usr/bin/bootc` bind mount
- Build the container image using our stock hack/Containerfile
  in Github Actions instead of building for c9s in GHA
- This all hence starts to make the logic reusable outside
  of Github Actions too; the container build is a known standard thing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-05-19 17:58:17 -04:00