mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
280 lines
8.7 KiB
YAML
280 lines
8.7 KiB
YAML
services:
|
|
# ugh the only solution i can come up with is a dind instance paired with every single build-bot we will need like k8s groups or something
|
|
dind:
|
|
expose:
|
|
- "2375"
|
|
image: docker:24-dind
|
|
command: ["dockerd", "-H", "tcp://0.0.0.0:2375", "--tls=false", "--storage-driver=overlay2"]
|
|
restart: always
|
|
privileged: true # This must run with privlege to support nested virtualization within the public Linux CP for `virtme-ng`
|
|
environment:
|
|
- DOCKER_TLS_CERTDIR # intentionally blank to optimize runtime
|
|
volumes:
|
|
- type: bind
|
|
source: ./crs_scratch
|
|
target: /crs_scratch
|
|
|
|
redis:
|
|
image: redis:7.4.2
|
|
restart: always
|
|
ports:
|
|
- '127.0.0.1:6379:6379'
|
|
# NOTE: Do not use the configuration file for now, so every time you restart
|
|
# the container, it will reset the redis instance
|
|
# command: redis-server /mount/redis.conf
|
|
# volumes:
|
|
# - cache:/data
|
|
# - ./redis:/mount
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
graphdb:
|
|
image: janusgraph/janusgraph:1.2.0-20250113-082101.7f6ffcf
|
|
restart: always
|
|
ports:
|
|
- '127.0.0.1:8182:8182'
|
|
|
|
stimulate-fuzzer-test:
|
|
build:
|
|
context: ./
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
command: /fuzzer/.venv/bin/python -m buttercup.fuzzing_infra.stimulate_build_bot --build_type fuzzer --ossfuzz /crs_scratch/oss-fuzz --engine libfuzzer --sanitizer address --target_package ${TARGET_PACKAGE} --redis_url redis://redis:6379 --source_path /crs_scratch/${TARGET_PACKAGE} --task_id 123e4567-e89b-12d3-a456-426614174000
|
|
profiles:
|
|
- fuzzer-test
|
|
restart: no
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
build-bot:
|
|
condition: service_started
|
|
fuzzer-bot:
|
|
condition: service_started
|
|
orchestrator-sim:
|
|
condition: service_started
|
|
coverage-bot:
|
|
condition: service_started
|
|
|
|
|
|
orchestrator-sim:
|
|
build:
|
|
context: ./
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
command: /fuzzer/.venv/bin/python -m buttercup.fuzzing_infra.orchestrator --redis_url redis://redis:6379
|
|
profiles:
|
|
- fuzzer-test
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
indexer-run:
|
|
image: program-model-image
|
|
command: -m buttercup.program_model.indexer.oss_fuzz_indexer --scriptdir /app/scripts --url ws://graphdb:8182/gremlin --allow_pull --oss_fuzz_dir /crs_scratch/ossfuzz --base_image_url gcr.io/oss-fuzz --package_name libpng --wdir /crs_scratch/ --kythe_dir /app/kythe-v0.0.67 --python /app/.venv/bin/python
|
|
build:
|
|
context: ./
|
|
dockerfile: ./program-model/upload_worker.Dockerfile
|
|
profiles:
|
|
- indexer-run
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
environment:
|
|
# These values will be modified automatically at competition time
|
|
- DOCKER_HOST=tcp://dind:2375
|
|
restart: no
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
dind:
|
|
condition: service_started
|
|
graphdb:
|
|
condition: service_started
|
|
|
|
coverage-bot:
|
|
command: ["buttercup-coverage-bot", "--wdir", "/crs_scratch", "--redis_url", "redis://redis:6379"]
|
|
build:
|
|
context: ./
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
- ./tasks_storage:/tasks_storage
|
|
environment:
|
|
# These values will be modified automatically at competition time
|
|
- DOCKER_HOST=tcp://dind:2375
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
dind:
|
|
condition: service_started
|
|
|
|
build-bot:
|
|
command: ["buttercup-fuzzer-builder", "--wdir", "/crs_scratch", "--redis_url", "redis://redis:6379"]
|
|
build:
|
|
context: ./
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
- ./tasks_storage:/tasks_storage
|
|
environment:
|
|
# These values will be modified automatically at competition time
|
|
- DOCKER_HOST=tcp://dind:2375
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
dind:
|
|
condition: service_started
|
|
|
|
fuzzer-bot:
|
|
build:
|
|
context: ./
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
command: ["buttercup-fuzzer", "--wdir", "/crs_scratch", "--redis_url", "redis://redis:6379", "--timeout", "900", "--timer", "5000"]
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
task-downloader:
|
|
build:
|
|
context: .
|
|
dockerfile: ./orchestrator/Dockerfile
|
|
command: ["buttercup-task-downloader", "serve"]
|
|
volumes:
|
|
- ./tasks_storage:/tasks_storage
|
|
environment:
|
|
- BUTTERCUP_DOWNLOADER_SERVE__REDIS_URL=redis://redis:6379
|
|
- BUTTERCUP_DOWNLOADER_LOG_LEVEL=debug
|
|
- BUTTERCUP_DOWNLOADER_DOWNLOAD_DIR=/tasks_storage
|
|
- BUTTERCUP_DOWNLOADER_SERVE__SLEEP_TIME=5
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
task-server:
|
|
build:
|
|
context: .
|
|
dockerfile: ./orchestrator/Dockerfile
|
|
command: ["buttercup-task-server"]
|
|
ports:
|
|
- "127.0.0.1:8000:8000"
|
|
environment:
|
|
- BUTTERCUP_TASK_SERVER_REDIS_URL=redis://redis:6379
|
|
- BUTTERCUP_TASK_SERVER_LOG_LEVEL=debug
|
|
- BUTTERCUP_TASK_SERVER_HOST=0.0.0.0
|
|
- BUTTERCUP_TASK_SERVER_PORT=8000
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
scheduler:
|
|
build:
|
|
context: .
|
|
dockerfile: ./orchestrator/Dockerfile
|
|
command: ["buttercup-scheduler", "serve"]
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
- ./tasks_storage:/tasks_storage
|
|
environment:
|
|
- BUTTERCUP_SCHEDULER_SERVE__REDIS_URL=redis://redis:6379
|
|
- BUTTERCUP_SCHEDULER_LOG_LEVEL=debug
|
|
- BUTTERCUP_SCHEDULER_SERVE__SLEEP_TIME=5
|
|
- BUTTERCUP_SCHEDULER_SERVE__COMPETITION_API_URL=http://competition-api:1323
|
|
- BUTTERCUP_SCHEDULER_TASKS_STORAGE_DIR=/tasks_storage
|
|
- BUTTERCUP_SCHEDULER_SCRATCH_DIR=/crs_scratch
|
|
- BUTTERCUP_SCHEDULER_SERVE__MOCK_MODE=true
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
seed-gen:
|
|
build:
|
|
context: .
|
|
dockerfile: ./seed-gen/Dockerfile
|
|
# TODO: Update seed-gen sleep once service is doing useful work
|
|
command: ["seed-gen", "server", "--redis_url", "redis://redis:6379", "--wdir", "/crs_scratch", "--sleep", "60", "--python", "/app/seed-gen/.venv/bin/python"]
|
|
env_file: .env
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
environment:
|
|
- BUTTERCUP_LITELLM_KEY=sk-1234
|
|
- BUTTERCUP_LITELLM_HOSTNAME=http://litellm:8080
|
|
- DOCKER_HOST=tcp://dind:2375
|
|
- LOG_LEVEL=DEBUG
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
litellm:
|
|
condition: service_started
|
|
dind:
|
|
condition: service_started
|
|
|
|
patcher:
|
|
build:
|
|
context: .
|
|
dockerfile: ./patcher/Dockerfile
|
|
command: ["buttercup-patcher", "serve"]
|
|
volumes:
|
|
- ./crs_scratch:/crs_scratch
|
|
environment:
|
|
- BUTTERCUP_PATCHER_SERVE__REDIS_URL=redis://redis:6379
|
|
- BUTTERCUP_PATCHER_SERVE__SLEEP_TIME=5
|
|
- BUTTERCUP_PATCHER_LOG_LEVEL=debug
|
|
- BUTTERCUP_PATCHER_TASK_STORAGE_DIR=/crs_scratch
|
|
- BUTTERCUP_PATCHER_SCRATCH_DIR=/crs_scratch
|
|
- BUTTERCUP_PATCHER_MOCK_MODE=true
|
|
- BUTTERCUP_LITELLM_KEY=sk-1234
|
|
- BUTTERCUP_LITELLM_HOSTNAME=http://litellm:8080
|
|
- DOCKER_HOST=tcp://dind:2375
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
dind:
|
|
condition: service_started
|
|
|
|
litellm:
|
|
image: ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.57.8-stable
|
|
configs:
|
|
- source: litellm_config
|
|
target: /app/config.yaml
|
|
env_file: .env
|
|
ports:
|
|
- "127.0.0.1:8080:8080"
|
|
environment:
|
|
DATABASE_URL: "postgresql://litellm_user:litellm_password11@litellm-db:5432/litellm"
|
|
|
|
# note: litellm recommends 1 worker for kubernetes: https://docs.litellm.ai/docs/proxy/prod
|
|
command: ["--config", "/app/config.yaml", "--port", "8080", "--num_workers", "8"]
|
|
depends_on:
|
|
litellm-db:
|
|
condition: service_healthy
|
|
|
|
litellm-db:
|
|
image: postgres:17.2
|
|
restart: always
|
|
environment:
|
|
POSTGRES_DB: litellm
|
|
POSTGRES_USER: litellm_user
|
|
POSTGRES_PASSWORD: litellm_password11
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
competition-api:
|
|
image: ghcr.io/aixcc-finals/example-crs-architecture/example-competition-api:v0.1
|
|
|
|
configs:
|
|
litellm_config:
|
|
file: ./litellm/litellm_config.yaml
|
|
|
|
volumes:
|
|
cache:
|
|
driver: local
|