Skip to content

Quickstart & Deployment

Prerequisites

  • Docker Engine 24+ and Docker Compose v2
  • Python 3.11+ (optional, for running the local pytest IQ/OQ qualification suite and GMP binder generator)

Step 1: Configure Environment & Launch the Stack

Clone the GxPHistorian GitHub repository, copy the GxP environment template, and start all 7 orchestrated services:

Terminal window
git clone https://github.com/saram-io/gxp-historian.git
cd gxp-historian
cp .env.example .env
docker compose up -d --build

Verify that all 7 containers (postgres-control, clickhouse-archive, instrument-mock-server, edge-collector, historian-api, gxphistorian-mcp, grafana-vision) are running and healthy:

Terminal window
docker compose ps
curl -s http://localhost:8020/api/v1/health | jq .
curl -s http://localhost:8030/health | jq .
curl -s http://localhost:8095/health | jq .
curl -s -X POST http://localhost:8095/control/self-test | jq .

Expected Health Response (historian-api & gxphistorian-mcp)

{
"status": "healthy",
"service": "gxphistorian-mcp",
"protocol": "Model Context Protocol (MCP) + Pydantic AI",
"mcp_endpoint": "/mcp",
"ai_model": "google:gemini-3-flash-preview",
"live_llm_enabled": false,
"postgres": {
"connected": true
},
"clickhouse": {
"connected": true
},
"pydantic_ai_agents": [
"gxp_deviation_investigator_agent",
"gxp_copilot_agent"
],
"mcp_tools_count": 6,
"mcp_resources_count": 3
}

Step 2: Inspect Seeded GxP Assets, Tags & Part 11 Users

On initial startup, init-postgres/01_control_plane_part11.sql seeds the ISA-95 asset hierarchy, multi-protocol bioprocess tags, and 21 CFR Part 11 user accounts inside an attributed bootstrap transaction (SET LOCAL app.actor_id = 'system_bootstrap').

Seeded ISA-95 Assets (assets)

Asset IDAsset NameISA-95 ltree Asset PathTemplate
1Bioreactor_201BioCorp.Fremont.USP.Bioreactor_201Bioreactor_USP_Template
2Cleanroom_ISO7BioCorp.Fremont.Facilities.Cleanroom_ISO7Cleanroom_EMS_Template
3Chrom_Skid_01BioCorp.Fremont.DSP.Chrom_Skid_01Chromatography_DSP_Template

Seeded Multi-Protocol GxP Tags (tags)

Tag IDTag NameISA-95 ltree Asset PathAttributeUnitsStep Tag (LOCF)Deadband (exc_dev)Limits (Low / High)Source Protocol
101BR201_TEMP_PVBioCorp.Fremont.USP.Bioreactor_201Vessel_TempdegCfalse (LINEAR)0.0536.0 / 38.0OPC_UA
102BR201_PH_PVBioCorp.Fremont.USP.Bioreactor_201Vessel_pHpHfalse (LINEAR)0.026.8 / 7.4OPC_UA
103BR201_AGIT_STATEBioCorp.Fremont.USP.Bioreactor_201Agitator_Modestatetrue (LOCF)0.00.0 / 2.0S7COMM
301CR_ISO7_DP_PVBioCorp.Fremont.Facilities.Cleanroom_ISO7Differential_PressurePafalse (LINEAR)0.512.5 / 25.0BACNET_IP
401CHROM_UV280_PVBioCorp.Fremont.USP.Bioreactor_201UV280_AbsorbancemAUfalse (LINEAR)0.10.0 / 2500.0OPC_DA

Seeded 21 CFR Part 11 Accounts (users)

[!NOTE] init-postgres/01_control_plane_part11.sql seeds bcrypt password hashes via pgcrypto (crypt(..., gen_salt('bf', 10))).

User IDFull NameRoleQualification Password
operator_01Sarah Jenkins (USP Lead Operator)OPERATOROperator_2026!
qa_approver_01Dr. Marcus Vance (QA Qualified Person)QA_APPROVERQA_Approver_2026!

Step 3: Access Interactive Interfaces

  1. Swagger / OpenAPI Interactive REST Docs:
    • Open http://localhost:8020/docs in your browser.
  2. Pydantic AI Co-Pilot & gxphistorian-mcp Server (:8030):
    • Streamable HTTP MCP endpoint: http://localhost:8030/mcp
    • Manifest & OpenAPI Docs: http://localhost:8030/mcp/manifest and http://localhost:8030/docs
  3. Multi-Protocol Biopharma Instrument Mock Server (instrument-mock-server on :8095, :4840, :5020, :47808/udp, :1102, :4001):
    • Open http://localhost:8095/docs for the interactive protocol control plane, or run the 6-protocol wire self-test and push live samples to edge-collector:
      Terminal window
      curl -s -X POST http://localhost:8095/control/self-test \
      -H "Content-Type: application/json" \
      -d '{"push_to_edge_collector": true}' | jq .
    • See the full Mock Instrument Server & Protocol Testing Guide for raw socket testing (OPC UA, Modbus ABCD/CDAB, BACnet/IP, Siemens S7 DB10, Moxa RS-232 MT-SICS, and OPC DA / PI UFL) and fault/excursion injection (/control/override).
  4. Grafana Vision Operator HMI:
    • Open http://localhost:3020/d/gxphistorian-gxp-bioreactor-hmi
    • Login with admin / GxP_Grafana_2026!
  5. Verify 21 CFR Part 11 Audit Hash Chain:
    Terminal window
    curl -s http://localhost:8020/api/v1/audit-trail/verify | jq .
  6. Run the 21-Test Automated IQ/OQ Qualification Suite:
    Terminal window
    .venv/bin/pytest -v

Step 4: Optional Hybrid Cloud Deployment (AWS, Microsoft Azure & Google Cloud)

To deploy GxPHistorian in a hybrid OT + Cloud topology (keeping edge-collector at Purdue Level 2.5 on-premises while running 15-Year WORM Object Lock storage, Zero-ETL Parquet Lakehouses, or Managed PostgreSQL 16 + ClickHouse in AWS, Microsoft Azure, or Google Cloud):

Terminal window
# 1. Inspect validated hybrid cloud blueprints & WORM XML policies via REST API
curl -s "http://localhost:8020/api/v1/cloud/hybrid-blueprints?provider=aws&pattern=pattern_b_cloud_core" | jq .
# 2. Or launch the Thin Purdue Level 2.5 Edge Collector stack (Pattern B) streaming over HTTPS/mTLS (:8443)
docker compose -f deploy/hybrid-cloud/docker-compose.edge-only.yml config

See the Hybrid Cloud Deployment Guide (AWS, Azure & GCP) for step-by-step cloud walkthroughs.

Need Turnkey GxPHistorian Implementation, Legacy OSIsoft PI Migration, or Site IQ/OQ/PQ Validation?

Saram Consulting (saram.io) delivers end-to-end OT/IT skid connectivity (Xcellerex, Biostat, ÄKTA, Raman PAT, BACnet EMS), lossless PI Data Archive backfill, and QA-signed 21 CFR Part 11 & GAMP 5 qualification packages.

Diagram Viewer