Skip to content

eBPF-based security platform

ci: remove obsolete kernel-obs workflow

Tobias Klauser39923c519f60
diff --git a/.github/workflows/kernel-obs.yml b/.github/workflows/kernel-obs.yml
deleted file mode 100644
index 1a50ca45..00000000
--- a/.github/workflows/kernel-obs.yml
+++ /dev/null
@@ -1,200 +0,0 @@
-name: Build kernel-obs BPM package
-
-on:
- workflow_run:
- workflows: ["Build packages"]
- types: [completed]
-
-permissions:
- actions: read
- contents: read
-
-jobs:
- filter:
- if: >-
- github.event.workflow_run.conclusion == 'success' &&
- ((github.event.workflow_run.event == 'push' &&
- github.event.workflow_run.head_branch == 'main') ||
- (github.event.workflow_run.event == 'pull_request' &&
- github.event.workflow_run.head_repository.full_name ==
- github.repository))
- runs-on: ubuntu-latest
- timeout-minutes: 15
- outputs:
- eligible: ${{ steps.prepare.outputs.eligible }}
- source_sha: ${{ steps.prepare.outputs.source_sha }}
- version: ${{ steps.prepare.outputs.version }}
- steps:
- - name: Check out source revision
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- ref: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.pull_requests[0].head.sha || github.event.workflow_run.head_sha }}
- path: source-code
- persist-credentials: false
-
- - name: Select package revision and version
- id: prepare
- env:
- SOURCE_EVENT: ${{ github.event.workflow_run.event }}
- SOURCE_SHA: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.pull_requests[0].head.sha || github.event.workflow_run.head_sha }}
- # Run numbers restart when the upstream workflow file is renamed.
- RUN_ID: ${{ github.event.workflow_run.id }}
- run: |
- set -eu
-
- case "$SOURCE_EVENT" in
- push|pull_request)
- version="0.1.$RUN_ID"
- eligible=true
- ;;
- *)
- echo "unsupported source event: $SOURCE_EVENT" >&2
- exit 1
- ;;
- esac
-
- printf 'source_sha=%s\n' "$SOURCE_SHA" >> "$GITHUB_OUTPUT"
- printf 'version=%s\n' "$version" >> "$GITHUB_OUTPUT"
- printf 'eligible=%s\n' "$eligible" >> "$GITHUB_OUTPUT"
-
- build-and-publish:
- needs: filter
- if: needs.filter.outputs.eligible == 'true'
- runs-on: ubuntu-latest
- timeout-minutes: 30
- environment:
- name: kernel-obs
- permissions:
- actions: read
- contents: read
- packages: write
- steps:
- - name: Check out package source
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- ref: ${{ needs.filter.outputs.source_sha }}
- path: source-code
- persist-credentials: false
-
- - name: Download shirudo operator package
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
- with:
- name: shirudo-deb
- path: upstream/shirudo-deb
- repository: ${{ github.repository }}
- run-id: ${{ github.event.workflow_run.id }}
- github-token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Download bpf-next kernel header
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
- with:
- name: bpf-next-vmlinux-h
- path: upstream/bpf-next-vmlinux-h
- repository: ${{ github.repository }}
- run-id: ${{ github.event.workflow_run.id }}
- github-token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Write package version
- env:
- KERNEL_OBS_VERSION: ${{ needs.filter.outputs.version }}
- run: |
- set -eu
- test -n "$KERNEL_OBS_VERSION"
- mkdir -p build
- printf '%s\n' "$KERNEL_OBS_VERSION" > build/kernel-obs-version
-
- - name: Ensure QEMU is installed
- run: |
- set -eu
- if ! command -v qemu-system-x86_64 >/dev/null 2>&1; then
- sudo apt-get update
- sudo apt-get install -y --reinstall qemu-system-x86
- fi
- command -v qemu-system-x86_64
-
- - name: Materialize signing key
- env:
- KERNEL_OBS_SIGNING_KEY_PEM: ${{ secrets.KERNEL_OBS_SIGNING_KEY_PEM }}
- KERNEL_OBS_CERT_DER_B64: ${{ secrets.KERNEL_OBS_CERT_DER_B64 }}
- run: |
- set -eu
- keys_dir=.ci/kernel-obs-keys
- test -n "$KERNEL_OBS_SIGNING_KEY_PEM"
- test -n "$KERNEL_OBS_CERT_DER_B64"
- install -d -m 0700 "$keys_dir"
- printf '%s\n' "$KERNEL_OBS_SIGNING_KEY_PEM" > "$keys_dir/signing_key.pem"
- 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: Materialize registry credentials
- env:
- KERNEL_OBS_REGISTRY_USERNAME: ${{ github.actor }}
- KERNEL_OBS_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- set -eu
- test -n "$KERNEL_OBS_REGISTRY_USERNAME"
- test -n "$KERNEL_OBS_REGISTRY_TOKEN"
- install -d -m 0700 .ci
- umask 077
- printf '%s\n%s\n' "$KERNEL_OBS_REGISTRY_USERNAME" \
- "$KERNEL_OBS_REGISTRY_TOKEN" > .ci/kernel-obs-registry-credentials
-
- - name: Build and publish BPM package in LVH
- uses: ./.github/actions/lvh
- 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: ${{ runner.temp }}/lvh
- install-dependencies: false
- ssh-port: 2222
- cmd: |
- set -eu
- systemctl start host.mount
- 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
-
- 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
-
- {
- IFS= read -r BPM_OCI_USERNAME
- IFS= read -r BPM_OCI_PASSWORD
- } < /host/.ci/kernel-obs-registry-credentials
- export BPM_OCI_USERNAME BPM_OCI_PASSWORD
-
- /usr/bin/shirudo bpm push "\$package" \
- oci://ghcr.io/shirudo-dev/kernel-obs \
- --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()
- run: rm -rf .ci/kernel-obs-keys .ci/kernel-obs-registry-credentials