Documentation · Working document

Deployment and Site Activation

Immutable release, workload identity, database, object custody, qualification, promotion, and rollback procedure.

About this file

Kind of file
Markdown text
Status
Working document
Size
9 KB
File
DEPLOYMENT_AND_ACTIVATION.md
Fingerprint (SHA-256)
d7777d38636f8bee747ecad987fcaf18eff63aca46b22c8b018ba2475738d835

This page is drawn from the file itself each time it opens, so it always shows what the download holds.

Deployment and Site Activation

Runbook: PREPAIRE-LIM-DEPLOYMENT@3.0.0
Baseline status: Infrastructure-ready source; site activation requires controlled evidence and signatures.

Deployment principle

The repository is deployable software, but a deployment is not an approved laboratory system. Promotion is allowed only by immutable image digest. Patient processing remains disabled until the exact site, instrument, assay, connector, software, terminology, infrastructure, and release workflow pass the production-readiness checklist.

Runtime publication modes

The hosting platform supplies PORT; the application must not assume a fixed external port. When mounted below a shared host path, set APP_BASE_PATH or NEXT_PUBLIC_BASE_PATH during the Next.js build so navigation, static assets, documentation downloads, and browser API calls stay within the assigned application path.

The runtime has two explicit modes:

  • read_only: starts the registry and documentation console but rejects every privileged API with PLATFORM_READ_ONLY. This is the required mode for an infrastructure bootstrap deployment.
  • operational: enables the possibility of authenticated operations only after every required database, OIDC, immutable-storage, KMS, callback, execution-identity, and execution-backend value is present. Ordinary clinical and site gates still apply.

Publishing the read-only console is not patient activation. Never set operational mode merely to clear a hosting health check.

Feynman Labs hosted console

Configure the Feynman application build with:

  • APP_BASE_PATH=/apps/lim-ingestor-3-0
  • PLATFORM_RUNTIME_MODE=read_only

Do not set a fixed PORT; Feynman injects it at runtime. pnpm build prepares the Next.js standalone artefact together with its static and public assets, and pnpm start launches that artefact through the validated production entrypoint. The expected health URL is /apps/lim-ingestor-3-0/api/v1/health.

Move this deployment to operational only after the required services below are provisioned and the complete site evidence package is approved.

Required platform services

ServiceRequired production control
PostgreSQLManaged high availability, TLS, encryption, point-in-time recovery, restore test, least-privilege roles
Object storageS3-compatible versioning, compliance object lock, KMS, inventory, replication, lifecycle monitoring
IdentityOIDC issuer/JWKS, fixed audiences, role mapping, MFA for people, workload identity for services
ExecutionRestricted Kubernetes namespace or governed GA4GH TES engine; digest admission and no host socket
Build planeSeparate GitLab project, isolated ephemeral runner, signed provenance, SBOM, scan, immutable registry
ObservabilityMetrics, structured redacted logs, alerts, immutable audit export, SIEM integration
SecretsManaged secret store, rotation, access logging, no repository or environment-file custody

Release image process

  1. Build the application and worker from the reviewed commit in an isolated GitLab runner.
  2. Generate SBOM and SLSA-compatible provenance.
  3. Scan dependencies, source, image, and secret patterns.
  4. Sign the image digest through the approved workload identity.
  5. Verify signature and provenance in admission control.
  6. Replace every REPLACE_WITH_RELEASE_DIGEST value in the site overlay with the exact approved digest.
  7. Apply migrations as a dedicated migration identity before rolling application pods.
  8. Seed only the controlled IRENA registry and findings; do not seed patient or example clinical records.
  9. Deploy API and worker, then verify health, OIDC, storage, database, and execution identity.
  10. Run non-patient fixtures and retain the signed deployment receipt.

The approved site then records two append-only activation attestations for each exact instrument/profile/assay/version scope: one by qa_officer and one by lab_director. They must be current and made by different identities. Either authority can revoke its own scope through a new attestation; history is never overwritten.

Protected GitLab variables

Configure these as protected project/group variables using approved immutable image@sha256:digest references:

  • DOCKER_CLI_IMAGE
  • DOCKER_DIND_IMAGE
  • POSTGRES_CI_IMAGE
  • TRIVY_IMAGE
  • COSIGN_IMAGE
  • KUBECTL_IMAGE

The pipeline fails closed when any required tool image is absent. It builds platform and worker targets separately, exports their pushed digests, scans both, signs both, and deploys both by digest. The fresh-database job applies the baseline migration, seeds only the instrument registry, verifies required triggers, and proves representative append-only mutations are rejected.

Configuration ownership

Public configuration may live in a site-specific Kustomize overlay. Credentials, client secrets, storage keys, and private material must come from the approved secrets manager.

Mandatory site values include:

  • DATABASE_URL
  • OIDC_ISSUER, OIDC_AUDIENCE, OIDC_JWKS_URL, and OIDC_ROLE_CLAIM
  • S3_ENDPOINT, S3_REGION, S3_BUCKET, and KMS_KEY_ID
  • object-store credentials delivered by workload identity where available
  • PLATFORM_INTERNAL_URL
  • EXECUTION_OIDC_ISSUER, EXECUTION_OIDC_AUDIENCE, EXECUTION_OIDC_JWKS_URL, and EXECUTION_OIDC_SUBJECT
  • Kubernetes namespace and execution service account, or the governed TES endpoint
  • GitLab build project and trigger identity

Operational startup fails when the required identity, database, storage, or execution callback configuration is absent. Read-only startup deliberately remains available for controlled publication and documentation while every privileged endpoint is closed.

Kubernetes workload identity

The worker creates an execution Job under lim-pipeline-executor. The Job receives a projected service-account token for the dedicated lim-ingestor-execution audience. The application accepts that token only when signature, issuer, audience, expiry, and exact subject all match the configured values.

The base manifests intentionally require a site overlay for issuer/JWKS, image digests, ingress, storage, database, and external egress. Restrict the base TCP 443 egress rule to the site's exact OIDC, storage, registry, audit, and approved vendor endpoints before activation.

For GA4GH TES, configure the engine's supported secret/workload-identity facility to supply a valid bearer token to the approved publisher. The platform deliberately does not embed a token in the TES task document.

Database activation

  1. Create separate migration, application, worker, and read-only support roles.
  2. Apply prisma migrate deploy to an empty qualification database.
  3. Confirm all append-only and immutable-identity triggers exist.
  4. Run mutation-negative tests against audit, approvals, validation evidence, releases, verified artefact identity, and approved build identity.
  5. Seed the registry and compare counts, source-workbook SHA-256, profiles, and findings.
  6. Perform backup and point-in-time restore before go-live approval.

Object custody activation

  1. Demonstrate bucket versioning and compliance object lock before the first upload.
  2. Upload a fixture with multipart part checksums.
  3. Complete the object and confirm a version ID is returned.
  4. Alter declared size and hash in negative fixtures; both must quarantine.
  5. Verify the worker independently streams the stored object version and recomputes SHA-256.
  6. Confirm a verified artefact cannot have identity or lineage modified in Postgres.
  7. Confirm download receipts are audited and URLs expire.

End-to-end qualification

Run at least these cases through LIM event, edge capture, execution, output custody, review, and disabled KG adapter:

  • expected positive and negative reference materials
  • malformed LIM event and duplicate event replay
  • wrong instrument, missing serial, and inactive asset
  • missing native file and corrupted multipart part
  • unknown local code, unit conflict, and impossible converted value
  • wrong image digest and revoked software build
  • wrong workload token issuer, audience, subject, and expiry
  • compute success with missing output
  • changed identity under a repeated output key
  • incomplete upstream lineage
  • invalid KG JSON, schema failure, foreign DRS ID, and mismatched subject/run/instrument/build
  • same-person submission and release attempt
  • object-store, worker, database, and execution-backend recovery

Promotion and rollback

  • Qualify one instrument, assay, software build, and pipeline definition scope at a time.
  • Run a non-patient canary, then an approved prospective pilot with KG write disabled.
  • Approval records bind exact digests and reference versions.
  • Rollback uses the last approved image digest and database-compatible release plan.
  • Runs crossing a deployment window are reconciled individually.
  • A failed gate revokes the affected scope; expansion stops until quality disposition.

Site evidence package

Go-live evidence consists of the signed infrastructure qualification, migration result, object-lock proof, restore result, OIDC and workload-identity negative tests, penetration test, connector qualification, analytical validation, pipeline fixtures, terminology validation, operator competency, prospective reconciliation, incident exercise, and all required signatures.

Until that package is complete, the correct system state is NOT APPROVED FOR PATIENT ACTIVATION.

Demonstration copy