dwyl / learn-devops

🚧 Learn the craft of "DevOps" (Developer Operations) to Deploy your App and Monitor it so it stays "Up"!
GNU General Public License v2.0
417 stars 172 forks source link

Investigate Fly.io App & Postgres Deployment #72

Closed nelsonic closed 3 years ago

nelsonic commented 3 years ago

https://fly.io/docs/reference/postgres

nelsonic commented 3 years ago

Logging into the Fly Forum https://community.fly.io using GitHub OAuth requires "Act on your behalf" permissions ...

image

This feels like a violation of the principal of least privilege. 🤷‍♂️ I know it's "just" a Discourse instance, but I don't remember granting this for the Elixir Forum ... 💭

Reading: https://github.community/t/why-does-this-forum-need-permission-to-act-on-my-behalf/120453

nelsonic commented 3 years ago

After reading the entire thread, which was quite repetitive, the conclusion is that when people setup a Discourse Forum instance as a GitHub App instead of just using GitHub OAuth, the scopes have a terrible wording. Apparently it only gets access to Email Address.

It's the same case for: https://github.community image

I would definitely prefer it if they updated their wording, this is terrible UX. 🤦 But I'm going to go ahead and use the Fly forum. 👍

nelsonic commented 3 years ago

https://www.crunchbase.com/organization/fly-io image

nelsonic commented 3 years ago

As far as I'm concerned this is the deal-maker for me considering using Fly.io for Phoenix projects: 😍 https://twitter.com/chris_mccord/status/1428821074553315332 image

nelsonic commented 3 years ago

Continue: https://fly.io/docs/hands-on/start/

nelsonic commented 3 years ago

https://fly.io/docs/getting-started/elixir/

nelsonic commented 3 years ago

https://hexdocs.pm/phoenix/fly.html

nelsonic commented 3 years ago

https://fly.io/docs/about/pricing The first thing on the pricing page is the "Free Tier": https://fly.io/docs/about/pricing/#free-tier image

Looks we will be able to run the Hits App off "Free Tier" (except for the persistent storage ...) One VM for the App and two for Postgres (with backup).

The VMs are reasonably priced: https://fly.io/docs/about/pricing/#virtual-machines image

Persistent Volumes: https://fly.io/docs/about/pricing/#persistent-volumes $0.15/GB per month image

200GB x $0.15 = $30/month

By contrast AWS Elastic Block Store (EBS) appears cheaper on the surface: https://aws.amazon.com/ebs/pricing/ image

The same 200GB on AWS EBS would cost $34.25/month ...

https://fly.io/docs/about/pricing/#postgresql-clusters image

https://fly.io/docs/about/pricing/#outbound-data-transfer image

Not suuuper happy about paying for outbound data transfers. Especially not $0.02/gb ... 💭 💸 We'll have to see if egress bandwidth becomes an issue. ⏳ back-of-the-envelope calculation: 1kb (per hit), 1000 projects, 1000 hits/month = 1Gb If Fly.io gives us 160Gb of "free tier" bandwidth per month, then we can have 160M hits per month "free". We will monitor this and if it gets out-of-hand we'll have to revise it. 👍

nelsonic commented 3 years ago

Hits app deployed to Fly.io: https://github.com/dwyl/hits/pull/128 Screen Shot 2021-11-01 at 1 07 07 AM

nelsonic commented 3 years ago

Investigation complete. App deployed. ✅ Next: https://github.com/dwyl/hits/issues/130

nelsonic commented 3 years ago

The "usage" is a little concerning: https://fly.io/organizations/personal/usage

image

like why do they charge for accessing data in the DB 🤷‍♂️ surely it's on the same subnet and doesn't count as "outbound" ...? 💭

nelsonic commented 2 years ago

We're 1/3 through the month of November and we've used 12.6 GB of outbound data transfer:

image

This is good considering the "Free Tier" is 160 GB https://github.com/dwyl/learn-devops/issues/72#issuecomment-945001230 and it was my only "concern" with using Fly.io. 💭

nelsonic commented 2 years ago

Continuous Deployment: https://github.com/dwyl/hits/pull/133