Live data from Hacker News

Migrating from Heroku to AWS using Docker

blog.doordash.com

31–40 of 58 posts

Re: Migrating from Heroku to AWS using Docker

#31

> it’s not possible to SSH into a server to debug a CPU or memory issue. Not true. You can do all sorts of SSH-like things with 'heroku run bash'. Of course, your changes will be wiped when you end the session, but you can inspect things.

Yes, but you won't see production traffic there since it's a isolated instance. Great for doing one-off tasks with your app, but doesn't help debug performance issues.

Re: Migrating from Heroku to AWS using Docker

#32

Out of curiosity, did you consider Dokku, which approximately reimplements the Heroku API on top of Docker?

Good question - I did take a brief look but it wasn't really solving the main problem we had at the time, which was how to manage a cluster of servers. I feel like emulating the Heroku features is pretty easy to do yourself anyway (and kind of a fun exercise)

Re: Migrating from Heroku to AWS using Docker

#33
post #21

Earlier quoted context omitted.

It's worth noting that Elastic Beanstalk just released support for multiple docker containers per instance. This takes EBS from being a novelty to being production-grade Docker orchestration. Previously, it ran a single docker container per instance which - while good for stage/prod parity and easy rollbacks - doesn't really take advantage of the core Docker advantages over a VM. Now, you can orchestrate multiple con…

> (Note - here EBS = elastic beanstalk, not elastic block storage) I, really, really don't recommend using EBS as an abbreviation for Elastic Beanstalk, since Amazon uses the actual abbreviation canonically to refer to Elastic Block Storage. At worst, just call it Beanstalk, when the AWS context is clear.

The AWS abbreviation for Elastic Beanstalk is EB.

Re: Migrating from Heroku to AWS using Docker

#34
I'm in a situation like this as well, using Heroku but not happy with the performance on the Dynos and looking to move to EC2 (we already use our own databases etc hosted on EC2).

The biggest issue is finding a solution which can give similar ease of use and functionality as Heroku. Doing a opsworks/chef setup like this isn't appealing - over time we want to have many microservices which can be scaled independently, and you don't want to be doing a lot of setup for each one. It's also complex to setup the kinds of scaling and rollbacks with git deploys like you can get on Heroku.

Right now Deis or Flynn looks best, giving most of the advantages of Heroku, but they are also pretty immature. Deis only just got the ability to send logs to a syslog instance, and can't be upgraded without either building a new cluster and migrating across (lots of work), or doing a in-place upgrade, which could mean up to 10 mins of downtime.

Flynn has no ability to send logs to an syslog server from what I can see, and seems even more immature than Deis, but looks like it might have a better technical foundation.

I've also been evaluating Amazon's Elastic Container Service, but that is unfortunately also very immature - No load balancing integration yet and also no information on logging, rollbacks, etc.

Elastic beanstalk is also interesting in a way, but we already have one app deployed on it using Docker and it's not great - logging is a kludge using a logger running in each container, and you either use your own docker repository (in which case you can't do rollbacks), or give them a zipfile with a Dockerfile and your app, which allows rollbacks but means the docker image gets built by every server in the cluster. It also doesn't seem to have any way of easily running and scaling multiple processes per app like you can with the Procfile on Heroku.

Anybody else in a similar situation? It seems that there are a bunch of interesting projects that will be very competitive with Heroku soon, but nothing that's really matured yet.

I wish Heroku would just introduce a new range of PX (running on their own EC2 instance) Dynos without the crazy pricing - right now the only PX dyno they have is $500 per month when you can get a substantially faster instance on EC2 for ~170 per month.

Re: Migrating from Heroku to AWS using Docker

#35
post #5

Would you mind sharing more details about the Docker setup on AWS? "Our code deployment flow was straightforward, and mostly consisted of building a Docker image off our latest codebase and distributing it to our server instances, with the help of a Docker image server. We only needed to write a few short Chef scripts to download the latest Docker image build and start up a new Docker container." I was wondering what…

Store your Dockerfile in version control, either in its own repo with other Docker files or in the same repo as the app. Use Jenkins (or preferred build system) to fetch the Dockerfile, your app, build the Docker container, and then docker push to your own private docker registry. Bake your AMIs with your Docker image (tags are your friend). You don't want to have to scale and find out you're having problems fetching…

Yup, pretty much.

We actually were using Docker Hub but they went down a few times so we are going to try setting up a private registry. We also tried Docker Hub's "Automated Build" service but it doesn't do any layer caching between builds so we found it way too slow.

One thing I'd recommend is at least installing the Docker service itself on the AMI (spinning up EC2 instances, especially on Opsworks, is slow enough as is)

Re: Migrating from Heroku to AWS using Docker

#36
Suggesting that moving to Docker obviates the need for configuration management is frankly naive.

The whole point of CM tools is to make the layout/configuration of systems predictable. That doesn't make Docker or CM redundant. It means that when you build Docker containers, it makes good sense to install a CM tool and use it to do the systems configuration.

Saying that the Dockerfile works like BASH and thus makes life easier is a huge step backwards. Ultimately, administrators have to enter, troubleshoot and debug containers. Moving back to shell script-style configuration inside of containers just kicks the problem down the road.

Docker, and containers in general, are great. And you should treat their contents with the same respect that you do any system.

Re: Migrating from Heroku to AWS using Docker

#38
post #36

Suggesting that moving to Docker obviates the need for configuration management is frankly naive. The whole point of CM tools is to make the layout/configuration of systems predictable. That doesn't make Docker or CM redundant. It means that when you build Docker containers, it makes good sense to install a CM tool and use it to do the systems configuration. Saying that the Dockerfile works like BASH and thus makes l…

Appreciate the comment. The point I was hoping to get across wasn't that Docker would completely replace CM (or that CM is a bad thing), but that it could help reduce the amount of work in the CM world. As mentioned, we still needed to use Chef anyway (and using Opsworks to get a head start), so at least in this kind of environment CM is still necessary. That said I can see how the article could be slightly misleading =)

Re: Migrating from Heroku to AWS using Docker

#39
Since you folks serve real users in the real world (as opposed to being a much higher QPS product like a consumer oriented game or analytics or data service), I can't imagine your needs are extremely high in terms of QPS. Why not optimize other front-end experience, like serving one CSS/js file instead of many, serving assets from CDNs, etc? Cheers on moving to AWS and using Docker, though!
Post reply on HN