ci: Sync prow config with rpm-ostree, enable composefs there
authorColin Walters <walters@verbum.org>
Mon, 19 Jun 2023 23:07:01 +0000 (19:07 -0400)
committerColin Walters <walters@verbum.org>
Mon, 19 Jun 2023 23:07:01 +0000 (19:07 -0400)
I want to gain testing over the composefs path; but without
yet changing the main Jenkins build.  Because we have duplicate/overlapping
CI systems, we can take advantage of this by testing the composefs
flow via Prow.

Sync the Prow build scripts with what's in coreos/rpm-ostree
right now.

Then let's test the composefs flow a bit more e2e there.

ci/prow/Dockerfile
ci/prow/fcos-e2e.sh [new file with mode: 0644]

index b1f83c019095229b686a8087c5717f54d5e3a208..156db34dfb13f3d99f08f8ee61def0ede9c8d28e 100644 (file)
@@ -1,4 +1,21 @@
-FROM registry.fedoraproject.org/fedora:30
+FROM registry.ci.openshift.org/coreos/fcos-buildroot:testing-devel as builder
 WORKDIR /src
 COPY . .
-RUN ./ci/build.sh
+RUN env CONFIGOPTS=--with-composefs ./ci/build.sh && make install DESTDIR=/cosa/component-install
+RUN make -C tests/kolainst install DESTDIR=/cosa/component-tests
+# Uncomment this to fake a build to test the code below
+#RUN mkdir -p /cosa/component-install/usr/bin && echo foo > /cosa/component-install/usr/bin/foo
+
+FROM registry.ci.openshift.org/coreos/coreos-assembler:latest
+WORKDIR /srv
+USER root
+# Copy binaries from the build
+COPY --from=builder /cosa /cosa
+# Merge them to the real root since we're used at compose time
+RUN rsync -rlv /cosa/component-install/ /
+# Merge installed tests
+RUN rsync -rlv /cosa/component-tests/ /
+# Grab all of our ci scripts
+COPY --from=builder /src/ci/ /ci/
+RUN ln -sr /ci/prow/fcos-e2e.sh /usr/bin/fcos-e2e
+USER builder
diff --git a/ci/prow/fcos-e2e.sh b/ci/prow/fcos-e2e.sh
new file mode 100644 (file)
index 0000000..9d42dcc
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -xeuo pipefail
+
+# Prow jobs don't support adding emptydir today
+export COSA_SKIP_OVERLAY=1
+# And suppress depcheck since we didn't install via RPM
+export COSA_SUPPRESS_DEPCHECK=1
+ostree --version
+cd $(mktemp -d)
+cosa init https://github.com/coreos/fedora-coreos-config/
+rsync -rlv /cosa/component-install/ overrides/rootfs/
+cosa fetch
+cosa build
+# For now, Prow just runs the composefs tests, since Jenkins covers the others
+cosa kola run 'ext.ostree.destructive-rs.composefs*'