Our team has been very interested in continuous deployment recently, but we've run into a little bit of a roadblock in regards to how to actually get code deployed on Heroku - it seems inevitable that there needs to be some amount of downtime to do a code push to Heroku.
In a traditional environment, code deployment would probably look something like this:
With Heroku, I have very little control over two critical steps:
We do use the maintenance screen currently, but it's not going to be a scalable solution if we move to full continous deployment (we'd probably have about 10-20 deployments a day, and 10-20 * 30 seconds of maintenance screen starts to add up)
Has anyone run into similar issues? How did you address them? Any great case studies / success stories for true continuous deployment on heroku?
Heroku Flow is designed to streamline the app release experience by making continuous delivery easy, visual, and efficient.
Heroku CI automatically runs your app's test suite with every push to your app's GitHub repository, enabling you to easily review test results before merging or deploying changes to your codebase.
What is Heroku? Heroku is a container-based cloud Platform as a Service (PaaS). Developers use Heroku to deploy, manage, and scale modern apps. Our platform is elegant, flexible, and easy to use, offering developers the simplest path to getting their apps to market.
Heroku Pipelines Each app in a pipeline represents one of these steps in a continuous delivery workflow: Review, development, staging, and production.
Regarding the dynos spin-up time, Heroku has a beta feature to address just that:
https://devcenter.heroku.com/articles/labs-preboot/
It basically boots your new dynos first, waits a while, switched traffic and only then kills the old ones. My app saw a marked improvement in performance during deploys. You can read it here:
http://ylan.segal-family.com/blog/2012/08/27/deploy-to-heroku-with-near-zero-downtime/
On Heroku we'll issue a SIGTERM to your dyno(s) at restart. After a short while if the process(es) don't stop they will be killed. This should allow you enough grace time for a seamless restart when you're not running migrations.
You can always push code to a staging app that's pointed at your production DB and run migrations from there. Pedro wrote a nice blog post on running zero downtime migrations that should help too: http://pedro.herokuapp.com/past/2011/7/13/rails_migrations_with_no_downtime/
Hope this helps some.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With