Slide 1

Slide 1 text

{Ba,E}dge Computing Adding Compute to Conference Badges

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

Sr. Solutions Architect at HashiCorp and former Site Reliability Engineer @sofixa Adrian Todorov

Slide 4

Slide 4 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 5

Slide 5 text

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

Slide 6

Slide 6 text

1 The Idea

Slide 7

Slide 7 text

Speaker Kerim Satirli

Slide 8

Slide 8 text

Speaker Kerim Satirli conference branding reusable frame low-powered screen

Slide 9

Slide 9 text

Nomad for job orchestration Raspberry Pi Zero 2 W battery shield

Slide 10

Slide 10 text

"Wearer" screen Speaker Kerim Satirli

Slide 11

Slide 11 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 12

Slide 12 text

2 The Problem(s)

Slide 13

Slide 13 text

2.1 Targeting

Slide 14

Slide 14 text

Problem: not all workers may be eligible for work

Slide 15

Slide 15 text

Software Support ▪ operating system (type and version) ▪ system-specific device fingerprinting ▪ driver and port availability Hardware Support ▪ CPU architecture and speed ▪ resource availability (disk / memory) ▪ security rating (ports exposed or sealed) Targeting Patterns

Slide 16

Slide 16 text

Uplinks ▪ wired or wireless (or both) ▪ fall-back uplinks and networks ▪ additional uplink methods Power ▪ hardwired or battery ▪ battery health (cycles, maintenance) ▪ battery percentage vs. required runtime Targeting Patterns, cont'd.

Slide 17

Slide 17 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 18

Slide 18 text

job "baedge" { region = "baedges" datacenters = [“edge"] node_pool = "baedges" type = "system" namespace = "default" priority = 10 constraint { attribute = "${attr.kernel.arch}" value = "aarch64" } group "baedge" { constraint { attribute = "${meta.battery_level}" operator = ">" baedge.nomad.hcl Constraints

Slide 19

Slide 19 text

node_pool = "baedges" type = "system" namespace = "default" priority = 10 constraint { attribute = "${attr.kernel.arch}" value = "aarch64" } group "baedge" { constraint { attribute = "${meta.battery_level}" operator = ">" value = "33" } constraint { attribute = "${meta.battery_cycles}" operator = "<" value = "400" } constraint { attribute = "${meta.epaper_size}" value = "2in7b" baedge.nomad.hcl Constraints

Slide 20

Slide 20 text

value = "33" } constraint { attribute = "${meta.battery_cycles}" operator = "<" value = "400" } constraint { attribute = "${meta.epaper_size}" value = "2in7b" } constraint { attribute = "${meta.epaper_revision}" value = "V2" } ephemeral_disk { migrate = true size = 128 sticky = false } baedge.nomad.hcl Constraints

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

runtime (h) battery capacity (mAh) power consumption (mW) =

Slide 23

Slide 23 text

runtime (h) = 4.92 h (under max. load)

Slide 24

Slide 24 text

Power-up? arstechnica.com/science/2023/05/researchers-craft-a-fully-edible-battery

Slide 25

Slide 25 text

2.2 Connectivity

Slide 26

Slide 26 text

Problem: not all workers may have healthy backhauls

Slide 27

Slide 27 text

local-first ▪ limit need for active uplinks ▪ gracefully degrade service ▪ architect for local operations reconnecting ▪ back-off and retry strategy ▪ support for network roaming ▪ alternate backhauls) Connectivity Patterns

Slide 28

Slide 28 text

data / system integrity ▪ data deduplication strategy ▪ forced updates ▪ manage device replacement lifecycle coverage ▪ continuously evaluate service ▪ map outages (time, physical location) ▪ expand coverage of network Connectivity Patterns, cont'd.

Slide 29

Slide 29 text

! reception okay'ish frequently disconnects

Slide 30

Slide 30 text

Connectivity Spectrum Scan (2.4 GHz) 09:12 10:24 11:36 12:48 14:00 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Channels

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

namespace = "default" priority = 10 node_pool = "baedges" constraint { attribute = "${attr.kernel.arch}" value = "aarch64" } group "baedge" { disconnect { ttl = "4h" stop_after = "2h" replace = true reconcile = "keep_original" } ephemeral_disk { migrate = true size = 128 sticky = false } network { mode = "host" baedge.nomad.hcl Disconnect

Slide 33

Slide 33 text

Observability https:!"grafana.local.workloads.io/

Slide 34

Slide 34 text

2.3 Applications

Slide 35

Slide 35 text

Problem: not all workloads may be built "agreeably" built like, well, "

Slide 36

Slide 36 text

flexible ▪ hot-reload config ▪ functional tiers tolerant ▪ gracefully degrade ▪ easy deployments Application Patterns

Slide 37

Slide 37 text

observable ▪ predict maintenance ▪ utilize digital twins mindfully replaceable ▪ data inheritance strategy ▪ modular SW / HW architecture Application Patterns, cont'd.

Slide 38

Slide 38 text

03 Prototyping

Slide 39

Slide 39 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 logging.basicConfig(level=cfg.app["logging"]["level"]) hlp.log_debug(!#name!#, 'detected platform: `' + platform.system() + '`') baedge.py

Slide 40

Slide 40 text

object: Object containing EPD library and configuration """ hlp.log_debug('initialize_screen', 'init function') try: epd = epd_library.EPD() hlp.log_debug('initialize_screen', 'initialize screen') epd.init() hlp.log_debug('initialize_screen', 'clear screen') epd.Clear() hlp.log_debug('initialize_screen', 'end function') return epd except IOError as e: hlp.log_exception('initialize_screen', e) return None def clear_screen(epd, sleep_screen=False): """ Clear contents on screen baedge.py

Slide 41

Slide 41 text

"SCaLE" screen

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Camera

Slide 44

Slide 44 text

This talk wasn't about conference badges.

Slide 45

Slide 45 text

This talk was about fault tolerance on the edge.

Slide 46

Slide 46 text

Demo Code github.com/workloads/baedge

Slide 47

Slide 47 text

Thank you speakerdeck.com/ksatirli