Skip to main content
Version: v3.8.0

Acme Smart Plant Tutorial

Greenfield release: v3.8.0

Platform train v3.8.0 is a greenfield release. Complete the Migrating to v3.8.0 checklist before running this tutorial.

This tutorial deploys the Acme Smart Plant reference demo on a live ECN. You use potctl YAML from the pot-edge-patterns repo. No hand-built NATS credentials and no Kubernetes manifests.

The story has two phases:

  1. Phase 1, Smart factory: four CNC/press machines on site-a, remote operations dashboard on ops-b
  2. Phase 2, Fab vision inspection: wafer frames on site-a, ONNX inference on edge-c, inspection gallery on ops-b

Scenario

Acme runs a production floor with four machines (M001M004). A sensor-simulator replays curated manufacturing rows. A smart-anomaly-detector watches telemetry and raises alerts. Operators on ops-b see fleet charts, live alerts, and an event journal without exposing raw factory telemetry outside the plant NATS account.

When a fault fires, the dashboard calls diagnostic-service on site-a through a Router bridge. Phase 2 adds wafer inspection: frame-generator publishes thumbnails, object-detector runs wafer-defect ONNX on edge-c, and snapshot-service serves a gallery on ops-b.

Default Edgelet node names are site-a, ops-b, and edge-c. Override agent.name in Application YAML if your ECN uses different names.

Topology

Three Edgelet nodes, two NATS integration styles, and Router HTTP bridges:

PoT primitives in one plant story:

PrimitiveWhere you see it
In-account NATS pub/subTelemetry inside production-monitoring
Cross-account NATS export/importAlerts and fleet telemetry from plant to operations-center
Router Service interconnectDashboard on ops-b calls HTTP on site-a
Edge AI placementONNX inference on edge-c for fab inspection

NATS subjects and cross-account rules

Phase 1 splits workloads into two NATS accounts:

AccountApplicationEdgelet node
production-monitoringPlant floor microservicessite-a
operations-centerAlert dashboardops-b

Inside the plant account, microservices talk on subjects such as telemetry.machine.{machineId}. Raw telemetry stays local until you explicitly export it.

Steps 2 and 4 wire cross-account delivery to ops-b:

Subject patternNATS kindPurpose
notify.alerts.>Service export/importLive alert panel (ephemeral)
journal.events.>Stream export/importEvent journal (JetStream, durable)
telemetry.machine.>Service export/importRead-only fleet sparklines on the dashboard

Step 2 adds an export rule on production-monitoring. After you deploy the plant Application (step 3), run potctl get nats-accounts and copy the account public key (step 4). Step 5 deploys the matching import rule on operations-center.

When the detector fires, it publishes the same alert JSON on two paths: notify.alerts.{machineId} for immediate UI updates and journal.events.{machineId} for audit history.

Phase 2 adds vision-inspection with subjects vision.wafers.> and vision.inspections.>. Steps 11 and 12 add vision user rules and an in-account NATS rule. Unlike Phase 1, vision traffic stays in one account across three nodes. There is no cross-application import for the fab pipeline.

Demo image version (v1.1.0)

Use ghcr.io/datasance/pot-edge-patterns/*:1.1.0 for every microservice in this tutorial. Do not mix :1.0.0 and :1.1.0 images in one Application.

Areav1.0.0 (deprecated)v1.1.0 (this tutorial)
Telemetry subjecttelemetry.temperaturetelemetry.machine.{machineId}
Telemetry payloadSingle °C valueMulti-metric JSON + status/faultType
Vision subjectsvision.frames.* / vision.detections.*vision.wafers.* / vision.inspections.*
Vision modelMobileNet / forklift imagesWafer defect ONNX
DashboardAlert list onlyFleet sparklines + fault types + fab link

A full redeploy is required when moving from v1.0.0. Update NATS user rules (steps 1 and 11), re-apply export/import (steps 2 and 5), redeploy Applications with :1.1.0 images, and recreate Services if bridge ports change.

Prerequisites

Before you start:

  1. A provisioned ECN on platform train v3.8.0 with Controller reachable
  2. Edgelet v1.0.0+ nodes provisioned. Phase 1 needs site-a and ops-b. Phase 2 also needs edge-c
  3. potctl v3.8.0 configured for your namespace
  4. Completed Quick Start With Local Deployment or an equivalent production deploy from Platform Deployment

Optional: set your current namespace before deploying:

potctl configure current-namespace <your-namespace>

Each deploy step uses potctl deploy -f with a manifest from pot-edge-patterns:

potctl deploy -f deploy/steps/01-nats-user-rules.yaml

Application manifests use your flavor apiVersion:

Application header
---
apiVersion: datasance.com/v3
kind: Application
metadata:
name: production-monitoring
spec:
agent:
name: site-a

Clone pot-edge-patterns and run deploy commands from that repo root on your configured ECN.

Step index

Follow these steps in order. YAML steps map to files under deploy/steps/ in pot-edge-patterns. Manual steps collect values you paste into later YAML.

Phase 1: Smart factory

StepActionTypePage
1Deploy NATS user rulesYAMLStep 1: NATS user rules
2Deploy production-monitoring export ruleYAMLStep 2: NATS account export
3Deploy site-a microservices (sensor, detector, diagnostic)YAMLStep 3: Production monitoring Application
4potctl get nats-accounts: copy account public keyManualStep 4: Copy account key
5Replace <production-monitoring-account-id>, deploy import ruleYAMLStep 5: NATS account import
6Create diagnostic ServiceYAMLStep 6: Diagnostic Service
7potctl describe service diagnostic-service: note bridge portManualStep 7: Note bridge port
8Set DIAGNOSTIC_URL, deploy operations-center ApplicationYAMLStep 8: Operations center Application
9Create alert-dashboard ServiceYAMLStep 9: Alert dashboard Service
10Optional: set ports.external on alert-dashboard for direct agent IP accessManual(documented in Step 9)

Phase 2: Fab vision inspection

StepActionTypePage
11Deploy vision NATS user rulesYAMLStep 11: Vision NATS user rules
12Deploy in-account vision NATS ruleYAMLStep 12: Vision NATS account rule
13Deploy frame-generator, object-detector, snapshot microservicesYAMLStep 13: Vision inspection Application
14Create snapshot ServiceYAMLStep 14: Snapshot Service
15potctl describe service snapshot-service: set SNAPSHOT_URL on dashboardManualStep 15: Set SNAPSHOT_URL

Numbering: Tutorial steps use step-01step-09 (Phase 1) and step-11step-15 (Phase 2). YAML files under deploy/steps/ in pot-edge-patterns use a different index (for example 04-nats-account-import.yaml is tutorial step 5).

Placeholder cheat sheet

PlaceholderHow to obtain
<production-monitoring-account-id>potctl get nats-accounts after step 3
<diagnostic-bridge-port>potctl describe service diagnostic-service
<dashboard-bridge-port>potctl describe service alert-dashboard
<snapshot-bridge-port>potctl describe service snapshot-service
<agent-site-a>Your Edgelet node name (default site-a)

Operating the demo

After you finish the deploy steps, use Operating the demo to replay faults, walk through dual NATS delivery and Router diagnose, validate smoke tests, and recover from a bad state.

Verification checklist

After Phase 1:

  • sensor-simulator logs show four machines publishing on telemetry.machine.{machineId}
  • Dashboard fleet panel shows sparklines for M001M004
  • Fault replay or dataset window produces live alerts with faultType
  • Event journal shows the same alert after page refresh
  • Diagnose returns runbook JSON via Router

After Phase 2:

  • frame-generator publishes waferId values on vision.wafers.fab-01
  • object-detector logs defect class and confidence on vision.inspections.fab-01
  • Snapshot gallery opens from the dashboard Fab inspection link
Group 3See anything wrong with the document? Help us improve it!