We’ve been discussing ways to improve the experience of launching applications with flyctl
. Here we gather all the ideas and propose a work path.
The overarching goals are to make it easy for:
- Developers to configure and deploy existing applications with minimal effort
- Developers to launch vetted services (Redis, imgproxy, etc) from existing images, Git repositories or both
- Us to keep templates, docs and images up-to-date without modifying flyctl directly
My thought on commands:
fly launch
: Detect apps in the current directory and try to generate a Fly config and a builder (Dockerfile or otherwise)
fly launch redis
: Launch a vetted redis service with some prompts for secrets/vars, like our UI-based launchers have done
fly launch —from https://github.com/fly-apps/keydb
: Launch a service from a repo which has a .fly
directory and meets requirements for deployment
Configuring and deploying existing apps
fly launch
simply scans the current directory for the existence of strings or files, and plants a fly.toml
and other embedded files (like a Dockerfile). It also asks for required secrets, adds entries to statics
, etc. This works, but it’s brittle and requires updating flyctl for every small change to a scanner.
To improve this, we’d want each detectable project type to have an associated git repo, under a separate Github org like fly-apps
. We might even consider moving the detectors to a set of bash scripts that could be run by flyctl
to encourage contributions.
These repos might contain:
- A working example app for a particular runtime version, service, etc
- Documentation about app configuration and concepts, in markdown, that can be displayed in flyctl, and also embedded in our docs pages
- A
.fly
directory with templates we would inject into an app, like aDockerfile
We’ve discussed that default-but-editable Dockerfiles are sometimes preferable to bulky, 3rd party build packs. Especially when we know the environment well and can design efficient default Dockerfiles (like for Phoenix).
That said, detecting accurately can be a tricky job, so we may want to restrict our work here only to newer, known good configurations of common frameworks. A fallback could be general buildpacks when we don’t know what else to do.
Launching vetted services
Devs want an easy way to launch things like Redis, KeyDB, imgproxy, etc. We want to build smart tooling around this like we have with Postgres, but that’s a pretty big effort that ties in with our plans to change the orchestration API, drop nomad, etc.
Today, we hand people a git repo and say ‘clone and follow docs’. These examples tend to get outdated. They may refer to a command or feature removed from Fly, or something else changing with the config or upstream package.
To improve on this, we could:
- Run integration tests that deploy projects and test basic functionality, like test flight does today
- Build docker images to use via
fly launch redis
or another, similar command, to avoid ‘docker drift’ people might run into with tool version updates - Allow pointing at any repo with
fly launch —from https://github.com/fly-apps/keydb
- Make it possible to ‘eject’ the current app config of a running app
Documentation
These commands could be too mysterious if we don’t provide docs both on our site and inline while running them.
For the CLI, adding some output about ‘what happened’ and ‘next steps’ can go a long way. This could live in the repo rather than in flyctl.
For the docs site, we could revive the ability to render repo README files in our docs site. For each vetted service or runtime, we create a section. This was already setup before, but was too disorganised and led a lot of people astray with outdated examples.
It would be useful to think about ways to template docs in such a way that repeated commands like fly volumes create
are not written directly into the markdown files. This was a problem when we removed fly init
and broke a bunch of examples. This would be easy to do on the docs site, but would need some work to fit into the git repo approach.
Maybe we could keep the common templates in another repo, and ensure the final README is built on push.