689 points · by kwindla · 5y ago · 210 comments
It gives context for the article and immediately creates the possibility of converting people off nothing but the article, right off the gate. Blows my mind that it's one of the first times I see this done.
https://news.ycombinator.com/item?id=22616857
We wrote this piece (well, "they" did; I hadn't joined up with Fly yet --- this piece is part of why I did) but Dan edited it. I got to read the back-and-forth and revisions when I got here and it was bananas how much effort he put in. In blog posts, I just keep doing what he suggested in that Launch piece. Seems to be working?
Go look at all the "Launch HN" pieces. I think a lot of them are comparably informed by Dan.
I'm commenting about this because I think it's super interesting that one of YC's secret weapons is the moderator for HN, who informally moonlights as the editor for YC launch posts, and is spooky good at it.
>>> Moving server apps close to users is a simple way to decrease latency, sometimes by 80% or more.
I am willing to believe, but ... what about all the time I spend cacheing, optimising my SQL indexes, buying new RAM.
Does sending a packet a few thousand extra miles.... oh never mind I think I am answering my own question.
It would be interesting however to have a service that does latency testing for different sites from different locations. Now maybe I could use fly for that?
(This info gets added automatically to any article I send to my Kindle for later reading.)
And do away with the stupid and annoying teaser pictures that force me to scroll down on a 27" monitor to even see some text.
I think they're called hero images[1]. I think it's okay to have them, but scaling them up with monitor size is a web-design pattern that needs to die IMHO.
It also signals to me it is not battle tested and results in lost sales.
I'll find someone else.
Final thoughts:
CLI-first: flyctl reminds me of `vercel` (fka Zeit `now`), which is a big compliment
> "VM build-and-boot process on a second deployment is faster than the logging that we do" ... ie, well-suited for lambdas / serverless functions at CDN edge -- which is of extreme relevance and interest to me and everyone else working on minimizing latency with modern webapp architecture... exciting times!
The cool bit is how many interesting things are here/arriving like bpf, io_uring, and wireguard in linux and with wasm and all of the interesting things it opens up with fast, sandboxed execution. I fully expect from some of these techs will really come innovation that will shake-up infrastructure even more than cloud and kubernetes already have.
(Also, hi Kurt and team, cool stuff!)
It is very cool what's available to mashup these days. Kind of a lot to keep up with sometimes.
Indeed! It’s striking what a difference there is compared to the 70s/80s when all tech in utility computing was proprietary and owned by IBM. These days companies like Amazon, Google and Facebook provide a lot of building blocks as FOSS libraries. The innovation rate is amazing.
https://fly.io/blog/sandboxing-and-workload-isolation/
You can skip to the grafs immediately before and after the string "If you’re running someone else’s applications, you should probably care a lot".
I don't think you can reasonably host general-purpose applications on a multi-tenant basis on shared hardware using container systems (ie: using directly shared kernels), for reasons that post gets into. It's for the same reason that AWS wrote Firecracker to run Fargate, which is also a container hosting service.
It's my post and I don't totally get the writing thing either. My M.O. with these posts: write it like it was an HN comment, and then edit the sentences to be shorter. I'm glad people like it, though.
Well done.
> I don't think you can reasonably host general-purpose applications on a multi-tenant basis on shared hardware using container systems
I'm really not sure what point you're trying to make
What you gain is a stronger security boundary. Just FYI, since 2019, you can also do this in Kubernetes using Kata containers + containerd which will happily shim firecracker. The setup is not simple though.
https://github.com/kata-containers/documentation/wiki/Initia...
Overall, fly.io building infrastructure on this pattern and making it accessible is fantastic. Looking forward to seeing how this continues to evolve and am happy to see more infra build on top of firecracker. Very exciting!
I'm sure there is some advantage to all that cleverness but its not at all clear what that is (cost?). So, I disagree it the article is that well written. There's a lot of what and how but not a whole lot of why that matters to their customers. It kind of fails to communicate that part. It could be as simple as "you pay less for more because we did X and this is how we did it and why that matters to you".
Writing is hard.
That’s not entirely correct. You don’t run a docker container. The filesystem is extracted from an docker image and mounted in a VM (firecracker).
Big difference that requires the cleverness described in the blog post.
But in general case, their target should be the security.
"Less is more" they say :)
I'd really like to use Fly for a project that is supposed to go serverless, but may never evolve out of the "Docker on EC2" phase of life. Have you had any third-party security audits done? It'd check a lot of boxes for me.
- Anycast IPv4 to VMs hosted near the edge
- Raw TCP/UDP servers or external HTTP/HTTPS termination
- $.02/GB egress, no per-request pricing
You can build almost anything with this model (VoIP, video, gaming, Heroku-like, App Engine-like, Lambda-like, ..), and the bandwidth pricing is astounding. Fly have an obviously bright future, they aren't even on the same page as existing CDNs.
Maybe some folks have millions of VC money to blow, but I would never build a VoIP or gaming (= bandwidth intensive) app on this.
We're pushing that price down pretty regularly, you can read some details about it here:
> Inflicting that complexity on you all would help with margin control, but ugh. What we've done instead is set a blended price that fits most apps running on Fly.io, and decided to just eat the extra cost from outliers. If you want to exploit that, run an app in Sydney with a whole bunch of users in India. We'll lose money on your app and you will win one round of capitalism.
With Fly you're getting the raw magic behind Lambda@Edge, CloudFlare Workers and every anycast DNS and edge reverse proxy service in existence, with a large chunk of compute, RAM and local storage to build out whatever exact combination of CloudFront or whatever else you like thrown in as part of the deal. Also if you want to skimp on backends, it's still possible to use their HTTPS termination (ala GCE) to reduce handshake latency without rearchitecting everything
But do not that you get a lot of free bandwidth to play with.
Skimming the pricing docs just now, I don't see protection against bandwidth overage:
I don't even write Elixir and I love it, because we built a system that makes it super easy to take a Dockerfile of some random thing, and deploy 20 instances of it spread evenly around some bunch of regions that can talk privately to each other by default.
That's a fun thing to be able to do in any language, but to exploit it in a Go program, I'd have to actually think, pull something like Serf in, whatever.
But Phoenix LiveView apps literally ship with a dashboard where you can see all your instances running, and then first-class features for them to chat between themselves.
LiveView is cool all on its own, but Elixir+Phoenix+LiveView is such a sweet application of a hosting environment like ours. Expect us to be weirdly chatty about Elixir in the coming months.
It's a multi region Phoenix app using libcluster to power LiveView. We have some fun ideas for Elixir, we just need to speed up builds.
Is anyone doing orchestration without containers? I'm working on the JVM so we already have well-isolated single-file deployables, but orchestrating which of them get run on which server is still significantly tricky. I'd love to be able to use the orchestration part of something like Kubernetes without having to worry about all the extra complexity of docker/containers.
This looks very impressive but i'm scared to use this instead of something battle tested like Heroku or App Engine.
Is the experience similar?
The deployment experience is just as easy as Heroku. Perhaps easier.
We use LVM so we can expose raw block devices to peoples' applications.
Seems like people are getting tired of some accidental complexity :)
Simplicity is important for people who are in smaller groups. This is why many people who dislike kubernetes like Fly.io, and people who love kubernetes think we're building a toy.
If anybody is interested: https://github.com/combust-labs/firebuild
It’s very early stages so many things could be improved but things are working.
In particular, we also used to use loop devices [1] but with AUFS mounted on them.
Later we moved over to BTRFS and then Overlay on XFS [2] to help with our unprivileged (security) story.
Also, this was a great piece of technical writing. Thanks for sharing!
1: https://github.com/cloudfoundry-attic/garden-shed/blob/6c5b0...
But there's a number of things that don't quite work how we want it to out of the box, for example, our DNS isn't configured. It seems fly solves this with their custom init system, so I'm really excited to play around with that! Thank you for sharing!
1. Install jq, umoci and skopeo on your host.
2. Run "lxc-create -n <name> -t oci -f <temp-config> -- -u docker://<link to container on registry> --no-cache"
3. Start the resulting container with "lxc-execute -d" rather than "lxc-start".
The <temp-config> file should contain a uid and gid mapping for LXC. If you don't intend to run the containers rootless, you can omit it and "--no-cache" (the caching mechanism is broken for rootless containers).
After container creation we patch the generated config file with our network configuration, etc. similarly to what we would do with a normal LXC container.
This has worked with all containers we tried it with, but if it relies on interacting with the Docker domain directly via docker.sock it obviously won't.
A colleague has had success adding the init system from a container (in that case tini) and changing the confict so the container can start with lxc-start, this was a much more manual process, though.
I use proxmox with lxc, but there's nothing like the simplicity of a Dockerfile
I think it would be nice to have say "dockerpull2lxc" or even better "dockerbuild2lxc".
Entire proxmox community is constantly arguing over
LXC > Docker > Container
or
VM > Docker > Container
...with it being accepted wisdom that container on lxc is impossible. Thought whether above steps can be integrated into proxmox is another question.
Either way - thanks
Has anyone tried using docker-compose files to deploy direct to separate cloud machines?
By which I mean, given some config with user creds to AWS or Digital Ocean or Hetzner or whatever, running:
dockerless-compose some.address.com up
could spin up servers (ec2 instances, droplets, maybe some kind of hinting in the docker-compose.yml file to show sizes), maybe set up a virtual network if the hosting provider supports it, set network aliases in the /etc/hosts, set some.address.com to be the gatekeeper (the system would need to install SSH on your boxes, but it means that it could set up an ssh authorized key from the gatekeeper box)And then, maybe it doesn't need to be actual cloud servers. It could be bare metal. It could be chroots. It could even be a single host with docker (a bit pointless, but maybe useful for proving parity with docker-compose)
Essentially, suddenly we have a replacement for the likes of terraform in many organisations. Your local developer setup becomes exactly the same as your production setup.
Am I missing something? Is that where we're headed with this, or would this be a complete nightmare?
https://aws.amazon.com/blogs/containers/deploy-applications-...
(See also https://aws.amazon.com/containers/copilot/)
The catch is that this doesn’t replace a tool like Terraform unless your projects are extremely simple and you don’t have much in the way of security requirements. Once you need anything more, Compose doesn’t have the information you’d need and you’d lose the veneer of simplicity and portability trying to add it in.
Other than that, I think there's a reason why things like lxd, k8s (maybe joyent/smartos belong in this list) - generally have one layer for the actual hw, and a higher level abstraction on top.
Otoh, I suppose something like canonical metal-as-a-service might be able to do more with a little help. In fact I think maas+lxd is probably pretty close to being able to work with a compose-like tool and docker containers.
All together it might save a little one-time startup cost, at the expense of making every other operation on the filesystem much slower for the life of each container.
Weavework has been doing quite some good stuff around OCI interface around microvms. Ignite[1] which is more robust and productize version of what is mentioned in this blog. Other projects that should be watched out for is kata containers [2]
[1] https://github.com/weaveworks/ignite
[2] https://gokulchandrapr.medium.com/kata-containers-on-kuberne...
Anybody who was happy with heroku for mostly everything other than price that migrated to fly and remained happy?
There is also nerdctl (now a part of containerd community tools) - https://medium.com/nttlabs/nerdctl-359311b32d0e
I aim to build a platform like theirs someday (probably not any time soon) but I don't think I'd do any of what they're doing -- it feels unnecessary, because I feel like I know lots of projects that have actually already done the hard work for this. I probably only think this because I haven't actually done it, but think it's worth sharing the tech anyway. Bear with me as I recently learned that they use nomad[0] and some of these suggestions are kubernetes projects but I'd love to hear why the following technologies were decided against (if they were):
- kata-containers[1] (it does the whole container -> VM flow for you, automatically) with multiple VMM options[2]
- linuxkit[3] (let's say you didn't go with kata-containers, this is another container->VM path)
- firecracker-containerd[4] (very minimal keep-your-container-but-run-it-as-a-VM)
- kubevirt[5] (if you just want to actually run VMs, regardless of how you built them)
- Ceph[6] for storage -- make LVM pools and just give them to Ceph, you'll get blocks, distributed filesystems (CephFS), and object gateways (S3/Swift) out of it (in the k8s space Rook manages this)
As an aside to all this, there's also LXD, which supports running "system" (user namespace isolated) containers, VMs (somewhat recent[7][8]), live migration via criu[9], management/migration of underlying filesystems, runs on LVM or zfs[10], it's basically all-in-one, but does fall behind in terms of ecosystem since everyone else is aboard the "cloud native"/"works-with-kubernetes" train.
I've basically how I plan to run a service like fly.io if I ever did -- so maybe my secret is out, but I sure would like to know just how much of this fly.io got built on (if any of it), and/or what was turned down.
[0]: https://news.ycombinator.com/item?id=26745514
[1]: https://github.com/kata-containers/kata-containers
[2]: https://github.com/kata-containers/kata-containers/blob/2fc7...
[3]: https://github.com/linuxkit/linuxkit
[4]: https://github.com/firecracker-microvm/firecracker-container...
[5]: https://github.com/kubevirt/kubevirt
[7]: https://discuss.linuxcontainers.org/t/running-virtual-machin...
[8]: https://github.com/lxc/lxd/issues/6205
Even if they had been, though, most things that touch kubernetes are incredibly complex. We have to be very careful how we manage complexity.
For example, we decided not to use any CSI or CNI projects for our storage and networking because those are designed to be pluggable. We don't need pluggable, and it's simpler to just build the very small things we did need.
If I think of the choices for pre-built orchestration being:
- LXD
- Kubernetes + CSI/CNI
- Nomad + a little bit of orchestration
I think I know the answer for some of the other options, but not Nomad -- how I'd get some of the features that CSI/CNI provide. Do ya'll just run jobs that take and ship LVM volume snapshots? Is live migration supported (to be fair this isn't really easy/possible/built-in anywhere except LXD AFAIK yet), or do you do a rolling traffic-shifting and application-replica-shooting process?
Looks like I need to read up on nomad this weekend -- looks like it's got just enough for you all to productively use it and build just what you need on top. I have to admit I haven't given it enough of a read/examination.
We manage LVM ourselves, yes. We don't do any live migration. Our disk offering is relatively new so we haven't exposed much snapshot based functionality to them. Most of them just want to know backups are happening and disks are encrypted, though.
Network isolation was much simpler with a little bit of bpf and a ipv6 tricks. Some of that is detailed here: https://fly.io/blog/ipv6-wireguard-peering/
Letting customers connect to their networks with wireguard is something we probably couldn't have done well with k8s and CNI. Or at least, we'd have been fighting cni complexity to make it work.
What do you mean, Nomad does both CSI and CNI, optionally.
https://fly.io/blog/sandboxing-and-workload-isolation/
>As batshit as this plan is, it works surprisingly well; you can build gVisor and runsc, its container runtime, relatively easily. Once you have runsc installed, it will run Docker containers for you. After reading the code, I sort of couldn’t believe it was working as well as it did, or, if it was, that it was actually using the code I had read. But I scattered a bunch of panic calls across the codebase and, yup, that all that stuff is actually happening. It’s pretty amazing.
>You are probably strictly better off with gVisor than you are with a tuned Docker configuration, and I like it a lot. The big downside is performance; you’ll be looking at a low-double-digits percentage hit, degrading with I/O load. Google runs this stuff at scale in GCE; you can probably get away with it too. If you’re running gVisor, you should brag about it, because, again, gVisor is pretty bananas.
I wonder if my grandkids will have the things the OS vendors were promising us back in the early 90's.
From a Dockerfile, it's not as simple without creating an image first.
The command @tptacek means is most likely docker export for a running container and docker save for an image. First exports selected paths, second exports a complete image as a tgz archive.
You could get this done yourself pretty easily: just unpack the Docker image (there's a Docker command that does this, I forget what) onto a mounted loop device, then hand its block device off to Firecracker.
Our driver does its own local address goop, but it's not complicated (it just dumps netlink and allocates the next available subnet in a particular range).
Having said all that: there are projects that do this already; for instance, I think there's a Kata Firecracker somewhere.
We do have people deploy single instance apps and use them just like you'd use a Droplet. "fly ssh console" will SSH you directly into them, and with a persistent volume you can do all kinds of fun stuff.
$330M with no sustainable path to revenue. Everyone ate up the open source pieces and there's nothing left to monetize.
Docker without Docker.
Fly uses Firecracker to separate containers.
Those are two quite different methods and AFAICT Fly uses Firecracker because of the stronger security model of that solution.
Doing my homework, a quick search shows uses as far back as 17th c. (which I din't quite expect!)
Later
The parent comment is getting downvoted into oblivion (because, again, we're a hosting provider) but it's an honest observation! It just happens to have a simple answer.
I'm not that familiar with any of these, but SmartOS sounded cool when I looked it up.
My point on the other hand is that all that flapping in the fly.io article is too complex and completely unnecessary because that problem can be solved with a better, simpler solution which has existed far longer.
Which means we support what people already use. Postgres is great but I wouldn't choose to run it for fun. Our customers use Postgres. Node is not my favorite runtime, but we have good support for Node because it's popular. Devs are willing to package their apps as docker images. So we run Docker images.
Your better, simpler solution would cause our company to fail. I'm very familiar with Joyent and SmartOS. They lost the container battle, despite the elegance.