Skip to content

About

forge-ci.com: live utilization dashboard for the forge CI fleet (FastAPI + Vite/TypeScript, deployed on Render)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

forge-ci.com

Forge CI serves an organization-scoped run explorer backed by Signal. The public home page links to GitHub sign-in. After sign-in, /v2 lists the installed organizations where GitHub reports active membership.

FastAPI reads Signal's v2 snapshots, event stream and masked job logs using a server-side reader credential for the selected organization. Signal applies that credential's scope to run IDs, job IDs, logs and events. The browser uses a signed session cookie. Viewer membership is checked again at the next sign-in after the one-hour session expires. OAuth callbacks and viewer requests can land on any replica that shares the same configuration.

Signal's stored chunks are job-wide. Step views associate live log events with the step reported by Signal and show stored output under Stored job logs. A gap notice appears if Signal can no longer resume at the last event ID.

Checks

All of these also run inside docker build, so Render cannot ship a failing gate.

uv sync
uv run ruff format --check .   # Black-compatible formatting
uv run ruff check .            # every ruff rule, isort ("I") included
uv run basedpyright            # typeCheckingMode = "all"
uv run pytest

cd frontend && npm ci
npm run check                  # prettier --check, tsc --strict, eslint strictTypeChecked
npx playwright install chromium
npm run test:browser
npm run build

Local dev: uv run uvicorn forge_dash.app:app_factory --factory --app-dir backend --reload and cd frontend && npm run dev (Vite proxies /api to port 8000).

Deploy

The Render Docker service reads the following environment variables for the run explorer. Configure identical values across replicas.

The Blueprint generates the viewer session key and prompts for the other viewer settings when creating a service. For an existing service, enter the OAuth app credentials and Signal reader tokens in Render's Environment tab. After deploy, an unauthenticated request to /viewer/login should return a redirect to GitHub. If it returns 503, the service log lists the names of the missing or unusable settings.

Variable Value
FORGE_VIEWER_GITHUB_CLIENT_ID GitHub OAuth App client ID. Register https://forge-ci.com/viewer/callback as its authorization callback URL.
FORGE_VIEWER_GITHUB_CLIENT_SECRET GitHub OAuth App client secret. The app requests read:org. Organizations with OAuth app restrictions must approve the app.
FORGE_VIEWER_SESSION_KEY Shared random signing secret of at least 32 bytes.
FORGE_SIGNAL_READER_TOKENS JSON object mapping each installed lowercase GitHub organization to its own Signal reader bearer token. Configure the matching lowercase SHA-256 digest for each organization in Signal's [event_feed.readers].

Legacy host pushes

The production Blueprint enables the fleet dashboard and legacy ingestion with FORGE_ENABLE_LEGACY_INGEST=1. Visitors to / sign in through the Soldr administrator flow and land on /dashboard. The run explorer is still at /v2. Set FORGE_ADMIN_KEY to enable headless access to the dashboard read APIs with an Authorization: Bearer <key> header.

Set FORGE_INGEST_TOKEN_SHA256 to the JSON object of host IDs and token hashes. The dashboard keeps history in process, so use a single worker and replica. Deployments without the flag return HTTP 410 on legacy ingest routes.

Install or update an agent (the token goes over stdin and lands in /var/lib/forge-metrics/token, mode 0600):

deploy/install-agent.sh root@192.168.1.173 https://forge-ci-com.onrender.com/api/ingest < e640.token
deploy/install-agent.sh root@159.89.232.188 https://forge-ci-com.onrender.com/api/ingest -i ~/.ssh/id_rsa < droplet.token

For the Signal droplet, set FORGE_HOST_ID=admin-droplet when running the installer. It also installs an unprivileged systemd timer that snapshots fleet services and recent oneshot results. The container reads the snapshot through a read-only mount. Quick runner counts come from listener and worker processes in the forge-quick.slice cgroup.

The container (forge-metrics-agent) uses --network host, a read-only root, no capabilities, 64 MB and 0.2 CPU. Remove it with docker rm -f forge-metrics-agent.

Set FORGE_IO_STALL_SNAPSHOT=1 with the SSH installer to enable the optional systemd sampler. It samples blocked threads once a second and writes aggregated wait categories and top commands to /run/forge/forge-io-stalls/io-stalls.json. The agent reads that directory through its existing read-only mount. Linux kernels that require CAP_SYS_ADMIN for kernel stacks use wait-channel attribution with this service's capability set. The agent uses a single wait-channel sample when the host-side snapshot is unavailable or stale.

For stack-based attribution on Linux 6.18 hosts, see the CO-RE sampler build and NixOS service. When its snapshot is fresh, the Utilization card shows sampled switch-outs by category and cgroup with the ebpf source label.

The signed-in dashboard shows live GitHub Actions job counts for the two E640s. Enable the dispatcher snapshot at /run/forge/host-load.json before installing the agent. The installer mounts the parent directory read-only when present, and observations older than 30 seconds appear as unavailable. On NixOS runner hosts, install the optional Docker-independent observer with deploy/install-runner-count.sh <ssh-target>. The agent uses its fresh worker count while the dispatcher observation is unavailable.

Adding a host: add a HostInfo to backend/forge_dash/config.py (order = colour order), add its token hash to the env var, run the installer.

Soldr pairing

Register a GitHub OAuth app with callback https://forge-ci.com/soldr/pair/github. Set FORGE_SOLDR_GITHUB_CLIENT_ID and FORGE_SOLDR_GITHUB_CLIENT_SECRET on the forge-ci-com Render service. For an existing service, add those two values in the Render Dashboard.

The Blueprint sets the first customer's numeric GitHub ID and generates a persistent device signing key. On a service deployed outside the Blueprint, set FORGE_SOLDR_GITHUB_CUSTOMER_ID to the allowed account ID and FORGE_SOLDR_SIGNING_KEY to a stable, randomly generated secret of at least 32 bytes. Rotating the signing key invalidates previously issued credentials. GitHub access tokens are used to fetch the account identity during the callback.

Configure FORGE_SOLDR_WORKER_ORIGIN with the HTTPS origin of a worker that accepts Forge CI grants. Set FORGE_SOLDR_WORKER_KEY to a separate, randomly generated secret of at least 32 bytes and provision it on that worker. The discovery API returns no worker until both settings are valid.

Git Ops

The signed-in dashboard opens with fleet utilization charts and live Dell job counts. Git Ops follows with repository activity, per-job workflow and step details, execution placement, and a sampled 24-hour outcome and duration summary. Individual host cards appear below Git Ops.

deploy/install-git-ops.sh actions root@signal-host uses the existing forge-pool-watch GitHub App on the admin droplet. It requests Actions read access for repositories in that watcher's configuration, then posts a snapshot with the droplet's existing metrics credential. The collector polls live runs every two minutes and includes up to 12 completed workflow runs per repository from the past 24 hours. A repository with incomplete coverage is marked in the table. The GitHub counts include hosted jobs and are scoped to watched repositories. The Dell host counts cover all locally observed workers.

deploy/install-git-ops.sh runner root@runner-host relays start and finish events from the runner listener journal, using the existing host metrics token. Events contain timestamp, runner and job name, phase, and result. GitHub supplies repository, workflow, branch, attempt, job status, and step metadata. The job details endpoint is available to signed-in dashboard users.

Diagnosing fleet load

Compare On-CPU time with CPU contention and I/O stalls on the same time range. On-CPU and steal are shares of aggregate logical CPU time. Linux PSI reports wall-time stalls from the kernel's 10-second rolling averages, so CPU, memory, and I/O PSI can overlap. The I/O full series shows when all non-idle tasks were stalled on I/O together. CPU I/O wait comes from CPU accounting and can differ substantially from task I/O PSI. These are host signals, not a per-process off-CPU profile.

Use Block device diagnostics to compare the selected host's whole disks by busy time, read/write latency, average outstanding requests, and throughput. Read/write latency includes queueing and service time. A missing latency sample means there were no completed reads or writes to measure, or the counter reset. Partitions, loop devices, device-mapper layers, and zram are excluded. Samples from older agents have gaps in the new series.

The dashboard keeps Utilization, CPU timing, Pressure, Block devices, Git Ops, and Hosts in sticky tabs. Switching views keeps their existing data and selections. Runner utilization is shown as running jobs over the configured dispatcher cap. The denominator can remain visible through a short dispatcher stall while the worker observer supplies the running count.

On Utilization, Network throughput discloses top downloaded network resources progressively: hover the Network throughput heading (or its Top downloads pill) for the current Top 3 resources, scrub the chart for the Top 3 at any timestamp, or click Top downloads to pin a persistent breakdown with Live and Window scopes. On runner hosts, forge-metrics-agent tails read-only /var/log/nginx/forge-{url,apt,actions}-cache.log (mounted by deploy/install-agent.sh when present) and merges optional /run/forge/net-fetch.json snapshots.

Build attestation statistics

The signed-in dashboard's Attestations tab combines live fleet telemetry with the last 24 hours of completed remote Soldr builds:

  • Attestation pipeline: shows live active counts, 24-hour stage latencies (lock, prepare, command, postprocess, publish), worker outbox queue depth / delivery health, and per-worker telemetry status (Reporting, Stale, No worker telemetry, Unreachable).
  • Live activity: lists every active paired-worker and remote-gate attestation across all reporting hosts (no 6-row cap), its current pipeline stage, and a toggleable stdout/stderr snapshot (scrubbed and bounded).
  • Completed · Last 24 hours: reads /api/attestation-stats (proxying soldr attestation serve using FORGE_ATTESTATION_STATS_ORIGIN and FORGE_ATTESTATION_STATS_READ_TOKEN kept server-side) and joins recent completions with worker stdout/stderr snapshots when available.

On Dell worker hosts, mount /run/forge-attestation read-only into forge-metrics-agent (FORGE_ATTESTATION_LIVE_DIR) so the agent can merge paired-worker.json (written by soldr remote serve via SOLDR_ATTESTATION_LIVE_SNAPSHOT) and remote-gates.json (from forge_metrics_agent.py --snapshot-remote-gates) with /proc CPU accounting.

GitOps fleet policy

In Git Ops → Hosts, the dashboard combines Dell metrics heartbeats with dispatcher capacity from Signal's /v1/pool and the ledger policy hash from /v1/status. The Dell metrics installer mounts /run/gh-runner and /var/lib/gh-runner-deploy read-only so the agent can report the drain intent and deploy-lock marker. An online host with an older agent shows Awaiting host policy telemetry until its agent is refreshed. The current fleet markers carry ownership and expiry or lock state. Newer markers can supply the drain reason, rollout step and ref.

The published update policy calls for draining before each host update and giving the host back if jobs are still running after 90 minutes. Runtime-only changes stay live. Rollout enforcement is tracked in gh-runner#475.

The signed-in GitHub owner can record a drain request with a reason and a 1–360 minute deadline, or an undo request with a reason. The receipt ID appears in the service logs with the event name fleet_action_requested, authenticated actor, host, action and deadline. The operator can use these records for manual handling under the fleet lock. Check the live drain owner and deployment state before applying an undo, and use the remaining time before expiry if applying a drain with FLEET_DRAIN_TTL_S.

Fleet operators

At /v2/operator, operators can validate a fleet policy edit, preview the diff, and open a draft pull request against forge-ci/gh-runner. The existing viewer sign-in supplies GitHub identity and active forge-ci membership. Set FORGE_OPERATOR_IDS to the comma-separated numeric GitHub account IDs that hold the operator role. Operators sign in again to obtain a session with their account ID.

The existing GitHub App installation for the policy repository must have Contents: Read and write and Pull requests: Read and write. Configure its existing credentials as FORGE_POLICY_APP_ID, FORGE_POLICY_APP_INSTALLATION_ID, and FORGE_POLICY_APP_PRIVATE_KEY. The policy repository is private. Without an authorized installation the policy editor reports that it is unavailable. The App pins the schema and source to the same Git revision and opens a draft against main. A reviewer runs uv run scripts/policy.py validate and uv run scripts/policy.py render in the policy checkout and includes the generated files before review and merge. Opening a proposal leaves the live fleet policy untouched.

FORGE_SIGNAL_OPERATOR_TOKENS is a server-side JSON object mapping each operator's numeric GitHub account ID to their existing Signal fgop_ bearer credential. Each credential must have its own actor and matching digest under Signal's [routing.operators]. The dashboard uses Signal's audited /v2/toggles endpoint to set or end overrides. Both commands require a reason and future expiry. The operator page shows the Signal policy hash beside the GitHub hash and highlights active overrides in the audit.

Tenant console

Open Tenant console from the run explorer. Members of an organization in FORGE_SIGNAL_READER_TOKENS can see its installed repositories, cache scopes and current-period usage. Active GitHub organization owners with a configured writer credential can install the app, change repo enablement and reset caches. Owner membership is checked at sign-in and lasts for the viewer session.

Live operation depends on Signal #153. Until Signal implements the contract, the website reports unavailable data or writes. Production onboarding for new organizations also needs tenant credential provisioning, after the third-party security review. The fixture tests exercise a provisioned tenant from sign-in and installation through its first job.

To configure the console once Signal supports it, set FORGE_TENANT_APP_SLUG to the existing GitHub App slug and point that app's Setup URL at https://forge-ci.com/tenant/install/callback. Set FORGE_SIGNAL_TENANT_WRITE_TOKENS to a JSON object keyed by lowercase organization name, with a distinct Signal console-write token for each tenant. The viewer OAuth app, session key and reader credentials are reused. Signal verifies installations using its GitHub App credentials.

Signal tenant API contract

Paths below are relative to /v2/orgs/{org}/tenant. Signal must authorize every request against the credential's tenant and enforce that boundary when looking up installation, repository and scope identifiers.

Method and path Credential Request and successful response
GET / (base path, no trailing slash) Reader 200 snapshot with installation_id (integer or null), period (current usage period label), repositories and scopes.
POST /installation Writer {installation_id, actor}. Verify via GitHub that this installation belongs to the configured app and target organization. Link it idempotently, then return 204.
PUT /repos/{repo} Writer {enabled, actor}. Set dispatch eligibility for the named installed repository and return 204.
POST /scopes/{scope}/reset Writer {confirmation, actor}. Require the exact scope ID as confirmation. Clear that scope's seeds and cache while preserving other scopes. Commit the reset and its durable audit entry together, then return 200 with {id, actor, scope} (strings).

Each repository has name (unqualified), enabled, labels (runner-label strings), minutes (number), cache_bytes (integer), and nullable latest_run_id and latest_job_id (integers from the organization run feed). Each scope has id, repositories (unqualified names), bytes and quota_bytes. Repository and scope IDs are single URL segments starting with a letter, digit, underscore, hyphen or dot, with . and .. reserved. The console sends the authenticated account as actor: "github:<id>" on writes. Signal returns 404 for missing or cross-tenant mutation targets.

Artifact Cache observability and janitor

When FORGE_ARTIFACTS_URL is configured, GET /api/artifacts/status polls the artifact relay's /v1/admin/summary (using server-side FORGE_ARTIFACTS_ADMIN_TOKEN, falling back to /healthz when the summary route or admin token is unavailable) with a short in-memory TTL cache and renders the Artifact Cache card on the signed-in dashboard (hidden when unconfigured).

Variable Value
FORGE_ARTIFACTS_URL Base URL of the forge-artifacts relay service (optional; leave unset to disable).
FORGE_ARTIFACTS_ADMIN_TOKEN Server-side bearer token for /v1/admin/summary and /v1/admin/janitor/sweep. Never exposed to the browser or API responses.

At /v2/operator, operators can trigger a Dry-Run Sweep or confirmed Run Sweep via POST /api/operator/artifacts/janitor (gated with the same operator identity and same-origin checks as policy and routing routes). In the Run Explorer (/v2), structured [forge-artifact] transfer telemetry lines in stored or live job logs are surfaced as compact transfer badges (stream-spool, redirect-r2, fallback, handoff latency, and size).

About

forge-ci.com: live utilization dashboard for the forge CI fleet (FastAPI + Vite/TypeScript, deployed on Render)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages