Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Orchestration at the Edge with Nomad

Orchestration at the Edge with Nomad

In this demo, I showcase a hardware concept for "Badge Computing" and how HashiCorp Nomad can be used to make a "smart" conference badge.

This version of the demo was given at Seeed Studio's Pi Day stream in March 2024.

Kerim Satirli

March 14, 2024
Tweet

Video


Resources

eInk conference badge

https://github.com/workloads/baedge

This repository has all the code (and information) you need to get started with building your own eInk conference badge.

Nomad Pack for eInk conference badge

https://github.com/workloads/nomad-pack-registry/tree/main/packs/baedge

This repository has the [Nomad Pack](https://github.com/hashicorp/nomad-pack) configuration for the `baedge` application server.

More Decks by Kerim Satirli

Other Decks in How-to & DIY

Transcript

  1. 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
  2. computing that takes place on your conference or event badge,

    using a SBC and e-paper screen. noun badge com·put·ing
  3. 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
  4. :(

  5. """ 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
  6. # 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
  7. 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.
  8. 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
  9. # 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