Skip to content

Commit

Permalink
Install docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
rootxakash committed Oct 16, 2024
1 parent 535be37 commit 570d91e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
with:
lein: "2.8.1"
- uses: actions/checkout@v2

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Run Tests on Kafka Cluster
run: ./bin/run_cluster_tests_in_ci.sh
env:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ topic="topic"
another_test_topic="another-test-topic"

setup:
docker compose down
docker-compose down
lein deps
docker compose up -d
docker-compose up -d
sleep 10
docker exec ziggurat_kafka /opt/bitnami/kafka/bin/kafka-topics.sh --create --topic $(topic) --partitions 3 --replication-factor 1 --zookeeper ziggurat_zookeeper
docker exec ziggurat_kafka /opt/bitnami/kafka/bin/kafka-topics.sh --create --topic $(another_test_topic) --partitions 3 --replication-factor 1 --zookeeper ziggurat_zookeeper

test: setup
TESTING_TYPE=local lein test
docker compose down
docker-compose down

setup-cluster:
rm -rf /tmp/ziggurat_kafka_cluster_data
docker compose -f docker compose-cluster.yml -p ziggurat down
docker-compose -f docker-compose-cluster.yml -p ziggurat down
lein deps
docker compose -f docker compose-cluster.yml -p ziggurat up -d
docker-compose -f docker-compose-cluster.yml -p ziggurat up -d
sleep 30
# Sleeping for 30s to allow the cluster to come up
docker exec ziggurat_kafka1_1 kafka-topics --create --topic $(topic) --partitions 3 --replication-factor 3 --if-not-exists --zookeeper ziggurat_zookeeper_1
docker exec ziggurat_kafka1_1 kafka-topics --create --topic $(another_test_topic) --partitions 3 --replication-factor 3 --if-not-exists --zookeeper ziggurat_zookeeper_1

test-cluster: setup-cluster
TESTING_TYPE=cluster lein test
docker compose -f docker compose-cluster.yml down
docker-compose -f docker-compose-cluster.yml down
rm -rf /tmp/ziggurat_kafka_cluster_data

coverage: setup
lein code-coverage
docker compose down
docker-compose down

proto:
protoc -I=resources --java_out=test/ resources/proto/example.proto
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Refer to [concepts](doc/CONCEPTS.md) to understand the concepts referred to in t

1. Install Clojure: `brew install clojure`
2. Install Leiningen: `brew install leiningen`
3. Run Docker Compose: `docker compose up`. This starts:
3. Run docker-compose: `docker-compose up`. This starts:
- Kafka on localhost:9092
- ZooKeeper on localhost:2181
- RabbitMQ on localhost:5672
Expand Down

0 comments on commit 570d91e

Please sign in to comment.