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

55 Commits

Author SHA1 Message Date
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
Joseph Marrero Corchado
51aef4d454 Merge pull request #35 from cgwalters/update-ostree-ext
Use version API from ostree-ext
2023-01-18 15:15:41 -05:00
Joseph Marrero Corchado
4876178473 Merge pull request #33 from cgwalters/install-prep
Small prep patches for `install`
2023-01-18 15:13:39 -05:00
Colin Walters
d3fdd62fba Use version API from ostree-ext
In preparation for https://github.com/ostreedev/ostree-rs-ext/pull/454

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-17 13:53:35 -05:00
Colin Walters
55f7d950a5 Add a reexec helper
Prep for the `install` path where we will use this in
more ways.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-13 09:34:39 -05:00
Colin Walters
f09bde5a3e cli: Add some error prefixing
On general principle.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-13 09:34:39 -05:00
Colin Walters
5864a15c07 status: Use if instead of .then(||)
It's equally clear and avoids clippy lint conflicts between different
Rust versions.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-13 09:34:39 -05:00
Joseph Marrero Corchado
71142b7523 Merge pull request #32 from cgwalters/add-internal-testing
Add an `internal-tests run-privileged-integration`
2023-01-12 10:59:52 -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
8c09af7d3d status: Don't error out if not booted
For now, just print out nothing.  This helps a future integration
testing scenario.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-09 17:46:28 -05:00
Colin Walters
522f8e6285 Merge pull request #29 from cgwalters/status
README.md: Add a status note
2022-12-20 10:07:19 -05:00
Colin Walters
004a8f3fd9 README.md: Add a status note
Also using this as a canary to test the new CI.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-20 09:25:12 -05:00
Joseph Marrero Corchado
705c490c3a Merge pull request #28 from cgwalters/ci-fix
ci/run-kola: Support pull secret for running in Prow
2022-12-19 11:22:18 -05:00
Colin Walters
6f4bfd5bf7 ci/run-kola: Support pull secret for running in Prow
This is needed to support fetching the image from the
registry.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-16 10:47:21 -05:00
Colin Walters
1698b3c9f3 Merge pull request #27 from cgwalters/use-pub-cli
cli: Use the new exported cli functions from ostree-ext
2022-12-11 13:09:56 -05:00
Colin Walters
d49d942857 cli: Use the new exported cli functions from ostree-ext
Reduces code duplication.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-10 13:55:25 -05:00
Joseph Marrero Corchado
f78fce1b1f Merge pull request #26 from cgwalters/detect-selinux
Update to ostree-ext 0.10.1, add SELinux verification
2022-12-07 18:22:46 -05:00
Colin Walters
80b6b66402 Update to ostree-ext 0.10.1, add SELinux verification
This uses the new ostree API to verify we're in a compatible
SELinux domain.  Otherwise, it's a really evil trap because
things *seem* to work fine but will just explode in the case
when trying to do a major policy update.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-07 17:39:33 -05:00
Joseph Marrero Corchado
fcfdc33423 Merge pull request #25 from cgwalters/enable-vendoring
Enable `cargo vendor-filterer`
2022-12-07 13:58:18 -05:00
Joseph Marrero Corchado
ce769db338 Merge pull request #23 from cgwalters/fix-invalid-ref
switch: Fix changing from an ostree remote
2022-12-07 12:56:17 -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
102022dc8a switch: Fix changing from an ostree remote
When we added logic to prune previous containers, we broke
switching from an ostree remote + ref.  We need to parse
the ref to handle the remote.

Closes: https://github.com/containers/bootc/issues/19
Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-07 09:54:37 -05:00
Joseph Marrero Corchado
685da52ac4 Merge pull request #18 from cgwalters/centralize-deploy
Clean up staging flow
2022-12-05 20:20:03 -05:00
Colin Walters
131a34522b Clean up staging flow
Add a helper `stage()` which takes all the data we need,
and use it in both the `upgrade` and `switch` paths.  This drops
out an "internal error" message and avoids the "utils" code growth.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-05 17:15:53 -05:00
Joseph Marrero Corchado
54decd5858 Merge pull request #17 from cgwalters/switch-new-origin
switch: Always create a new origin
2022-12-05 16:36:34 -05:00
Colin Walters
e749d84486 switch: Always create a new origin
This way we won't leak state like rpm-ostree packages
from a previous one.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-05 16:28:13 -05:00
Joseph Marrero Corchado
ee41755b6c Merge pull request #16 from cgwalters/bootc-kargs 2022-12-05 16:21:45 -05:00
Colin Walters
a94dc2b689 Use stage_tree_with_options
This is a bug in the ostree Rust bindings, it can't
express the difference between a zero-length array and an unset
array.

And if we provide a zero-length array, ostree will happily remove
all other kargs.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-05 16:06:47 -05:00
Colin Walters
7d1476c7ad ci: Two fixes 2022-12-04 11:51:10 -05:00
Colin Walters
7d86704923 ci: Fix Dockerfile.ci 2022-12-03 13:04:40 -05:00
Joseph Marrero Corchado
a584e4d8fa Merge pull request #15 from cgwalters/more-centralize-status
Also use DeploymentStatus for upgrade
2022-12-03 00:38:42 -05:00
Colin Walters
68392e756d Also use DeploymentStatus for upgrade
Add an API to gather our extra metadata from a single deployment, such
as the supported status.  Use it in the status path and the upgrade
path, instead of gathering the supported state separately.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-02 17:55:12 -05:00
Colin Walters
54b1716cbf Merge pull request #13 from cgwalters/centralize-info
status: Use both C struct and gathered info consistently
2022-12-02 17:35:16 -05:00
Colin Walters
e1a64bc767 status: Use both C struct and gathered info consistently
This reduces duplication between the JSON and `println!` paths.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-02 17:32:06 -05:00
Colin Walters
2ff8acc4eb Merge pull request #12 from cgwalters/error-on-other-stuff
Cleanly display/error if origin is rpm-ostree owned
2022-12-02 17:29:08 -05:00
Colin Walters
aff6450733 Cleanly display/error if origin is rpm-ostree owned
If one does any machine-local layering/overrides via rpm-ostree,
we really should error out if one does `bootc upgrade`; otherwise
we'll just lose their changes.

This is a bit of an ugly hack; what would be more elegant is
to add something like a clear `owner` flag into origin files, and
have rpm-ostree flip that on if it needs to take over.

But for now, let's do this to avoid more confusion.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-02 13:48:54 -05:00
Colin Walters
ab4495f916 Merge pull request #11 from cgwalters/prow-ci
Add initial CI infrastructure designed for Prow
2022-12-02 13:15:59 -05:00
Colin Walters
500ec3133b Merge pull request #6 from cgwalters/use-published-ostree-ext
Use published ostree-ext 0.10
2022-12-02 13:02:09 -05:00
Colin Walters
656ef9322d Add initial CI infrastructure designed for Prow
This test will

- build a container image derived from FCOS, injecting bootc-under-test
  into it
- Schedule a separate container derived from coreos-assembler
  which has a reference to that container injected via
  https://docs.ci.openshift.org/docs/architecture/ci-operator/#referring-to-images-in-tests
- Run the stable FCOS base image via kola (qemu), injecting the target oscontainer
- Execute a basic test that just verifies `status --json` today

However, in the future we can change the build system to generate
multiple container images, and test upgrades, rollbacks, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-02 11:07:37 -05:00
Colin Walters
5bfe2ce5e9 Merge pull request #9 from cgwalters/rpmostree-info
README.md: Add a decription of relationship with rpm-ostree
2022-12-01 15:30:24 -05:00
Colin Walters
1fea5ca96c README.md: Add a decription of relationship with rpm-ostree
Closes: https://github.com/containers/bootc/issues/8
Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-01 14:40:28 -05:00
Colin Walters
dd786ab011 Use published ostree-ext 0.10
I just pushed this out, should fix the `cargo deny` failures.

Signed-off-by: Colin Walters <walters@verbum.org>
2022-12-01 14:16:58 -05:00
Colin Walters
c10f53fe59 status: Serialize via Display
Now that we've got the fixes in the ostree-ext side.
2022-12-01 11:34:35 -05:00
Colin Walters
c3d22bc58b Directly use locked sysroot
Explicit `deref()` looks odd and we don't need it now.
2022-12-01 10:59:33 -05:00
Colin Walters
32277047f8 Split helpers into a utils module
Having a `utils` module shows that project has reached maturity.
2022-11-30 20:31:56 -05:00
Colin Walters
9a8efcf08c Link to rpmostree docs on containers 2022-11-30 20:03:58 -05:00
Colin Walters
458583272e Split status to a separate file
It's cleaner with the helper serialization structs and functions
etc.
2022-11-30 19:54:18 -05:00
Colin Walters
5d427226f0 Fix deprecation warning print sleep to be async
Randomly noticed this while working on something else.
2022-11-30 19:43:14 -05:00
Colin Walters
a0bb16fc77 Add some more comments
On general principle.
2022-11-30 19:38:30 -05:00
Colin Walters
22db9d34fb Only unshare for write invocations
Fixes the manpage generation which shouldn't do this.
2022-11-30 17:59:34 -05:00