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

33 Commits

Author SHA1 Message Date
ckyrouac
44ce2cf2c2 install: Deprecate skip-fetch-check, replace with run-fetch-check
This deprecates skip-fetch-check in favor of the inverse,
run-fetch-check. Updates docs and tests to reflect the change.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-08 14:51:58 -04:00
Xiaofeng Wang
ffa709f222 test: drop nested virt required on integration test
Use TF runner as test machine and run all test on TF runner itself

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-04-04 01:13:21 +08:00
Colin Walters
8ca5e49f0c hack: Add missing sysusers.d entry for sudo
TODO add this to the base image

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05:00
Colin Walters
eb55216f7d provision: Fast track some tmpfiles.d additions
I put these in https://gitlab.com/fedora/bootc/base-images/-/merge_requests/92
too but let's fast track them to our images here so
we unblock testing tmpfiles.d translation.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:38 -05:00
Colin Walters
9363b23fc6 provision: Clean even more rpm stuff
In some cases we have /var/lib/rhsm too... *cry*

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -05:00
Colin Walters
293e9e2e5a hack: Use lint --fatal-warnings
Because if failures somehow creep in we really want to know.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -05:00
Colin Walters
3461ddee70 provision-derived: Clean lots more stuff
Yeah, we're going to need a `dnf clean all --everything`...

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 08:55:20 -05:00
Colin Walters
cb99cf5c95 ci: Bump Fedora to 41
For newer ostree

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 12:37:38 -05:00
Colin Walters
292d9e165c build: Handle dnf5 in Fedora
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
8990b54244 build.sh: Use our embedded spec
One CI run just got a server error fetching the spec from Fedora.
We have a spec here (which I don't like but we do) so use it
to lower CI flakes.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-17 09:55:22 -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
32612035d5 tests: Drop more bind mount instances
These should be unnecessary.

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
Chris Kyrouac
140eeacb17 tmt: Add new tmt scripts path to $PATH
Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-10-31 14:44:36 -04:00
Chris Kyrouac
e1ea6f1fed tmt: Add webserver to provision-derived
Our custom tmt image needs to start the web server on port 10022 that
tmt expects.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-10-30 14:30:46 -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
Colin Walters
27d955c44e hack: Remove everything in /tmp
Somehow, something else is leaking into `/tmp` at least in the
GHA runs...remove it all.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-27 19:57:24 -04:00
Colin Walters
969d032bfc Merge pull request #626 from cgwalters/tests-bind-dev
tree: Add missing -v /dev:/dev in a few places
2024-06-24 20:22:17 -04:00
Colin Walters
9a758e3a14 tests: Add pytest and nushell based tests
I've been trying to keep this project in "one" programming
language by writing even tests in Rust...but specifically
for our integration tests it's pretty painful not just to
compile them but have to deal with baking them into the base image.

The tmt framework is very GHA like in that it scrapes the
git source tree and copies it into the target environment, which
works really well with scripts.

Now, if you know me you know I am not a fan of dynamic programming
languages like bash and Python. I'm one of those folks that actually
tries to use Rust for things that feel like "scripts" i.e. they're
*mostly* about forking external processes (see the xtask/
crate which uses "xshell").

Some of our testing code is in Rust too. However...there's a giant
tension here because:

- Iteration speed is very important for tests and scripts
- The artifact being an architecture-dependent binary pushes us
  to inject it into container images; having the binary part
  of the bootc image under test conceptually forces us to reprovision
  for each test change, which is super expensive

Most other people when faced with the testing challenge would
just write shell scripts (or Python); that's definitely what tmt
expects people to do.

The podman project has a mix of a "bats" suite which is all
bash based, and a Go-based framework.

The thing is: bash is easy to mess up and has very little ability
to do static analysis. Go (and Python) are very verbose for forking external
processes.

I've been using https://www.nushell.sh/ for my interactive shell
for quite a while; I know just enough to get by day to day
(but honestly sometimes I still type "bash" and run a few things there
 that I know how to express in bash but not nu)

Anyways though, nushell has a lot of desirable properties for
tests (which are basically scripts):

- Architecture independent
- Running an external process requires zero ceremony; it's the
  default!
- But it *is* easy to e.g. scrape JSON from an external binary
  into a rich data structure
- A decently rich standard library

The downside is, it's a new language. And in the end, I'm
not going to say it's the only way to write tests...maybe we
do end up with some more bash. It wouldn't be the end of the world.
But...after playing with this, I definitely like the result.

OK, and after some debate we decided to add Python too, so this
demos a pytest test.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-24 13:46:13 -04:00
Colin Walters
527151969a tree: Add missing -v /dev:/dev in a few places
We're really going to need to switch over to having the container
do dynamic mounts; cc https://github.com/containers/bootc/issues/380#issuecomment-1983721453

Just noticed this missing in one place, and found others with
a grep.

Right now we do operate without, but it can be racier.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-22 09:21:25 -04: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
Colin Walters
b97359f48e build: Install git too
This must be a regression from the timestamp change:
91ed63caf1

Without this we fail to parse the timestamp and get errors;
maybe something else changed.

Of course, we should use a non-Makefile language for
this so we get proper error checking.  I may move some
of the makefile bits into xtask.rs or so.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-12 14:35:44 +00:00
Xiaofeng Wang
08ad8121f5 Merge pull request #590 from cgwalters/hack-tmt
hack: Add support for installing cloud-init+rsync
2024-06-12 13:24:47 +08:00
Chris Kyrouac
7ec44f6a0b hack: Add remote lldb utilities to hack dir
This is useful for remote debugging bootc running in a VM.

Until podman-bootc has support for forwarding arbitrary ports,
this custom solution is needed.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-06-11 10:21:59 -04:00
Colin Walters
8657ce5392 hack: Add support for installing cloud-init+rsync
These are things that https://tmt.readthedocs.io/en/stable/
wants, and the goal is to support running under tmt more
directly.

Part of https://github.com/containers/bootc/issues/543

With this I can run:

```
provision:
  how: virtual
  image: /home/walters/src/github/containers/bootc/target/testbootc-cloud.qcow2
summary: Basic smoke test
execute:
    how: tmt
    script: bootc status
```

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-09 16:05:32 -04:00
Colin Walters
0455f808b1 build: Fetch latest spec from Fedora
To get `zstd-devel`.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-04 14:19:44 -04:00
Steven Presti
858acbe5dd cli: add container lint
Add an entrypoint that basically everyone can start
adding to their builds which performs some basic
static analysis for known problems.

Closes : #216

Co-authored-by: Joseph Marrero <jmarrero@redhat.com>
Co-authored-by: Huijing Hei <hhei@redhat.com>
Co-authored-by: Yasmin de Souza <ydesouza@redhat.com>

Signed-off-by: Steven Presti <spresti@redhat.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2024-05-30 19:52:46 -04:00
Colin Walters
c69e132004 Merge pull request #548 from cgwalters/test-improvements
Move install tests shell script into Rust
2024-05-20 15:20:56 -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
Colin Walters
3fcfed0117 hack: Also support --build-arg=base=<fedora>
Let's make it also easy to build using fedora.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-05-17 16:40:17 -04:00
Colin Walters
ebeb643b62 ci: Target c9s in more places
There's some instability in eln right now, but more importantly
I think our baseline target should be c9s because that acts
as the real lower bound for what we want to support.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-15 11:00:47 -05:00
Colin Walters
5510052111 hack: Allow injecting stuff into target/dev-rootfs
Specifically, I want to hack on both e.g. ostree and bootc
at the same time.  With this, I can do (from ostree):

```bash
$ make install DESTDIR=/path/to/bootc/target/dev-rootfs
```

Then from this repo, running a container build will get me both.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-09 18:32:41 -05:00
Colin Walters
7ba823a162 hack/Containerfile: New file for local container builds
This is a relatively efficient container-oriented build flow
suitable for local iteration.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-12 16:52:30 -05:00