Draft
svc-ncu — NCU Controller
Clientnovameraactive
FastAPI backend that drives the NBIT downhole tool through a full DAQ → QC → upload workflow. Runs in two modes: field (on hardened operator laptops at drill sites) and hosted simulator (ECS Fargate, paired with
svc-nbit-simfor QA).
flowchart LR
subgraph Field["Field laptop"]
CLI["ncu CLI
(Typer)"] --> NCU["svc-ncu
FastAPI"]
NCU --> SM["15-state machine"]
end
subgraph Hosted["ECS Fargate (QA)"]
NCU2["svc-ncu"] --> SIM["svc-nbit-sim
digital twin"]
SIM --> NCU2
end
NBIT["NBIT downhole tool"] --> NCU
NCU --> NBIT
NCU -->|ZIP upload| S3[(S3)]
S3 --> QC[svc-qc]
style NCU fill:#EDEDFF,stroke:#3B54F7
style NCU2 fill:#EDEDFF,stroke:#3B54F7
style SIM fill:#E4E4FF,stroke:#23233A
- State machine: 15 states via the
transitionslibrary (connect → start-run → download → run-qc → upload → complete). - Operator CLI:
ncucommand (Typer) — connect, start-run, stop-run, download, run-qc, upload, complete, update/rollback. - Updates:
ncu updatewrites a signal file read byncu-updater.timersystemd service;--directruns docker pull immediately. - Field release: push a semver tag (
v1.2.0) →release-field.ymlbuilds multi-arch (amd64 + arm64) image → ECR. - Hosted release:
deploy.yml→ ECS deploy (dev1 / stg1 / prd1). - Built on: the ecs-service pattern for the hosted tier.