allsource-core 0.26.1

High-performance event store core built in Rust
Documentation
# Fly.io Configuration for AllSource Core
# Deploy from monorepo root (Core Dockerfile needs workspace context):
#   flyctl deploy --config apps/core/fly.toml --dockerfile apps/core/Dockerfile
# Scale: flyctl scale count 2 --app allsource-core

app = "allsource-core"
primary_region = "iad"  # US East (Virginia) - change to your preferred region

[build]
  dockerfile = "Dockerfile"

[env]
  RUST_LOG = "allsource_core=info,tower_http=info"
  ALLSOURCE_HOST = "::"
  # PORT is automatically set by Fly.io

  # Sustainable data strategy (Steps 1-6, landed 2026-04-27 — see
  # docs/proposals/SUSTAINABLE_DATA_STRATEGY.md). The cache budget is
  # eviction target introduced after issue #160 (WAL replay OOM) is
  # based on estimated event bytes, not total process RSS. Keep
  # headroom for indices, the runtime and archive staging; this soft
  # cache limit alone cannot prevent OOM during a cold load.
  ALLSOURCE_CACHE_BYTES = "2147483648"
  # Admit one strict cold loader at a time on this 8 GiB machine. The
  # worker retains its slot after an HTTP timeout until warming actually ends.
  ALLSOURCE_ARCHIVE_WORKERS = "1"
  # Step 6: checkpoint cadence (Parquet flush + WAL truncate). Bounds
  # cold-restart replay to ~one minute of writes regardless of how
  # large the dataset has grown.
  ALLSOURCE_CHECKPOINT_INTERVAL_SECONDS = "60"
  # Step 4: per-tenant compaction cadence (default 3600s / hourly is
  # also set by code; explicit here so ops can grep fly.toml).
  ALLSOURCE_SNAPSHOT_INTERVAL_SECONDS = "3600"
  # Step 5: retention for the `system` tenant ONLY — Core's own CP heartbeat
  # stream. It reaches no customer tenant: RetentionConfig's default_ttl is
  # None and `system` is the single override. Plan-tier retention
  # (subscription.go: 7/14/90/365/-1 days) is a Control Plane concept that
  # nothing currently enforces.
  #
  # 0 = keep forever. Unsetting this does NOT disable it — the code default
  # is 30 days.
  #
  # Deliberately off while compaction runs for the first time. The sweep
  # never ran before 2026-10-12, so this TTL never ran either, and enabling
  # both at once would have the first pass delete ~1.9 GB of heartbeats that
  # have never been subject to it. Compaction alone fixes the fragmentation
  # behind gh#321. Set this to 30 as a separate, deliberate change — no
  # cold-tier archive is configured, so the events are deleted outright.
  ALLSOURCE_RETENTION_SYSTEM_DAYS = "0"

  # One-shot flat→tenant Parquet migration (Step 1 / commit bdd3cd8).
  # The migrator is idempotent: once the storage tree has no flat files
  # at the root, every subsequent boot's pre-Core check is a fast
  # directory listing. Safe to leave set permanently — see
  # apps/core/docker-entrypoint.sh and
  # docs/migrations/STORAGE_LAYOUT_FLAT_TO_TENANT.md.
  ALLSOURCE_MIGRATE_FLAT_TO_TENANT = "true"

# Core is internal-only (bead t-0ff8). Public ingress removed 2026-04-17.
# All user-facing traffic enters through Control Plane's delegation layer.
# Internal .fly network (http://allsource-core.internal:3900) still works
# because other Fly apps in the same org reach machine IPs directly — no
# [http_service] / [[services]] block is needed. See
# docs/deployment/API_SUBDOMAIN_SETUP.md for the full topology.
#
# Rollback: restore [http_service] and re-allocate a public IPv6 with
# `fly ips allocate-v6 -a allsource-core`.

# Top-level machine orchestration (was nested under [http_service])
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1

# Internal HTTP health check so auto_stop/auto_start don't kill a healthy
# machine. Runs inside the Fly network; does not expose anything publicly.
[checks.health]
  grace_period = "10s"
  interval = "30s"
  method = "GET"
  path = "/health"
  port = 3900
  protocol = "http"
  timeout = "5s"
  type = "http"

[[vm]]
  # shared-cpu-4x to unlock 8 GiB; shared-cpu-2x caps at 4 GiB, which is
  # the ceiling a cold load of the largest tenant exceeded (gh#321).
  cpu_kind = "shared"
  cpus = 4
  # 8 GiB host with a 2 GiB estimated cache target and one strict
  # archive worker. Constrained Linux evidence supports 600,000 rows
  # for the measured synthetic shape, not arbitrary concurrent load.
  # See docs/evidence/2026-09-27-isolated-archive-capacity/. Do not
  # downsize or widen row/worker limits without new headroom evidence.
  memory_mb = 8192

[mounts]
  source = "allsource_data"
  destination = "/app/data"