Slide 1

Slide 1 text

Badge Computing Orchestration at the Edge with Nomad

Slide 2

Slide 2 text

Sr. Developer Advocate at HashiCorp for Infrastructure and Orchestration @ksatirli Kerim Satirli

Slide 3

Slide 3 text

computing that takes place at or near the physical location of the producer or consumer of data. point of presence mobile datacenter Similar: edge com·put·ing noun

Slide 4

Slide 4 text

computing that takes place on your conference or event badge, using a SBC and e-paper screen. noun badge com·put·ing

Slide 5

Slide 5 text

01 Inspiration to Design

Slide 6

Slide 6 text

Pi Day Conf !

Slide 7

Slide 7 text

PiDayConf Speaker Kerim Satirli

Slide 8

Slide 8 text

PiDayConf Speaker Kerim Satirli conference branding plastic frame low-powered screen

Slide 9

Slide 9 text

Nomad for job orchestration Raspberry Pi Zero 2 W ESP32 battery shield

Slide 10

Slide 10 text

PiDayConf Speaker Kerim Satirli back front

Slide 11

Slide 11 text

"Wearer" screen PiDayConf Speaker Kerim Satirli

Slide 12

Slide 12 text

PiDayConf "Nomad" screen "Baedge" screen Allocation: 1a2b3c4d Address: 192.168.0.246 Version: 1.7.5 Nomad Runtime PiDayConf Kerim Satirli Model: 2in7b Revision: v2 BAEDGE

Slide 13

Slide 13 text

02 Design to Prototype

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

:(

Slide 16

Slide 16 text

""" application """ import importlib import logging import os import platform import qrcode from PIL import Image, ImageDraw, ImageFont import helpers as hlp import config as cfg def write_screen(epd, screen_name, sleep_screen=False): """ Write contents to screen baedge.py

Slide 17

Slide 17 text

# iterate over shape items for screen if "shapes" in screen: for item in screen["shapes"]: hlp.log_debug('write_screen:shape', item) if item["coordinates"] and item["fill"] and item["type"]: coordinates = item["coordinates"] fill = item["fill"] # don't use `type` as it overrides a builtin shape_type = item["type"] hlp.log_debug('write_screen:shape', 'write shape') hlp.log_debug('write_screen:shape', 'shape_type is: ' + shape_type) else: hlp.log_debug('write_screen:shape', 'incomplete data, skip write shape') # iterate over text items for screen if "texts" in screen: for item in screen["texts"]: hlp.log_debug('write_screen:text', item) baedge.py

Slide 18

Slide 18 text

Model: 2in7b Revision: v2 {Ba,E}dge Hardware

Slide 19

Slide 19 text

HashiCorp Nomad https:!"nomadproject.io/ Container Orchestration Deploy, manage, and scale containers in production with ease. Application Orchestration Deploy and manage legacy applications without the need to refactor or rewrite. Alternative to Kubernetes Deploy and scale containers without complexity. Multi-Orchestrator Pattern Deploy and scale containers with multiple orchestrators. Multi-OS Support Deploy to Linux, macOS, or Microsoft Windows. Edge Workload Management Globally scale edge deployments with a simple single-cluster topology.

Slide 20

Slide 20 text

job "baedge" { region = "baedges" datacenters = ["edge"] type = "system" namespace = "default" priority = 10 node_pool = "baedges" group "baedge" { network { mode = "host" port "main" { static = 2343 to = 2343 } } baedge.nomad.hcl

Slide 21

Slide 21 text

# general configuration LOG_LEVEL="!# .log_level !$" # Baedge-specific configuration BAEDGE_FONTS_PATH="!# .baedge_fonts_path !$" BAEDGE_HARDWARE_MODEL="!# .baedge_hardware_model !$" BAEDGE_HARDWARE_REVISION="!# .baedge_hardware_revision !$" BAEDGE_MEDIA_PATH="!# .baedge_media_path !$" BAEDGE_SERVER_DEBUG="!# .baedge_server_debug !$" BAEDGE_SERVER_PORT = "2343" # (human) wearer-specific configuration BAEDGE_WEARER_NAME="!# .baedge_wearer_name !$" BAEDGE_WEARER_TITLE="!# .baedge_wearer_title !$" BAEDGE_WEARER_SOCIAL="!# .baedge_wearer_social !$" BAEDGE_WEARER_LINK="!# .baedge_wearer_link !$" !# end !$ # Nomad-specific configuration NOMAD_VERSION = "!# env "attr.nomad.version" !$" DATA destination = "${NOMAD_ALLOC_DIR}/.env" env = true error_on_missing_key = true baedge.nomad.hcl

Slide 22

Slide 22 text

Nomad UI on reTerminal

Slide 23

Slide 23 text

Baedge UI on reTerminal

Slide 24

Slide 24 text

03 Prototype to Next Steps

Slide 25

Slide 25 text

"Wearer" screen

Slide 26

Slide 26 text

"Nomad" screen "Baedge" screen Allocation: 1a2b3c4d Address: 192.168.0.246 Version: 1.7.5 Nomad Runtime

Slide 27

Slide 27 text

Camera

Slide 28

Slide 28 text

Demo Code

Slide 29

Slide 29 text

Thank you speakerdeck.com/ksatirli