Skip to content

alainpham/business-platform

Repository files navigation

business platform demo

This is a guide to deploy a set of synchronous and asynchronous microservices in spring boot to observed with & Grafana LGTM OSS stack or Grafana Cloud.

architecture diagram

alt text

build services and run using docker

build docker locally

mvn install
mvn clean package exec:exec@rmi exec:exec@build -f hub/pom.xml
mvn clean package exec:exec@rmi exec:exec@build -f availability-calculator/pom.xml
mvn clean package exec:exec@rmi exec:exec@build -f notification-dispatcher/pom.xml
mvn clean package exec:exec@rmi exec:exec@build -f sms/pom.xml
mvn clean package exec:exec@rmi exec:exec@build -f email/pom.xml

mvn clean package exec:exec@rmi exec:exec@build -f smoke-test/pom.xml
mvn clean package exec:exec@rmi exec:exec@build -f flow-log-simulator/pom.xml

push to dockerhub

mvn exec:exec@push -f hub/pom.xml
mvn exec:exec@push -f availability-calculator/pom.xml
mvn exec:exec@push -f notification-dispatcher/pom.xml
mvn exec:exec@push -f sms/pom.xml
mvn exec:exec@push -f email/pom.xml

mvn exec:exec@push -f smoke-test/pom.xml
mvn exec:exec@push -f flow-log-simulator/pom.xml

generate yaml

mvn install
mvn exec:exec@kyml -f hub/pom.xml
mvn exec:exec@kyml -f availability-calculator/pom.xml
mvn exec:exec@kyml -f notification-dispatcher/pom.xml
mvn exec:exec@kyml -f sms/pom.xml
mvn exec:exec@kyml -f email/pom.xml

mvn exec:exec@kyml -f smoke-test/pom.xml
mvn exec:exec@kyml -f flow-log-simulator/pom.xml

run local container in background with otel

mvn exec:exec@runoteld -f hub/pom.xml
mvn exec:exec@runoteld -f availability-calculator/pom.xml
mvn exec:exec@runoteld -f notification-dispatcher/pom.xml
mvn exec:exec@runoteld -f sms/pom.xml
mvn exec:exec@runoteld -f email/pom.xml

mvn exec:exec@runoteld -f smoke-test/pom.xml
mvn exec:exec@runoteld -f flow-log-simulator/pom.xml

run k6 test

docker run -d --rm \
  --name k6 \
  --network primenet \
  -v $(pwd)/k6/script.js:/config/script.js:ro \
  -v $(pwd)/k6/loop.sh:/home/k6/loop.sh:ro \
  --entrypoint /bin/sh \
  grafana/k6:1.0.0-with-browser \
  /home/k6/loop.sh

stop everything

docker stop hub availability-calculator notification-dispatcher sms email smoke-test flow-log-simulator k6

build and run local with otel for testing

mvn install
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f hub/pom.xml
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f availability-calculator/pom.xml
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f notification-dispatcher/pom.xml
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f sms/pom.xml
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f email/pom.xml

mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f smoke-test/pom.xml
mvn clean package exec:exec@rmi exec:exec@build exec:exec@runotel -f flow-log-simulator/pom.xml

build and push to dockerhub in multi arch

mvn install
mvn clean package exec:exec@buildpush -f hub/pom.xml
mvn clean package exec:exec@buildpush -f availability-calculator/pom.xml
mvn clean package exec:exec@buildpush -f notification-dispatcher/pom.xml
mvn clean package exec:exec@buildpush -f sms/pom.xml
mvn clean package exec:exec@buildpush -f email/pom.xml

mvn clean package exec:exec@buildpush -f smoke-test/pom.xml
mvn clean package exec:exec@buildpush -f flow-log-simulator/pom.xml

remove all images

mvn clean exec:exec@rmi -f hub/pom.xml
mvn clean exec:exec@rmi -f availability-calculator/pom.xml
mvn clean exec:exec@rmi -f notification-dispatcher/pom.xml
mvn clean exec:exec@rmi -f sms/pom.xml
mvn clean exec:exec@rmi -f email/pom.xml

mvn clean exec:exec@rmi -f smoke-test/pom.xml
mvn clean exec:exec@rmi -f flow-log-simulator/pom.xml

k8s deployment

kubectl create ns java-apps
kubectl apply -n java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/hub-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/availability-calculator-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/notification-dispatcher-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/sms-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/email-deploy.yaml

kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/k6.yaml

additional things

kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/smoke-test-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/flow-log-simulator-deploy.yaml


kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/hub-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/availability-calculator-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/notification-dispatcher-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/sms-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/email-deploy.yaml

kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/k6.yaml

kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/smoke-test-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/flow-log-simulator-deploy.yaml

k8s deployment without otel

kubectl create ns java-apps
kubectl apply -n java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/hub-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/availability-calculator-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/notification-dispatcher-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/sms-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/email-deploy.yaml

kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/k6.yaml

kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/smoke-test-deploy.yaml
kubectl apply -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment-no-otel/flow-log-simulator-deploy.yaml


kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/hub-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/availability-calculator-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/notification-dispatcher-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/sms-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/email-deploy.yaml

kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/k6.yaml

kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/smoke-test-deploy.yaml
kubectl delete -n  java-apps -f https://raw.githubusercontent.com/alainpham/business-platform/refs/heads/master/k8s-deployment/flow-log-simulator-deploy.yaml

generate k8s deployment yaml

mvn exec:exec@kyml -f hub/pom.xml
mvn exec:exec@kyml -f availability-calculator/pom.xml
mvn exec:exec@kyml -f notification-dispatcher/pom.xml
mvn exec:exec@kyml -f sms/pom.xml
mvn exec:exec@kyml -f email/pom.xml

mvn exec:exec@kyml -f smoke-test/pom.xml
mvn exec:exec@kyml -f flow-log-simulator/pom.xml
 

cp **/target/*-deploy.yaml ./k8s-deployment

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published