Skip to content

Fly workers choose their CPU kind, performance by default; AGENTS.md no longer published; release 0.8.0 - #39

Merged
flujo-app merged 3 commits into
mainfrom
fly-worker-cpu-kind
Nov 23, 2026
Merged

flujo-app merged 3 commits into
mainfrom
fly-worker-cpu-kind

Conversation

@flujo-app

Copy link
Copy Markdown
Owner

Fixes #38.

Cost change, please read first: a managed Fly worker that does not choose now gets two performance CPUs with 4096 MB instead of two shared CPUs with 2048 MB. While it runs, that costs about five times as much (Fly lists $66.00 against $13.39 a month, November 2026). Pass cpuKind: 'shared' to keep the old size and price. A call that sets memoryMb: 2048 without cpuKind: 'shared' is now refused, because Fly does not accept that size on performance CPUs.

What changes

One setting, cpuKind ('performance' or 'shared'), on adapter.preflight(...), adapter.provision(...) and a managed fleet worker's provisionInput:

provisionInput: { app: 'my-worker', workspace: 'my-workspace', cpuKind: 'shared' }
  • The bundled bridge (deploy/managed-cloud/lib/bridge.mjs) applies the kind when the machine is created and again at bootstrap. The journal, the local records and the receipts carry it.
  • Memory follows the kind, within Fly's limits for two CPUs (Machine sizing): performance takes 4096 to 16384 MB in steps of 2048 (4096 when omitted), shared takes 1024 to 4096 MB in steps of 256 (2048 when omitted).
  • A size that does not fit is refused before anything is created. The SDK adapter refuses it itself and says why (MANAGED_CLOUD_INPUT_INVALID); a refusal by the service would reach the caller without a reason.
  • scripts/cloud-pilot.mjs asks for cpuKind: 'shared', so the pilot keeps its size and price.
  • provenance.json lists the local changes to the bundled flujo-cloud files with their new sizes and SHA256 values. The manifest hash in Dockerfile.factory, deploy/factory-service.broker.md and test/capacity-service.test.mjs is recomputed from the files.
  • PUBLIC_SDK.md describes the setting, the sizes and the price difference.
  • Release 0.8.0 (package.json, package-lock.json).

Not changed: cloud lite fleets. Their plan already has cpuKind (shared by default) beside cpus and memoryMb.

Known limit: the SDK passes cpuKind on to whatever flujo-cloud module it is given. The published flujo-cloud (0.2.0) still creates shared CPUs, so with that module the setting has no effect yet; a receipt without cpuKind shows that. The bundled bridge in the FACTORY image applies it.

AGENTS.md is removed from the repository. It holds working rules for one machine and stays there as a local file.

Tests

  • New test/fly-cpu.test.mjs: invalid kinds, the memory range of each kind, the default size of each kind, the SDK refusing a misfit size before the service is called, and a full synthetic provision for default, performance and shared that checks the machine configuration at creation and at bootstrap plus the journal.
  • test/managed-cloud.test.mjs and test/managed-fleet-real-module.test.mjs cover the default and the shared kind through the adapter and the real ManagedCloud module.
  • The workflow's focused list gains test/fly-cpu.test.mjs, test/managed-cloud.test.mjs and test/managed-cloud-source.test.mjs.

Local CI before GitHub

The steps of .github/workflows/public-sdk.yml, run on commit 6e5eff6 from a clean source snapshot (git archive) with a clean npm ci:

Platform Node npm Python Result
Windows 10 (Git Bash, Windows tar.exe ahead of Git's) 22.17.0 10.9.2 3.13.1 pass
Windows 10 (same) 24.22.1 11.19.1 3.13.1 pass
Linux, node:22.17.0-bookworm-slim container, non-root user 22.17.0 10.9.2 3.11.2 pass
Linux, node:24.22.1-bookworm-slim container, non-root user 24.22.1 11.19.1 3.11.2 pass

Each run:

  • npm ci
  • npm audit --omit=dev --audit-level=high: passes; it reports 2 moderate findings, which are the same on main (no dependency changed).
  • node scripts/test-temp-guard.mjs <focused list from the workflow>: 287 tests, 287 pass, nothing left in the temp location.
  • python -B -m unittest discover -s selfhost/modal -p "test_*.py": 11 tests pass.
  • npm pack, a fresh install of flujo-factory-0.8.0.tgz into an empty folder, scripts/verify-public-sdk.mjs, --help of factory-public, factory-lite and factory-evidence, factory-selfhost profiles, and the installed MCP stdio test: pass.
  • node scripts/test-temp-guard.mjs test/generic-swarm-evidence.test.mjs: 7 tests pass.
  • Extra, not in the workflow: the integrity test of the bundled files in test/capacity-service.test.mjs passes with the new hashes.

The slim Linux images got python3 and git from Debian inside the container first, as the GitHub runner has both. The Linux container is Debian 12, not the runner's Ubuntu image.

cpuKind ('performance' or 'shared') is accepted by adapter.preflight, adapter.provision and a managed fleet worker's provisionInput. The bundled bridge applies it at creation and at bootstrap, the journal and receipts record it. Memory follows the kind within Fly's limits for two CPUs: performance 4096-16384 MB in steps of 2048 (4096 when omitted), shared 1024-4096 MB in steps of 256 (2048 when omitted). A size outside the range is refused before anything is created.
@flujo-app
flujo-app merged commit c839dc8 into main Nov 23, 2026
2 checks passed
@flujo-app
flujo-app deleted the fly-worker-cpu-kind branch November 23, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed Fly workers always get a shared CPU; there is no setting for a faster one

1 participant