Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions benchmark.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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