Recently I wanted to switch our deployments from manual setups to something more suitable and automatable in terms of scaling, process management and so on.
Since we were already on EC2, Elastic Beanstalk was the first thing that came to mind:
From the docs:
AWS Elastic Beanstalk is an even easier way for you to quickly deploy and manage applications in the AWS cloud. You simply upload your application, and Elastic Beanstalk automatically handles the deployment details of capacity provisioning, load balancing, auto-scaling, and application health monitoring.
Seems like a good fit. Unless it isn’t.
So what’s the problem with Elastic Beanstalk?
Nothing f***ing works. Nothing f***ing works.
First of all, you need to understand one thing: I tried to get a basic rails app up and running. I did absolutely nothing by hand – I only used amazon’s built-in steps. This means I exclusively used amzon’s webinterface. No manual fumbling on the instances itself.
Now, even with this basic setup I had problems all of the time. Below a list errors that randomly popped up and in the same manner disappeared again from deployment to deployment:
All of a sudden my ruby setup seems borked big time:
2013-04-26 08:18:48,080 [INFO] (29466 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: /usr/bin/rake:9:in `require’: no such file to load — rubygems (LoadError)
Rake task failed to run, skipping database migrations
Events / logs are not reliable:
Trying to get the logs after a failed deployment gives me:
Failed to pull logs for environment instances. Reason: Some instances have not responded to commands. Responses were not received from [i-52f6fc18].
In the “Events” Tab I see:
Failed to deploy application
However there is NO error in the logs and despite what the “Events” say, deployment apparently was successful
All of a sudden my rails setup is borked:
From the logs (after more than a dozen deployments):
2013-04-19 10:25:38,717 [INFO] (1831 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with –trace)
Rake task failed to run, skipping asset compilation.
Apart from this seemingly random bugs which come and go as they please, I am pretty sure that almost no one is using EB for ruby / rails. You can google for any problem you have and you find nothing. It seems like amazon just added this specific layer because it is hip.
All in all, using Elastic Beanstalk was a horrible experience and I can’t recommend it to anybody. Funny enough I tried out amazon opswork after Elastic Beanstalk and so far, this has been nothing short of fantastic.
Long story short: If you want to use amazon deployments mechanisms, use opswork, not Elastic Beanstalk.