Skip to content

Commit d1e8f87

Browse files
authored
Merge pull request #608 from cgwalters/integration-bootc
ci: Add a workflow which does an install via bootc
2 parents 021b9db + 3adff83 commit d1e8f87

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.github/workflows/ci.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
permissions:
4+
actions: read
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
workflow_dispatch: {}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
c9s-bootc-e2e:
22+
runs-on: ubuntu-latest
23+
steps:
24+
# We use docker to build because it updates to the latest, whereas right now ubuntu-latest
25+
# has podman and buildah from ~2021 (insane!)
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
- uses: actions/checkout@v3
29+
- name: Cache Dependencies
30+
uses: Swatinem/rust-cache@v2
31+
with:
32+
key: "build-c9s"
33+
- name: Build and export to Docker
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
file: ci/Containerfile.c9s
38+
load: true
39+
tags: localhost/bootupd:latest
40+
- name: Copy to podman
41+
run: sudo skopeo copy docker-daemon:localhost/bootupd:latest containers-storage:localhost/bootupd:latest
42+
- name: bootc install
43+
run: |
44+
set -xeuo pipefail
45+
sudo podman run --rm -ti --privileged -v /:/target --pid=host --security-opt label=disable \
46+
-v /var/lib/containers:/var/lib/containers \
47+
localhost/bootupd:latest bootc install to-filesystem --skip-fetch-check \
48+
--disable-selinux --replace=alongside /target

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ install: install-units
4848
install-grub-static:
4949
install -m 644 -D -t ${DESTDIR}$(PREFIX)/lib/bootupd/grub2-static src/grub2/*.cfg
5050
install -m 755 -d ${DESTDIR}$(PREFIX)/lib/bootupd/grub2-static/configs.d
51+
52+
bin-archive:
53+
rm target/inst -rf
54+
$(MAKE) install install-grub-static DESTDIR=$$(pwd)/target/inst
55+
tar -C target/inst -c --zstd -f target/bootupd.tar.zst .

ci/Containerfile.c9s

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This container build is just a demo effectively; it shows how one might
2+
# build bootc in a container flow, using Fedora ELN as the target.
3+
FROM quay.io/centos/centos:stream9 as build
4+
RUN dnf -y install dnf-utils zstd && dnf builddep -y rust-bootupd
5+
COPY . /build
6+
WORKDIR /build
7+
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
8+
# We aren't using the full recommendations there, just the simple bits.
9+
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make && make bin-archive && mkdir -p /out && cp target/bootupd.tar.zst /out
10+
11+
FROM quay.io/centos-bootc/centos-bootc-dev:stream9
12+
COPY --from=build /out/bootupd.tar.zst /tmp
13+
RUN tar -C / --zstd -xvf /tmp/bootupd.tar.zst && rm -vf /tmp/*

0 commit comments

Comments
 (0)