3 FORTUNE=juplo/wordcount--fortune:1.0.0
4 RECORDER=juplo/wordcount--recorder:1.1.0
5 USERS=juplo/wordcount--users:1.0.4
6 SPLITTER=juplo/wordcount--splitter:1.1.4
7 COUNTER=juplo/wordcount--counter:1.2.4
8 TOP10=juplo/wordcount--top10:1.0.1
9 QUERY=juplo/wordcount--query:1.0.4
11 if [ "$1" = "cleanup" ]
13 docker compose down -v --remove-orphans
14 docker image rm $FORTUNE
15 docker image rm $RECORDER
16 docker image rm $USERS
17 docker image rm $SPLITTER
18 docker image rm $COUNTER
19 docker image rm $TOP10
20 docker image rm $QUERY
25 $(docker image ls -q $FORTUNE) == "" ||
26 $(docker image ls -q $RECORDER) == "" ||
27 $(docker image ls -q $USERS) == "" ||
28 $(docker image ls -q $SPLITTER) == "" ||
29 $(docker image ls -q $COUNTER) == "" ||
30 $(docker image ls -q $TOP10) == "" ||
31 $(docker image ls -q $QUERY) == "" ||
35 mvn clean package || exit
36 docker compose rm -svf recorder users splitter counter top10 query
37 ( cd fortune; ./README.sh $FORTUNE; )
38 mvn -f recorder/pom.xml docker:build
39 mvn -f users/pom.xml docker:build
40 mvn -f splitter/pom.xml docker:build
41 mvn -f counter/pom.xml docker:build
42 mvn -f top10/pom.xml docker:build
43 mvn -f query/pom.xml docker:build
45 echo "Using existing images:"
46 docker image ls $FORTUNE
47 docker image ls $RECORDER
48 docker image ls $USERS
49 docker image ls $SPLITTER
50 docker image ls $COUNTER
51 docker image ls $TOP10
52 docker image ls $QUERY
56 docker compose up -d zookeeper kafka cli traefik
58 echo "Waiting for the Kafka-Cluster to become ready..."
59 docker compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
60 docker compose exec cli zookeeper-shell zookeeper:2181 ls /brokers/ids
62 docker compose up -d users
63 while [ "$(http users.localhost/actuator/health 2> /dev/null | jq -r .status 2> /dev/null)" != "UP" ]; do echo "Waiting for service users..."; sleep 1; done
64 http -v post users.localhost username=bart firstName=Bart lastName=Simpson sex=MALE
65 http -v post users.localhost username=nerd firstName=Jane lastName=Doe sex=FEMALE
66 http -v post users.localhost username=riddler firstName=Rumpel lastName=Stilzchen sex=MALE
68 echo "Starting all instances..."
71 while [ "$(http query.localhost/actuator/health 2>/dev/null | jq -r .status 2> /dev/null)" != "UP" ]; do echo "Waiting for service query..."; sleep 1; done
72 http -v query.localhost/bart
74 http -v query.localhost/bart
76 http -v query.localhost/bart
78 http -v query.localhost/bart
80 http -v query.localhost/bart
82 http -v query.localhost/bart
84 http -v query.localhost/bart
85 http -v query.localhost/nerd
86 http -v query.localhost/riddler
88 // docker compose up -d --scale query=5 query
89 http -v --follow query.localhost/bart
91 http -v --follow query.localhost/bart
93 http -v --follow query.localhost/bart
95 http -v --follow query.localhost/bart
97 http -v --follow query.localhost/bart
99 http -v --follow query.localhost/bart
101 http -v --follow query.localhost/bart
103 http -v --follow query.localhost/nerd
104 http -v --follow query.localhost/nerd
105 http -v --follow query.localhost/nerd
106 http -v --follow query.localhost/nerd
107 http -v --follow query.localhost/nerd
109 http -v --follow query.localhost/riddler
110 http -v --follow query.localhost/riddler
111 http -v --follow query.localhost/riddler
112 http -v --follow query.localhost/riddler
113 http -v --follow query.localhost/riddler