Skip to content

Commit e2de1bb

Browse files
committed
Switch to a subprocess-based separation for fuzzer-runner
1 parent b594cc5 commit e2de1bb

File tree

33 files changed

+424
-1215
lines changed

33 files changed

+424
-1215
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
**/.pdm-python
1818
**/pdm.lock
1919
fuzzer/Dockerfile
20-
fuzzer_runner/Dockerfile
2120
orchestrator/Dockerfile
2221
patcher/Dockerfile
2322
seed-gen/Dockerfile

.github/workflows/docker.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
dockerfile: ./orchestrator/Dockerfile
3434
- component: fuzzer
3535
dockerfile: ./fuzzer/Dockerfile
36-
- component: fuzzer_runner
37-
dockerfile: ./fuzzer_runner/Dockerfile
3836
- component: patcher
3937
dockerfile: ./patcher/Dockerfile
4038
- component: seed-gen

common/src/buttercup/common/types.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,3 @@ class FuzzConfiguration:
77
target_path: str
88
engine: str
99
sanitizer: str
10-
11-
12-
@dataclass
13-
class BuildConfiguration:
14-
project_id: str
15-
engine: str
16-
sanitizer: str
17-
source_path: str | None
18-
19-
20-
FUZZER_RUNNER_HEALTH_ENDPOINT = "/health"
21-
FUZZER_RUNNER_FUZZ_ENDPOINT = "/fuzz"
22-
FUZZER_RUNNER_MERGE_CORPUS_ENDPOINT = "/merge-corpus"
23-
FUZZER_RUNNER_TASKS_ENDPOINT = "/tasks"
24-
FUZZER_RUNNER_TASK_ENDPOINT = "/tasks/{task_id}"

common/src/buttercup/common/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def copyanything(src: PathLike, dst: PathLike, **kwargs: Any) -> None:
2525
"""
2626
src, dst = Path(src), Path(dst)
2727
try:
28-
shutil.copytree(src, dst, dirs_exist_ok=True, **kwargs)
28+
shutil.copytree(src, dst, dirs_exist_ok=True, ignore_dangling_symlinks=True, **kwargs)
29+
except shutil.Error:
30+
logger.exception(f"Some errors occurred while copying {src} to {dst}, continuing anyway...")
2931
except OSError as exc: # python >2.5
3032
if exc.errno in (errno.ENOTDIR, errno.EINVAL):
3133
shutil.copy(src, dst)

deployment/crs-architecture.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ up() {
128128
fi
129129

130130
if [ -n "$FUZZER_BASE_IMAGE" ]; then
131-
FUZZER_RUNNER_BUILD_ARGS="--build-arg BASE_IMAGE=$FUZZER_BASE_IMAGE"
131+
FUZZER_BUILD_ARGS="--build-arg BASE_IMAGE=$FUZZER_BASE_IMAGE"
132132
else
133-
FUZZER_RUNNER_BUILD_ARGS=""
133+
FUZZER_BUILD_ARGS=""
134134
fi
135135

136136
docker build $ORCHESTRATOR_BUILD_ARGS -f "$SCRIPT_DIR"/../orchestrator/Dockerfile -t localhost/orchestrator:latest "$SCRIPT_DIR"/..
137137
docker build $FUZZER_BUILD_ARGS -f "$SCRIPT_DIR"/../fuzzer/Dockerfile -t localhost/fuzzer:latest "$SCRIPT_DIR"/..
138-
docker build $FUZZER_RUNNER_BUILD_ARGS -f "$SCRIPT_DIR"/../fuzzer_runner/Dockerfile -t localhost/fuzzer-runner:latest "$SCRIPT_DIR"/..
139138
docker build $SEED_GEN_BUILD_ARGS -f "$SCRIPT_DIR"/../seed-gen/Dockerfile -t localhost/seed-gen:latest "$SCRIPT_DIR"/..
140139
docker build $PATCHER_BUILD_ARGS -f "$SCRIPT_DIR"/../patcher/Dockerfile -t localhost/patcher:latest "$SCRIPT_DIR"/..
141140
docker build $PROGRAM_MODEL_BUILD_ARGS -f "$SCRIPT_DIR"/../program-model/Dockerfile -t localhost/program-model:latest "$SCRIPT_DIR"/..

deployment/k8s/charts/fuzzer-bot/templates/deployment.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,12 @@ spec:
3535
{{- include "buttercup.env.nodeData" . | nindent 8 }}
3636
{{- include "buttercup.fuzzerBotEnv" . | nindent 8 }}
3737
{{- include "buttercup.env.telemetry" . | nindent 8 }}
38-
resources:
39-
{{- toYaml .Values.fuzzerBot.resources | nindent 10 }}
40-
volumeMounts:
41-
{{- include "buttercup.standardVolumeMounts" (dict "usesTasksStorage" false) | nindent 8 }}
42-
{{- include "buttercup.nodeLocalVolumeMount" . | nindent 8 }}
43-
{{- if .Values.fuzzerRunner.enabled }}
44-
- name: fuzzer-runner
45-
image: "{{ .Values.global.fuzzerRunnerImage.repository }}:{{ .Values.global.fuzzerRunnerImage.tag }}"
46-
imagePullPolicy: {{ .Values.global.fuzzerRunnerImage.pullPolicy }}
47-
command: ["buttercup-fuzzer-server"]
48-
ports:
49-
- containerPort: {{ .Values.fuzzerRunner.port }}
50-
name: runner-http
51-
env:
52-
{{- include "buttercup.fuzzerRunnerEnv" . | nindent 8 }}
53-
{{- include "buttercup.commonEnv" . | nindent 8 }}
54-
{{- include "buttercup.env.nodeData" . | nindent 8 }}
5538
resources:
5639
{{- toYaml .Values.resources | nindent 10 }}
5740
volumeMounts:
5841
{{- include "buttercup.standardVolumeMounts" (dict "usesTasksStorage" false) | nindent 8 }}
5942
{{- include "buttercup.nodeLocalVolumeMount" . | nindent 8 }}
60-
{{- end }}
6143
volumes:
6244
{{- include "buttercup.volumes.scratch" . | nindent 6 }}
6345
{{- include "buttercup.nodeLocalVolume" . | nindent 6 }}
64-
{{- end }}
46+
{{- end }}

deployment/k8s/charts/fuzzer-bot/values.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,3 @@ healthCheck:
2525
timeoutSeconds: 10
2626
# Allow 2 failures before restarting
2727
failureThreshold: 2
28-
29-
# Fuzzer runner side container configuration
30-
fuzzerRunner:
31-
enabled: true
32-
port: 8000
33-
34-
fuzzerBot:
35-
resources:
36-
limits:
37-
cpu: 1000m
38-
memory: 1Gi
39-
requests:
40-
cpu: 250m
41-
memory: 256Mi

deployment/k8s/charts/merger-bot/templates/daemonset.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,11 @@ spec:
2525
env:
2626
{{- include "buttercup.env.nodeData" . | nindent 8 }}
2727
{{- include "buttercup.env.telemetry" . | nindent 8 }}
28-
resources:
29-
{{- toYaml .Values.mergerBot.resources | nindent 10 }}
30-
volumeMounts:
31-
{{- include "buttercup.standardVolumeMounts" (dict "usesTasksStorage" false) | nindent 8 }}
32-
{{- include "buttercup.nodeLocalVolumeMount" . | nindent 8 }}
33-
{{- if .Values.fuzzerRunner.enabled }}
34-
- name: fuzzer-runner
35-
image: "{{ .Values.global.fuzzerRunnerImage.repository }}:{{ .Values.global.fuzzerRunnerImage.tag }}"
36-
imagePullPolicy: {{ .Values.global.fuzzerRunnerImage.pullPolicy }}
37-
command: ["buttercup-fuzzer-server"]
38-
ports:
39-
- containerPort: {{ .Values.fuzzerRunner.port }}
40-
name: runner-http
41-
env:
42-
{{- include "buttercup.fuzzerRunnerEnv" . | nindent 8 }}
43-
{{- include "buttercup.commonEnv" . | nindent 8 }}
44-
{{- include "buttercup.env.nodeData" . | nindent 8 }}
4528
resources:
4629
{{- toYaml .Values.resources | nindent 10 }}
4730
volumeMounts:
4831
{{- include "buttercup.standardVolumeMounts" (dict "usesTasksStorage" false) | nindent 8 }}
4932
{{- include "buttercup.nodeLocalVolumeMount" . | nindent 8 }}
50-
{{- end }}
5133
volumes:
5234
{{- include "buttercup.volumes.scratch" . | nindent 6 }}
5335
{{- include "buttercup.nodeLocalVolume" . | nindent 6 }}

deployment/k8s/charts/merger-bot/values.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,3 @@ resources:
1111
timeout: 900
1212
timer: 5000
1313
max_local_files: 500
14-
15-
# Fuzzer runner side container configuration
16-
fuzzerRunner:
17-
enabled: true
18-
port: 8000
19-
20-
mergerBot:
21-
resources:
22-
limits:
23-
cpu: 1000m
24-
memory: 1Gi
25-
requests:
26-
cpu: 250m
27-
memory: 256Mi

deployment/k8s/templates/common-env.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,8 @@ Service-specific environment variables that utilize the standardized variables
336336
value: "{{ include "buttercup.core.logMaxLineLength" . }}"
337337
- name: BUTTERCUP_FUZZER_MAX_POV_SIZE
338338
value: {{ int .Values.global.maxPovSize | quote }}
339-
{{- end }}
340-
341-
{{- define "buttercup.fuzzerRunnerEnv" }}
342-
- name: BUTTERCUP_FUZZER_RUNNER_HOST
343-
value: "127.0.0.1"
344-
- name: BUTTERCUP_FUZZER_RUNNER_PORT
345-
value: "{{ .Values.fuzzerRunner.port }}"
339+
- name: BUTTERCUP_FUZZER_RUNNER_PATH
340+
value: "/app/fuzzer_runner/runner.sh"
346341
{{- end }}
347342

348343
{{- define "buttercup.povReproducerEnv" }}

0 commit comments

Comments
 (0)