Slide 1

Slide 1 text

Industrial Mining at Scale (A Minecraft Story)

Slide 2

Slide 2 text

Industrial Mining at Scale (A Minecraft Story)

Slide 3

Slide 3 text

Sr. Developer Advocate at HashiCorp he / him @ksatirli Kerim Satirli

Slide 4

Slide 4 text

Aletta

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Challenge: Dig less, build more.

Slide 7

Slide 7 text

Let's build a Minecraft Bot

Slide 8

Slide 8 text

chat interface and API (2 of 3) Laws of Robotics health endpoint

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

FROM !"platform=linux/amd64 node:18-alpine3.16 LABEL org.opencontainers.image.authors='ksatirli' LABEL org.opencontainers.image.url='github.com/workloads/minecraft-bot' LABEL org.opencontainers.image.description='Excavation Assistant' LABEL org.opencontainers.image.licenses='Apache-2.0' LABEL org.opencontainers.image.source='github.com/workloads/minecraft-bot' COPY ./ / WORKDIR / RUN npm install CMD [ "node", "dist/index.js" ] Dockerfile Container Image

Slide 11

Slide 11 text

AWS: us-west-2

Slide 12

Slide 12 text

job "minecraft" { datacenters = ["aws"] type = "service" namespace = "default" priority = 99 group "minecraft" { count = 1 ephemeral_disk { migrate = true size = 1024 sticky = true } network { mode = "host" Minecraft Server server.nomad.hcl

Slide 13

Slide 13 text

nomad run server.nomad.hcl Terminal Minecraft Server ==> Monitoring evaluation "e614d2f7" Evaluation triggered by job "minecraft" Allocation "82aa9f54" created Evaluation status: "complete" ==> Evaluation "e614d2f7" finished.

Slide 14

Slide 14 text

nomad-leader.svcs.dev:4646 Minecraft Server

Slide 15

Slide 15 text

Demo

Slide 16

Slide 16 text

Let's deploy a Minecraft Bot

Slide 17

Slide 17 text

job "minecraft-bot" { task "minecraft_bot" { driver = "docker" config { image = "ghcr.io/workloads/minecraft-bot:v20231010" ports = [ "api", "inventory", ] } env { # APP CONFIGURATION DEBUG = "false" LOG_COLOR = "true" Minecraft Bot bot.nomad.hcl

Slide 18

Slide 18 text

nomad-leader.svcs.dev:4646 Minecraft Bot

Slide 19

Slide 19 text

nomad run bot.nomad.hcl Terminal Multi-Region Deployment ==> Monitoring evaluation "c6118496" Evaluation triggered by job "bot" Allocation "8862fb0e" created Allocation "cae76d09" created Allocation "ff1f1972" created Evaluation status: "complete" ==> Evaluation "c6118496" finished.

Slide 20

Slide 20 text

EMEA AMER APAC Multi-Region Deployment

Slide 21

Slide 21 text

data "aws_regions" "main" {} regional_deployments.tf Multi-Region Deployment

Slide 22

Slide 22 text

aws_regions = toset([ "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ca-central-1", "eu-central-1", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "me-south-1", "sa-east-1", Terraform Console Multi-Region Deployment

Slide 23

Slide 23 text

module "regional_aws_workspaces" { for_each = toset(data.aws_regions.main.names) source = "ksatirli/regional-workspace/tfe" version = "1.2.0" region = { category = "terraform" identifier = each.key prefix = "aws" variable = "aws_region" } vcs_repo = { identifier = "workloads/regional-aws-deployment" branch = "main" } } regional_deployments.tf Multi-Region Deployment

Slide 24

Slide 24 text

Multi-Region Deployment

Slide 25

Slide 25 text

console.aws.amazon.com/support Multi-Region Deployment

Slide 26

Slide 26 text

✉ from AWS Support

Slide 27

Slide 27 text

app.terraform.io/app/workloads/workspaces Multi-Region Deployment

Slide 28

Slide 28 text

Demo

Slide 29

Slide 29 text

deployed an army of bots to do our bidding learned about Cloud Geography provisioned resilient infrastructure built a bot and containerized it Recap

Slide 30

Slide 30 text

Demo Code github.com/workloads/

Slide 31

Slide 31 text

speakerdeck.com/ksatirli