diff options
| author | Greg Steuck <gnezdo@google.com> | 2021-07-30 18:19:13 -0700 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-08-04 17:42:26 +0200 |
| commit | b97d64c9fd454c0e4be1a5ab22450d0aeb368d18 (patch) | |
| tree | 437c41236b1bfcf1f95edb84da03857b42a82614 /dashboard/config/openbsd | |
| parent | 6c236867ce33c0c16b102e02a08226d7eb9b2046 (diff) | |
config: create a new hierarchy containing with ci-openbsd
This also includes the script which recreates the OpenBSD images from
the snapshots.
Diffstat (limited to 'dashboard/config/openbsd')
| -rw-r--r-- | dashboard/config/openbsd/config.ci | 83 | ||||
| -rwxr-xr-x | dashboard/config/openbsd/recreate.sh | 73 |
2 files changed, 156 insertions, 0 deletions
diff --git a/dashboard/config/openbsd/config.ci b/dashboard/config/openbsd/config.ci new file mode 100644 index 000000000..e2ff61c11 --- /dev/null +++ b/dashboard/config/openbsd/config.ci @@ -0,0 +1,83 @@ +{ + "name": "ci-openbsd", + "http": ":8080", + "manager_port_start": 50010, + "dashboard_addr": "https://syzkaller.appspot.com", + "dashboard_client": "ci-openbsd-ci", + "hub_addr": "ci-hub.c.syzkaller.internal:50001", + "cover_upload_path": "gs://syzkaller/cover", + "syzkaller_repo": "https://github.com/google/syzkaller.git", + "managers": [ + { + "name": "main", + "dashboard_client": "ci-openbsd", + "repo": "https://github.com/openbsd/src.git", + "repo_alias": "openbsd", + "userspace": "/syzkaller/userspace", + "kernel_config": "/syzkaller/config/openbsd/sp", + "jobs": { + "poll_commits": true, + "test_patches": true + }, + "manager_config": { + "target": "openbsd/amd64", + "cover": true, + "reproduce": false, + "procs": 2, + "type": "gce", + "vm": { + "count": 10, + "machine_type": "e2-small", + "gcs_path": "syzkaller/disks" + } + } + }, + { + "name": "multicore", + "dashboard_client": "ci-openbsd", + "repo": "https://github.com/openbsd/src.git", + "repo_alias": "multicore", + "userspace": "/syzkaller/userspace-multicore", + "kernel_config": "/syzkaller/config/openbsd/mp", + "jobs": { + "test_patches": true + }, + "manager_config": { + "target": "openbsd/amd64", + "cover": true, + "reproduce": false, + "procs": 2, + "type": "gce", + "vm": { + "count": 10, + "machine_type": "e2-highcpu-2", + "gcs_path": "syzkaller/disks" + } + } + }, + { + "name": "setuid", + "dashboard_client": "ci-openbsd", + "repo": "https://github.com/openbsd/src.git", + "repo_alias": "multicore", + "userspace": "/syzkaller/userspace", + "kernel_config": "/syzkaller/config/openbsd/mp", + "jobs": { + "test_patches": true + }, + "manager_config": { + "target": "openbsd/amd64", + "sandbox": "setuid", + "cover": true, + "reproduce": false, + "procs": 2, + "type": "gce", + "vm": { + "count": 10, + "machine_type": "e2-highcpu-2", + "gcs_path": "syzkaller/disks" + } + } + } + ] +} diff --git a/dashboard/config/openbsd/recreate.sh b/dashboard/config/openbsd/recreate.sh new file mode 100755 index 000000000..efbbbabe2 --- /dev/null +++ b/dashboard/config/openbsd/recreate.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +# Copyright 2021 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. + +# Rebuilds ci-openbsd in syzkaller project. Helpfully munges the +# .ssh/known_hosts file since the new image has a fresh key. +# +# DROPS files in the current directory, so best used from a subdir of /tmp. +# +# The user is expected to have the private key matching +# the public keys baked into create-openbsd* scripts and a +# section in their .ssh/config similar to this: +# Host ci-openbsd +# Hostname ci-openbsd # if running on a project VM or the external IP +# User syzkaller +# IdentityFile ~/.ssh/id_syzkaller + +set -eux + +TODAY=jul30 + +SYZ_DIR="$(cd "$(dirname "${0}")"/../../..; pwd -P)" +[[ -d "${SYZ_DIR}/tools" ]] || { echo "Requires syzkaller dir $SYZ_DIR" ; exit 1; } + +ZONE=us-central1-c +INSTANCE=ci-openbsd +IP=$(gcloud compute instances describe "${INSTANCE}" --zone="${ZONE}" --project=syzkaller '--format=text(networkInterfaces[].accessConfigs[].natIP)' | cut -f2 -d' ') +SERVICE_ACCOUNT=$(gcloud compute instances describe "${INSTANCE}" --zone="${ZONE}" --project=syzkaller '--format=text(serviceAccounts[].email)' | cut -d' ' -f2) +IMAGE="${INSTANCE}"-"${TODAY}"-root + +"${SYZ_DIR}"/tools/create-openbsd-gce-ci.sh + +gsutil -u syzkaller cp -a public-read openbsd-amd64-snapshot-gce.tar.gz gs://syzkaller/openbsd-amd64-"${TODAY}"-gce.tar.gz + +ssh root@"${INSTANCE}" halt -p || true + +yes | gcloud compute --project=syzkaller images delete "${IMAGE}" || true +gcloud compute --project=syzkaller images create "${IMAGE}" --source-uri gs://syzkaller/"openbsd-amd64-${TODAY}-gce.tar.gz" + +yes | gcloud compute --project=syzkaller instances delete "${INSTANCE}" \ + --zone="${ZONE}" +gcloud compute --project=syzkaller \ + instances create "${INSTANCE}" \ + --address="${IP}" \ + --private-network-ip "${INSTANCE}"-internal \ + --boot-disk-device-name="${INSTANCE}" \ + --boot-disk-size=10GB \ + --boot-disk-type=pd-ssd \ + --disk=name="${INSTANCE}"-syzkaller,device-name="${INSTANCE}"-syzkaller,mode=rw,boot=no \ + --image-project=syzkaller \ + --image="${IMAGE}" \ + --machine-type=custom-12-65536 \ + --maintenance-policy=MIGRATE \ + --metadata=serial-port-enable=1 \ + --network-tier=PREMIUM \ + --scopes=https://www.googleapis.com/auth/cloud-platform \ + --service-account="${SERVICE_ACCOUNT}" \ + --subnet=default \ + --zone="${ZONE}" + +(grep -v "^$IP" ~/.ssh/known_hosts && echo "${IP}" "$(grep ssh-ed25519 install_log)") > ~/.ssh/known_hosts.new +mv ~/.ssh/known_hosts{.new,} + +"${SYZ_DIR}"/tools/create-openbsd-vmm-worker.sh + +ssh syzkaller@"${INSTANCE}" mkdir -p /syzkaller/userspace +ssh syzkaller@"${INSTANCE}" ln -sf /syzkaller/{gopath/src/github.com/google/syzkaller/dashboard/,}config +scp "${SYZ_DIR}"/config/ci-openbsd/config.ci "${INSTANCE}":/syzkaller/config-openbsd.ci +scp worker_key syzkaller@"${INSTANCE}":/syzkaller/userspace/key +scp -C worker_disk.raw syzkaller@"${INSTANCE}":/syzkaller/userspace/image +ssh syzkaller@"${INSTANCE}" 'D=/syzkaller/userspace-multicore && mkdir -p $D && ln -sf ../userspace/{image,key} $D && ln -sf ../config/overlays/ci-openbsd-multicore $D/overlay' +ssh root@"${INSTANCE}" reboot |
