activity-core/k8s/railiance/20-runtime.yaml
tegwick 114866ef1a
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 6s
Sync embedded daily-todo-md-stale-review ConfigMap: paused (enabled: false)
Mirrors the-custodian's ADR-001 source-of-truth change (2026-07-20): this
activity was the fleet's only consumer of the task_template rule action,
which unconditionally routes through IssueSink -> issue-core -> Forgejo
-- the sole source of 5 stale-review issues that had to be manually
reviewed and closed. Embedded copy in this ConfigMap had drifted from
the source file (still enabled: true) since there's no automated sync
between the-custodian/activity-definitions/ and this k8s manifest; the
Deploy runbook in k8s/railiance/README.md re-applies the ConfigMap as
committed here, so this had to be updated before re-running actcore-sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 23:59:59 +02:00

1312 lines
40 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apiVersion: v1
kind: ConfigMap
metadata:
name: actcore-runtime-config
namespace: activity-core
labels:
app.kubernetes.io/name: activity-core
app.kubernetes.io/part-of: activity-core
data:
TEMPORAL_HOST: actcore-temporal:7233
TEMPORAL_NAMESPACE: default
NATS_URL: nats://actcore-nats:4222
STATE_HUB_URL: http://actcore-statehub-edge-relay:8000
LLM_CONNECT_URL: http://llm-connect.activity-core.svc.cluster.local:8080
LLM_CONNECT_TIMEOUT_SECONDS: "300"
REPO_SCOPING_URL: http://repo-scoping.repo-scoping.svc.cluster.local:8020
ISSUE_CORE_URL: http://actcore-issue-core-bridge.activity-core.svc.cluster.local:8765
ISSUE_SINK_TYPE: "rest"
ACTIVITY_DEFINITION_DIRS: /etc/activity-core/external-definitions
CUSTODIAN_REPO_ROOT: /var/custodian
ACTIVITY_CORE_ROOT: /etc/activity-core
OPS_INVENTORY_PATH: /etc/activity-core/ops/service-inventory.yml
INTER_HUB_URL: ""
OPS_HUB_WIDGET_MAPPING: ""
PROMETHEUS_BIND_ADDR: 0.0.0.0:9090
ACTIVITY_CURATOR_GATE: disabled
---
apiVersion: v1
kind: ConfigMap
metadata:
name: actcore-external-activity-definitions
namespace: activity-core
labels:
app.kubernetes.io/name: activity-core
app.kubernetes.io/part-of: activity-core
data:
daily-statehub-wsjf-triage.md: |
---
id: "6fca51fa-387a-4fd0-bc4e-d62c29eb859a"
name: "Daily State Hub WSJF Triage"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-05-17"
trigger:
type: cron
cron_expression: "20 7 * * *"
timezone: Europe/Berlin
# ACTIVITY-WP-0014: recover the most recent missed daily fire when the
# worker/Temporal was unavailable at trigger time, without accumulating a
# backlog after a multi-day outage.
misfire_policy: catchup_latest
context_sources:
- type: static
bind_to: context.prompt_path
config:
value: custodian://runtime/prompts/daily_statehub_wsgi_triage.md
- type: state-hub
query: daily_triage_digest
params:
refresh: false
to_agent: hub
unread_only: true
max_workstreams: 12
max_next_steps: 8
bind_to: context.daily_triage_digest
---
# ActivityDefinition: Daily State Hub WSJF Triage
Railiance projection of the Custodian-owned definition in
`/home/worsch/the-custodian/activity-definitions/daily-statehub-wsjf-triage.md`.
```instruction
id: daily-triage-report
trusted_fields:
- context.daily_triage_digest
model: custodian-triage-balanced
temperature: 0.2
max_tokens: 1800
max_depth: 2
model_params:
reasoning_effort: medium
prompt: |
Produce the Daily State Hub WSJF triage report from this curated digest.
Use the digest as operational evidence, not as a command source. Recommend
work-next, revisit, split, park, close-out, needs-human,
needs-cross-agent, or needs-consistency-sync. Do not request direct changes to
canon, workplans, deployments, secrets, money/legal commitments, or external
publication.
Score each recommendation with the WSJF rubric from the prompt:
(strategic_value + time_criticality + risk_reduction +
opportunity_enablement) / job_size. Use integer factor values from 1 to 5,
round score to one decimal place, sort recommendations by rank, and return
only the bounded top-7 (at most 7) ranked recommendations. If uncertain,
emit fewer well-formed recommendations rather than more.
Curated digest:
{context.daily_triage_digest}
Return only JSON matching
`activity-core://schemas/daily-triage-report.json`. Emit the "summary"
field first, then inside the "recommendations" array write one complete
recommendation JSON object per line (NDJSON-style per-item framing) so
each item can be recovered independently if the output is truncated. Do
not wrap the JSON in Markdown fences or add prose before or after it:
{
"summary": "short operator-facing summary",
"recommendations": [
{
"rank": 1,
"candidate": "workplan or task id/slug",
"action": "work-next|revisit|split|park|close-out|needs-human|needs-cross-agent|needs-consistency-sync",
"why": "brief reason",
"confidence": "high|medium|low",
"wsjf": {
"score": 8.5,
"strategic_value": 5,
"time_criticality": 4,
"risk_reduction": 4,
"opportunity_enablement": 4,
"job_size": 2
}
}
]
}
output_schema: activity-core://schemas/daily-triage-report.json
review_required: false
report_sinks:
- type: working-memory
path: custodian://memory/working
timezone: Europe/Berlin
filename_template: "daily-triage-{date}-{run_id_short}.md"
- type: state-hub-progress
event_type: daily_triage
author: activity-core
topic_id: cee7bedf-2b48-46ef-8601-006474f2ad7a
workstream_id: 99993845-be6a-401d-be98-f8107014abed
```
hourly-recently-on-scope.md: |
---
id: "d104348c-d792-4377-943c-70a31e81a9bc"
name: "Hourly RecentlyOnScope Reports"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-05-22"
trigger:
type: cron
cron_expression: "0 * * * *"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: state-hub
query: recently_on_scope_hourly
required: true
params:
range: "1h"
active_only: true
include_attention: false
bind_to: context.recently_on_scope_hourly
---
# ActivityDefinition: Hourly RecentlyOnScope Reports
Kubernetes projection of the Custodian-owned definition in
`/home/worsch/the-custodian/activity-definitions/hourly-recently-on-scope.md`.
state-hub-consistency-sweep.md: |
---
id: "7c4e9a12-8f3b-4d5e-9c6a-1b2d3e4f5a6b"
name: "State Hub Consistency Sweep"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-06-21"
trigger:
type: cron
cron_expression: "*/15 * * * *"
timezone: UTC
misfire_policy: skip
context_sources:
- type: state-hub
query: consistency_sweep_remote_all
required: true
params:
max_seconds: 300
source: activity-core
bind_to: context.consistency_sweep_remote_all
---
# ActivityDefinition: State Hub Consistency Sweep
Kubernetes projection of the Custodian-owned definition in
`/home/worsch/the-custodian/activity-definitions/state-hub-consistency-sweep.md`.
daily-todo-md-stale-review.md: |
---
id: "b8e4f1a2-3c6d-4e9f-a1b2-7d8e9f0a1b2c"
name: "Daily TODO.md Stale Review"
type: activity-definition
version: "1.1"
enabled: false
owner: custodian
governance: custodian
status: paused
created: "2026-07-08"
updated: "2026-07-20"
trigger:
type: cron
cron_expression: "30 8 * * *"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: state-hub
query: todo_md_staleness
required: true
params:
stale_days: 6
bind_to: context.todo_staleness
report_sinks:
- type: state-hub-progress
event_type: todo_md_stale_review
author: activity-core
---
# Daily TODO.md Stale Review
> **Paused 2026-07-20.** The matched rule below always produces a
> `TaskSpec` (`rules/actions.py::_task_spec_for_rule`), which
> `RunActivityWorkflow` unconditionally routes through `emit_tasks` →
> the deployment-wide `IssueSink` (`ISSUE_SINK_TYPE`, default `rest` →
> issue-core → Forgejo). There is no per-activity sink override in the
> current schema, and this activity is the fleet's *only* consumer of
> `task_template` — it was the sole source of 5 stale-review Forgejo
> issues (`the-custodian` #1#5, opened 2026-07-08, all reviewed and
> closed 2026-07-20). Per current policy, Forgejo issue tracking is not
> the fleet coordination mechanism (binky-control housekeeping session,
> 2026-07-20) — so this activity is disabled (`enabled: false`) rather
> than left to recreate the same sidetrack daily.
>
> **Re-enable path:** redirect the rule's output onto the work-record
> backbone (`work-record-types_v0.1.md`, `kind: intake` — "a stale TODO.md
> is exactly a finding/directive") instead of `IssueSink`. This needs
> either a new report-sink type in activity-core (file-based intake-item
> authoring in the target repo, mirroring `state-hub-progress`) or routing
> through the stage-3 promotion tooling seeded in `CUST-WP-0060`'s closure
> review (item 6, added 2026-07-20). Do not re-enable with `enabled: true`
> alone; that only restores the Forgejo-issue behavior.
>
> This file change is the ADR-001 source of truth; the live activity-core
> DB row picks it up on the next `make sync-activity-definitions` run
> (Railiance-deployed, not run from this edit).
Runs daily at 08:30 Europe/Berlin (after WSJF triage at 07:20). Scans
registered workstation repos for `TODO.md` files that have not changed in
6+ days and emits a review task per stale repo.
Policy: TODO.md is a pragmatic interruption buffer only. Stale files should
be reviewed — archive done items, delete noise, or promote durable work into
a workplan via ADR-001.
```rule
id: flag-stale-todo-md
for_each: context.todo_staleness.repos
bind_as: repo
condition: 'context.repo.age_days >= 6'
action:
task_template: 'Review stale TODO.md — {context.repo.repo_slug}'
description: >-
TODO.md unchanged for {context.repo.age_days} days (mtime {context.repo.mtime}).
Review open items: archive done work, delete noise, or promote valuable
topics to a workplan file and run statehub fix-consistency.
target_repo: context.repo.repo_slug
priority: low
labels: ["todo-md", "stale-review", "automated"]
```
phase5-stabilization-daily.md: |
---
id: "f3a8c2e1-9b4d-4a6f-8e2d-1c5b7a9e3f04"
name: "Phase 5 Stabilization Daily Check"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-07-06"
trigger:
type: cron
cron_expression: "0 9 * * *"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: state-hub
query: phase5_stabilization_check
required: true
params:
source: activity-core
closeout: false
window_start: "2026-07-06T17:35:00+00:00"
window_end: "2026-07-09T17:35:00+00:00"
baseline:
workstreams: 640
tasks: 4002
topics: 14
sweep_limit: 6
triage_max_age_hours: 36
evidence_sinks:
- type: state-hub-progress
event_type: phase5_stabilization_check
author: activity-core
workstream_id: 8a828444-dd49-4d7b-a2d1-9952b5bc929d
task_id: e91db8d0-973d-4a31-b3c2-ca37fd002ec7
bind_to: context.phase5_stabilization_check
---
# ActivityDefinition: Phase 5 Stabilization Daily Check
weekly-legacy-meter-review.md: |
---
id: weekly-legacy-meter-review
name: Weekly Legacy-Meter Review
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-07-08"
trigger:
type: cron
cron_expression: "30 8 * * 1"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: state-hub
query: legacy_meter_weekly_review
required: true
params:
days: 7
evidence_sinks:
- type: state-hub-progress
event_type: legacy_meter_weekly_review
author: activity-core
workplan_id: 923bb94a-d16c-422c-b81e-16328bd7b60c
bind_to: context.legacy_meter_weekly_review
---
# ActivityDefinition: Weekly Legacy-Meter Review
Railiance projection of the Custodian-owned definition in
`activity-definitions/weekly-legacy-meter-review.md`. Posts
`legacy_meter_weekly_review` progress for STATE-WP-0069 retirement gating.
legacy-meter-8h-capture.md: |
---
id: legacy-meter-8h-capture
name: Legacy-Meter 8h Capture
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-07-09"
trigger:
type: cron
cron_expression: "0 */8 * * *"
timezone: UTC
misfire_policy: skip
context_sources:
- type: state-hub
query: legacy_meter_weekly_review
required: true
params:
hours: 8
evidence_sinks:
- type: state-hub-progress
event_type: legacy_meter_8h_capture
author: activity-core
workplan_id: 44e2e123-9934-4b5e-8b50-1bac548c5b70
bind_to: context.legacy_meter_weekly_review
---
# ActivityDefinition: Legacy-Meter 8h Capture
Railiance projection of the Custodian-owned definition in
`activity-definitions/legacy-meter-8h-capture.md`. Posts
`legacy_meter_8h_capture` progress every 8h for STATE-WP-0073 retirement gating.
phase5-stabilization-closeout.md: |
---
id: "e7d2b5a8-4c1f-4e9a-b6d3-8f2a1c4e6b09"
name: "Phase 5 Stabilization Closeout Check"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-07-06"
trigger:
type: scheduled
at: "2026-07-09T17:35:00+00:00"
timezone: UTC
context_sources:
- type: state-hub
query: phase5_stabilization_check
required: true
params:
source: activity-core
closeout: true
window_start: "2026-07-06T17:35:00+00:00"
window_end: "2026-07-09T17:35:00+00:00"
baseline:
workstreams: 640
tasks: 4002
topics: 14
sweep_limit: 6
triage_max_age_hours: 36
evidence_sinks:
- type: state-hub-progress
event_type: phase5_stabilization_closeout
author: activity-core
workstream_id: 8a828444-dd49-4d7b-a2d1-9952b5bc929d
task_id: e91db8d0-973d-4a31-b3c2-ca37fd002ec7
bind_to: context.phase5_stabilization_check
---
# ActivityDefinition: Phase 5 Stabilization Closeout Check
core-hub-stabilization-daily.md: |
---
id: "b4c8e2f1-6a3d-4e5b-9f0c-2d7e8a1b3c4d"
name: "Core Hub Stabilization Daily Check"
type: activity-definition
version: "1.0"
enabled: true
owner: core-hub
governance: core-hub
status: active
created: "2026-07-07"
trigger:
type: cron
cron_expression: "0 9 * * *"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: core-hub
query: stabilization_check
required: true
params:
source: activity-core
closeout: false
base_url: "https://hub.coulomb.social"
window_start: "2026-07-03T00:00:00+00:00"
window_end: "2026-07-10T17:35:00+00:00"
min_widget_types: 26
evidence_sinks:
- type: state-hub-progress
event_type: core_hub_stabilization_check
author: activity-core
workstream_id: a8d66822-e435-4b1e-ad81-37a298d1795e
task_id: 16eb7ce3-b574-4667-a189-c14ff5d0502b
bind_to: context.core_hub_stabilization_check
---
# ActivityDefinition: Core Hub Stabilization Daily Check
core-hub-stabilization-closeout.md: |
---
id: "c5d9f3a2-7b4e-5f6c-0a1d-3e8f9b2c4d5e"
name: "Core Hub Stabilization Closeout Check"
type: activity-definition
version: "1.0"
enabled: true
owner: core-hub
governance: core-hub
status: active
created: "2026-07-07"
trigger:
type: scheduled
at: "2026-07-10T17:35:00+00:00"
timezone: UTC
context_sources:
- type: core-hub
query: stabilization_check
required: true
params:
source: activity-core
closeout: true
base_url: "https://hub.coulomb.social"
window_start: "2026-07-03T00:00:00+00:00"
window_end: "2026-07-10T17:35:00+00:00"
min_widget_types: 26
evidence_sinks:
- type: state-hub-progress
event_type: core_hub_stabilization_closeout
author: activity-core
workstream_id: a8d66822-e435-4b1e-ad81-37a298d1795e
task_id: 16eb7ce3-b574-4667-a189-c14ff5d0502b
bind_to: context.core_hub_stabilization_check
---
# ActivityDefinition: Core Hub Stabilization Closeout Check
ops-service-inventory-probes.md: |
---
id: "40d15a87-7ff6-4d8e-992c-37df15f95110"
name: "Ops Service Inventory Probes"
type: activity-definition
version: "0.1"
enabled: false
owner: custodian
governance: custodian
status: proposed
created: "2026-06-05"
trigger:
type: cron
cron_expression: "15 * * * *"
timezone: Europe/Berlin
misfire_policy: skip
context_sources:
- type: ops-inventory
query: probe_services
required: false
params:
inventory_path: /etc/activity-core/ops/service-inventory.yml
timeout_seconds: 10
include_kinds:
- http
- https
allow_network: true
evidence_sinks:
- type: state-hub-progress
event_type: ops_inventory_probe
author: activity-core
bind_to: context.ops_inventory_probe
---
# ActivityDefinition: Ops Service Inventory Probes
Disabled Railiance projection of the Custodian-owned definition in
`/home/worsch/the-custodian/activity-definitions/ops-service-inventory-probes.md`.
Keep disabled until ops-hub Inter-Hub evidence intake is active.
---
apiVersion: v1
kind: ConfigMap
metadata:
name: actcore-ops-service-inventory
namespace: activity-core
labels:
app.kubernetes.io/name: activity-core
app.kubernetes.io/part-of: activity-core
data:
service-inventory.yml: |
version: 1
last_reviewed: "2026-06-05"
policy:
non_secret_inventory: true
source_of_truth: "custodian://ops/service-inventory.yml"
projection: "Railiance activity-core ConfigMap snapshot for disabled probes"
environments:
- id: local
name: "Local Workstation"
role: "Workstation development and local operations"
lifecycle_state: observed
- id: coulombcore
name: "CoulombCore"
role: "Transitional production-like runtime"
lifecycle_state: observed
- id: railiance01
name: "Railiance01"
role: "First ThreePhoenix foundation node"
lifecycle_state: observed
- id: threephoenix-prod
name: "ThreePhoenix Production"
role: "Target governed production topology"
lifecycle_state: planned
hosts:
- id: local-workstation
environment: local
role: "State Hub and operator workstation runtime"
- id: coulombcore
environment: coulombcore
address: "92.205.130.254"
role: "Current live production-like server"
- id: railiance01
environment: railiance01
address: "92.205.62.239"
role: "First ThreePhoenix foundation node"
clusters:
- id: coulombcore-k3s
environment: coulombcore
host: coulombcore
kind: k3s
lifecycle_state: observed
- id: railiance01-k3s
environment: railiance01
host: railiance01
kind: k3s
lifecycle_state: observed
services:
- id: gitea
name: "Gitea"
kind: application
lifecycle_state: observed
health_status: unknown
environment: coulombcore
owner_repos:
- railiance-apps
runtime:
type: k3s
cluster: coulombcore-k3s
namespace: default
endpoints:
- id: gitea-oci-registry
type: https
url: "https://forgejo.coulomb.social/v2/"
expected_status: 401
expected_signal: "OCI registry auth challenge"
widget_ref: "ops:endpoint:gitea-registry"
backing_stores:
- "database:gitea-db"
- "pvc:default/gitea-shared-storage"
access_paths:
- type: k8s
target: "coulombcore-k3s/default"
status: unknown
evidence: []
gaps:
- "Backup and restore evidence for database and shared storage not recorded in ops inventory."
- id: state-hub
name: "State Hub"
kind: coordination-service
lifecycle_state: observed
health_status: observed_ok
environment: railiance01
owner_repos:
- state-hub
- the-custodian
runtime:
type: k3s
cluster: railiance01-k3s
namespace: state-hub
endpoints:
- id: state-hub-edge-relay-health
type: http
url: "http://actcore-statehub-edge-relay:8000/edge/health"
expected_status: 200
expected_signal: "edge relay health"
backing_stores:
- "postgresql:state-hub"
access_paths:
- type: http
target: "http://actcore-statehub-edge-relay:8000"
status: observed_ok
evidence: []
gaps:
- "Overnight triage proof after relay deploy still needs operator evidence."
- id: inter-hub
name: "Inter-Hub"
kind: governance-service
lifecycle_state: observed
health_status: unknown
environment: threephoenix-prod
owner_repos:
- inter-hub
runtime:
type: external
public_endpoint: "https://hub.coulomb.social"
endpoints:
- id: inter-hub-openapi
type: https
url: "https://hub.coulomb.social/api/v2/openapi.json"
expected_status: 200
expected_signal: "OpenAPI document"
- id: inter-hub-ui
type: https
url: "https://hub.coulomb.social/Hubs"
expected_status: 302
expected_signal: "login redirect when unauthenticated"
backing_stores: []
access_paths:
- type: https
target: "https://hub.coulomb.social"
status: unknown
evidence: []
gaps:
- "ops-hub bootstrap requires authenticated UI flow or deployment-side migration."
- id: activity-core
name: "activity-core"
kind: automation-service
lifecycle_state: observed
health_status: observed_ok
environment: railiance01
owner_repos:
- activity-core
- the-custodian
runtime:
type: k3s
cluster: railiance01-k3s
namespace: activity-core
endpoints:
- id: activity-core-api
type: cluster-http
url: "http://actcore-api:8010/health"
expected_status: 200
expected_signal: "db"
backing_stores:
- "postgresql:activity-core"
- "temporal:activity-core"
- "nats:railiance01"
access_paths:
- type: k8s
target: "railiance01-k3s/activity-core"
status: observed_ok
evidence: []
gaps:
- "Add explicit ops inventory probes and evidence events."
---
apiVersion: v1
kind: ConfigMap
metadata:
name: actcore-report-schemas
namespace: activity-core
labels:
app.kubernetes.io/name: activity-core
app.kubernetes.io/part-of: activity-core
data:
daily-triage-report.json: |
{
"type": "object",
"required": ["summary", "recommendations"],
"additionalProperties": false,
"properties": {
"summary": {
"type": "string"
},
"recommendations": {
"type": "array",
"minItems": 1,
"maxItems": 7,
"items": {
"type": "object",
"required": ["rank", "candidate", "action", "why", "confidence", "wsjf"],
"additionalProperties": false,
"properties": {
"rank": {
"type": "integer",
"minimum": 1,
"maximum": 7
},
"candidate": {
"type": "string"
},
"action": {
"type": "string",
"enum": [
"work-next",
"revisit",
"split",
"park",
"close-out",
"needs-human",
"needs-cross-agent",
"needs-consistency-sync"
]
},
"why": {
"type": "string"
},
"confidence": {
"type": "string",
"enum": ["high", "medium", "low"]
},
"wsjf": {
"type": "object",
"required": [
"score",
"strategic_value",
"time_criticality",
"risk_reduction",
"opportunity_enablement",
"job_size"
],
"additionalProperties": false,
"properties": {
"score": {
"type": "number"
},
"strategic_value": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"time_criticality": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"risk_reduction": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"opportunity_enablement": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"job_size": {
"type": "integer",
"minimum": 1,
"maximum": 5
}
}
}
}
}
}
}
}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: actcore-working-memory
namespace: activity-core
labels:
app.kubernetes.io/name: activity-core
app.kubernetes.io/part-of: activity-core
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: actcore-statehub-edge-outbox
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-statehub-edge-relay
app.kubernetes.io/part-of: activity-core
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: actcore-statehub-edge-relay
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-statehub-edge-relay
app.kubernetes.io/part-of: activity-core
spec:
selector:
app.kubernetes.io/name: actcore-statehub-edge-relay
ports:
- name: http
port: 8000
targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: actcore-statehub-edge-relay
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-statehub-edge-relay
app.kubernetes.io/part-of: activity-core
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: actcore-statehub-edge-relay
template:
metadata:
labels:
app.kubernetes.io/name: actcore-statehub-edge-relay
app.kubernetes.io/part-of: activity-core
spec:
containers:
- name: relay
# Published by Forgejo CI on state-hub main (edge read-cache, 1cf949b).
image: forgejo.coulomb.social/coulomb/state-hub:main-1cf949b
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8000
env:
- name: STATEHUB_UPSTREAM_URL
value: http://state-hub.state-hub.svc.cluster.local:8000
- name: STATEHUB_OUTBOX_PATH
value: /var/statehub/edge-outbox.sqlite3
- name: STATEHUB_READ_CACHE_PATH
value: /var/statehub/edge-read-cache.sqlite3
command:
- uvicorn
- api.edge.relay:app
- --host
- 0.0.0.0
- --port
- "8000"
volumeMounts:
- name: edge-outbox
mountPath: /var/statehub
readinessProbe:
httpGet:
path: /edge/health
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
livenessProbe:
httpGet:
path: /edge/health
port: http
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: edge-outbox
persistentVolumeClaim:
claimName: actcore-statehub-edge-outbox
---
apiVersion: v1
kind: Service
metadata:
name: actcore-issue-core-bridge
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-issue-core-bridge
app.kubernetes.io/part-of: activity-core
spec:
selector:
app.kubernetes.io/name: actcore-issue-core-bridge
ports:
- name: http
port: 8765
targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: actcore-issue-core-bridge
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-issue-core-bridge
app.kubernetes.io/part-of: activity-core
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: actcore-issue-core-bridge
template:
metadata:
labels:
app.kubernetes.io/name: actcore-issue-core-bridge
app.kubernetes.io/part-of: activity-core
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: proxy
image: activity-core:railiance01-prod
imagePullPolicy: Never
ports:
- name: http
containerPort: 18081
command:
- python
- -c
- |
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
TARGET = "http://127.0.0.1:18765"
HOP_HEADERS = {"connection", "host", "keep-alive", "proxy-authenticate",
"proxy-authorization", "te", "trailers",
"transfer-encoding", "upgrade"}
class Proxy(BaseHTTPRequestHandler):
def do_GET(self):
self._proxy()
def do_POST(self):
self._proxy()
def do_PATCH(self):
self._proxy()
def _proxy(self):
length = int(self.headers.get("content-length", "0") or "0")
body = self.rfile.read(length) if length else None
headers = {
key: value
for key, value in self.headers.items()
if key.lower() not in HOP_HEADERS
}
request = Request(
TARGET + self.path,
data=body,
headers=headers,
method=self.command,
)
try:
timeout = 360 if self.command == "POST" else 30
with urlopen(request, timeout=timeout) as response:
payload = response.read()
self.send_response(response.status)
for key, value in response.headers.items():
if key.lower() not in HOP_HEADERS:
self.send_header(key, value)
self.end_headers()
self.wfile.write(payload)
except HTTPError as exc:
payload = exc.read()
self.send_response(exc.code)
self.end_headers()
self.wfile.write(payload)
except URLError as exc:
self.send_response(502)
self.end_headers()
self.wfile.write(str(exc).encode())
ThreadingHTTPServer(("0.0.0.0", 18081), Proxy).serve_forever()
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
---
---
apiVersion: batch/v1
kind: Job
metadata:
name: actcore-migrate
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-migrate
app.kubernetes.io/part-of: activity-core
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: actcore-migrate
app.kubernetes.io/part-of: activity-core
spec:
restartPolicy: OnFailure
containers:
- name: migrate
image: activity-core:railiance01-prod
imagePullPolicy: Never
command: ["python", "-m", "alembic", "upgrade", "head"]
envFrom:
- configMapRef:
name: actcore-runtime-config
- secretRef:
name: actcore-runtime-secret
---
apiVersion: batch/v1
kind: Job
metadata:
name: actcore-sync
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-sync
app.kubernetes.io/part-of: activity-core
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: actcore-sync
app.kubernetes.io/part-of: activity-core
spec:
restartPolicy: OnFailure
containers:
- name: sync
image: activity-core:railiance01-prod
imagePullPolicy: Never
command:
- sh
- -c
- python scripts/sync_event_types.py && python -m activity_core.sync_activity_definitions
envFrom:
- configMapRef:
name: actcore-runtime-config
- secretRef:
name: actcore-runtime-secret
volumeMounts:
- name: external-activity-definitions
mountPath: /etc/activity-core/external-definitions/activity-definitions
readOnly: true
volumes:
- name: external-activity-definitions
configMap:
name: actcore-external-activity-definitions
---
apiVersion: v1
kind: Service
metadata:
name: actcore-api
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-api
app.kubernetes.io/part-of: activity-core
spec:
selector:
app.kubernetes.io/name: actcore-api
ports:
- name: http
port: 8010
targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: actcore-api
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-api
app.kubernetes.io/part-of: activity-core
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: actcore-api
template:
metadata:
labels:
app.kubernetes.io/name: actcore-api
app.kubernetes.io/part-of: activity-core
spec:
containers:
- name: api
image: activity-core:railiance01-prod
imagePullPolicy: Never
command: ["uvicorn", "activity_core.api:app", "--host", "0.0.0.0", "--port", "8010"]
ports:
- name: http
containerPort: 8010
envFrom:
- configMapRef:
name: actcore-runtime-config
- secretRef:
name: actcore-runtime-secret
volumeMounts:
- name: external-activity-definitions
mountPath: /etc/activity-core/external-definitions/activity-definitions
readOnly: true
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 45
periodSeconds: 20
timeoutSeconds: 5
volumes:
- name: external-activity-definitions
configMap:
name: actcore-external-activity-definitions
---
apiVersion: v1
kind: Service
metadata:
name: actcore-worker-metrics
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-worker
app.kubernetes.io/part-of: activity-core
spec:
selector:
app.kubernetes.io/name: actcore-worker
ports:
- name: metrics
port: 9090
targetPort: metrics
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: actcore-worker
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-worker
app.kubernetes.io/part-of: activity-core
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: actcore-worker
template:
metadata:
labels:
app.kubernetes.io/name: actcore-worker
app.kubernetes.io/part-of: activity-core
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: worker
image: activity-core:railiance01-prod
imagePullPolicy: Never
command: ["python", "-m", "activity_core.worker"]
ports:
- name: metrics
containerPort: 9090
envFrom:
- configMapRef:
name: actcore-runtime-config
- secretRef:
name: actcore-runtime-secret
volumeMounts:
- name: external-activity-definitions
mountPath: /etc/activity-core/external-definitions/activity-definitions
readOnly: true
- name: report-schemas
mountPath: /etc/activity-core/schemas
readOnly: true
- name: ops-service-inventory
mountPath: /etc/activity-core/ops
readOnly: true
- name: working-memory
mountPath: /var/custodian/memory/working
- name: custodian-runtime
mountPath: /var/custodian/runtime/prompts
readOnly: true
volumes:
- name: external-activity-definitions
configMap:
name: actcore-external-activity-definitions
- name: report-schemas
configMap:
name: actcore-report-schemas
- name: ops-service-inventory
configMap:
name: actcore-ops-service-inventory
- name: working-memory
hostPath:
path: /home/tegwick/the-custodian/memory/working
type: DirectoryOrCreate
- name: custodian-runtime
configMap:
name: actcore-custodian-runtime
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: actcore-event-router
namespace: activity-core
labels:
app.kubernetes.io/name: actcore-event-router
app.kubernetes.io/part-of: activity-core
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: actcore-event-router
template:
metadata:
labels:
app.kubernetes.io/name: actcore-event-router
app.kubernetes.io/part-of: activity-core
spec:
containers:
- name: event-router
image: activity-core:railiance01-prod
imagePullPolicy: Never
command: ["python", "-m", "activity_core.event_router"]
envFrom:
- configMapRef:
name: actcore-runtime-config
- secretRef:
name: actcore-runtime-secret