Workflow joins the platform (the general approval engine, slug workflow)
- compose: workflow-migrate and -backend under profile workflow, networks 172.30.32.0/24 + db 172.30.42.0/24, FRAME_ANCESTORS 'self', workflow-data volume, /healthz; managed-db overlay follows; front door routes /workflow. - workflow_app joins MODULE_EVENT_EMITTER_ROLES (every step of a run is an event, dredd_core.workflow_contract). push.sh checks workflow with --events, pgcrypto (its committed provision.sql asks for it) and its evidence lists: audit_log, module_event, module_event_receipt, workflow_event append-only; workflow_run, request, workflow_template, request_type, approver_group never deleted. - init.sh writes both env files (APP_BASE_URL, GALENA_BASE_URL) and --add workflow; preflight renders and dry-runs it with every profile on. Twelve apps again (Compass left), so max_connections 200 holds. - Catalogue tile (live, Dokumenty): Workflow gray clock, offered once to an already-seeded Atrium (ADDED_AFTER_FIRST_SEED). Not the retired compass slug: revision 0014 and its test are untouched. - Submodule deploy/modules/workflow pinned to Alpaq92/Workflow feat/workflow-module (37b5ed6), the head of Workflow#1, which is not merged yet: repin to main once it is. Workflow pins dredd-core v0.24.0 (dredd-core#6), so that tag must exist before the image builds. - RUNBOOK-workflow.md; tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uwxqGMgd9zpNbzXUGJ1FV
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
aaa161b5d5
commit
3ea611f29d
+2
-2
@@ -19,7 +19,7 @@ ROOT_PATH=
|
||||
# streams every other module to its backend. This is that FIXED map, slug=http://service:port,
|
||||
# comma-separated; the upstream never comes from a request. A slug left out answers 404. Empty for
|
||||
# the standalone stack in docker-compose.yml (Atrium alone, at /atrium).
|
||||
# FRONTDOOR_UPSTREAMS=galena=http://galena-backend:8000,sygna=http://sygna-backend:8000,counsel=http://counsel-backend:8000,insider=http://insider-backend:8000,arbiter=http://arbiter-backend:8000,lexicon=http://lexicon-backend:8000,agora=http://agora-backend:8000,panorama=http://panorama-backend:8000,parafa=http://parafa-backend:8000,scribe=http://scribe-backend:8000
|
||||
# FRONTDOOR_UPSTREAMS=galena=http://galena-backend:8000,sygna=http://sygna-backend:8000,counsel=http://counsel-backend:8000,insider=http://insider-backend:8000,arbiter=http://arbiter-backend:8000,lexicon=http://lexicon-backend:8000,agora=http://agora-backend:8000,panorama=http://panorama-backend:8000,parafa=http://parafa-backend:8000,scribe=http://scribe-backend:8000,workflow=http://workflow-backend:8000
|
||||
FRONTDOOR_UPSTREAMS=
|
||||
|
||||
# ── Database ─────────────────────────────────────────────────────────────────
|
||||
@@ -140,7 +140,7 @@ CORS_ALLOW_ORIGINS=
|
||||
# ── Bootstrap admin (seed) ───────────────────────────────────────────────────
|
||||
BOOTSTRAP_ADMIN_EMAIL=admin@example.com
|
||||
BOOTSTRAP_ADMIN_PASSWORD=admin12345
|
||||
# The seed also puts the Dredd family (Galena, Sygna, Counsel Scorecard, Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe) into the module
|
||||
# The seed also puts the Dredd family (Galena, Sygna, Counsel Scorecard, Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe, Workflow) into the module
|
||||
# catalog — once per instance, without addresses; add those under Administration → Modules.
|
||||
|
||||
# ── App tokens ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -28,3 +28,6 @@
|
||||
[submodule "deploy/modules/arbiter"]
|
||||
path = deploy/modules/arbiter
|
||||
url = https://github.com/Alpaq92/Arbiter
|
||||
[submodule "deploy/modules/workflow"]
|
||||
path = deploy/modules/workflow
|
||||
url = https://github.com/Alpaq92/Workflow
|
||||
|
||||
@@ -54,7 +54,7 @@ Send = Callable[[dict], Awaitable[None]]
|
||||
#: never be configured, so a typo in FRONTDOOR_UPSTREAMS refuses start-up.
|
||||
ATRIUM = "atrium"
|
||||
MODULES = ("galena", "sygna", "counsel", "insider", "arbiter", "lexicon", "agora", "panorama",
|
||||
"parafa", "scribe")
|
||||
"parafa", "scribe", "workflow")
|
||||
SLUGS = (ATRIUM, *MODULES)
|
||||
|
||||
#: Uploads above this are refused: 413 up front on a declared Content-Length, or as soon as a chunked
|
||||
@@ -65,7 +65,7 @@ MAX_BODY = 100 * 1024 * 1024
|
||||
TIMEOUT = httpx.Timeout(connect=5.0, read=300.0, write=300.0, pool=10.0)
|
||||
|
||||
NOT_FOUND = (b"Not found. This server serves /atrium, /galena, /sygna, /counsel, /insider, "
|
||||
b"/arbiter, /lexicon, /agora, /panorama, /parafa and /scribe.")
|
||||
b"/arbiter, /lexicon, /agora, /panorama, /parafa, /scribe and /workflow.")
|
||||
|
||||
# RFC 9110 7.6.1, plus the two non-standard ones still seen in the wild. Never forwarded either way,
|
||||
# together with every header a `Connection` header names.
|
||||
|
||||
+15
-1
@@ -37,7 +37,7 @@ CATALOG_SEEDED = "_seed.catalog"
|
||||
# install gets these with the rest of FAMILY and sets their markers then. The next module that
|
||||
# joins appends its slug here; nothing ever leaves this tuple.
|
||||
ADDED_AFTER_FIRST_SEED: tuple[str, ...] = ("insider", "arbiter", "lexicon", "agora", "panorama",
|
||||
"parafa", "scribe")
|
||||
"parafa", "scribe", "workflow")
|
||||
|
||||
|
||||
def _marker(slug: str) -> str:
|
||||
@@ -184,6 +184,20 @@ FAMILY: list[dict] = [
|
||||
"zapisanymi w kodzie i eksportuje gotowy projekt do Galeny jako nowy dokument."
|
||||
),
|
||||
},
|
||||
{
|
||||
# The platform's general approval engine (decision of 2026-11-18; not the retired `compass`,
|
||||
# whose slug revision 0014 removed). Gray is the one tile hue no sibling wears. In English the
|
||||
# tagline reads "Approval runs for documents, files and requests". The slug is its path
|
||||
# (/workflow), schema, roles and MODULE_SLUG.
|
||||
"slug": "workflow", "name": "Workflow", "hue": "gray", "glyph": "clock", "sort_order": 120,
|
||||
"category": "Dokumenty", "status": ModuleStatus.live.value,
|
||||
"tagline": "Obiegi akceptacji dokumentów, plików i wniosków.",
|
||||
"description": (
|
||||
"Workflow prowadzi obieg akceptacji — na dokumencie z Galeny, przesłanym pliku albo "
|
||||
"wniosku — przez etapy zatwierdzane przez osoby, grupy zatwierdzających albo role z "
|
||||
"Galeny, z historią każdej decyzji i powrotem do wcześniejszego etapu po odrzuceniu."
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def test_push_checks_each_module_with_its_own_lists(slug):
|
||||
def test_each_module_is_checked_in_its_own_tier():
|
||||
push = PUSH.read_text(encoding="utf-8")
|
||||
assert 'case $slug in lexicon) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --model-provider-keys" ;; esac' in push
|
||||
assert "case $slug in galena|agora|parafa)" in push
|
||||
assert "case $slug in galena|agora|parafa|workflow)" in push
|
||||
assert 'case $slug in panorama) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --events-reader" ;; esac' in push
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ def test_the_hub_template_lists_each_in_exactly_its_tier():
|
||||
|
||||
def test_init_add_puts_each_module_in_its_tier():
|
||||
init = INIT.read_text(encoding="utf-8")
|
||||
assert "case $ADD in galena|agora|parafa)" in init
|
||||
assert "case $ADD in galena|agora|parafa|workflow)" in init
|
||||
assert 'add_to_list "$OUT/env/atrium.env" MODULE_EVENT_READER_ROLES "$ROLE_PREFIX${ADD}_app"' in init
|
||||
assert '"env/atrium.env:MODULE_EVENT_READER_ROLES"' in init
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ def test_the_evidence_lists_as_shipped():
|
||||
|
||||
def test_parafa_is_an_emitter_and_scribe_is_in_no_tier():
|
||||
push, init = PUSH.read_text(encoding="utf-8"), INIT.read_text(encoding="utf-8")
|
||||
assert "case $slug in galena|agora|parafa)" in push
|
||||
assert "case $ADD in galena|agora|parafa)" in init
|
||||
assert "case $slug in galena|agora|parafa|workflow)" in push
|
||||
assert "case $ADD in galena|agora|parafa|workflow)" in init
|
||||
assert "parafa_app" in _list("MODULE_EVENT_EMITTER_ROLES")
|
||||
assert "parafa_app" not in _list("MODULE_EVENT_READER_ROLES")
|
||||
for key in OPT_INS:
|
||||
|
||||
@@ -41,7 +41,7 @@ PUSH = DEPLOY / "push.sh"
|
||||
PREFLIGHT = DEPLOY / "preflight.sh"
|
||||
ENVFILE_LIB = DEPLOY / "lib" / "envfile.sh"
|
||||
FAMILY = ("atrium", "galena", "sygna", "counsel", "insider", "arbiter", "lexicon", "agora",
|
||||
"panorama", "parafa", "scribe")
|
||||
"panorama", "parafa", "scribe", "workflow")
|
||||
#: Where an app's tree sits inside its checkout — push.sh's SUBDIR and preflight.sh's. Arbiter's
|
||||
#: repository also carries the analysis engine and holds the application in a subdirectory; every other
|
||||
#: app's repository is the application. The fixture has to lay the scratch tree out the same way, or
|
||||
@@ -144,7 +144,7 @@ def rig(tmp_path_factory):
|
||||
base_env = f"MODULES_DIR={root / 'modules'}\nDEPLOY_ENV_DIR={root / 'env'}\n"
|
||||
# The rig is a box with every module deployed, the switched-off ones included, so the tests above mean
|
||||
# "all of them" without each having to say so. .env.off is the same box before either was switched on.
|
||||
_write(root / ".env", base_env + "COMPOSE_PROFILES=insider,arbiter,lexicon,agora,panorama,parafa,scribe\n")
|
||||
_write(root / ".env", base_env + "COMPOSE_PROFILES=insider,arbiter,lexicon,agora,panorama,parafa,scribe,workflow\n")
|
||||
_write(root / ".env.off", base_env)
|
||||
# Records the command line and succeeds, so the push walks all five steps without a database.
|
||||
_write(root / "recorder.sh", '#!/usr/bin/env bash\nprintf \'%s\\n\' "$*" >> "$PUSH_TRACE"\nexit 0\n')
|
||||
@@ -160,7 +160,7 @@ HUB_ON_THE_PLATFORM = {
|
||||
"IDENTITY_READER_ROLES": ",".join(f"{app}_app" for app in FAMILY[1:]),
|
||||
"IDENTITY_MIGRATOR_ROLES": ",".join(f"{app}_migrator" for app in FAMILY[1:]),
|
||||
# The modules taking part in the shared event log (dredd-core 0.20.0), init.sh's default.
|
||||
"MODULE_EVENT_EMITTER_ROLES": "galena_app,agora_app,parafa_app",
|
||||
"MODULE_EVENT_EMITTER_ROLES": "galena_app,agora_app,parafa_app,workflow_app",
|
||||
# The event log's reader tier (dredd-core 0.23.0) and the model-provider key readers.
|
||||
"MODULE_EVENT_READER_ROLES": "panorama_app",
|
||||
"MODEL_PROVIDER_KEY_READER_ROLES": "arbiter_app,lexicon_app",
|
||||
@@ -371,7 +371,8 @@ class TestTheHalfDoneShapesOfOneAccountAreRefused:
|
||||
and must not be a refusal here."""
|
||||
done, _ = _push(rig, platform=True, trace="spaces", settings={"atrium": {
|
||||
"IDENTITY_READER_ROLES": "galena_app, sygna_app, counsel_app, insider_app, arbiter_app, "
|
||||
"lexicon_app, agora_app, panorama_app, parafa_app, scribe_app"}})
|
||||
"lexicon_app, agora_app, panorama_app, parafa_app, scribe_app, "
|
||||
"workflow_app"}})
|
||||
assert done.returncode == 0, done.stdout + done.stderr
|
||||
|
||||
@pytest.mark.parametrize("cookie, shown", [("galena_session", "galena_session"),
|
||||
@@ -662,7 +663,7 @@ class TestEveryAppIsProvisionedBeforeAnyMigrates:
|
||||
def test_the_budget_counts_a_module_only_when_it_runs(self, rig):
|
||||
on, _ = _push(rig, "--dry-run", platform=False, trace="budget-on")
|
||||
off, _ = _push(rig, "--dry-run", platform=False, trace="budget-off", compose_env=".env.off")
|
||||
assert re.search(r"budget\s+11 apps x", on.stdout), on.stdout
|
||||
assert re.search(r"budget\s+12 apps x", on.stdout), on.stdout
|
||||
assert re.search(r"budget\s+4 apps x", off.stdout), off.stdout
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
"""deploy/push.sh checks Workflow with exactly the lists it declares, and with the platform tier it is granted.
|
||||
|
||||
Its evidence lists are `app.models.APPEND_ONLY_TABLES` / `NO_DELETE_TABLES`, which its revisions grant
|
||||
from, so push.sh's CHECK_EXTRA is compared with them wherever the submodule is checked out (skipped
|
||||
where it is not).
|
||||
|
||||
The tier: every step of a run writes the event log (dredd_core.workflow_contract), so Workflow is an
|
||||
EMITTER, like Agora and Parafa; it calls no model and keeps no counterparties.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
from test_deploy_m6_m7_check_args import OPT_INS, _check_extra, _list, _tuple
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[2]
|
||||
SHIPPED = ("--append-only audit_log module_event module_event_receipt workflow_event "
|
||||
"--no-delete workflow_run request workflow_template request_type approver_group")
|
||||
|
||||
|
||||
def test_push_checks_workflow_with_its_own_lists():
|
||||
models = ROOT / "deploy" / "modules" / "workflow" / "backend" / "app" / "models" / "__init__.py"
|
||||
if not models.exists():
|
||||
pytest.skip("deploy/modules/workflow is not checked out")
|
||||
src = models.read_text(encoding="utf-8")
|
||||
expected = (f"--append-only {' '.join(_tuple(src, 'APPEND_ONLY_TABLES'))} "
|
||||
f"--no-delete {' '.join(_tuple(src, 'NO_DELETE_TABLES'))}")
|
||||
assert _check_extra("workflow") == expected
|
||||
|
||||
|
||||
def test_the_evidence_lists_as_shipped():
|
||||
"""Without the submodule (CI), at least the lists Workflow shipped with at its first pin."""
|
||||
assert _check_extra("workflow") == SHIPPED
|
||||
|
||||
|
||||
def test_workflow_is_an_emitter_and_in_no_other_tier():
|
||||
assert "workflow_app" in _list("MODULE_EVENT_EMITTER_ROLES")
|
||||
for key in OPT_INS:
|
||||
if key != "MODULE_EVENT_EMITTER_ROLES":
|
||||
assert not any(r.startswith("workflow_") for r in _list(key)), key
|
||||
|
||||
|
||||
def test_workflow_is_offered_to_an_instance_seeded_before_it():
|
||||
from app import frontdoor
|
||||
from app.seed import ADDED_AFTER_FIRST_SEED, FAMILY
|
||||
|
||||
entry = next(e for e in FAMILY if e["slug"] == "workflow")
|
||||
assert "workflow" in ADDED_AFTER_FIRST_SEED and "workflow" in frontdoor.MODULES
|
||||
assert (entry["hue"], entry["glyph"]) == ("gray", "clock")
|
||||
+3
-2
@@ -39,8 +39,9 @@ MODULES_DIR=./modules
|
||||
# Arbiter (contract analysis, built from the arbiter submodule's apps/arbiter) ships switched off too,
|
||||
# under the `arbiter` profile (deploy/RUNBOOK-arbiter.md).
|
||||
# Lexicon, Agora and Panorama (the split plan's M2-M4) the same, each under a profile of its own name
|
||||
# (deploy/RUNBOOK-m2-m4.md); Parafa and Scribe (M6, M7) likewise (deploy/RUNBOOK-m6-m7.md).
|
||||
# COMPOSE_PROFILES=insider,arbiter,lexicon,agora,panorama,parafa,scribe
|
||||
# (deploy/RUNBOOK-m2-m4.md); Parafa and Scribe (M6, M7) likewise (deploy/RUNBOOK-m6-m7.md),
|
||||
# and Workflow, the approval engine (deploy/RUNBOOK-workflow.md).
|
||||
# COMPOSE_PROFILES=insider,arbiter,lexicon,agora,panorama,parafa,scribe,workflow
|
||||
# Parafa's signer: a directory holding the operator's PKCS#12 signing file and its passphrase file,
|
||||
# mounted READ-ONLY into parafa-backend at /run/parafa-signer (env/parafa.env names the files).
|
||||
# Relative to this directory; empty or missing = signing unconfigured (409 signing_unconfigured).
|
||||
|
||||
+5
-2
@@ -63,6 +63,7 @@ deployment, and the kit in this directory does the per-app work for all four app
|
||||
| Panorama (off by default) | `panorama` | `panorama_migrator`, `panorama_app` | none | `audit_log` append-only |
|
||||
| Parafa (off by default) | `parafa` | `parafa_migrator`, `parafa_app` | none | `audit_log`, `module_event`, `module_event_receipt` append-only; `signing_request` never deleted |
|
||||
| Scribe (off by default) | `scribe` | `scribe_migrator`, `scribe_app` | none | `audit_log` append-only; `draft_export` never deleted |
|
||||
| Workflow (off by default) | `workflow` | `workflow_migrator`, `workflow_app` | `pgcrypto` | `audit_log`, `module_event`, `module_event_receipt`, `workflow_event` append-only; `workflow_run`, `request`, `workflow_template`, `request_type`, `approver_group` never deleted |
|
||||
|
||||
**Workflow (codename `compass`) was retired on 2026-11-14** and is no longer in the kit; a box that ran
|
||||
it is taken down by the removal runbook kept outside the kit (dump, stop, DROP SCHEMA, DROP ROLE), and Atrium's
|
||||
@@ -74,7 +75,9 @@ bringing it in is [`RUNBOOK-arbiter.md`](RUNBOOK-arbiter.md). **Lexicon, Agora a
|
||||
(the clause library, negotiation rooms and the dashboard, the split plan's M2-M4) ship switched off the same way,
|
||||
each under a profile of its own name; bringing them in is [`RUNBOOK-m2-m4.md`](RUNBOOK-m2-m4.md). **Parafa and Scribe, the
|
||||
eleventh and twelfth** (PAdES signing of PDFs and drafting from templates and clauses, M6 and M7) the same; bringing
|
||||
them in is [`RUNBOOK-m6-m7.md`](RUNBOOK-m6-m7.md). **Licences:** Atrium, Galena, Sygna and Counsel
|
||||
them in is [`RUNBOOK-m6-m7.md`](RUNBOOK-m6-m7.md). **Workflow** (`Alpaq92/Workflow`, slug `workflow`: the
|
||||
general approval engine, a new module, not the retired `compass`) the same; bringing it in is
|
||||
[`RUNBOOK-workflow.md`](RUNBOOK-workflow.md). **Licences:** Atrium, Galena, Sygna and Counsel
|
||||
Scorecard each run a CI licence gate that refuses GPL, AGPL and SSPL, and no image in the kit ships
|
||||
copyleft code: Arbiter's image carries no analysis engine (orders run on a workstation). See [`../CREDITS.md`](../CREDITS.md#the-platform-kit-deploy).
|
||||
|
||||
@@ -144,7 +147,7 @@ Then verify as in §7 step 7, and set Atrium's module addresses as in §8.
|
||||
|
||||
**One address, a path per module, and Atrium is the front door.** There is no reverse proxy:
|
||||
`atrium-backend` publishes `:80` and serves the whole family as one site — `<site>/atrium`,
|
||||
`<site>/galena`, `<site>/sygna`, `<site>/counsel`, `<site>/insider`, `<site>/arbiter`, `<site>/lexicon`, `<site>/agora`, `<site>/panorama`, `<site>/parafa`, `<site>/scribe`; `/` redirects to `/atrium/` and a
|
||||
`<site>/galena`, `<site>/sygna`, `<site>/counsel`, `<site>/insider`, `<site>/arbiter`, `<site>/lexicon`, `<site>/agora`, `<site>/panorama`, `<site>/parafa`, `<site>/scribe`, `<site>/workflow`; `/` redirects to `/atrium/` and a
|
||||
bare `/<slug>` to `/<slug>/`. It serves Atrium itself and streams every other path to that module's
|
||||
backend, from a **fixed** map in `compose.yaml` (`FRONTDOOR_UPSTREAMS`; no target ever comes from a
|
||||
request), refuses encoded or dot-segment path tricks, drops inbound `X-Forwarded-*` and sets them anew
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Runbook: Workflow onto a running platform
|
||||
|
||||
Workflow is the platform's general approval engine: a run (*obieg akceptacji*) on a Galena document, an
|
||||
uploaded file or a request (*wniosek*), through 1-10 stages approved by people, an approver group or a
|
||||
Galena role. It is not the retired Workflow of `compass-contract-hub` (slug `compass`, removed by
|
||||
Atrium's revision `0014`): this one is `Alpaq92/Workflow`, slug `workflow`. Like Parafa and Scribe
|
||||
([`RUNBOOK-m6-m7.md`](RUNBOOK-m6-m7.md), whose steps apply unchanged with the slug swapped), it is a
|
||||
dredd-core app in simple tenancy with its own submodule under `deploy/modules/workflow`, its own schema
|
||||
and roles, one account through Atrium, and it ships **switched off** under the `workflow` profile.
|
||||
|
||||
| Module | Path / profile | Repository | Network / db network | Opt-ins in `env/atrium.env` | Evidence (push.sh check) |
|
||||
|---|---|---|---|---|---|
|
||||
| Workflow (approval runs) | `/workflow` | `Alpaq92/Workflow` | 172.30.32.0/24 / 172.30.42.0/24 | `MODULE_EVENT_EMITTER_ROLES` += `workflow_app` | `--append-only audit_log module_event module_event_receipt workflow_event --no-delete workflow_run request workflow_template request_type approver_group --events` |
|
||||
|
||||
It pins dredd-core **v0.24.0** (the Workflow contract, `dredd_core.workflow_contract`): that tag must
|
||||
exist before the image builds. Its committed `db/managed/provision.sql` is the platform rendering with
|
||||
`--extension pgcrypto`, which push.sh provisions and compares. The catalogue tile (gray `clock`, `live`,
|
||||
category "Dokumenty") is offered once to an already-seeded Atrium (`ADDED_AFTER_FIRST_SEED`).
|
||||
|
||||
**What it needs from the others.** Every step of a run writes to the hub's event log, so `workflow_app`
|
||||
must be an event EMITTER before Workflow goes live (`--add workflow` lists it). `GALENA_BASE_URL`
|
||||
(hairpin, written by init) lets a run pin a Galena document and a stage be approved by a Galena role;
|
||||
empty, Workflow runs on uploaded files and requests only. **Connections:** Workflow takes the twelfth
|
||||
place Compass left, so the twelve-app budget (`max_connections=200`) holds as it is.
|
||||
|
||||
## Steps
|
||||
|
||||
```bash
|
||||
cd /srv/atrium/deploy
|
||||
docker compose exec -T postgres sh -c 'pg_dump -U postgres -d "$POSTGRES_DB" -Fc' > "$HOME/dredd-pre-workflow.dump"
|
||||
git -C .. pull --ff-only && git -C .. submodule update --init deploy/modules/workflow
|
||||
./init.sh --add workflow
|
||||
read -rs DREDD_CORE_TOKEN && export DREDD_CORE_TOKEN
|
||||
docker compose build atrium-backend workflow-backend && unset DREDD_CORE_TOKEN
|
||||
./push.sh --dry-run atrium workflow && ./push.sh atrium workflow
|
||||
docker compose up -d atrium-backend workflow-backend && curl -fsS "$SITE/workflow/healthz"
|
||||
```
|
||||
|
||||
Then, in Atrium as the administrator: give people a `user` or `moderator` row (Administration →
|
||||
Modules); no row is no access.
|
||||
|
||||
**A box that ran Workflow by hand** (a `compose.override.yaml` with `workflow-*` services): remove those
|
||||
services from the override before `docker compose up`, or Compose merges two definitions of one service.
|
||||
The database roles, schema and `workflow-data` volume are the same names, so the data stays.
|
||||
|
||||
## Rollback
|
||||
|
||||
`COMPOSE_PROFILES` without `workflow`, `docker compose stop workflow-backend`; the schema stays.
|
||||
@@ -140,6 +140,14 @@ services:
|
||||
volumes:
|
||||
- *db_ca
|
||||
|
||||
workflow-migrate:
|
||||
networks:
|
||||
workflow-db: !reset null
|
||||
depends_on:
|
||||
postgres: !reset null
|
||||
volumes:
|
||||
- *db_ca
|
||||
|
||||
# ── the backends: their networks with the front door (compose.yaml) and their own migrate, plus the CA ──
|
||||
atrium-backend:
|
||||
networks:
|
||||
@@ -229,6 +237,14 @@ services:
|
||||
volumes:
|
||||
- *db_ca
|
||||
|
||||
workflow-backend:
|
||||
networks:
|
||||
workflow-db: !reset null
|
||||
depends_on:
|
||||
postgres: !reset null
|
||||
volumes:
|
||||
- *db_ca
|
||||
|
||||
# Insider's optional OCR worker (profiles `insider` + `ocr`): like a one-shot, it listens on nothing,
|
||||
# so without its database network it lands on the project's default network.
|
||||
insider-ocr:
|
||||
|
||||
+87
-7
@@ -22,7 +22,7 @@
|
||||
# ONE ADDRESS, ONE MODULE PER PATH, AND ATRIUM IS THE FRONT DOOR. There is no reverse proxy: Atrium's
|
||||
# backend (backend/app/frontdoor.py) redirects `/` to /atrium/ and `/<slug>` to `/<slug>/`, serves Atrium
|
||||
# itself under /atrium, and streams /galena, /sygna, /counsel, /insider, /arbiter, /lexicon, /agora,
|
||||
# /panorama, /parafa and /scribe to the backends named in
|
||||
# /panorama, /parafa, /scribe and /workflow to the backends named in
|
||||
# FRONTDOOR_UPSTREAMS below — a FIXED map; no target ever comes from a request. It strips the prefix on
|
||||
# the way, and each module's ROOT_PATH (env/<app>.env, handed to uvicorn as --root-path by its image's
|
||||
# CMD) puts it back on every URL that module generates. Both halves or neither: change one without the
|
||||
@@ -36,7 +36,7 @@
|
||||
# The consoles are COPIED into the images at build time, from the second build context `frontend`.
|
||||
#
|
||||
# Where the code comes from: Atrium is this repository (../backend, ../frontend); the modules are
|
||||
# ${MODULES_DIR}/galena, /sygna, /counsel, /insider, /arbiter, /lexicon, /agora, /panorama, /parafa and /scribe: the git submodules under ./modules
|
||||
# ${MODULES_DIR}/galena, /sygna, /counsel, /insider, /arbiter, /lexicon, /agora, /panorama, /parafa, /scribe and /workflow: the git submodules under ./modules
|
||||
# (Arbiter's repository also carries the analysis engine, so its app sits at apps/arbiter of its checkout)
|
||||
# (MODULES_DIR=./modules in .env.example), or sibling checkouts next to this repository (MODULES_DIR=../..;
|
||||
# modules/README.md).
|
||||
@@ -83,7 +83,7 @@ services:
|
||||
# verify-full. Rename it and every app refuses to start.
|
||||
image: postgres:17
|
||||
# The server settings that are not initdb's, and the one hook for changing them. max_connections is
|
||||
# raised from postgres:17's default of 100 for twelve apps (12 x 13 = 156 of 160), and the push budgets 80% of it
|
||||
# raised from postgres:17's default of 100 for twelve apps (12 x 13 = 156 of 160; Workflow is the twelfth since Compass left), and the push budgets 80% of it
|
||||
# (README, Option A, "Sizing"): raise it here and LOCAL_DB_MAX_CONNECTIONS in db.env together, then
|
||||
# `docker compose up -d postgres`. `postgres` must stay the first word — the image's entrypoint only
|
||||
# does its setup when the command is the server itself.
|
||||
@@ -125,7 +125,7 @@ services:
|
||||
retries: 20
|
||||
start_period: 30s
|
||||
networks: [atrium-db, galena-db, sygna-db, counsel-db, insider-db, arbiter-db, lexicon-db,
|
||||
agora-db, panorama-db, parafa-db, scribe-db]
|
||||
agora-db, panorama-db, parafa-db, scribe-db, workflow-db]
|
||||
logging: *logging
|
||||
|
||||
# ── Atrium, the hub ────────────────────────────────────────────────────────────
|
||||
@@ -167,10 +167,10 @@ services:
|
||||
MIGRATION_DATABASE_URL: ""
|
||||
# THE FRONT DOOR's fixed routing table (backend/app/frontdoor.py): slug=backend, nothing else. A slug
|
||||
# outside the family refuses start-up; a module listed here whose backend is not running (Insider,
|
||||
# Arbiter, Lexicon, Agora, Panorama, Parafa or Scribe while its profile is off) answers 502 at its path. Each name resolves on that module's own
|
||||
# Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe or Workflow while its profile is off) answers 502 at its path. Each name resolves on that module's own
|
||||
# network below. No FORWARDED_ALLOW_IPS: nothing stands in front of this process, so its image runs
|
||||
# uvicorn with --no-proxy-headers and the peer address IS the client (the audit log's IP).
|
||||
FRONTDOOR_UPSTREAMS: "galena=http://galena-backend:8000,sygna=http://sygna-backend:8000,counsel=http://counsel-backend:8000,insider=http://insider-backend:8000,arbiter=http://arbiter-backend:8000,lexicon=http://lexicon-backend:8000,agora=http://agora-backend:8000,panorama=http://panorama-backend:8000,parafa=http://parafa-backend:8000,scribe=http://scribe-backend:8000"
|
||||
FRONTDOOR_UPSTREAMS: "galena=http://galena-backend:8000,sygna=http://sygna-backend:8000,counsel=http://counsel-backend:8000,insider=http://insider-backend:8000,arbiter=http://arbiter-backend:8000,lexicon=http://lexicon-backend:8000,agora=http://agora-backend:8000,panorama=http://panorama-backend:8000,parafa=http://parafa-backend:8000,scribe=http://scribe-backend:8000,workflow=http://workflow-backend:8000"
|
||||
# The ONE published port of the whole stack: plain HTTP. TLS is optional and off by default:
|
||||
# compose.tls.yaml (switched on in deploy/.env, RUNBOOK-tls.md) adds :443 here and the certbot sidecar.
|
||||
ports:
|
||||
@@ -195,6 +195,7 @@ services:
|
||||
panorama: {}
|
||||
parafa: {}
|
||||
scribe: {}
|
||||
workflow: {}
|
||||
depends_on:
|
||||
atrium-migrate: { condition: service_completed_successfully }
|
||||
postgres: { condition: service_healthy }
|
||||
@@ -962,6 +963,79 @@ services:
|
||||
retries: 10
|
||||
logging: *logging
|
||||
|
||||
# ── Workflow (repository Alpaq92/Workflow): approval runs on documents, files and requests ─────────────────
|
||||
# SWITCHED OFF until deploy/.env names `workflow` in COMPOSE_PROFILES, exactly like the modules above
|
||||
# (deploy/RUNBOOK-workflow.md).
|
||||
# Every step of a run writes to the hub's shared event log (dredd_core.workflow_contract), so workflow_app
|
||||
# must be an event EMITTER (MODULE_EVENT_EMITTER_ROLES in env/atrium.env) before it goes live. Galena is
|
||||
# optional: GALENA_BASE_URL in env/workflow.env, empty = runs on uploaded files and requests only.
|
||||
workflow-migrate:
|
||||
profiles: ["workflow"]
|
||||
build:
|
||||
context: ${MODULES_DIR:-./modules}/workflow/backend
|
||||
# The module's console ships in its image (its Dockerfile: COPY --from=frontend).
|
||||
additional_contexts:
|
||||
frontend: ${MODULES_DIR:-./modules}/workflow/frontend
|
||||
secrets: [dredd_core_token]
|
||||
image: dredd-family/workflow-backend:local
|
||||
# `required: false` for Insider's reason: a missing env_file breaks the whole PROJECT, and the
|
||||
# profile keeps the service off until the files exist (push.sh refuses a missing one by name).
|
||||
env_file:
|
||||
- path: ${DEPLOY_ENV_DIR:-./env}/workflow.env
|
||||
required: false
|
||||
- path: ${DEPLOY_ENV_DIR:-./env}/workflow.migrate.env
|
||||
required: false
|
||||
command: ["sh", "-c", "alembic upgrade head && python -m app.seed"]
|
||||
restart: "no"
|
||||
volumes:
|
||||
- workflow-data:/data
|
||||
networks:
|
||||
workflow-db: {}
|
||||
depends_on:
|
||||
# Identity and the event log are shared and Atrium's migration is what creates them (and grants
|
||||
# workflow_app the log through MODULE_EVENT_EMITTER_ROLES).
|
||||
atrium-migrate: { condition: service_completed_successfully }
|
||||
postgres: { condition: service_healthy }
|
||||
logging: *logging
|
||||
|
||||
workflow-backend:
|
||||
profiles: ["workflow"]
|
||||
build:
|
||||
context: ${MODULES_DIR:-./modules}/workflow/backend
|
||||
# The module's console ships in its image (its Dockerfile: COPY --from=frontend).
|
||||
additional_contexts:
|
||||
frontend: ${MODULES_DIR:-./modules}/workflow/frontend
|
||||
secrets: [dredd_core_token]
|
||||
image: dredd-family/workflow-backend:local
|
||||
env_file:
|
||||
- path: ${DEPLOY_ENV_DIR:-./env}/workflow.env
|
||||
required: false
|
||||
environment:
|
||||
MIGRATION_DATABASE_URL: ""
|
||||
# Trust X-Forwarded-* only from this module's own network, where atrium-backend (the front door) is
|
||||
# the one other member; change it together with the subnet at the bottom of this file.
|
||||
FORWARDED_ALLOW_IPS: "172.30.32.0/24"
|
||||
# Atrium frames this module's console at the one origin: SAMEORIGIN / frame-ancestors 'self'
|
||||
# (the module's own default is 'none' / DENY). Set here, not in env/, so no env file can undo it.
|
||||
FRAME_ANCESTORS: "'self'"
|
||||
expose: ["8000"]
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
# Uploaded run subjects and request attachments.
|
||||
- workflow-data:/data
|
||||
networks:
|
||||
workflow: {}
|
||||
workflow-db: {}
|
||||
depends_on:
|
||||
workflow-migrate: { condition: service_completed_successfully }
|
||||
postgres: { condition: service_healthy }
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/healthz').status==200 else 1)"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
logging: *logging
|
||||
|
||||
# One network per module backend, shared only with atrium-backend (the front door): a module cannot reach
|
||||
# another module's backend directly, and each trusts X-Forwarded-For from exactly its own subnet. If a
|
||||
# subnet collides with an existing network on the host, change it here AND in that FORWARDED_ALLOW_IPS.
|
||||
@@ -1012,6 +1086,10 @@ networks:
|
||||
ipam: { config: [{ subnet: 172.30.31.0/24 }] }
|
||||
scribe-db:
|
||||
ipam: { config: [{ subnet: 172.30.41.0/24 }] }
|
||||
workflow:
|
||||
ipam: { config: [{ subnet: 172.30.32.0/24 }] }
|
||||
workflow-db:
|
||||
ipam: { config: [{ subnet: 172.30.42.0/24 }] }
|
||||
|
||||
volumes:
|
||||
# NEVER `docker compose down -v`. It deletes all of these at once, and they hold the only copy of
|
||||
@@ -1019,7 +1097,8 @@ volumes:
|
||||
# repositories, which are not in the database at all, sygna-data holds uploads, and
|
||||
# insider-data is Insider's DATA_DIR (shared with its optional OCR worker), arbiter-data Arbiter's,
|
||||
# and lexicon-data / agora-data / panorama-data theirs (Lexicon's sources, Agora's plain-file rounds),
|
||||
# parafa-data / scribe-data Parafa's uploaded and signed PDFs and Scribe's exports.
|
||||
# parafa-data / scribe-data Parafa's uploaded and signed PDFs and Scribe's exports,
|
||||
# workflow-data Workflow's run files and request attachments.
|
||||
# `down` without -v keeps them; to stop the stack, use `docker compose down` or `stop`. Back them up
|
||||
# (README, Option A, "Backups", and §9). A box that ran the Caddy release still has caddy_data and
|
||||
# caddy_config volumes: nothing uses them any more, and removing them is the operator's call.
|
||||
@@ -1033,6 +1112,7 @@ volumes:
|
||||
panorama-data:
|
||||
parafa-data:
|
||||
scribe-data:
|
||||
workflow-data:
|
||||
|
||||
secrets:
|
||||
# Used only by each image's build stage (one `pip install` of the private dredd-core); no running
|
||||
|
||||
@@ -112,6 +112,7 @@ PLATFORM_IDENTITY_SCHEMA=dredd
|
||||
# 200 (156 of 160; LOCAL_DB_MAX_CONNECTIONS defaults to the same 200), or use 3 / 6 -> 12 x 10 = 120.
|
||||
# Option B with twelve: 1 / 4 -> 12 x 6 = 72 of 72 at 90 (no headroom: prefer 1 / 3 -> 60); with 60,
|
||||
# 1 / 1 -> 12 x 3 = 36 of 48.
|
||||
# Workflow takes the twelfth place Compass left (retired 2026-11-14), so the same twelve-app budget holds.
|
||||
#
|
||||
# Sized for FIVE modules, not four (2026-10-03). At the old 5 / 10 a fifth app made it 5 x 16 = 80 of
|
||||
# 80 — the budget met exactly, with nothing left for a `psql`, a `docker compose run --rm <app>-migrate`
|
||||
@@ -150,6 +151,8 @@ PARAFA_MIGRATOR_PASSWORD=
|
||||
PARAFA_APP_PASSWORD=
|
||||
SCRIBE_MIGRATOR_PASSWORD=
|
||||
SCRIBE_APP_PASSWORD=
|
||||
WORKFLOW_MIGRATOR_PASSWORD=
|
||||
WORKFLOW_APP_PASSWORD=
|
||||
|
||||
# ── Role names: leave them on a real deployment ────────────────────────────────────────────────
|
||||
# Role names are cluster-wide, so each carries its app's name. Override only on a test cluster
|
||||
@@ -176,6 +179,8 @@ SCRIBE_APP_PASSWORD=
|
||||
# PARAFA_APP_ROLE=parafa_app
|
||||
# SCRIBE_MIGRATOR_ROLE=scribe_migrator
|
||||
# SCRIBE_APP_ROLE=scribe_app
|
||||
# WORKFLOW_MIGRATOR_ROLE=workflow_migrator
|
||||
# WORKFLOW_APP_ROLE=workflow_app
|
||||
|
||||
# ── --local only (no Docker on this machine) ───────────────────────────────────────────────────
|
||||
# The module checkouts and the CA come from deploy/.env (or --compose-env FILE) as for Compose.
|
||||
|
||||
Vendored
+4
-3
@@ -57,7 +57,7 @@ IDENTITY_SCHEMA=dredd
|
||||
# does not exist. So Insider, switched off by default, is not listed; switch it on by adding
|
||||
# insider_app / insider_migrator here together with `insider` in COMPOSE_PROFILES in deploy/.env,
|
||||
# before the first push (`./init.sh --add insider` writes both). Arbiter the same: arbiter_app / arbiter_migrator with `arbiter` in COMPOSE_PROFILES
|
||||
# (`./init.sh --add arbiter`). Lexicon, Agora, Panorama, Parafa and Scribe likewise (`./init.sh --add lexicon` etc.).
|
||||
# (`./init.sh --add arbiter`). Lexicon, Agora, Panorama, Parafa, Scribe and Workflow likewise (`./init.sh --add lexicon` etc.).
|
||||
# Insider is a reader of the shared model providers like every listed module, never a key reader. Atrium's own two roles are never listed — its runtime role IS the writer tier
|
||||
# (DB_APP_ROLE) and its migrator owns the schema. The grants are applied by Atrium's revisions, once
|
||||
# each: after the last one has run, a module joining later also needs a revision that re-applies them
|
||||
@@ -82,8 +82,9 @@ MODEL_PROVIDER_MIGRATOR_ROLES=arbiter_migrator
|
||||
# runtime role always does. Each takes effect once its role is in IDENTITY_READER_ROLES too; a module
|
||||
# not listed reaches nothing in the log. Re-applied on every migrate (python -m app.identity_grants).
|
||||
# Agora writes `negotiation.round_received` when the other side sends a round, so agora_app is listed;
|
||||
# Parafa writes `document.signed` when a PDF is signed, so parafa_app is listed too.
|
||||
MODULE_EVENT_EMITTER_ROLES=galena_app,agora_app,parafa_app
|
||||
# Parafa writes `document.signed` when a PDF is signed, so parafa_app is listed too; Workflow writes
|
||||
# its run events (dredd_core.workflow_contract), so workflow_app is listed as well.
|
||||
MODULE_EVENT_EMITTER_ROLES=galena_app,agora_app,parafa_app,workflow_app
|
||||
# The event log's READER tier (dredd-core 0.23.0): SELECT and nothing else, for a module that reports
|
||||
# on the log and says nothing itself — Panorama's trends. Joined the same way; a role is an emitter or
|
||||
# a reader, never both (the grant block refuses the overlap). push.sh checks it with --events-reader.
|
||||
|
||||
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
# deploy/env/workflow.env — Workflow's backend, on the platform.
|
||||
#
|
||||
# Copy to workflow.env (init.sh writes it; `./init.sh --add workflow` on a box that predates Workflow) and
|
||||
# fill in. Read by workflow-backend and workflow-migrate; the migrator's URL lives in workflow.migrate.env,
|
||||
# which only the one-shot reads.
|
||||
#
|
||||
# The app's own template is modules/workflow/.env.example, and it is the authority on every key below
|
||||
# that is not about this platform. Where the two differ, that one wins: this file exists to say what
|
||||
# changes when Workflow is a module rather than a standalone stack. Leave out POSTGRES_DB /
|
||||
# DB_*_PASSWORD (the kit's postgres service is configured in deploy/.env).
|
||||
|
||||
APP_ENV=production
|
||||
|
||||
# The front door (atrium-backend) strips /workflow before the request arrives; this puts it back on
|
||||
# every URL the app generates (the image's CMD hands it to uvicorn as --root-path). The two are one
|
||||
# decision — see compose.yaml's header. FORWARDED_ALLOW_IPS and FRAME_ANCESTORS='self' are set by
|
||||
# compose.yaml, not here: the first names the subnet the front door forwards from (172.30.32.0/24).
|
||||
ROOT_PATH=/workflow
|
||||
APP_BASE_URL=http://<site>/workflow
|
||||
|
||||
# ── one account (the default) ──────────────────────────────────────────────────────────────────
|
||||
# The shared identity schema. Set, this app reads the platform's accounts and never writes them;
|
||||
# empty, it is a standalone Workflow with its own sign-in. It must equal PLATFORM_IDENTITY_SCHEMA in
|
||||
# deploy/db.env — push.sh refuses the half-done combination by name. Switching Workflow on also means
|
||||
# listing workflow_app / workflow_migrator in env/atrium.env's IDENTITY_*_ROLES (the push refuses
|
||||
# without them; `./init.sh --add workflow` does both, and the event emitter list (every step of a run writes to the hub's event log)). STANDALONE (`./init.sh --standalone`):
|
||||
# both lines commented out, with every other app's identity settings blanked to match.
|
||||
#
|
||||
# SESSION_COOKIE_NAME must match every other app's: one origin plus one cookie plus one session row
|
||||
# IS the single sign-on, and there is no handoff protocol to configure.
|
||||
IDENTITY_SCHEMA=dredd
|
||||
SESSION_COOKIE_NAME=dredd_session
|
||||
# The name this module answers to, and the slug Atrium's catalogue uses for it: a permission row and
|
||||
# an app token are both addressed by it, and two spellings fail silently.
|
||||
MODULE_SLUG=workflow
|
||||
# Where the console sends somebody who is not signed in. Blank is correct here: the hub is a sibling
|
||||
# path at the same origin.
|
||||
IDENTITY_HUB_URL=
|
||||
|
||||
# ── database ───────────────────────────────────────────────────────────────────────────────────
|
||||
# Option A (the default): the runtime role workflow_app on this box's own PostgreSQL — plain role
|
||||
# name, the compose service `postgres`, LOCAL_DB_NAME from deploy/.env, NO sslmode / sslrootcert.
|
||||
# Password: WORKFLOW_APP_PASSWORD from db.env, percent-encoded.
|
||||
DATABASE_URL=postgresql+pg8000://workflow_app:<percent-encoded-password>@postgres:5432/dredd
|
||||
# Must be DATABASE_URL's role (Workflow refuses to start otherwise).
|
||||
DB_APP_ROLE=workflow_app
|
||||
# Option B: a managed PostgreSQL provider's database (deploy/README.md, "Option B").
|
||||
# DATABASE_URL=postgresql+pg8000://workflow_app.<tenant>:<percent-encoded-password>@<host>:5432/postgres?sslmode=verify-full&sslrootcert=/run/certs/db-ca.crt
|
||||
# Every app shares one connection limit (db.env.example, "Connection budget"). Do not raise these for
|
||||
# one app without redoing that arithmetic.
|
||||
DB_POOL_SIZE=4
|
||||
DB_MAX_OVERFLOW=8
|
||||
|
||||
CORS_ALLOW_ORIGINS=
|
||||
|
||||
DATA_DIR=/data
|
||||
# A production module seeds no demo content: the platform's people and documents are real.
|
||||
SEED_DEMO=false
|
||||
|
||||
# Galena's PUBLIC address, a hairpin back through the front door: no module shares a network with
|
||||
# another module (compose.yaml), so `galena-backend` does not resolve from here. A run on a Galena
|
||||
# document pins it and a stage can be approved by a Galena role, both read with the acting person's own
|
||||
# token. Empty: Galena off for this module (runs on uploaded files and requests only; anything on a
|
||||
# Galena document answers 409 galena_disabled).
|
||||
GALENA_BASE_URL=http://<site>/galena
|
||||
|
||||
# ── auth ───────────────────────────────────────────────────────────────────────────────────────
|
||||
SESSION_TTL_HOURS=12
|
||||
LOGIN_MAX_ATTEMPTS=5
|
||||
LOGIN_LOCKOUT_MINUTES=15
|
||||
# Empty = auto-detect from the request scheme (Secure over HTTPS only).
|
||||
SESSION_COOKIE_SECURE=
|
||||
# App tokens (workflow_pat_...) stay listable and revocable here; on the platform they are minted at
|
||||
# the hub.
|
||||
APP_TOKENS_ENABLED=true
|
||||
|
||||
OTEL_ENABLED=false
|
||||
OTEL_SERVICE_NAME=workflow-backend
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
# Workflow's one-shot settings: loaded ONLY by workflow-migrate (together with workflow.env), never by the
|
||||
# long-running backend. Alembic runs as the migrator; the seed after it runs as the runtime role
|
||||
# (workflow_app, workflow.env's DATABASE_URL). init.sh writes env/workflow.migrate.env from this template
|
||||
# (git-ignored); on a deployment that already exists, `./init.sh --add workflow` does.
|
||||
|
||||
# ── Option A (the default): the migrator workflow_migrator on this box's own PostgreSQL ──────────
|
||||
# Plain role name, the `postgres` service, LOCAL_DB_NAME from deploy/.env, no TLS parameters (see
|
||||
# workflow.env). Password: WORKFLOW_MIGRATOR_PASSWORD, percent-encoded.
|
||||
MIGRATION_DATABASE_URL=postgresql+pg8000://workflow_migrator:<percent-encoded-password>@postgres:5432/dredd
|
||||
|
||||
# ── Option B: a managed PostgreSQL provider's database (deploy/README.md, "Option B") ───────────
|
||||
# Comment MIGRATION_DATABASE_URL above and uncomment this one, together with DATABASE_URL in workflow.env.
|
||||
# MIGRATION_DATABASE_URL=postgresql+pg8000://workflow_migrator.<tenant>:<percent-encoded-password>@<host>:5432/postgres?sslmode=verify-full&sslrootcert=/run/certs/db-ca.crt
|
||||
|
||||
# One account (the default): nobody is created here — Atrium is the one place accounts are made, and
|
||||
# this module holds no INSERT on the shared `app_user` — so the EMAIL names the hub's first
|
||||
# administrator, whom the seed looks up. The PASSWORD is inert on the platform, but push.sh's
|
||||
# preflight refuses an empty, default or short one (12+ characters), so it stays set; init.sh
|
||||
# generates it. Standalone (`./init.sh --standalone`): the seed creates this module's own first
|
||||
# administrator with them when no user has the EMAIL.
|
||||
BOOTSTRAP_ADMIN_EMAIL=admin@example.com
|
||||
BOOTSTRAP_ADMIN_PASSWORD=
|
||||
+16
-10
@@ -3,7 +3,7 @@
|
||||
# its own PostgreSQL (deploy/README.md, "Option A"): every setting, every secret, every file, mode 600.
|
||||
#
|
||||
# The family is ONE SITE with one module per path — <site>/atrium, /galena, /sygna, /counsel,
|
||||
# /insider, /arbiter, /lexicon, /agora, /panorama, /parafa, /scribe, and / goes to Atrium (atrium-backend is the front door, compose.yaml) — so what this asks for is ONE
|
||||
# /insider, /arbiter, /lexicon, /agora, /panorama, /parafa, /scribe, /workflow, and / goes to Atrium (atrium-backend is the front door, compose.yaml) — so what this asks for is ONE
|
||||
# address:
|
||||
#
|
||||
# ./init.sh --ip 1.2.3.4 # a plain-HTTP trial: http://dredd.1.2.3.4.sslip.io/atrium ...
|
||||
@@ -24,11 +24,12 @@
|
||||
# ./init.sh --add panorama
|
||||
# ./init.sh --add parafa # (Parafa and Scribe: deploy/RUNBOOK-m6-m7.md)
|
||||
# ./init.sh --add scribe
|
||||
# ./init.sh --add workflow # (Workflow: deploy/RUNBOOK-workflow.md)
|
||||
#
|
||||
# ONE ACCOUNT FOR THE WHOLE PLATFORM is what it writes by default: PLATFORM_IDENTITY_SCHEMA=dredd in
|
||||
# db.env, IDENTITY_SCHEMA=dredd and SESSION_COOKIE_NAME=dredd_session in every env/<app>.env, and in
|
||||
# env/atrium.env the module roles Atrium's migration grants the shared schema to (IDENTITY_READER_ROLES /
|
||||
# IDENTITY_MIGRATOR_ROLES: Galena's, Sygna's and Counsel's — Insider, Arbiter, Lexicon, Agora, Panorama, Parafa and Scribe ship switched off, so
|
||||
# IDENTITY_MIGRATOR_ROLES: Galena's, Sygna's and Counsel's — Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe and Workflow ship switched off, so
|
||||
# their roles join the lists when they do). People sign in once, at /atrium, as the one first administrator in
|
||||
# env/atrium.migrate.env. --standalone writes the opt-out instead, all of it at once: those keys blank
|
||||
# (and each module's commented out, so each app keeps its own cookie name), four apps with four sets
|
||||
@@ -40,7 +41,7 @@
|
||||
# regenerated. When db.env sets PLATFORM_IDENTITY_SCHEMA (the one-account platform) it also sets the
|
||||
# app's IDENTITY_SCHEMA and SESSION_COOKIE_NAME to the platform's and adds the app's two roles to
|
||||
# env/atrium.env's IDENTITY_READER_ROLES / IDENTITY_MIGRATOR_ROLES (for arbiter also the
|
||||
# model-provider key reader and migrator lists, for lexicon the key reader list, for agora and parafa the event
|
||||
# model-provider key reader and migrator lists, for lexicon the key reader list, for agora, parafa and workflow the event
|
||||
# emitters, for panorama the event readers), and for every module that ships switched off it adds
|
||||
# the app's own profile to COMPOSE_PROFILES in .env: Atrium's identity grants will name the new roles, so the next push must
|
||||
# provision them, and it does only for an app that is switched on. When db.env does not, the app is
|
||||
@@ -100,9 +101,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
DEPLOY_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
FAMILY="atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe"
|
||||
FAMILY="atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow"
|
||||
# The modules that ship switched off, each under a compose profile of its own name (compose.yaml).
|
||||
PROFILED="insider arbiter lexicon agora panorama parafa scribe"
|
||||
PROFILED="insider arbiter lexicon agora panorama parafa scribe workflow"
|
||||
refuse() { printf 'init: %s\n' "$*" >&2; exit 2; }
|
||||
usage() { sed -n '2,/^set -euo pipefail$/p' "${BASH_SOURCE[0]}" | sed -e '$d' -e 's/^# \{0,1\}//'; }
|
||||
|
||||
@@ -427,9 +428,9 @@ write_app_files() {
|
||||
set_key "$runtime" MODEL_PROVIDER_MIGRATOR_ROLES "$ROLE_PREFIX"arbiter_migrator
|
||||
# The modules that take part in the shared event log (dredd-core 0.20.0, revision 0011); like
|
||||
# the opt-ins above, each takes effect once its role is also an identity reader.
|
||||
# Agora emits (a round from the other side), Parafa too (document.signed); Panorama only reads
|
||||
# (dredd-core 0.23.0's reader tier).
|
||||
set_key "$runtime" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX"galena_app,"$ROLE_PREFIX"agora_app,"$ROLE_PREFIX"parafa_app
|
||||
# Agora emits (a round from the other side), Parafa too (document.signed), and Workflow (every
|
||||
# step of a run, dredd_core.workflow_contract); Panorama only reads (dredd-core 0.23.0's reader tier).
|
||||
set_key "$runtime" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX"galena_app,"$ROLE_PREFIX"agora_app,"$ROLE_PREFIX"parafa_app,"$ROLE_PREFIX"workflow_app
|
||||
set_key "$runtime" MODULE_EVENT_READER_ROLES "$ROLE_PREFIX"panorama_app
|
||||
# The shared counterparty register (dredd-core 0.21.0, revision 0012): Sygna writes, and its
|
||||
# migrator moves its own counterparties in. No reader since Workflow (Compass) was retired.
|
||||
@@ -490,6 +491,11 @@ write_app_files() {
|
||||
# Clauses come from Lexicon and exports go to Galena, each with the person's own token.
|
||||
set_key "$runtime" LEXICON_URL "$PUBLIC/lexicon"
|
||||
set_key "$runtime" GALENA_URL "$PUBLIC/galena" ;;
|
||||
workflow)
|
||||
set_key "$runtime" APP_BASE_URL "$PUBLIC/workflow"
|
||||
# A run on a Galena document pins it, and a stage can be approved by a Galena role: both read
|
||||
# with the person's own token.
|
||||
set_key "$runtime" GALENA_BASE_URL "$PUBLIC/galena" ;;
|
||||
esac
|
||||
WRITTEN="$WRITTEN $runtime $migrate"
|
||||
}
|
||||
@@ -526,8 +532,8 @@ if [ -n "$ADD" ]; then
|
||||
add_to_list "$OUT/env/atrium.env" IDENTITY_READER_ROLES "$ROLE_PREFIX${ADD}_app"
|
||||
add_to_list "$OUT/env/atrium.env" IDENTITY_MIGRATOR_ROLES "$ROLE_PREFIX${ADD}_migrator"
|
||||
CHANGED="$CHANGED\n env/atrium.env IDENTITY_READER_ROLES += $ROLE_PREFIX${ADD}_app, IDENTITY_MIGRATOR_ROLES += $ROLE_PREFIX${ADD}_migrator"
|
||||
# Galena, Agora and Parafa take part in the shared event log (push.sh checks them with --events).
|
||||
case $ADD in galena|agora|parafa)
|
||||
# Galena, Agora, Parafa and Workflow take part in the shared event log (push.sh checks them with --events).
|
||||
case $ADD in galena|agora|parafa|workflow)
|
||||
add_to_list "$OUT/env/atrium.env" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX${ADD}_app"
|
||||
CHANGED="$CHANGED\n env/atrium.env MODULE_EVENT_EMITTER_ROLES += $ROLE_PREFIX${ADD}_app" ;;
|
||||
esac
|
||||
|
||||
@@ -48,7 +48,7 @@ managed (Option B, a managed PostgreSQL provider)
|
||||
backend is on it); nothing waits for postgres
|
||||
- all twenty-four app services mount the provider's CA read-only at /run/certs/db-ca.crt; Galena's,
|
||||
Sygna's, Insider's, Arbiter's, Lexicon's, Agora's, Panorama's,
|
||||
Parafa's and Scribe's data volumes survived the merge
|
||||
Parafa's, Scribe's and Workflow's data volumes survived the merge
|
||||
|
||||
Standard library only. Exit 0 = every property holds, 1 = a property failed (each one printed),
|
||||
2 = the model could not be read.
|
||||
@@ -60,14 +60,14 @@ import sys
|
||||
|
||||
HUB = "atrium"
|
||||
MODULES = ("galena", "sygna", "counsel", "insider", "arbiter", "lexicon", "agora", "panorama",
|
||||
"parafa", "scribe")
|
||||
"parafa", "scribe", "workflow")
|
||||
APPS = (HUB, *MODULES)
|
||||
FRONT_DOOR = f"{HUB}-backend"
|
||||
PG = "postgres"
|
||||
CA_TARGET = "/run/certs/db-ca.crt"
|
||||
DATA_VOLUMES = {"galena": "/data", "sygna": "/data", "insider": "/data", "arbiter": "/data",
|
||||
"lexicon": "/data", "agora": "/data", "panorama": "/data", "parafa": "/data",
|
||||
"scribe": "/data"}
|
||||
"scribe": "/data", "workflow": "/data"}
|
||||
#: Optional workers, each under a compose profile of its own that the preflight never activates — so the
|
||||
#: rendered model leaves them out, while compose.yaml read as YAML (test_deploy_front_door_kit.py) has
|
||||
#: them. Either way they are held to the same rules: the profile, no ports, no migrator URL, and (Option
|
||||
|
||||
@@ -47,7 +47,7 @@ _envfile_value_pick() {
|
||||
}
|
||||
|
||||
# Compose's own settings (deploy/.env): the ones the kit reads besides Compose.
|
||||
# COMPOSE_PROFILES is how a module ships in the kit switched off (Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe) and is switched on per box.
|
||||
# COMPOSE_PROFILES is how a module ships in the kit switched off (Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe, Workflow) and is switched on per box.
|
||||
# PARAFA_SIGNER_DIR is the host directory compose.yaml mounts read-only into parafa-backend.
|
||||
# The TLS switch (compose.tls.yaml): TLS, the site's ATRIUM_DOMAIN, ACME_EMAIL, ACME_STAGING,
|
||||
# HSTS_MAX_AGE, and COMPOSE_FILE, which is how a plain `docker compose up` finds that override.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Module checkouts
|
||||
|
||||
`deploy/compose.yaml` builds Galena, Sygna and Counsel Scorecard from `${MODULES_DIR}/galena`,
|
||||
`${MODULES_DIR}/sygna` and `${MODULES_DIR}/counsel` (and Arbiter from `${MODULES_DIR}/arbiter/apps/arbiter`, Insider from `${MODULES_DIR}/insider`, Lexicon, Agora, Panorama, Parafa and Scribe from `${MODULES_DIR}/lexicon`, `/agora`, `/panorama`, `/parafa` and `/scribe`),
|
||||
`${MODULES_DIR}/sygna` and `${MODULES_DIR}/counsel` (and Arbiter from `${MODULES_DIR}/arbiter/apps/arbiter`, Insider from `${MODULES_DIR}/insider`, Lexicon, Agora, Panorama, Parafa, Scribe and Workflow from `${MODULES_DIR}/lexicon`, `/agora`, `/panorama`, `/parafa`, `/scribe` and `/workflow`),
|
||||
each image with a second build context, `frontend`, the module's console, which the image serves itself. Atrium itself is the repository this directory is in.
|
||||
`MODULES_DIR` is set in `deploy/.env`, which Compose, `push.sh` and `preflight.sh` all read (`init.sh
|
||||
--modules-dir` writes it).
|
||||
|
||||
Submodule
+1
Submodule deploy/modules/workflow added at 37b5ed660d
+21
-20
@@ -99,7 +99,7 @@ missing=""
|
||||
# repository also carries the analysis engine (packages/*), so its app is apps/arbiter; the others are the app.
|
||||
module_subdir() { case $1 in arbiter) printf 'apps/arbiter' ;; *) printf '' ;; esac; }
|
||||
module_checkout() { printf '%s' "$1"; }
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe; do
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow; do
|
||||
sub=$(module_subdir "$slug")
|
||||
[ -d "$modules/$(module_checkout "$slug")${sub:+/$sub}/backend" ] || missing="$missing $slug"
|
||||
done
|
||||
@@ -116,7 +116,7 @@ kit_modules=$modules
|
||||
if [ -n "$missing" ]; then
|
||||
kit_modules=$tmp/modules
|
||||
echo " (steps 2, 5 and 6 use empty stand-ins for every module: they check the kit's files, not the modules)"
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe; do
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow; do
|
||||
sub=$(module_subdir "$slug")
|
||||
root=$tmp/modules/$(module_checkout "$slug")${sub:+/$sub}
|
||||
mkdir -p "$root/backend" "$root/frontend" "$root/db/managed"
|
||||
@@ -168,7 +168,7 @@ CLEAN_KEYS="$COMPOSE_KEYS POSTGRES_PASSWORD
|
||||
MANAGED_DB_MAX_CONNECTIONS
|
||||
DB_POOL_SIZE DB_MAX_OVERFLOW CHECK_REQUIRE_TLS PLATFORM_IDENTITY_SCHEMA
|
||||
DB_HOST DB_PORT DB_NAME ROLE_PREFIX OUT"
|
||||
for upper in ATRIUM GALENA SYGNA COUNSEL INSIDER ARBITER LEXICON AGORA PANORAMA PARAFA SCRIBE; do
|
||||
for upper in ATRIUM GALENA SYGNA COUNSEL INSIDER ARBITER LEXICON AGORA PANORAMA PARAFA SCRIBE WORKFLOW; do
|
||||
for suffix in MIGRATOR_PASSWORD APP_PASSWORD MIGRATOR_ROLE APP_ROLE PYTHON; do
|
||||
CLEAN_KEYS="$CLEAN_KEYS ${upper}_$suffix"
|
||||
done
|
||||
@@ -179,11 +179,11 @@ for key in $CLEAN_KEYS; do CLEAN_ARGS+=(-u "$key"); done
|
||||
clean() { env "${CLEAN_ARGS[@]}" "$@"; }
|
||||
compose() {
|
||||
clean docker compose --project-directory "$DEPLOY_DIR" -f "$DEPLOY_DIR/compose.yaml" --env-file "$tmp/.env" \
|
||||
--profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe "$@"
|
||||
--profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe --profile workflow "$@"
|
||||
}
|
||||
compose_managed_db() {
|
||||
clean docker compose --project-directory "$DEPLOY_DIR" -f "$DEPLOY_DIR/compose.yaml" \
|
||||
-f "$DEPLOY_DIR/compose.managed-db.yaml" --env-file "$tmp/.env.managed-db" --profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe "$@"
|
||||
-f "$DEPLOY_DIR/compose.managed-db.yaml" --env-file "$tmp/.env.managed-db" --profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe --profile workflow "$@"
|
||||
}
|
||||
# Steps 2 and 2b render with every profile a module can be switched on by, so a switched-off module is
|
||||
# still checked like the others. Step 2c renders WITHOUT them, which is what a box that has not deployed
|
||||
@@ -204,7 +204,7 @@ elif ! compose config -q; then
|
||||
else
|
||||
ok "compose.yaml is valid"
|
||||
services=$(compose config --services | sort | tr '\n' ' ') || services="(failed)"
|
||||
expected="agora-backend agora-migrate arbiter-backend arbiter-migrate atrium-backend atrium-migrate counsel-backend counsel-migrate galena-backend galena-migrate insider-backend insider-migrate lexicon-backend lexicon-migrate panorama-backend panorama-migrate parafa-backend parafa-migrate postgres scribe-backend scribe-migrate sygna-backend sygna-migrate "
|
||||
expected="agora-backend agora-migrate arbiter-backend arbiter-migrate atrium-backend atrium-migrate counsel-backend counsel-migrate galena-backend galena-migrate insider-backend insider-migrate lexicon-backend lexicon-migrate panorama-backend panorama-migrate parafa-backend parafa-migrate postgres scribe-backend scribe-migrate sygna-backend sygna-migrate workflow-backend workflow-migrate "
|
||||
if [ "$services" = "$expected" ]; then ok "services: $services"; else bad "services are '$services', expected '$expected'"; fi
|
||||
compose config --format json > "$tmp/compose.json" || bad "docker compose config --format json"
|
||||
if "$PYTHON" "$DEPLOY_DIR/lib/compose_checks.py" local "$tmp/compose.json"; then
|
||||
@@ -224,7 +224,7 @@ elif ! compose_managed_db config -q; then
|
||||
else
|
||||
ok "the merge is valid"
|
||||
services=$(compose_managed_db config --services | sort | tr '\n' ' ') || services="(failed)"
|
||||
expected="agora-backend agora-migrate arbiter-backend arbiter-migrate atrium-backend atrium-migrate counsel-backend counsel-migrate galena-backend galena-migrate insider-backend insider-migrate lexicon-backend lexicon-migrate panorama-backend panorama-migrate parafa-backend parafa-migrate scribe-backend scribe-migrate sygna-backend sygna-migrate "
|
||||
expected="agora-backend agora-migrate arbiter-backend arbiter-migrate atrium-backend atrium-migrate counsel-backend counsel-migrate galena-backend galena-migrate insider-backend insider-migrate lexicon-backend lexicon-migrate panorama-backend panorama-migrate parafa-backend parafa-migrate scribe-backend scribe-migrate sygna-backend sygna-migrate workflow-backend workflow-migrate "
|
||||
if [ "$services" = "$expected" ]; then ok "services: $services (postgres switched off)"; else bad "services are '$services', expected '$expected'"; fi
|
||||
compose_managed_db config --format json > "$tmp/compose.managed-db.json" || bad "docker compose config --format json (merged)"
|
||||
if "$PYTHON" "$DEPLOY_DIR/lib/compose_checks.py" managed "$tmp/compose.managed-db.json"; then
|
||||
@@ -246,14 +246,14 @@ else
|
||||
mv "$tmp/env/insider.env" "$tmp/env/insider.migrate.env" \
|
||||
"$tmp/env/arbiter.env" "$tmp/env/arbiter.migrate.env" "$tmp/env/lexicon.env" "$tmp/env/lexicon.migrate.env" \
|
||||
"$tmp/env/agora.env" "$tmp/env/agora.migrate.env" "$tmp/env/panorama.env" "$tmp/env/panorama.migrate.env" \
|
||||
"$tmp/env/parafa.env" "$tmp/env/parafa.migrate.env" "$tmp/env/scribe.env" "$tmp/env/scribe.migrate.env" "$tmp/env-aside/"
|
||||
"$tmp/env/parafa.env" "$tmp/env/parafa.migrate.env" "$tmp/env/scribe.env" "$tmp/env/scribe.migrate.env" \n "$tmp/env/workflow.env" "$tmp/env/workflow.migrate.env" "$tmp/env-aside/"
|
||||
if ! compose_off config -q 2> "$tmp/compose-off.err"; then
|
||||
sed 's/^/ | /' "$tmp/compose-off.err"
|
||||
bad "without the switched-off modules' env files and with their profiles off, docker compose config fails: a pull would break every compose command on a box that has not deployed them"
|
||||
else
|
||||
services=$(compose_off config --services | sort | tr '\n' ' ') || services="(failed)"
|
||||
case " $services " in
|
||||
*" insider-"*|*" arbiter-"*|*" lexicon-"*|*" agora-"*|*" panorama-"*|*" parafa-"*|*" scribe-"*) bad "a switched-off module's services are active without the profile: $services" ;;
|
||||
*" insider-"*|*" arbiter-"*|*" lexicon-"*|*" agora-"*|*" panorama-"*|*" parafa-"*|*" scribe-"*|*" workflow-"*) bad "a switched-off module's services are active without the profile: $services" ;;
|
||||
*) ok "the switched-off modules' env files absent and their profiles off: the kit loads, and up -d would start none of them" ;;
|
||||
esac
|
||||
fi
|
||||
@@ -261,7 +261,7 @@ else
|
||||
"$tmp/env-aside/arbiter.env" "$tmp/env-aside/arbiter.migrate.env" "$tmp/env-aside/lexicon.env" \
|
||||
"$tmp/env-aside/lexicon.migrate.env" "$tmp/env-aside/agora.env" "$tmp/env-aside/agora.migrate.env" \
|
||||
"$tmp/env-aside/panorama.env" "$tmp/env-aside/panorama.migrate.env" "$tmp/env-aside/parafa.env" \
|
||||
"$tmp/env-aside/parafa.migrate.env" "$tmp/env-aside/scribe.env" "$tmp/env-aside/scribe.migrate.env" "$tmp/env/"
|
||||
"$tmp/env-aside/parafa.migrate.env" "$tmp/env-aside/scribe.env" "$tmp/env-aside/scribe.migrate.env" \n "$tmp/env-aside/workflow.env" "$tmp/env-aside/workflow.migrate.env" "$tmp/env/"
|
||||
fi
|
||||
|
||||
step "2d. optional TLS: compose.tls.yaml merged, with TLS=on example settings"
|
||||
@@ -282,7 +282,7 @@ else
|
||||
files=(-f "$DEPLOY_DIR/compose.yaml" -f "$DEPLOY_DIR/compose.managed-db.yaml" -f "$DEPLOY_DIR/compose.tls.yaml")
|
||||
envf=$tmp/.env.managed-db.tls
|
||||
fi
|
||||
if ! clean docker compose --project-directory "$DEPLOY_DIR" "${files[@]}" --env-file "$envf" --profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe \
|
||||
if ! clean docker compose --project-directory "$DEPLOY_DIR" "${files[@]}" --env-file "$envf" --profile insider --profile arbiter --profile lexicon --profile agora --profile panorama --profile parafa --profile scribe --profile workflow \
|
||||
config --format json > "$tmp/compose.$shape.tls.json"; then
|
||||
bad "docker compose config ($shape + compose.tls.yaml)"
|
||||
elif "$PYTHON" "$DEPLOY_DIR/lib/compose_checks.py" "$shape" "$tmp/compose.$shape.tls.json" --tls; then
|
||||
@@ -312,7 +312,7 @@ step "4. header parity: each module exposes the FRAME_ANCESTORS switch the kit s
|
||||
# Atrium tab framing it would go blank with nothing in any log. So each checkout must carry the field
|
||||
# (default 'none'), the validator that refuses anything but 'none' / 'self', and the SAMEORIGIN its edge
|
||||
# stamps for 'self'. The headers' VALUES are each module's own tests' business (tests/test_edge.py there).
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe; do
|
||||
for slug in galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow; do
|
||||
sub=$(module_subdir "$slug")
|
||||
app=$modules/$(module_checkout "$slug")${sub:+/$sub}/backend/app
|
||||
if [ ! -d "$app" ]; then
|
||||
@@ -459,7 +459,7 @@ if clean bash "$DEPLOY_DIR/init.sh" --ip 203.0.113.10 --modules-dir "$kit_module
|
||||
# app's env file, one cookie name, and the hub's grants naming the modules that ship switched on.
|
||||
one_account=1
|
||||
grep -q '^PLATFORM_IDENTITY_SCHEMA=dredd$' "$init_out/db.env" || one_account=0
|
||||
for slug in atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe; do
|
||||
for slug in atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow; do
|
||||
grep -q '^IDENTITY_SCHEMA=dredd$' "$init_out/env/$slug.env" || one_account=0
|
||||
grep -q '^SESSION_COOKIE_NAME=dredd_session$' "$init_out/env/$slug.env" || one_account=0
|
||||
done
|
||||
@@ -517,12 +517,12 @@ if clean bash "$DEPLOY_DIR/init.sh" --ip 203.0.113.10 --modules-dir "$kit_module
|
||||
sed 's/^/ | /' "$tmp/dry-run.init.arbiter.log"
|
||||
bad "push.sh --dry-run with Arbiter switched on (and listed) is not complete, or does not include arbiter"
|
||||
fi
|
||||
# Lexicon, Agora, Panorama, Parafa and Scribe (M2-M4, M6, M7) together: their opt-ins (model-provider
|
||||
# Lexicon, Agora, Panorama, Parafa, Scribe and Workflow (M2-M4, M6, M7) together: their opt-ins (model-provider
|
||||
# key reader, event emitters, event reader) are in env/atrium.env from the first init, so only the
|
||||
# identity lists change here.
|
||||
all_profiles=insider,arbiter,lexicon,agora,panorama,parafa,scribe
|
||||
sed -e 's/^IDENTITY_READER_ROLES=.*/&,lexicon_app,agora_app,panorama_app,parafa_app,scribe_app/' \
|
||||
-e 's/^IDENTITY_MIGRATOR_ROLES=.*/&,lexicon_migrator,agora_migrator,panorama_migrator,parafa_migrator,scribe_migrator/' \
|
||||
all_profiles=insider,arbiter,lexicon,agora,panorama,parafa,scribe,workflow
|
||||
sed -e 's/^IDENTITY_READER_ROLES=.*/&,lexicon_app,agora_app,panorama_app,parafa_app,scribe_app,workflow_app/' \
|
||||
-e 's/^IDENTITY_MIGRATOR_ROLES=.*/&,lexicon_migrator,agora_migrator,panorama_migrator,parafa_migrator,scribe_migrator,workflow_migrator/' \
|
||||
"$init_out/env/atrium.env" > "$tmp/atrium.env.m2m4" && install -m 600 "$tmp/atrium.env.m2m4" "$init_out/env/atrium.env"
|
||||
if clean env COMPOSE_PROFILES=$all_profiles bash "$DEPLOY_DIR/push.sh" --dry-run --db-env "$init_out/db.env" \
|
||||
--compose-env "$init_out/.env" > "$tmp/dry-run.init.m2m4.log" 2>&1 \
|
||||
@@ -532,11 +532,12 @@ if clean bash "$DEPLOY_DIR/init.sh" --ip 203.0.113.10 --modules-dir "$kit_module
|
||||
&& grep -q "^\[panorama\] schema panorama, roles " "$tmp/dry-run.init.m2m4.log" \
|
||||
&& grep -q "^\[parafa\] schema parafa, roles " "$tmp/dry-run.init.m2m4.log" \
|
||||
&& grep -q "^\[scribe\] schema scribe, roles " "$tmp/dry-run.init.m2m4.log" \
|
||||
&& grep -q "^ budget 11 apps" "$tmp/dry-run.init.m2m4.log"; then
|
||||
ok "with every profile on and every module's roles listed the files are complete, the plan includes lexicon, agora, panorama, parafa and scribe, and the budget counts eleven apps"
|
||||
&& grep -q "^\[workflow\] schema workflow, roles " "$tmp/dry-run.init.m2m4.log" \
|
||||
&& grep -q "^ budget 12 apps" "$tmp/dry-run.init.m2m4.log"; then
|
||||
ok "with every profile on and every module's roles listed the files are complete, the plan includes lexicon, agora, panorama, parafa, scribe and workflow, and the budget counts twelve apps"
|
||||
else
|
||||
sed 's/^/ | /' "$tmp/dry-run.init.m2m4.log"
|
||||
bad "push.sh --dry-run with Lexicon, Agora, Panorama, Parafa and Scribe switched on (and listed) is not complete, or does not include them"
|
||||
bad "push.sh --dry-run with Lexicon, Agora, Panorama, Parafa, Scribe and Workflow switched on (and listed) is not complete, or does not include them"
|
||||
fi
|
||||
# The opt-out: separate accounts per app, written whole, and a push that accepts it as it stands.
|
||||
if clean bash "$DEPLOY_DIR/init.sh" --ip 203.0.113.10 --standalone --modules-dir "$kit_modules" \
|
||||
|
||||
+18
-10
@@ -8,12 +8,12 @@
|
||||
# [--stop-backend] [--lock-timeout DURATION]
|
||||
# [--db-env FILE] [--compose-env FILE] [--env-dir DIR]
|
||||
# [atrium] [galena] [sygna] [counsel] [insider] [arbiter] [lexicon] [agora]
|
||||
# [panorama] [parafa] [scribe]
|
||||
# [panorama] [parafa] [scribe] [workflow]
|
||||
#
|
||||
# No app named = every DEPLOYED app: all four, plus insider, arbiter, lexicon, agora,
|
||||
# panorama, parafa and scribe when COMPOSE_PROFILES names them (deploy/.env). Apps always run in the
|
||||
# panorama, parafa, scribe and workflow when COMPOSE_PROFILES names them (deploy/.env). Apps always run in the
|
||||
# family order (atrium, galena, sygna, counsel, insider, arbiter, lexicon, agora, panorama,
|
||||
# parafa, scribe).
|
||||
# parafa, scribe, workflow).
|
||||
#
|
||||
# 1. preflight before anything connects, for EVERY selected app: the platform admin's URL is
|
||||
# well-formed; the app's env files match deploy/db.env as its <app>-migrate AND its
|
||||
@@ -117,9 +117,9 @@ CONTAINER_CA=/run/certs/db-ca.crt
|
||||
MANAGED_DB_COMPOSE=$DEPLOY_DIR/compose.managed-db.yaml
|
||||
# The database service of compose.yaml, which is also LOCAL_DB_HOST's default.
|
||||
LOCAL_DB_SERVICE=postgres
|
||||
FAMILY="atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe"
|
||||
FAMILY="atrium galena sygna counsel insider arbiter lexicon agora panorama parafa scribe workflow"
|
||||
# The modules that ship in the kit switched OFF, each under a compose profile of its own name.
|
||||
PROFILED="insider arbiter lexicon agora panorama parafa scribe"
|
||||
PROFILED="insider arbiter lexicon agora panorama parafa scribe workflow"
|
||||
# The Compose service every step of the platform admin runs in.
|
||||
PROVISIONER=atrium-migrate
|
||||
ORIG_ARGS=("$@")
|
||||
@@ -156,7 +156,7 @@ while [ $# -gt 0 ]; do
|
||||
--env-dir) [ $# -ge 2 ] || refuse "--env-dir needs a directory"; ENV_DIR_ARG=$2; shift ;;
|
||||
--env-dir=*) ENV_DIR_ARG=${1#*=} ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
atrium|galena|sygna|counsel|insider|arbiter|lexicon|agora|panorama|parafa|scribe) SELECTED="$SELECTED $1" ;;
|
||||
atrium|galena|sygna|counsel|insider|arbiter|lexicon|agora|panorama|parafa|scribe|workflow) SELECTED="$SELECTED $1" ;;
|
||||
*) refuse "unknown argument: $1 (see --help)" ;;
|
||||
esac
|
||||
shift
|
||||
@@ -201,7 +201,7 @@ push_key() { # the settings deploy/db.env may carry (anything else is refused,
|
||||
# alembic and seed in --local mode, where env/<app>.env is silent about it, and the migration
|
||||
# would run with a setting the deployed backend will not have.
|
||||
PLATFORM_IDENTITY_SCHEMA) return 0 ;;
|
||||
ATRIUM_*|GALENA_*|SYGNA_*|COUNSEL_*|INSIDER_*|ARBITER_*|LEXICON_*|AGORA_*|PANORAMA_*|PARAFA_*|SCRIBE_*)
|
||||
ATRIUM_*|GALENA_*|SYGNA_*|COUNSEL_*|INSIDER_*|ARBITER_*|LEXICON_*|AGORA_*|PANORAMA_*|PARAFA_*|SCRIBE_*|WORKFLOW_*)
|
||||
case ${1#*_} in MIGRATOR_PASSWORD|APP_PASSWORD|MIGRATOR_ROLE|APP_ROLE|PYTHON) return 0 ;; esac ;;
|
||||
esac
|
||||
return 1
|
||||
@@ -306,7 +306,7 @@ resolve_compose_key() {
|
||||
resolve_compose_key MODULES_DIR ./modules; MODULES_ROOT=$(abspath "$RESOLVED") MODULES_SOURCE=$SOURCE
|
||||
resolve_compose_key DEPLOY_ENV_DIR ./env; ENV_DIR=$(abspath "$RESOLVED") ENV_DIR_SOURCE=$SOURCE
|
||||
|
||||
# Insider, Arbiter, Lexicon, Agora, Panorama, Parafa and Scribe ship in the kit switched OFF: compose.yaml puts their services under a profile
|
||||
# Insider, Arbiter, Lexicon, Agora, Panorama, Parafa, Scribe and Workflow ship in the kit switched OFF: compose.yaml puts their services under a profile
|
||||
# of the module's own name, so `docker compose up -d` leaves each alone until deploy/.env names it in
|
||||
# COMPOSE_PROFILES. A push with no app named follows the same switch — otherwise the four deployed apps
|
||||
# would be held up by one that is not, refused over env files and passwords nobody has written yet.
|
||||
@@ -364,6 +364,7 @@ module_repo() {
|
||||
panorama) printf 'https://github.com/Alpaq92/Panorama' ;;
|
||||
parafa) printf 'https://github.com/Alpaq92/Parafa' ;;
|
||||
scribe) printf 'https://github.com/Alpaq92/Scribe' ;;
|
||||
workflow) printf 'https://github.com/Alpaq92/Workflow' ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -411,6 +412,13 @@ app_setup() { # sets the per-app globals for $1
|
||||
parafa) UP=PARAFA; EXTENSIONS=""
|
||||
CHECK_EXTRA="--append-only audit_log module_event module_event_receipt --no-delete signing_request" ;;
|
||||
scribe) UP=SCRIBE; EXTENSIONS=""; CHECK_EXTRA="--append-only audit_log --no-delete draft_export" ;;
|
||||
# Workflow: the same rule, its app.models lists (test_deploy_workflow_check_args.py). Its event tables
|
||||
# are Agora's case (every step of a run is an event: --events), and its own timeline is append-only;
|
||||
# a run, its request and the templates, types and groups it ran on are archived, never deleted. Its
|
||||
# committed provision.sql is rendered with --extension pgcrypto (Galena's case), so the drift check
|
||||
# and the provisioning must ask for it too.
|
||||
workflow) UP=WORKFLOW; EXTENSIONS=pgcrypto
|
||||
CHECK_EXTRA="--append-only audit_log module_event module_event_receipt workflow_event --no-delete workflow_run request workflow_template request_type approver_group" ;;
|
||||
esac
|
||||
SCHEMA=$slug
|
||||
local var tier
|
||||
@@ -459,8 +467,8 @@ app_setup() { # sets the per-app globals for $1
|
||||
# Only once the module itself pins dredd-core 0.20.0 or later: an older pin's `managed check` has
|
||||
# no --events flag and would refuse the whole check.
|
||||
# Agora emits too (a round from the other side; it pins 0.22.0, so always --events), and Parafa
|
||||
# (document.signed; it pins 0.23.0).
|
||||
case $slug in galena|agora|parafa)
|
||||
# (document.signed; it pins 0.23.0), and Workflow (its runs' events; it pins 0.24.0).
|
||||
case $slug in galena|agora|parafa|workflow)
|
||||
pin=$(sed -n 's/^dredd-core @ .*@v\([0-9.]*\).*/\1/p' "$MODULE/backend/requirements.txt" 2>/dev/null | head -1 || true)
|
||||
case $pin in 0.[0-9].*|0.1[0-9].*) ;; *) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --events" ;; esac ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user