Skip to content

Commit

Permalink
fuzzer: introduce fuzzer runner (#28)
Browse files Browse the repository at this point in the history
The fuzzer runs as a separate service on NayDuck worker machines and
run fuzzing tests while the worker is idle.  When worker starts
executing a test it signals this to the fuzzer which then stops and
waits for the worker to finish.

The comments around the top of the file are there mostly to help
toggle between ‘run on GCP’ and ‘run on local machine’.

The API this exposes is:
- on port 7055, an HTTP server that can in particular pause/resume
  fuzzing upon hitting `/pause` and `/resume`;
- on port 5507, Prometheus metrics; and
- when a new artefact is found (~= a new crash is found), the
  `fuzz_artifacts_found` metric gets bumped by 1
  • Loading branch information
Ekleog authored May 13, 2022
1 parent 565392b commit b9b5d14
Show file tree
Hide file tree
Showing 12 changed files with 1,025 additions and 11 deletions.
17 changes: 10 additions & 7 deletions automation/setup-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ else
fi
fi

service=$type
if [ "$type" = frontend ]; then
service=ui
fi
cp -nvt /etc/systemd/system/ -- \
"/home/nayduck/nayduck/systemd/nayduck-$service.service"
systemctl enable "nayduck-$service"
case $type in
frontend) services=ui ;;
worker) services='worker fuzzer' ;;
*) services=$type
esac
for service in $services; do
cp -nvt /etc/systemd/system/ -- \
"/home/nayduck/nayduck/systemd/nayduck-$service.service"
systemctl enable "nayduck-$service"
done

rm -- "$basedir/setup-host.sh"

Expand Down
2 changes: 1 addition & 1 deletion automation/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if $only_frontend; then
exit 0
fi

for service in nayduck-ui nayduck-builder nayduck-worker; do
for service in nayduck-ui nayduck-builder nayduck-worker nayduck-fuzzer; do
if has_service "$service"; then
sudo systemctl restart "$service"
fi
Expand Down
1 change: 1 addition & 0 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parallel 'sh -xc {}' ::: \
'exec pylint -j0 */*.py' \
'exec python -m yapf -pir .' \
'exec mypy -m backend.backend' \
'exec mypy -m fuzzers.main' \
'exec mypy -m workers.builder' \
'exec mypy -m workers.worker' \
'exec shellcheck */*.sh'
Expand Down
Empty file added fuzzers/__init__.py
Empty file.
Loading

0 comments on commit b9b5d14

Please sign in to comment.