From f64dcbd9e3a03a070e5cf2efbf255e7212ce406e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 5 May 2024 09:54:47 +0200 Subject: [PATCH 01/16] Updated Confluent-Kafka to `7.5.1` and switched the cluster to KRAFT --- README.sh | 3 +-- docker-compose.yml | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.sh b/README.sh index ba50a69..b6f9a3c 100755 --- a/README.sh +++ b/README.sh @@ -53,11 +53,10 @@ else fi -docker-compose up -d zookeeper kafka cli traefik +docker-compose up -d kafka cli traefik echo "Waiting for the Kafka-Cluster to become ready..." docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 -docker-compose exec cli zookeeper-shell zookeeper:2181 ls /brokers/ids docker-compose up -d users 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 diff --git a/docker-compose.yml b/docker-compose.yml index c02465a..f057280 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,29 +1,27 @@ version: '3.2' services: - zookeeper: - image: confluentinc/cp-zookeeper:6.2.0 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ports: - - 2181:2181 kafka: - image: confluentinc/cp-kafka:6.2.0 + image: confluentinc/cp-kafka:7.5.1 environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082 + KAFKA_NODE_ID: 1 + KAFKA_LISTENERS: CONTROLLER://:9072, DOCKER://:9092, LOCALHOST://:9082 KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082 KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT, DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT + KAFKA_PROCESS_ROLES: broker, controller + KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9072 + KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER + CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 + KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" ports: - 9092:9082 - 9082:9082 - depends_on: - - zookeeper - + stop_grace_period: 120s traefik: image: "traefik:v2.5" -- 2.20.1 From 2a830ecf3b311b2012243a875c93c1206fb99ba2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 5 May 2024 09:58:42 +0200 Subject: [PATCH 02/16] Switched `README.sh` to the build-in version of Docker Compose --- README.sh | 14 +++++++------- docker-compose.yml | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.sh b/README.sh index b6f9a3c..b8005ab 100755 --- a/README.sh +++ b/README.sh @@ -10,7 +10,7 @@ QUERY=juplo/wordcount--query:1.0.4 if [ "$1" = "cleanup" ] then - docker-compose down -v --remove-orphans + docker compose down -v --remove-orphans docker image rm $FORTUNE docker image rm $RECORDER docker image rm $USERS @@ -33,7 +33,7 @@ if [[ ]] then mvn clean package || exit - docker-compose rm -svf recorder users splitter counter top10 query + docker compose rm -svf recorder users splitter counter top10 query ( cd fortune; ./README.sh $FORTUNE; ) mvn -f recorder/pom.xml docker:build mvn -f users/pom.xml docker:build @@ -53,19 +53,19 @@ else fi -docker-compose up -d kafka cli traefik +docker compose up -d kafka cli traefik echo "Waiting for the Kafka-Cluster to become ready..." -docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 +docker compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 -docker-compose up -d users +docker compose up -d users 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 http -v post users.localhost username=bart firstName=Bart lastName=Simpson sex=MALE http -v post users.localhost username=nerd firstName=Jane lastName=Doe sex=FEMALE http -v post users.localhost username=riddler firstName=Rumpel lastName=Stilzchen sex=MALE echo "Starting all instances..." -docker-compose up -d +docker compose up -d 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 http -v query.localhost/bart @@ -84,7 +84,7 @@ http -v query.localhost/bart http -v query.localhost/nerd http -v query.localhost/riddler -// docker-compose up -d --scale query=5 query +// docker compose up -d --scale query=5 query http -v --follow query.localhost/bart sleep 1 http -v --follow query.localhost/bart diff --git a/docker-compose.yml b/docker-compose.yml index f057280..4f2a6c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.2' services: kafka: -- 2.20.1 From cbf1b641e147552fdbafb1b440a5aab59dfe275f Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 26 May 2024 08:40:32 +0200 Subject: [PATCH 03/16] Introduced helper-service `setup` --- README.sh | 17 +++++--- docker-compose.yml | 99 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 102 insertions(+), 14 deletions(-) diff --git a/README.sh b/README.sh index b8005ab..1a3efb2 100755 --- a/README.sh +++ b/README.sh @@ -53,19 +53,24 @@ else fi -docker compose up -d kafka cli traefik - -echo "Waiting for the Kafka-Cluster to become ready..." -docker compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 +docker compose up setup +echo "Starting the service 'users'..." docker compose up -d users 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 http -v post users.localhost username=bart firstName=Bart lastName=Simpson sex=MALE http -v post users.localhost username=nerd firstName=Jane lastName=Doe sex=FEMALE http -v post users.localhost username=riddler firstName=Rumpel lastName=Stilzchen sex=MALE -echo "Starting all instances..." -docker compose up -d +echo "Starting the other instances..." +docker compose up -d recorder +docker compose up -d splitter +docker compose up -d counter +docker compose up -d top10 +docker compose up -d query + +echo "Starting the simulated users..." +docker compose up -d bart nerd riddler 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 http -v query.localhost/bart diff --git a/docker-compose.yml b/docker-compose.yml index 4f2a6c7..41716af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,7 @@ services: volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" + recorder: image: juplo/wordcount--recorder:1.0.1 labels: @@ -102,6 +103,7 @@ services: depends_on: - kafka + bart: image: juplo/wordcount--fortune:1.0.0 command: bash -c " @@ -138,16 +140,97 @@ services: sleep 1; done" + cli: image: juplo/toolbox - command: bash -c " - cub kafka-ready -b kafka:9092 1 60 ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic recordings ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic users ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic words ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic countings ; - kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic top10 ; - sleep infinity" + command: sleep infinity + stop_grace_period: 0s + depends_on: + - kafka + - traefik + + setup: + image: juplo/toolbox + command: + - bash + - -c + - | + cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 + if [ -e INITIALIZED ] + then + echo -n Bereits konfiguriert: + cat INITIALIZED + kafka-topics --bootstrap-server kafka:9092 --describe --topic users + kafka-topics --bootstrap-server kafka:9092 --describe --topic recordings + kafka-topics --bootstrap-server kafka:9092 --describe --topic words + kafka-topics --bootstrap-server kafka:9092 --describe --topic countings + kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 + else + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic users + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic recordings + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic words + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic countings + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic top10 + kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic users \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'users\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic users \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic recordings \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'recordings\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic recordings \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic words \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'words\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic words \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic countings \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'countings\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic countings \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic top10 \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'top10\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 \ + && date > INITIALIZED + fi + stop_grace_period: 0s + depends_on: + - cli akhq: image: tchiotludo/akhq:0.18.0 -- 2.20.1 From 81ecac56c746d574013ac638d77a7d4cbb908849 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 23 Jun 2024 09:15:15 +0200 Subject: [PATCH 04/16] Fixed the name of the docker-image `juplo/wordcount--fortune` --- README.sh | 2 +- docker-compose.yml | 6 +++--- fortune | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.sh b/README.sh index 1a3efb2..4fb1760 100755 --- a/README.sh +++ b/README.sh @@ -1,6 +1,6 @@ #!/bin/bash -FORTUNE=juplo/wordcount--fortune:1.0.0 +FORTUNE=juplo/wordcount--fortune:1.0.1 RECORDER=juplo/wordcount--recorder:1.0.1 USERS=juplo/wordcount--users:1.0.4 SPLITTER=juplo/wordcount--splitter:1.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index 41716af..32b8a82 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -105,7 +105,7 @@ services: bart: - image: juplo/wordcount--fortune:1.0.0 + image: juplo/wordcount--fortune:1.0.1 command: bash -c " while [ true ]; do @@ -117,7 +117,7 @@ services: done" nerd: - image: juplo/wordcount--fortune:1.0.0 + image: juplo/wordcount--fortune:1.0.1 command: bash -c " while [ true ]; do @@ -129,7 +129,7 @@ services: done" riddler: - image: juplo/wordcount--fortune:1.0.0 + image: juplo/wordcount--fortune:1.0.1 command: bash -c " while [ true ]; do diff --git a/fortune b/fortune index dde18ef..8c69a7c 160000 --- a/fortune +++ b/fortune @@ -1 +1 @@ -Subproject commit dde18ef24d54bb988ad458ad6e12ed99fbc53061 +Subproject commit 8c69a7caad51f067f129a751966d0f4638fa228c -- 2.20.1 From c9407ccc5b4721cbeba19c8682568a99701bb98f Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 4 Feb 2023 10:20:55 +0100 Subject: [PATCH 05/16] Switched to `JsonSerializer` / `JsonDeserializer` * Switched all services from manual serialization/deserialization with direct calls to the `ObjectMapper` to ``JsonSerializer`` / ``JsonDeserializer``. * All keys and values are serialized as JSON (expect the key from `users`). --- README.sh | 14 +++++++------- counter | 2 +- docker-compose.yml | 12 ++++++------ pom.xml | 2 +- query | 2 +- recorder | 2 +- splitter | 2 +- top10 | 2 +- users | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.sh b/README.sh index 4fb1760..10e475d 100755 --- a/README.sh +++ b/README.sh @@ -1,12 +1,12 @@ #!/bin/bash FORTUNE=juplo/wordcount--fortune:1.0.1 -RECORDER=juplo/wordcount--recorder:1.0.1 -USERS=juplo/wordcount--users:1.0.4 -SPLITTER=juplo/wordcount--splitter:1.0.0 -COUNTER=juplo/wordcount--counter:1.1.0 -TOP10=juplo/wordcount--top10:1.0.1 -QUERY=juplo/wordcount--query:1.0.4 +RECORDER=juplo/wordcount--recorder:1.2.0 +USERS=juplo/wordcount--users:1.0.5 +SPLITTER=juplo/wordcount--splitter:1.2.0 +COUNTER=juplo/wordcount--counter:1.3.0 +TOP10=juplo/wordcount--top10:1.2.1 +QUERY=juplo/wordcount--query:2.0.0 if [ "$1" = "cleanup" ] then @@ -89,7 +89,7 @@ http -v query.localhost/bart http -v query.localhost/nerd http -v query.localhost/riddler -// docker compose up -d --scale query=5 query +# docker compose up -d --scale query=5 query http -v --follow query.localhost/bart sleep 1 http -v --follow query.localhost/bart diff --git a/counter b/counter index fe04994..5aa0393 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit fe049944648d9675ffe66b586b6bf860fbac696f +Subproject commit 5aa03935c0d09c363dc2b3ddcbd5fc9aac93b8e1 diff --git a/docker-compose.yml b/docker-compose.yml index 32b8a82..a466934 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: recorder: - image: juplo/wordcount--recorder:1.0.1 + image: juplo/wordcount--recorder:1.2.0 labels: - "traefik.enable=true" - "traefik.http.routers.recorder.rule=Host(`recorder.localhost`)" @@ -49,7 +49,7 @@ services: - kafka users: - image: juplo/wordcount--users:1.0.4 + image: juplo/wordcount--users:1.0.5 labels: - "traefik.enable=true" - "traefik.http.routers.users.rule=Host(`users.localhost`)" @@ -60,7 +60,7 @@ services: - kafka splitter: - image: juplo/wordcount--splitter:1.0.0 + image: juplo/wordcount--splitter:1.2.0 labels: - "traefik.enable=true" - "traefik.http.routers.splitter.rule=Host(`splitter.localhost`)" @@ -71,7 +71,7 @@ services: - kafka counter: - image: juplo/wordcount--counter:1.1.0 + image: juplo/wordcount--counter:1.3.0 labels: - "traefik.enable=true" - "traefik.http.routers.counter.rule=Host(`counter.localhost`)" @@ -82,7 +82,7 @@ services: - kafka top10: - image: juplo/wordcount--top10:1.0.1 + image: juplo/wordcount--top10:1.2.1 labels: - "traefik.enable=true" - "traefik.http.routers.top10.rule=Host(`top10.localhost`)" @@ -93,7 +93,7 @@ services: - kafka query: - image: juplo/wordcount--query:1.0.4 + image: juplo/wordcount--query:2.0.0 labels: - "traefik.enable=true" - "traefik.http.routers.query.rule=Host(`query.localhost`)" diff --git a/pom.xml b/pom.xml index e116624..b9ee3bc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.juplo.kafka.wordcount docker pom - 1.0.2 + 2.0.0 Docker-Compose Setup Docker-Compose Setup for the multiuser-wordcount example diff --git a/query b/query index 251cf79..f929a47 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit 251cf79927d4c1c941467c8fee0349c1a7eb4b93 +Subproject commit f929a47a66a2c14a291133aaa624ad9c5696bd53 diff --git a/recorder b/recorder index c5700c2..b06e664 160000 --- a/recorder +++ b/recorder @@ -1 +1 @@ -Subproject commit c5700c2117f6c445278f272572c8b5732bf53bbf +Subproject commit b06e6649f54c4ab58cea812b96301dadbbd23b23 diff --git a/splitter b/splitter index 3bc3ef7..836368a 160000 --- a/splitter +++ b/splitter @@ -1 +1 @@ -Subproject commit 3bc3ef7ceb76e7643e1e373293cfdc78f870838a +Subproject commit 836368acb5e435a733df5893e477a406daeafcb3 diff --git a/top10 b/top10 index b3c3b1c..aa9d59f 160000 --- a/top10 +++ b/top10 @@ -1 +1 @@ -Subproject commit b3c3b1c1ab19d197d323d7c69e03d9bd09147690 +Subproject commit aa9d59fa93178f40797a8bb3716dd0a30594833f diff --git a/users b/users index 58563cd..aa0d1c4 160000 --- a/users +++ b/users @@ -1 +1 @@ -Subproject commit 58563cdc022363375c00ac580672f7daa22f6453 +Subproject commit aa0d1c4c8e47b2fffc5fa0ca2cae83f64ed8dd4e -- 2.20.1 From 84ecb54b3703f08350afab8185e5a953a23e3706 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 16 Jun 2024 21:45:32 +0200 Subject: [PATCH 06/16] Fixed JSON-mismatch in messages from top10 to query --- README.sh | 4 ++-- counter | 2 +- docker-compose.yml | 4 ++-- pom.xml | 2 +- query | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.sh b/README.sh index 10e475d..9aef18e 100755 --- a/README.sh +++ b/README.sh @@ -4,9 +4,9 @@ FORTUNE=juplo/wordcount--fortune:1.0.1 RECORDER=juplo/wordcount--recorder:1.2.0 USERS=juplo/wordcount--users:1.0.5 SPLITTER=juplo/wordcount--splitter:1.2.0 -COUNTER=juplo/wordcount--counter:1.3.0 +COUNTER=juplo/wordcount--counter:1.3.1 TOP10=juplo/wordcount--top10:1.2.1 -QUERY=juplo/wordcount--query:2.0.0 +QUERY=juplo/wordcount--query:2.0.1 if [ "$1" = "cleanup" ] then diff --git a/counter b/counter index 5aa0393..58681eb 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit 5aa03935c0d09c363dc2b3ddcbd5fc9aac93b8e1 +Subproject commit 58681eb5c2ea655385c8209b07330e4ef0ab2c49 diff --git a/docker-compose.yml b/docker-compose.yml index a466934..1d0ab83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,7 +71,7 @@ services: - kafka counter: - image: juplo/wordcount--counter:1.3.0 + image: juplo/wordcount--counter:1.3.1 labels: - "traefik.enable=true" - "traefik.http.routers.counter.rule=Host(`counter.localhost`)" @@ -93,7 +93,7 @@ services: - kafka query: - image: juplo/wordcount--query:2.0.0 + image: juplo/wordcount--query:2.0.1 labels: - "traefik.enable=true" - "traefik.http.routers.query.rule=Host(`query.localhost`)" diff --git a/pom.xml b/pom.xml index b9ee3bc..81945f9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.juplo.kafka.wordcount docker pom - 2.0.0 + 2.0.1 Docker-Compose Setup Docker-Compose Setup for the multiuser-wordcount example diff --git a/query b/query index f929a47..b52ff02 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit f929a47a66a2c14a291133aaa624ad9c5696bd53 +Subproject commit b52ff02b6952dfc708c7c7d94205b5b24afd68f9 -- 2.20.1 From aa49f65a1881f3005f0390cec268d9e42342d469 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 15 Jun 2024 13:05:29 +0200 Subject: [PATCH 07/16] Introduced service `popular` --- .gitmodules | 4 ++++ README.sh | 7 ++++++- counter | 2 +- docker-compose.yml | 24 ++++++++++++++++++++++++ pom.xml | 1 + popular | 1 + 6 files changed, 37 insertions(+), 2 deletions(-) create mode 160000 popular diff --git a/.gitmodules b/.gitmodules index b8abc8d..0126226 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,3 +29,7 @@ [submodule "splitter"] path = splitter url = ./ +[submodule "popular"] + path = popular + url = ./ + branch = popular diff --git a/README.sh b/README.sh index 9aef18e..12ee1d3 100755 --- a/README.sh +++ b/README.sh @@ -7,6 +7,7 @@ SPLITTER=juplo/wordcount--splitter:1.2.0 COUNTER=juplo/wordcount--counter:1.3.1 TOP10=juplo/wordcount--top10:1.2.1 QUERY=juplo/wordcount--query:2.0.1 +POPULAR=juplo/wordcount--popular:1.0.0 if [ "$1" = "cleanup" ] then @@ -18,6 +19,7 @@ then docker image rm $COUNTER docker image rm $TOP10 docker image rm $QUERY + docker image rm $POPULAR exit fi @@ -29,11 +31,12 @@ if [[ $(docker image ls -q $COUNTER) == "" || $(docker image ls -q $TOP10) == "" || $(docker image ls -q $QUERY) == "" || + $(docker image ls -q $POPULAR) == "" || "$1" = "build" ]] then mvn clean package || exit - docker compose rm -svf recorder users splitter counter top10 query + docker compose rm -svf recorder users splitter counter top10 query popular ( cd fortune; ./README.sh $FORTUNE; ) mvn -f recorder/pom.xml docker:build mvn -f users/pom.xml docker:build @@ -41,6 +44,7 @@ then mvn -f counter/pom.xml docker:build mvn -f top10/pom.xml docker:build mvn -f query/pom.xml docker:build + mvn -f popular/pom.xml docker:build else echo "Using existing images:" docker image ls $FORTUNE @@ -50,6 +54,7 @@ else docker image ls $COUNTER docker image ls $TOP10 docker image ls $QUERY + docker image ls $POPULAR fi diff --git a/counter b/counter index 58681eb..f9156ed 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit 58681eb5c2ea655385c8209b07330e4ef0ab2c49 +Subproject commit f9156ed2e1f43b64d39cc39a13d12ca8c0d24219 diff --git a/docker-compose.yml b/docker-compose.yml index 1d0ab83..8a5aff4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -103,6 +103,17 @@ services: depends_on: - kafka + popular: + image: juplo/wordcount--popular:1.0.0 + labels: + - "traefik.enable=true" + - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" + - "traefik.http.routers.popular.entrypoints=web" + environment: + juplo.wordcount.popular.bootstrap-server: kafka:9092 + depends_on: + - kafka + bart: image: juplo/wordcount--fortune:1.0.1 @@ -165,6 +176,7 @@ services: kafka-topics --bootstrap-server kafka:9092 --describe --topic words kafka-topics --bootstrap-server kafka:9092 --describe --topic countings kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 + kafka-topics --bootstrap-server kafka:9092 --describe --topic popular else kafka-topics --bootstrap-server kafka:9092 \ --delete \ @@ -186,6 +198,10 @@ services: --delete \ --if-exists \ --topic top10 + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic popular kafka-topics --bootstrap-server kafka:9092 \ --create \ --topic users \ @@ -226,6 +242,14 @@ services: --config min.insync.replicas=1 \ && echo Das Topic \'top10\' wurde erfolgreich angelegt: \ && kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic popular \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'popular\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic popular \ && date > INITIALIZED fi stop_grace_period: 0s diff --git a/pom.xml b/pom.xml index 81945f9..fe057b1 100644 --- a/pom.xml +++ b/pom.xml @@ -16,5 +16,6 @@ counter top10 query + popular diff --git a/popular b/popular new file mode 160000 index 0000000..e88db15 --- /dev/null +++ b/popular @@ -0,0 +1 @@ +Subproject commit e88db15eafe64ac083d066be29ad94058930bb5d -- 2.20.1 From 9d2f010636ee55c8597b0fe6d9c217637cba34e1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 20 Jun 2024 21:35:54 +0200 Subject: [PATCH 08/16] Service `popular` supresses intermediate results --- README.sh | 2 +- docker-compose.yml | 2 +- popular | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.sh b/README.sh index 12ee1d3..c355d24 100755 --- a/README.sh +++ b/README.sh @@ -7,7 +7,7 @@ SPLITTER=juplo/wordcount--splitter:1.2.0 COUNTER=juplo/wordcount--counter:1.3.1 TOP10=juplo/wordcount--top10:1.2.1 QUERY=juplo/wordcount--query:2.0.1 -POPULAR=juplo/wordcount--popular:1.0.0 +POPULAR=juplo/wordcount--popular:1.1.0 if [ "$1" = "cleanup" ] then diff --git a/docker-compose.yml b/docker-compose.yml index 8a5aff4..274c962 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,7 +104,7 @@ services: - kafka popular: - image: juplo/wordcount--popular:1.0.0 + image: juplo/wordcount--popular:1.1.0 labels: - "traefik.enable=true" - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" diff --git a/popular b/popular index e88db15..feb9d86 160000 --- a/popular +++ b/popular @@ -1 +1 @@ -Subproject commit e88db15eafe64ac083d066be29ad94058930bb5d +Subproject commit feb9d86212983d93d3546f5a4d9b15f14cd57314 -- 2.20.1 From e1f20111a6a16c6307e16658780beb24bd90ef1a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 20 Jun 2024 21:53:03 +0200 Subject: [PATCH 09/16] Refined output JSON for service `popular` --- README.sh | 2 +- docker-compose.yml | 2 +- popular | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.sh b/README.sh index c355d24..b785876 100755 --- a/README.sh +++ b/README.sh @@ -7,7 +7,7 @@ SPLITTER=juplo/wordcount--splitter:1.2.0 COUNTER=juplo/wordcount--counter:1.3.1 TOP10=juplo/wordcount--top10:1.2.1 QUERY=juplo/wordcount--query:2.0.1 -POPULAR=juplo/wordcount--popular:1.1.0 +POPULAR=juplo/wordcount--popular:1.1.1 if [ "$1" = "cleanup" ] then diff --git a/docker-compose.yml b/docker-compose.yml index 274c962..0040e57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,7 +104,7 @@ services: - kafka popular: - image: juplo/wordcount--popular:1.1.0 + image: juplo/wordcount--popular:1.1.1 labels: - "traefik.enable=true" - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" diff --git a/popular b/popular index feb9d86..8af553a 160000 --- a/popular +++ b/popular @@ -1 +1 @@ -Subproject commit feb9d86212983d93d3546f5a4d9b15f14cd57314 +Subproject commit 8af553a2b1cae0b7f5c9d9c63023b47af89bd5ab -- 2.20.1 From 40a3767aeaa3bea06f1fc2ec3165218059cdc128 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 23 Jun 2024 09:03:35 +0200 Subject: [PATCH 10/16] Introduced new generalized JSON-format for `top10` * Added an attribute `type`, that denotes the type of the statistics. * Introduces a common wording for the other attributes: ** Renamed `user` to `channel`. ** Renamed `word` to `key` (in the `key`/`counter`-pairing in the `Entry`). * Adapted all services accordingly: ** `counter` generates statistics of the type `COUNTER`. ** `popular` generates statistics of the type `POPULAR`. ** `top10` generates `Ranking`s for _all_ types of statistics and hands the `type` through to its consumers. ** `query` is only intrested in rankings of the type `COUNTER`. --- README.sh | 8 ++++---- counter | 2 +- docker-compose.yml | 8 ++++---- popular | 2 +- query | 2 +- top10 | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.sh b/README.sh index b785876..2f6d503 100755 --- a/README.sh +++ b/README.sh @@ -4,10 +4,10 @@ FORTUNE=juplo/wordcount--fortune:1.0.1 RECORDER=juplo/wordcount--recorder:1.2.0 USERS=juplo/wordcount--users:1.0.5 SPLITTER=juplo/wordcount--splitter:1.2.0 -COUNTER=juplo/wordcount--counter:1.3.1 -TOP10=juplo/wordcount--top10:1.2.1 -QUERY=juplo/wordcount--query:2.0.1 -POPULAR=juplo/wordcount--popular:1.1.1 +COUNTER=juplo/wordcount--counter:1.4.0 +TOP10=juplo/wordcount--top10:1.4.0 +QUERY=juplo/wordcount--query:2.1.0 +POPULAR=juplo/wordcount--popular:1.3.0 if [ "$1" = "cleanup" ] then diff --git a/counter b/counter index f9156ed..123d1d3 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit f9156ed2e1f43b64d39cc39a13d12ca8c0d24219 +Subproject commit 123d1d3df7e3665dbe511a2e7d7398e0aa235a63 diff --git a/docker-compose.yml b/docker-compose.yml index 0040e57..8bc4b78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,7 +71,7 @@ services: - kafka counter: - image: juplo/wordcount--counter:1.3.1 + image: juplo/wordcount--counter:1.4.0 labels: - "traefik.enable=true" - "traefik.http.routers.counter.rule=Host(`counter.localhost`)" @@ -82,7 +82,7 @@ services: - kafka top10: - image: juplo/wordcount--top10:1.2.1 + image: juplo/wordcount--top10:1.4.0 labels: - "traefik.enable=true" - "traefik.http.routers.top10.rule=Host(`top10.localhost`)" @@ -93,7 +93,7 @@ services: - kafka query: - image: juplo/wordcount--query:2.0.1 + image: juplo/wordcount--query:2.1.0 labels: - "traefik.enable=true" - "traefik.http.routers.query.rule=Host(`query.localhost`)" @@ -104,7 +104,7 @@ services: - kafka popular: - image: juplo/wordcount--popular:1.1.1 + image: juplo/wordcount--popular:1.3.0 labels: - "traefik.enable=true" - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" diff --git a/popular b/popular index 8af553a..73eec81 160000 --- a/popular +++ b/popular @@ -1 +1 @@ -Subproject commit 8af553a2b1cae0b7f5c9d9c63023b47af89bd5ab +Subproject commit 73eec81b106ad2a145565c8e87bd6fe2a32b617e diff --git a/query b/query index b52ff02..d835b70 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit b52ff02b6952dfc708c7c7d94205b5b24afd68f9 +Subproject commit d835b70fc4d49a50f42da9c21b3de1dbcd18cbaf diff --git a/top10 b/top10 index aa9d59f..238491e 160000 --- a/top10 +++ b/top10 @@ -1 +1 @@ -Subproject commit aa9d59fa93178f40797a8bb3716dd0a30594833f +Subproject commit 238491ed4d33495202e79879954802e5d0836006 -- 2.20.1 From c991a0f9681002ef5499123a40fb3da915580adc Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 23 Jun 2024 11:36:03 +0200 Subject: [PATCH 11/16] Upgraded JDK-Version, Spring Boot & Docker for all servies --- README.sh | 14 +++++++------- counter | 2 +- docker-compose.yml | 14 +++++++------- popular | 2 +- query | 2 +- recorder | 2 +- splitter | 2 +- top10 | 2 +- users | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.sh b/README.sh index 2f6d503..1eb2b70 100755 --- a/README.sh +++ b/README.sh @@ -1,13 +1,13 @@ #!/bin/bash FORTUNE=juplo/wordcount--fortune:1.0.1 -RECORDER=juplo/wordcount--recorder:1.2.0 -USERS=juplo/wordcount--users:1.0.5 -SPLITTER=juplo/wordcount--splitter:1.2.0 -COUNTER=juplo/wordcount--counter:1.4.0 -TOP10=juplo/wordcount--top10:1.4.0 -QUERY=juplo/wordcount--query:2.1.0 -POPULAR=juplo/wordcount--popular:1.3.0 +RECORDER=juplo/wordcount--recorder:1.2.1 +USERS=juplo/wordcount--users:1.0.6 +SPLITTER=juplo/wordcount--splitter:1.2.1 +COUNTER=juplo/wordcount--counter:1.4.1 +TOP10=juplo/wordcount--top10:1.4.1 +QUERY=juplo/wordcount--query:2.1.1 +POPULAR=juplo/wordcount--popular:1.3.1 if [ "$1" = "cleanup" ] then diff --git a/counter b/counter index 123d1d3..30e5e8b 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit 123d1d3df7e3665dbe511a2e7d7398e0aa235a63 +Subproject commit 30e5e8b9c41f3db0ede62fd0a903a5e54f151ce6 diff --git a/docker-compose.yml b/docker-compose.yml index 8bc4b78..cf6febf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: recorder: - image: juplo/wordcount--recorder:1.2.0 + image: juplo/wordcount--recorder:1.2.1 labels: - "traefik.enable=true" - "traefik.http.routers.recorder.rule=Host(`recorder.localhost`)" @@ -49,7 +49,7 @@ services: - kafka users: - image: juplo/wordcount--users:1.0.5 + image: juplo/wordcount--users:1.0.6 labels: - "traefik.enable=true" - "traefik.http.routers.users.rule=Host(`users.localhost`)" @@ -60,7 +60,7 @@ services: - kafka splitter: - image: juplo/wordcount--splitter:1.2.0 + image: juplo/wordcount--splitter:1.2.1 labels: - "traefik.enable=true" - "traefik.http.routers.splitter.rule=Host(`splitter.localhost`)" @@ -71,7 +71,7 @@ services: - kafka counter: - image: juplo/wordcount--counter:1.4.0 + image: juplo/wordcount--counter:1.4.1 labels: - "traefik.enable=true" - "traefik.http.routers.counter.rule=Host(`counter.localhost`)" @@ -82,7 +82,7 @@ services: - kafka top10: - image: juplo/wordcount--top10:1.4.0 + image: juplo/wordcount--top10:1.4.1 labels: - "traefik.enable=true" - "traefik.http.routers.top10.rule=Host(`top10.localhost`)" @@ -93,7 +93,7 @@ services: - kafka query: - image: juplo/wordcount--query:2.1.0 + image: juplo/wordcount--query:2.1.1 labels: - "traefik.enable=true" - "traefik.http.routers.query.rule=Host(`query.localhost`)" @@ -104,7 +104,7 @@ services: - kafka popular: - image: juplo/wordcount--popular:1.3.0 + image: juplo/wordcount--popular:1.3.1 labels: - "traefik.enable=true" - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" diff --git a/popular b/popular index 73eec81..5ed4826 160000 --- a/popular +++ b/popular @@ -1 +1 @@ -Subproject commit 73eec81b106ad2a145565c8e87bd6fe2a32b617e +Subproject commit 5ed4826dd2502ce8432ae9417462b771ca351e9b diff --git a/query b/query index d835b70..b223786 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit d835b70fc4d49a50f42da9c21b3de1dbcd18cbaf +Subproject commit b223786b36be5a1b1cb02235f90d1ae0e5ffc56c diff --git a/recorder b/recorder index b06e664..5d2525d 160000 --- a/recorder +++ b/recorder @@ -1 +1 @@ -Subproject commit b06e6649f54c4ab58cea812b96301dadbbd23b23 +Subproject commit 5d2525da0fc5ca061d7361cce5614ac53c1867eb diff --git a/splitter b/splitter index 836368a..e834325 160000 --- a/splitter +++ b/splitter @@ -1 +1 @@ -Subproject commit 836368acb5e435a733df5893e477a406daeafcb3 +Subproject commit e834325a1d41d2b448b7e97b7a491e85f02cd403 diff --git a/top10 b/top10 index 238491e..bed1a4e 160000 --- a/top10 +++ b/top10 @@ -1 +1 @@ -Subproject commit 238491ed4d33495202e79879954802e5d0836006 +Subproject commit bed1a4ebf7badd1e8e8dba3c338f8ea05f6cb9e3 diff --git a/users b/users index aa0d1c4..4f16805 160000 --- a/users +++ b/users @@ -1 +1 @@ -Subproject commit aa0d1c4c8e47b2fffc5fa0ca2cae83f64ed8dd4e +Subproject commit 4f16805af7e69c189daa364f113f57ee9abfc079 -- 2.20.1 From ba98888e1b9070219d0f93845287664633e3f01a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 23 Jun 2024 11:53:13 +0200 Subject: [PATCH 12/16] Switched all services to `eclipse-temurin:21-jre` * Kafka Streams uses RocksDB to store data locally. * Unfortunatly, RocksDB dose _not_ work on Alpine Linux. * Therefore, the bigger standard-image has to be used. --- README.sh | 14 +++++++------- counter | 2 +- docker-compose.yml | 14 +++++++------- popular | 2 +- query | 2 +- recorder | 2 +- splitter | 2 +- top10 | 2 +- users | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.sh b/README.sh index 1eb2b70..12b9703 100755 --- a/README.sh +++ b/README.sh @@ -1,13 +1,13 @@ #!/bin/bash FORTUNE=juplo/wordcount--fortune:1.0.1 -RECORDER=juplo/wordcount--recorder:1.2.1 -USERS=juplo/wordcount--users:1.0.6 -SPLITTER=juplo/wordcount--splitter:1.2.1 -COUNTER=juplo/wordcount--counter:1.4.1 -TOP10=juplo/wordcount--top10:1.4.1 -QUERY=juplo/wordcount--query:2.1.1 -POPULAR=juplo/wordcount--popular:1.3.1 +RECORDER=juplo/wordcount--recorder:1.2.2 +USERS=juplo/wordcount--users:1.0.7 +SPLITTER=juplo/wordcount--splitter:1.2.2 +COUNTER=juplo/wordcount--counter:1.4.2 +TOP10=juplo/wordcount--top10:1.4.2 +QUERY=juplo/wordcount--query:2.1.2 +POPULAR=juplo/wordcount--popular:1.3.2 if [ "$1" = "cleanup" ] then diff --git a/counter b/counter index 30e5e8b..996232b 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit 30e5e8b9c41f3db0ede62fd0a903a5e54f151ce6 +Subproject commit 996232bdbc8deeca105854f3f04d66715ecfa269 diff --git a/docker-compose.yml b/docker-compose.yml index cf6febf..c8ec5a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: recorder: - image: juplo/wordcount--recorder:1.2.1 + image: juplo/wordcount--recorder:1.2.2 labels: - "traefik.enable=true" - "traefik.http.routers.recorder.rule=Host(`recorder.localhost`)" @@ -49,7 +49,7 @@ services: - kafka users: - image: juplo/wordcount--users:1.0.6 + image: juplo/wordcount--users:1.0.7 labels: - "traefik.enable=true" - "traefik.http.routers.users.rule=Host(`users.localhost`)" @@ -60,7 +60,7 @@ services: - kafka splitter: - image: juplo/wordcount--splitter:1.2.1 + image: juplo/wordcount--splitter:1.2.2 labels: - "traefik.enable=true" - "traefik.http.routers.splitter.rule=Host(`splitter.localhost`)" @@ -71,7 +71,7 @@ services: - kafka counter: - image: juplo/wordcount--counter:1.4.1 + image: juplo/wordcount--counter:1.4.2 labels: - "traefik.enable=true" - "traefik.http.routers.counter.rule=Host(`counter.localhost`)" @@ -82,7 +82,7 @@ services: - kafka top10: - image: juplo/wordcount--top10:1.4.1 + image: juplo/wordcount--top10:1.4.2 labels: - "traefik.enable=true" - "traefik.http.routers.top10.rule=Host(`top10.localhost`)" @@ -93,7 +93,7 @@ services: - kafka query: - image: juplo/wordcount--query:2.1.1 + image: juplo/wordcount--query:2.1.2 labels: - "traefik.enable=true" - "traefik.http.routers.query.rule=Host(`query.localhost`)" @@ -104,7 +104,7 @@ services: - kafka popular: - image: juplo/wordcount--popular:1.3.1 + image: juplo/wordcount--popular:1.3.2 labels: - "traefik.enable=true" - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" diff --git a/popular b/popular index 5ed4826..b5adc17 160000 --- a/popular +++ b/popular @@ -1 +1 @@ -Subproject commit 5ed4826dd2502ce8432ae9417462b771ca351e9b +Subproject commit b5adc17bf44e22e5cdfabf7e82ab433de44d1abd diff --git a/query b/query index b223786..bcb04c8 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit b223786b36be5a1b1cb02235f90d1ae0e5ffc56c +Subproject commit bcb04c8b890c6b4233835151960cd69b77297af7 diff --git a/recorder b/recorder index 5d2525d..3a77a50 160000 --- a/recorder +++ b/recorder @@ -1 +1 @@ -Subproject commit 5d2525da0fc5ca061d7361cce5614ac53c1867eb +Subproject commit 3a77a501fb93403b6048df4e89c0ba515ac02242 diff --git a/splitter b/splitter index e834325..fa9b1d3 160000 --- a/splitter +++ b/splitter @@ -1 +1 @@ -Subproject commit e834325a1d41d2b448b7e97b7a491e85f02cd403 +Subproject commit fa9b1d34466c3cc8f8daaaefb926f19a1b7f5251 diff --git a/top10 b/top10 index bed1a4e..e4f7f1e 160000 --- a/top10 +++ b/top10 @@ -1 +1 @@ -Subproject commit bed1a4ebf7badd1e8e8dba3c338f8ea05f6cb9e3 +Subproject commit e4f7f1e134ae40ac8d4002a742f8426327cf177b diff --git a/users b/users index 4f16805..f589298 160000 --- a/users +++ b/users @@ -1 +1 @@ -Subproject commit 4f16805af7e69c189daa364f113f57ee9abfc079 +Subproject commit f58929826f3dd8087afbfa3e8f2ac6e776267d40 -- 2.20.1 From decd75b90f2b21cfbef1e2d144070b71d4ffde48 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 23 Jun 2024 12:00:08 +0200 Subject: [PATCH 13/16] If some images are missing, only the missing images are build --- README.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/README.sh b/README.sh index 12b9703..62805c6 100755 --- a/README.sh +++ b/README.sh @@ -35,26 +35,79 @@ if [[ "$1" = "build" ]] then - mvn clean package || exit - docker compose rm -svf recorder users splitter counter top10 query popular + docker compose rm -svf bart riddler nerd recorder users splitter counter top10 query popular +fi + +if [[ $(docker image ls -q $FORTUNE) == "" || "$1" = "build" ]] +then + echo "Building image $FORTUNE" ( cd fortune; ./README.sh $FORTUNE; ) - mvn -f recorder/pom.xml docker:build - mvn -f users/pom.xml docker:build - mvn -f splitter/pom.xml docker:build - mvn -f counter/pom.xml docker:build - mvn -f top10/pom.xml docker:build - mvn -f query/pom.xml docker:build - mvn -f popular/pom.xml docker:build else - echo "Using existing images:" - docker image ls $FORTUNE - docker image ls $RECORDER - docker image ls $USERS - docker image ls $SPLITTER - docker image ls $COUNTER - docker image ls $TOP10 - docker image ls $QUERY - docker image ls $POPULAR + echo -n "Using existing image for $FORTUNE: " + docker image ls --format json $FORTUNE | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $RECORDER) == "" || "$1" = "build" ]] +then + echo "Building image $RECORDER" + mvn -f recorder/pom.xml clean package docker:build +else + echo -n "Using existing image for $RECORDER: " + docker image ls --format json $RECORDER | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $USERS) == "" || "$1" = "build" ]] +then + echo "Building image $USERS" + mvn -f users/pom.xml clean package docker:build +else + echo -n "Using existing image for $USERS: " + docker image ls --format json $USERS | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $SPLITTER) == "" || "$1" = "build" ]] +then + echo "Building image $SPLITTER" + mvn -f splitter/pom.xml clean package docker:build +else + echo -n "Using existing image for $SPLITTER: " + docker image ls --format json $SPLITTER | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $COUNTER) == "" || "$1" = "build" ]] +then + echo "Building image $COUNTER" + mvn -f counter/pom.xml clean package docker:build +else + echo -n "Using existing image for $COUNTER: " + docker image ls --format json $COUNTER | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $TOP10) == "" || "$1" = "build" ]] +then + echo "Building image $TOP10" + mvn -f top10/pom.xml clean package docker:build +else + echo -n "Using existing image for $TOP10: " + docker image ls --format json $TOP10 | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $QUERY) == "" || "$1" = "build" ]] +then + echo "Building image $QUERY" + mvn -f query/pom.xml clean package docker:build +else + echo -n "Using existing image for $QUERY: " + docker image ls --format json $QUERY | jq -r '(.ID + " - " + .CreatedSince)' +fi + +if [[ $(docker image ls -q $POPULAR) == "" || "$1" = "build" ]] +then + echo "Building image $POPULAR" + mvn -f popular/pom.xml clean package docker:build +else + echo -n "Using existing image for $POPULAR: " + docker image ls --format json $POPULAR | jq -r '(.ID + " - " + .CreatedSince)' fi -- 2.20.1 From 666513244291c3cd45de721cf82a1f2fefb0202c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 25 Jun 2024 06:26:40 +0200 Subject: [PATCH 14/16] WIP --- .gitmodules | 4 ++++ stats | 1 + 2 files changed, 5 insertions(+) create mode 160000 stats diff --git a/.gitmodules b/.gitmodules index 0126226..aa65726 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,3 +33,7 @@ path = popular url = ./ branch = popular +[submodule "stats"] + path = stats + url = ./ + branch = stats diff --git a/stats b/stats new file mode 160000 index 0000000..6074f6d --- /dev/null +++ b/stats @@ -0,0 +1 @@ +Subproject commit 6074f6d1089a8a40944fff2c7b1f15d6e1c04108 -- 2.20.1 From 69fdb8a20a647e946c4d96f9b98573a564e7859b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 25 Jun 2024 07:07:45 +0200 Subject: [PATCH 15/16] WIP --- stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats b/stats index 6074f6d..28f7fff 160000 --- a/stats +++ b/stats @@ -1 +1 @@ -Subproject commit 6074f6d1089a8a40944fff2c7b1f15d6e1c04108 +Subproject commit 28f7fff6226d6f01f2c06b9d43c4b62aaf2c9ebe -- 2.20.1 From ebe0ce6465460d55b13eca643d3fd8234b917bfe Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 25 Jun 2024 07:09:10 +0200 Subject: [PATCH 16/16] WIP --- query | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query b/query index bcb04c8..9c1b637 160000 --- a/query +++ b/query @@ -1 +1 @@ -Subproject commit bcb04c8b890c6b4233835151960cd69b77297af7 +Subproject commit 9c1b63783704ee2adf031441ad13bfaba65f5969 -- 2.20.1