This demo uses a number of cloud technologies to implement a simple game from the earlier days of computing: Minesweeper!
Technologies include:
- JQuery-based Minesweeper written by Nick Arocho and available on GitHub.
- Backend baed on MicroProfile and Thorntail (part of Red Hat OpenShift Application Runtimes to persist scoreboard
- Deployed using Red Hat OpenShift and the Open Service Broker to deploy Cosmos DB on Microsoft Azure.
These steps are necessarily high level and encompass many smaller steps that will be added later.
- Get an Azure Account (e.g. using an Azure Pass)
- Use an OpenShift OKD all-in-one installer to deploy to Azure. Takes about 20 minutes.
- Install the Open Service Broker for Azure version 0.11.0 (use the helm charts
--version 0.11.0
option) to your OpenShift instance - Note the latest Open Service Broker has temporarily removed Cosmos DB as it's considered experimental!
- Provision an instance of CosmosDB to a new OpenShift project using the Service Broker, and elect to create a binding to a new project
- Deploy this sample app to that project via:
mvn clean package fabric8:deploy
- Edit the
microsweeper
Deployment Config and add new environment variables based on the newly-created secret from the service instance. - Be sure to use a
SCORESDB_
prefix when adding the env vars
Then run mvn clean package fabric8:deploy
to deploy.
Once deployed access the UI using the route exposed via OpenShift. And re-live your youth like a boss.
Service Catalog in OpenShift
Deploying Azure service through OpenShift Service Catalog
OpenShift Project with deployed service
Money Shot
Browsing Minesweeper scoreboard from Azure Portal
Sample Dependencies
<!-- microprofile -->
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>microprofile-health</artifactId>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>microprofile-config</artifactId>
</dependency>
oc set probe dc/microsweeper --liveness --readiness --get-url=http://:8080/health --initial-delay-seconds=30 --period-seconds=15 --timeout-seconds=5 --failure-threshold=5