/game-of-stacks

We try to compare different way of running a Quarkus Java service (GraalVM, Hotspot) using the monitoring power of Kiali. This repository contains the code of a simulation game showing the attack of Winterfell by a group of scary microservices. We’ll try to keep trolls out of the battle. :-)

Primary LanguageKotlinApache License 2.0Apache-2.0

Game of Stacks

The Game of Stacks shows the power of different stacks and VMs in the Java world (Quarkus, Vert.x ; native versus hotspot/openj9) depending on the business logic, by deploying a set of microservices in several variants and comparing their behaviours.

White walkers are coming! Winterfell is under attack! We'll try to find the best combination of heroes and weapons to defeat them!

Game

Kiali will help us to figure out the interactions between microservices and to compare some metrics.

Graph Metrics

Running locally

Kafka

  • With docker-compose:
make start-kafka
  • From local installation (example)
cd ~/apps/kafka_2.12-2.3.0/
bin/zookeeper-server-start.sh config/zookeeper.properties
# Open new terminal
bin/kafka-server-start.sh config/server.properties 

GoS services

make clean install start-web
# then Open http://localhost:8081
make start

Running on Kubernetes or OpenShift

Assuming Kube or OS is up and running

# Deploy Strimzi/Kafka in namespace "kafka"
make deploy-kafka

# Build GoS
make clean build build-native

# Build docker images & deploy
## For docker:
make docker deploy

## For podman:
make podman deploy

# Expose (port-forward)
make expose
# Then open browser on http://localhost:8081

It starts with all deployments scaled to 0, except the web interface. To start the demo:

# Deploys 5 heroes (native), arrows (native), villains (oj9)
make arrow-scaling-hero-native-vs-hotspot--native

# Redeploys with 5 heroes (hotspot), arrows (native), villains (oj9)
make arrow-scaling-hero-native-vs-hotspot--hotspot

# Redeploys with 4 heroes (mix hotspot/native), arrows (native), villains (oj9)
make start-mixed

# With more villains
make more-villains start-mixed

# MUCH more villains
make much-more-villains start-mixed

TODO

Next steps:

  • Reintroduce catapult
  • Differentiate sprites with text (e.g. graal/hotspot)

Istio

make deploy-istio
make enable-istio
# in new term
make expose-kiali

To disable:

make disable-istio

Resources