Skip to content

eBPF-based security platform

ci: Reuse LVH for kernel-obs build and publish steps

Michi Mutsuzaki7d4b9a16617d
diff --git a/.github/workflows/kernel-obs.yml b/.github/workflows/kernel-obs.yml
index 4794c99b..078043a7 100644
--- a/.github/workflows/kernel-obs.yml
+++ b/.github/workflows/kernel-obs.yml
@@ -65,7 +65,7 @@ jobs:
needs: filter
if: needs.filter.outputs.eligible == 'true'
runs-on: ubuntu-latest
- timeout-minutes: 15
+ timeout-minutes: 30
environment:
name: kernel-obs
permissions:
@@ -130,46 +130,6 @@ jobs:
printf '%s' "$KERNEL_OBS_CERT_DER_B64" | base64 --decode > "$keys_dir/cert.der"
chmod 0600 "$keys_dir/signing_key.pem" "$keys_dir/cert.der"
- - name: Build BPM package in LVH
- uses: cilium/little-vm-helper@f86d344aca812dda5aef167867a9a0a90ca6cca5 # v0.0.31
- with:
- test-name: shirudo-kernel-obs
- image: kind
- image-version: bpf-next-20260603.072225
- kernel-version: bpf-next-main
- host-mount: ${{ github.workspace }}
- images-folder-parent: ${{ github.workspace }}/../lvh
- install-dependencies: false
- ssh-port: 2222
- cpu: 4
- mem: 8G
- cmd: |
- set -eu
- cd /host
- apt-get update
- if ! DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Use-Pty=0 \
- install -y /host/upstream/shirudo-deb/shirudo-operator_*.deb; then
- /bin/sh /host/.github/scripts/kernel-obs-apt-diagnostics.sh
- exit 1
- fi
-
- keys_dir=/host/.ci/kernel-obs-keys
- version=\$(cat /host/build/kernel-obs-version)
- /usr/bin/shirudo bpm build /host/source-code/upatches/kernel-obs \
- --version "\$version" \
- --keys-dir "\$keys_dir" \
- --vmlinux /host/upstream/bpf-next-vmlinux-h/vmlinux.h
-
- test -s "/host/kernel-obs-\$version.bee"
- /usr/bin/shirudo bpm info "/host/kernel-obs-\$version.bee"
-
- - name: Upload BPM package
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
- with:
- name: kernel-obs-bpm
- path: kernel-obs-*.bee
- if-no-files-found: error
-
- name: Materialize registry credentials
env:
KERNEL_OBS_REGISTRY_USERNAME: ${{ github.actor }}
@@ -183,17 +143,17 @@ jobs:
printf '%s\n%s\n' "$KERNEL_OBS_REGISTRY_USERNAME" \
"$KERNEL_OBS_REGISTRY_TOKEN" > .ci/kernel-obs-registry-credentials
- - name: Publish BPM package
+ - name: Build and publish BPM package in LVH
uses: cilium/little-vm-helper@f86d344aca812dda5aef167867a9a0a90ca6cca5 # v0.0.31
with:
- test-name: shirudo-kernel-obs-publish
+ test-name: shirudo-kernel-obs
image: kind
image-version: bpf-next-20260603.072225
kernel-version: bpf-next-main
host-mount: ${{ github.workspace }}
images-folder-parent: ${{ github.workspace }}/../lvh
install-dependencies: false
- ssh-port: 2223
+ ssh-port: 2222
cpu: 4
mem: 8G
cmd: |
@@ -206,14 +166,22 @@ jobs:
exit 1
fi
+ keys_dir=/host/.ci/kernel-obs-keys
+ version=\$(cat /host/build/kernel-obs-version)
+ /usr/bin/shirudo bpm build /host/source-code/upatches/kernel-obs \
+ --version "\$version" \
+ --keys-dir "\$keys_dir" \
+ --vmlinux /host/upstream/bpf-next-vmlinux-h/vmlinux.h
+
+ package="/host/kernel-obs-\$version.bee"
+ test -s "\$package"
+ /usr/bin/shirudo bpm info "\$package"
+
install -d -m 0755 /etc/shirudo
printf '%s\n' 'tls.classical_hosts = ghcr.io' \
> /etc/shirudo/shirudo.conf
/usr/bin/shirudo config
- version=\$(cat /host/build/kernel-obs-version)
- package="/host/kernel-obs-\$version.bee"
- test -s "\$package"
{
IFS= read -r BPM_OCI_USERNAME
IFS= read -r BPM_OCI_PASSWORD
@@ -222,7 +190,15 @@ jobs:
/usr/bin/shirudo bpm push "\$package" \
oci://ghcr.io/shirudo-dev/kernel-obs \
- --keys-dir /host/.ci/kernel-obs-keys
+ --keys-dir "\$keys_dir"
+
+ - name: Upload BPM package
+ if: always()
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ with:
+ name: kernel-obs-bpm
+ path: kernel-obs-*.bee
+ if-no-files-found: ignore
- name: Remove credentials and signing key material
if: always()