-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPIC: Continuous Deployment of Phoenix Apps to Any VPS #59
Comments
@SimonLab please give a ballpark estimate for how long you think this will take. ⏳ |
|
|
My goal is to see how easy it is to run a small Phoenix application with Linode. The steps I'm going to try is to
So far I've:
got the following error:
|
@SimonLab have you had a chance to read Chapter 11 "Deploy Your Application to Production" of the Real-Time Phoenix book? I think it might be highly relevant to this Epic/Quest as we 100% want to have WebSockets/Channels in our App (that's the biggest selling point of using Elixir/Phoenix! 😉 ) |
I just rapidly read the deployment chapter: A production server can be run with Releases package BEAM (Erlang virtual machine), provide scripts (for example to monitor the running application), allow BEAM customisation with flags and preload some code to make the initial responses to client requests faster. You can decide to deploy the application on a "Platform as a Service" PaaS (e.g. Heroku, Gigalixir, Render) or on a virtual private server VPS (e.g. Linode). Make sure the server/platform can handle a large amount of concurrent connection and can use websocket. To manage the requests load you can use a load balancer which manage where the requests are sent to (e.g. HAProxy, nginx) Redeploying an application can be done with |
@SimonLab thanks for sharing this good summary of your reading. 👍 Ideally we would like to have a "how to guide" that gives the exact steps to setup CD for Elixir/Phoenix Apps (as per the issue description). And a set of (version controlled) scripts for actually executing the DevOps. Have you started creating a markdown file with your notes of what you have learned? (please push to GitHub) OpenBSD is a (really) "nice to have" at this point, definitely not a "requirement" right now.
To clarify: I would much rather figure out CD fast using Linux is "fine" for deploying "Hits" to Linode with backups enabled. For the purposes of deploying the DWYL APP, we need to make a time-value tradeoff assessment and determine how much more effort is needed to figure out how to get Zero-downtime CD on Linode. The DWYL APP is our "crown jewel" and we cannot afford to have a "hacky" deployment pipeline. We need something with an SLA and at least "five nines" of uptime. If the amount of effort required to set this up now is another 5 days of your time, that's enough cash to pay for Heroku or Gigalixir for a Year. By which point we will either have a few thousand paying customers or have run out of funds to continue working on the App ... 💸 NotesWe still need to get better at Estimating Tasks To be clear: I consider data security to be a "feature" but I don't know how many customers will use our product because of the security. It's more of a "hygiene" factor than a "motivator". As much as I want to have our own Continuous Delivery with Zero-downtime Deploys to a VPS, I feel that investing more time into this quest is not wise right now. Deploying our App to an existing (PaaS) provider is "enough" security during our MVP. |
Thanks for your comment above @nelsonic I feel confident that for a simple Phoenix application a VPS could be a nice solution, however I still have some aspect that I will need to research (backup, deployment without any downtime, elixir cluster) which can take a at least a few days of reading/testing. With that in mind I also think at the moment a PaaS is a good solution while the application is getting build and user tested.
|
I'm currently reviewing the changes that need to be made on #61 I'm reading/searching the following
Other questions I want to also clarify:
|
@SimonLab we can safely skip the S3 step for the Hits Application. I had to create specific deployment keys to add to Travis. Obvs documented it: |
Using Distillery and Edeliver we can use hot code upgrade (updating the code to a new version while the server is still running). The following thread is the current problem I'm trying to solve: https://elixirforum.com/t/graceful-restart-of-an-elixir-v1-9-release/24211/5 The idea is to have the current and new application running at the same time and to use a load balancer to transfer the requests to the new application.
|
@SimonLab for the Hits App a few seconds of downtime once a month when there is a new release is perfectly acceptable. Please don’t worry about that. As long as we have a deployment we are fine. |
http://dokku.viewdocs.io/dokku/ is an excellent open-source Heroku-style PaaS. - It uses Heroku build scripts under the hood so porting apps from Heroku to Dokku should be reasonably painless. You host it on your own VPS so it is a bit more involved than Heroku but you have control over your own infrastructure and allows for a transition to container-based solution in the future For running small applications with CD pipelines its probably one of the best options, only needing a |
@th0mas yeah, we used Dokku a couple of years ago to deploy Node.js Apps: The reason we decided not to use Dokku at the time for our Phoenix Apps is because |
At present we don't have a reliable way of doing Continuous Deployment to Linode for our Hits App.
https://github.com/dwyl/hits ... Because it's been infrequent, I have done the deploy manually. 🤦
We have setup CI/CD for Client Phoenix Apps in the past e.g:
https://github.com/dwyl/learn-microsoft-azure#how
But so far we have stuck to using Heroku for @dwyl Apps because it's so easy and cheap (Free!)
Now we need to do it with a fresh pair of eyes and with the benefit of all the enhancements that have occurred in the Phoenix/Elixir/Erlang community over the past couple of years.
Todo
phoenix-continuous-delivery.md
Related:
OpenBSD
instead ofLinux
? learn-security#73@SimonLab given that you prefer to focus on "back end" part of your "full stack" skills, I feel like your name is missing from this list: https://github.com/dwyl/learn-devops/graphs/contributors 😉
I've added you to the Linode account using your
gmail
address.Please add 2FA to enhance security: https://www.linode.com/docs/security/authentication/two-factor-authentication/linode-manager-security-controls
And feel free to play with a Linode VPS on my account.
P.S: I'm not married to Linode by any means. I just prefer to use an independent service that is not VC funded or pouring money into the pocket of the world's richest person 🙄
The reason the title of this issue is "Any VPS" is precisely because we want a generic solution to deploying our Phoenix Apps.
The text was updated successfully, but these errors were encountered: