Repository navigation
fly: deploy Op + local-fly starter example (#744) - #759
Merged
Merged
Conversation
The integration proof for the epic: a fly deploy Op composing boot → build → flyApply → wait → teardown on the local executor, and a runnable examples/local-fly/ that deploys an App + Machine offline against the mudflaps emulator (#740) and, by dropping the endpoint override, against a real Fly org. - lexicons/fly/src/composites/fly-deploy.ts — flyDeploy() builds the 5-phase Op plus typed step builders (flapsUp/flapsDown/flyApplyStep) that wrap the generic activity() builder, tagged with the activity names the fly lexicon exports from src/op/activities. The core registry resolves them by name when a project lists the fly lexicon, so these give gcpApply()-style DX with no core change. - examples/local-fly/ — one App + one Machine (src/infra.ts), ops/fly.op.ts (export default flyDeploy({ app })), chant.config.ts (lexicons: fly, temporal), package.json/tsconfig/README. `chant run fly` boots mudflaps, builds, applies, verifies the machine reached started, tears down. README walks the loop and the one-line change to target real Fly (endpoint: null + FLY_API_TOKEN). - examples/examples.test.ts — describeExample("local-fly", ...) build-validates the serialized plan (App app_name, Machine config + managed-by: chant) and asserts the Op's five phases compile. Docker is not used in CI (mirrors the getting-started deploy Op's compile-only validation). Verified: the full Op loop runs green end to end against live mudflaps (Emulator → Build → Apply → Verify started → Teardown, ok:true); examples and fly suites pass. No packages/core change. Endpoint defaults to local mudflaps; D3 real-Fly path is a one-line override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #744 (Phase 3 — the integration proof). A fly deploy Op composing boot → build → flyApply → wait → teardown, and a runnable
examples/local-fly/that deploys an App + Machine offline against the mudflaps emulator (#740) and, by dropping one override, against a real Fly org.Deploy Op composite (
lexicons/fly/src/composites/fly-deploy.ts)flyDeploy()builds the five-phase Op, plus typed step builders (flapsUp/flapsDown/flyApplyStep) that wrap the genericactivity()builder tagged with the activity names the fly lexicon exports (src/op/activities). The core registry resolves them by name when a project lists theflylexicon — so these givegcpApply()-style DX with nopackages/corechange.Example (
examples/local-fly/)One App + one Machine (
src/infra.ts),ops/fly.op.ts=export default flyDeploy({ app }),chant.config.ts(lexicons: ["fly", "temporal"]), package/tsconfig, and a README walking the loop. The machine carries no manual metadata — the serializer stampsmanaged-by: chant(D2).D3 — local vs real Fly
The endpoint defaults to local mudflaps (
http://localhost:4280). One-line change to target a real org:flyDeploy({ app, endpoint: null })+FLY_API_TOKEN.flyApply'sresolveEndpointthen falls through toFLY_FLAPS_BASE_URL/https://api.machines.devwith the bearer token.Verification
Emulator → Build → Apply (machine created) → Verify (started) → Teardown,"ok": true.examples/examples.test.ts—describeExample("local-fly", …)build-validates the serialized plan (Appapp_name, Machineconfig+managed-by: chant) and asserts the Op's five phases compile. Docker isn't used in CI (mirrors the getting-started deploy Op's compile-only validation).packages/corechange.Note: like the trio,
dist/is gitignored and CI validates via in-processbuild()(a source-checkoutchantbin can't run the loop due to a pre-existing module-duplication quirk that affects all examples equally; a real npm install runs it).🤖 Generated with Claude Code