跳至主要内容

Deployment Topology

Jope.SMB 運行於兩台主機:Plant IPC(Console + Historian,Windows)與 專用 Inference Host(plant LAN,運行 Python Inference Server)。 本頁涵蓋兩台主機的 prerequisites、installer、process management、network config、備份與升級路徑。

目標環境

Plant IPC(Console + Historian)

項目需求
OSWindows 10 21H2+ 或 Windows 11 21H2+
CPU4+ 核 @ 2.5 GHz(建議 6+ 核)
RAM16 GB
Disk500 GB SSD(historian 7 年保留約 100-200 GB / 年)
Network隔離 plant VLAN;無直接 internet 存取

Inference Host(獨立主機,預設)

項目需求
OSLinux(推薦 — Ubuntu 22.04 LTS / Rocky 9)、Windows Server 2022 或 container host (Docker / Podman)
CPU8+ 核 @ 3.0 GHz
RAM32 GB(若 model > 500 MB 或使用 GPU buffering 則 64 GB)
GPU (選配)NVIDIA 搭 CUDA 12+(若使用 GPU 加速推論)
Disk200 GB SSD
NetworkPlant VLAN,TCP 連至 Plant IPC 的 ports 5555、5556

Runtime Prerequisites

Plant IPC(Windows)

元件版本用途
.NET Desktop Runtime 88.0.x(最新 LTS patch)執行 Jope.SMB Console
TimescaleDB2.15+(PostgreSQL 15+)Historian
Visual C++ Redistributable2015-2022Native 相依

Inference Host

元件版本用途
Python3.11.x執行 Inference Server
Process managersystemd(Linux,推薦)或 Docker / Podman以 daemon 執行 Inference,auto-restart
CUDA Toolkit (選配)12.xGPU 加速推論

Installation Layout

Plant IPC(Windows)

C:\Jope\
├── SMB\ ← Console binaries
│ ├── Jope.SMB.WPF.exe
│ ├── config\
│ │ ├── app.json ← endpoints · theme · language
│ │ └── devices.json ← device COM port 分配
│ └── logs\
└── Historian\ ← TimescaleDB data dir(容量考量可放 D:\)
└── data\

Inference Host(Linux · 推薦)

/opt/jope-inference/
├── venv/ ← 獨立 Python 環境
├── main.py
├── models/ ← .joblib files + metadata
├── config/
│ └── server.toml ← endpoint binding · model paths
└── logs/

/etc/systemd/system/
└── jope-inference.service ← systemd unit

Inference Host(Docker · 替代方案)

jope-inference/
├── Dockerfile
├── docker-compose.yml ← 單一服務 compose
├── models/ ← mount 為 volume
└── config/ ← mount 為 volume

Process Management

Plant IPC · Service Registration

Service NameProcessStart ModeDepends On
postgresql-x64-15PostgreSQL + TimescaleDB(Windows Service)Auto

Console 不是 service — 在 logged-in operator session 下互動式執行。 這是設計上的刻意:electronic signature dialog 必須對使用者可見, session-tied UI 也是合規的期望。

Inference Host · daemon

  • Linux(推薦)systemctl enable --now jope-inference.service。Unit file 設 Restart=alwaysUser=jopeWorkingDirectory=/opt/jope-inference
  • Dockerdocker compose up -d — restart policy unless-stopped

Daemon 對 plant LAN 開放 ZMQ :5555 與 HTTP :5556

Network Configuration

EndpointPort主機備註
Inference ZMQ5555Inference HostTCP bind 至 plant LAN;於 Console app.json 可配置
Inference REST5556Inference HostHTTP/1.1;JSON
Historian5432Plant IPC(loopback 優先)PostgreSQL 預設
Raman gateway502Plant LANModbus TCP
Operator ConsolePlant IPC無 listening port;僅對外連線

Firewall Rules

Inference Host(Linux iptables / firewalld 或 Windows Firewall):

  • Allow inbound 5555 + 5556 僅限 Plant IPC 位址
  • Block 所有 plant VLAN 其他 inbound
  • Block 所有 outbound 至 internet(plant 為 air-gap)

Plant IPC(Windows Firewall):

  • Allow outbound 至 Inference Host 的 5555 + 5556
  • Block 所有 plant VLAN inbound
  • Block 所有 outbound 至 internet

Deployment Layout

Plant LAN 上兩台主機:

Plant IPC (Windows)            Inference Host (推薦 Linux)
├── Jope.SMB Console ├── Inference Server (daemon)
└── TimescaleDB (service) └── Model Registry (.joblib files)
│ ▲
└────── plant LAN ─────────────┘
ZMQ :5555 + REST :5556
  • Plant IPC — Windows;互動執行 Console + Historian 為 service。掌管硬體 I/O。
  • Inference Host — Linux + systemd(推薦)或 Docker / Podman。以 daemon 執行 Python Inference。獨立 CPU / RAM / 選配 GPU 資源。

為何分離

  • Plant IPC 可專注於即時硬體 polling + operator UI + 合規寫入,不受 Python GIL / 訓練 CPU 峰值干擾
  • Inference Host 可獨立 sizing(更多 RAM 給較大 model、選配 GPU 做平行推論)
  • 訓練 job(可能 saturate CPU 數分鐘)不影響 Console 反應
  • Python ML 工具鏈於 Linux 原生運行;無需強制 Windows 相容
  • 未來 model 演進時,Inference Host 較容易獨立 scale / 替換

Plant LAN 延遲 ~1-2 ms,遠在 predict p95 ≤ 20 ms 目標內。

Backup

ScopeFrequencyTargetRetentionEncryption
Historian (full)每日 02:00NAS \\nas01\backup\jope-smb\90 天滾動 + 每月 archive(1 年)AES-256 at rest
Historian (WAL)持續同上隨 full backupAES-256
Config(C:\Jope\SMB\config\每週同上90 天AES-256
Models(C:\Jope\Inference\models\變更時同上無限(檔小)Signed packages

Restore 需 雙簽核,見 Compliance Mapping · 4-Eyes

Upgrade Path

每個元件都有版本化升級腳本:

  1. 宣告 maintenance window — Console 於 24 小時前顯示 banner
  2. 優雅停批次 — operator 完成當前 run,不強制中斷
  3. 完整備份 + WAL snapshot
  4. 停服務(Inference 先停,Console 次之 — Historian 保留以便查詢)
  5. 執行 upgrade installer
  6. 套用 DB migrations — TimescaleDB schema 變更版本化;down scripts 存在
  7. 驗證Jope.SMB.Core.Tests smoke tests;device connectivity checks
  8. 重啟 services + Console
  9. Audit event: SystemUpgraded,帶 {old_version, new_version, operator, timestamp}

Rollback:從升級前備份還原;需雙簽核。

Monitoring

  • Windows Event Log: 每個 service 寫入 structured JSON line
  • Operator Console · Status Bar: Inference heartbeat、Historian 連線狀態、剩餘磁碟
  • Historian self-query: SELECT COUNT(*) FROM audit_events WHERE ts > now() - interval '24 h' — 應單調成長
  • Optional — 廠房 SCADA 可 poll Inference Server 的 /health 做全廠 dashboard

Installer 責任分工

項目負責單位
Installer 打包(Plant IPC MSI + Inference Host image / systemd unit)Jope 工程團隊
Plant OS provisioningPlant IT
User 帳號建立(dev + service)Plant IT
首次開機驗證Jope 工程 + Plant QA
持續 patching(Windows Update)Plant IT,宣告 maintenance window
Jope.SMB 版本升級Jope 工程,Plant QA 雙簽核