Skip to content

group(enhancements): Albacore #158

Description

@nfebe

Albacore release. Theme: full deployment lifecycle and self-healing operations.
Umbrella for the next release; each item below ships this cycle.

Features

  • Observability & self-recovery (feat: Add AI-native observability and self-recovery module #148): shipped in feat(observ): Add observability engine, plugin tool bridge, notifications #165 and feat(observ): Add observability UI, plugin slots, notifications settings ui#78. OTel-semconv metrics with a native time-series UI, health self-heal scoped to FlatRun-managed deployments only (capped retries with cooldown, so an external container can't trigger a restart loop), a core notification system wite email/webhook targets and test-send, and a plugin framework that lets a plugin inject UI sections, contribute settings, and expose tools the AI assistant can call. Follow-ups tracked under Improvements; none blocked the release.
  • S3-compatible backups (feat(backup): Add remote S3-compatible backup destinations #168, ui: Object stores, a base component library, and dark-mode fixes ui#79): backups now mirror to remote S3-compatible object storage (AWS, R2, B2, MinIO) on top of the always-local copy, best-effort so a remote outage never fails a backup. What/how/where is documented in docs/BACKUPS.md; object-storage secrets live in the credential manager, never the flat-file config. This also seeds the object store abstraction (external vs managed stores, a MinIO template so FlatRun can run its own S3 endpoint), specced in docs/OBJECT_STORES.md. Follow-up slices, still open: one-click managed deploy with auto-register, an object browser, deployment consumption, and store-to-store replication.
  • Dashboard & API performance (performance: Loading deployments and the dashboard is generally too slow #154): progressive / lazy loading for the deployments
    list and dashboard instead of loading everything at once
    (parked: the backend is no
    longer the bottleneck, so whether the UI still needs this is unmeasured); profile and
    optimize the backend paths behind those views. This item is about how fast FlatRun's own
    UI and API respond, not how fast the deployed apps serve their traffic (tracked
    separately below).
    Backend profiling (this cycle): deployment status was recomputed on every request by
    shelling out to the docker compose CLI with nothing cached, so latency scaled with
    the number of deployments and was dominated by process startup. Listing N deployments
    spawned 2N to 4N docker processes; a single detail view spawned 4 to 8. The backend
    status path is addressed in perf(deployments): Read deployment status from the Docker engine #171: status now comes from one Engine API
    query covering every deployment at once, so listing is flat with the deployment count
    instead of scaling with it. The query is deliberately restricted to live containers,
    which is what keeps reported status identical to what the compose CLI reported.
    Progressive / lazy loading on the UI side is still open. Concrete work:
    • Memoize compose-command detection so docker compose version runs once per process,
      not once per runCompose.
    • Serve list/detail status from one Engine API ContainerList filtered by
      com.docker.compose.project labels, reusing the existing APIClient, instead of
      per-deployment docker compose ps.
    • Collapse the detail path that runs the compose sequence twice into one status read.
    • Skip the status fan-out for endpoints that only need on-disk metadata (certificates,
      proxy sync, traffic), reading via FindDeployments rather than ListDeployments.
      Cluster is excluded: it marshals the full deployment list to clients with status
      included, so it does need the status read.
    • Add a short-TTL cache for container status so request bursts don't each recompute
      it.
      Parked: it was specced when a list cost ~486ms and spawned 2N to 4N processes.
      A list is now ~22ms, of which ~20ms is the single Engine API call, so a cache would
      save ~20ms in exchange for stale status right after a start/stop and the invalidation
      needed to avoid it. The call scales with live container count, so revisit if a busy
      host shows it in real numbers.
    • Record before/after list and detail timings at 1, 10, and 50 deployments: list 128ms
      to 25ms at 1, 104ms to 22ms at 10, and 486ms to 26ms at 50; detail ~150ms to ~22ms.
  • Deployment serving performance: how fast a deployed app answers real end-user
    requests through FlatRun's reverse proxy, distinct from dashboard/API speed above. The
    proxy is the shared path every deployment's traffic crosses, so its defaults set the
    floor for everyone. Establish a baseline and remove the obvious drags:
    • Measure request latency and throughput through the proxy to a deployment (p50/p95,
      requests/sec) against hitting the container directly, so proxy overhead is a number. With
      keepalive pooling in place the proxy adds ~0.05ms mean over a direct hit (p50 0.04 to
      0.09ms, p95 0.07 to 0.17ms on loopback): negligible, not a bottleneck.
    • Audit the generated nginx/openresty vhost defaults: keepalive to upstreams, gzip,
      HTTP/2, sensible proxy buffer sizes, and static-asset caching headers. Audited; gzip,
      proxy buffers, and HTTP/1.1 to upstreams landed in fix: Auto-renew certificates by default, with honest renew reporting and proxy tuning #167; HTTP/2 and the TLS
      session cache were already set on every generated vhost. The two remaining gaps are now
      closed too:
    • Confirm no per-request work scales badly (excess logging, TLS session cache off,
      DNS re-resolution of upstreams). Checked, and all three are fine: access logging is
      buffered (buffer=32k flush=5s) and the ACME challenge locations log nothing, the TLS
      session cache is on for a day on every vhost, and upstream DNS re-resolution is the
      cheap 30s resolver that exists on purpose. The one real per-request drag this audit
      turned up is the upstream keepalive above.
    • Surface per-deployment request latency in the observability UI so a slow app is
      visible next to its CPU and memory, closing the loop with feat: Add AI-native observability and self-recovery module #148. Shipped in
      feat(observ): Make the metrics reach someone, and outlive the process #174 and feat(observ): Show what a deployment is doing, and let rules be written ui#82: rate, errors, average and p95 are bucketed from the
      proxy's own record of every request and served per deployment.
    • Document knobs an operator can turn per deployment (worker limits, cache toggles).
  • Integrations: deploy from a GitHub or git URL and from uploaded code, not only
    from compose content or a template. Today a deployment must already have a compose
    file; this adds source-based deployment with auth.
  • Builders: build code and then deploy it. Today only an existing compose build:
    section runs. This adds build-from-source (Dockerfile detection, buildpacks / nixpacks)
    with build config (args, cache, secrets).
  • More AI tools (feat(ai): Add more tools for quick actions, file editing, summarization etc #147): expand the AI assistant with quick actions, file editing,
    summarization, and related tools (UI side: feat(ai): Add AI workflow to file viewers/editors accross the application ui#71). First agent-side set shipped in
    feat(ai): Let the assistant edit files, run actions, and control deployments #185: write a deployment file, run a quick action, start/stop/restart a
    deployment, and list a deployment's security events to summarize. Every state-changing tool
    requires deployment write access and honours protected mode (failing closed if that check
    errors). The shared tool set is exposed over an MCP server (feat(ai): Expose FlatRun's tools as an MCP server #184, feat: Expose the assistant tool set over an MCP server #186;
    settings tab feat: Add MCP server settings tab ui#89), the assistant's loop runs on the reusable
    whilesmartgo/agents runner with per-call tool approval (refactor(ai): Adopt whilesmartgo/agents for the assistant core #182, refactor(ai): Adopt whilesmartgo/agents for the model engine #183 and
    refactor(ai): Drive the assistant loop through the shared agents runner #187), and the website and docs present the MCP server and the agent-runtimes
    direction (flatrun/website#11). Editor integration closed the loop (feat(ai): Scope file-editor assistant to the deployment and cover env vars ui#90,
    fix(ai): Redact session input and gate state-changing tools on approval #188): file-editor sessions are deployment-scoped, the env tab shares keys
    only, seeded session input is redacted server side, a state-changing tool always pauses for
    per-call approval even in auto-run sessions, and the open editor reloads after an approved
    write instead of clobbering it. Future tools land as needs surface.
  • Agents v0 (feat(ai): Add agents defined as flat markdown files #189, feat(ai): Add the Agents view ui#91): agents defined as flat markdown files
    in .flatrun/agents/, executed by the runtime as AI sessions through the shared tool set,
    so permission gates, protected mode, secret redaction, and the state-change approval pause
    all carry over; each run records its agent, so run history is just sessions. Three creation
    paths: describe it to the assistant (a validated, gated write tool), the panel's editor with
    a starter template, or drop a file in the directory. Architecture for governance policy,
    durable runs, triggers, and MCP-client tools is in docs/AGENTS.md; positioning shipped as
    the self-operating server (flatrun/website#12). Next slices: policy frontmatter, run
    lifecycle, MCP client, triggers.
  • Persist AI chat sessions (feat(ai): List saved assistant sessions so past chats can be resumed #181, feat(ui): List and resume past assistant conversations ui#88): sessions were already
    persisted per user on the agent, but nothing could enumerate them. Added a listing of the
    caller's saved sessions (all for an admin), most recent first, each with a title from its
    first message; the assistant's history view now loads real conversations and reopening one
    restores its transcript and scope, replacing the previous hardcoded placeholder.
  • Marketplace-sourced templates: the deployment flow's templates should come from the
    marketplace (api.flatrun.dev) and be kept current, with flatrun/marketplace on GitHub
    as the fallback source for public publications when the API is unreachable. Today the
    deploy flow uses the templates embedded in the agent binary.
  • Firewall enforcement (feat(firewall): Enforce the host firewall policy through nftables #180): saving a policy now translates it to
    nftables and applies it, re-applies at startup, and removes the rules when disabled. It
    only touches FlatRun's own table (Docker untouched), always keeps loopback, established
    connections, and the active SSH port open so a default-deny cannot lock the operator out,
    and snapshots/restores on a failed load. Where nftables is unavailable the policy is saved
    but reported as not enforced. Verified via unit tests and by loading the generated ruleset
    into real nft in an isolated netns; not applied to a live host's firewall.

Improvements

Housekeeping

  • Document the release naming system: keep the convention below current and reuse
    it when opening the next umbrella issue.

Release naming: umbrella releases are codenamed after sea creatures, advancing one
letter per release. Albacore (A) -> Barnacle (B) -> Cuttlefish (C) -> Dolphin (D) ...
Pick the next unused letter when opening each new group(enhancements): issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions