diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..94352eb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.11 + +WORKDIR /app +RUN apt-get update && apt-get install -y tee + +COPY . . + +RUN pip install -r requirements.txt + +CMD ["/bin/bash", "benchmark.sh"] diff --git a/benchmark.sh b/benchmark.sh new file mode 100644 index 0000000..2772016 --- /dev/null +++ b/benchmark.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Run the producer_benchmark.py script and print its output to the screen +python producer_benchmark.py | tee producer_output.txt & + +# Wait for a few seconds to let the producer start sending messages +sleep 5 + +# Run the consumer_benchmark.py script and print its output to the screen +python consumer_benchmark.py | tee consumer_output.txt \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e1abc34 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3.8" +services: + + kafka: + image: "bitnami/kafka:3.4.0" + container_name: kafka + environment: + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_CREATE_TOPICS=page-views:3:1 + - KAFKA_ENABLE_KRAFT=yes + ports: + - "9092:9092" + python-wrapper: + depends_on: + - kafka + build: + context: . + dockerfile: Dockerfile + + + + + +