From 44f2ad31190603135f4ac758273f26111ca6003c Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 17 Dec 2024 16:10:02 +0100 Subject: syz-cluster: initial code The basic code of a K8S-based cluster that: * Aggregates new LKML patch series. * Determines the kernel trees to apply them to. * Builds the basic and the patched kernel. * Displays the results on a web dashboard. This is a very rudimentary version with a lot of TODOs that provides a skeleton for further work. The project makes use of Argo workflows and Spanner DB. Bootstrap is used for the web interface. Overall structure: * syz-cluster/dashboard: a web dashboard listing patch series and their test results. * syz-cluster/series-tracker: polls Lore archives and submits the new patch series to the DB. * syz-cluster/controller: schedules workflows and provides API for them. * syz-cluster/kernel-disk: a cron job that keeps a kernel checkout up to date. * syz-cluster/workflow/*: workflow steps. For the DB structure see syz-cluster/pkg/db/migrations/*. --- syz-cluster/kernel-disk/cron.yaml | 45 ++++++++++++++++++++++++++++++ syz-cluster/kernel-disk/kustomization.yaml | 6 ++++ syz-cluster/kernel-disk/pvc.yaml | 14 ++++++++++ 3 files changed, 65 insertions(+) create mode 100644 syz-cluster/kernel-disk/cron.yaml create mode 100644 syz-cluster/kernel-disk/kustomization.yaml create mode 100644 syz-cluster/kernel-disk/pvc.yaml (limited to 'syz-cluster/kernel-disk') diff --git a/syz-cluster/kernel-disk/cron.yaml b/syz-cluster/kernel-disk/cron.yaml new file mode 100644 index 000000000..8249e9c77 --- /dev/null +++ b/syz-cluster/kernel-disk/cron.yaml @@ -0,0 +1,45 @@ +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +apiVersion: batch/v1 +kind: CronJob +metadata: + name: kernel-repo-update +spec: + schedule: "0 */6 * * *" # Update every 6 hours + jobTemplate: + spec: + template: + spec: + restartPolicy: Never + volumes: + - name: git-repo + persistentVolumeClaim: + claimName: base-kernel-repo-pv-claim + containers: + - name: git-updater-debug-job + image: alpine/git:latest + imagePullPolicy: IfNotPresent + volumeMounts: + - name: git-repo + mountPath: /repo.git + resources: + requests: + cpu: 4 + memory: 8G + limits: + cpu: 8 + memory: 16G + command: # TODO: request the trees via the controller's API. + - "/bin/sh" + - "-c" + - | + cd /repo.git + if [ ! -d "refs" ]; then + git init --bare + fi + if ! git config --get remote.torvalds.url > /dev/null; then + git remote add torvalds git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + fi + git fetch torvalds --tags + git tag -f torvalds-head torvalds/master diff --git a/syz-cluster/kernel-disk/kustomization.yaml b/syz-cluster/kernel-disk/kustomization.yaml new file mode 100644 index 000000000..aeff33f63 --- /dev/null +++ b/syz-cluster/kernel-disk/kustomization.yaml @@ -0,0 +1,6 @@ +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +resources: + - pvc.yaml + - cron.yaml diff --git a/syz-cluster/kernel-disk/pvc.yaml b/syz-cluster/kernel-disk/pvc.yaml new file mode 100644 index 000000000..1977e969b --- /dev/null +++ b/syz-cluster/kernel-disk/pvc.yaml @@ -0,0 +1,14 @@ +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: base-kernel-repo-pv-claim +spec: + storageClassName: standard + accessModes: + - ReadWriteMany + resources: + requests: + storage: 32Gi -- cgit mrf-deployment