AWS CodeDeploy
aws.amazon.com
aws.amazon.com
I can imagine how, for a new user, it's utterly baffling which of these options is the best for the longterm, with the least friction. I use OpsWorks quite a bit but have found it very challenging, and the feedback cycle when attempting to develop new cookbooks is excruciatingly slow.
All I want, personally, is a system that uses a set of interchangeable scripts that represent dependencies, so my server configs can live in version control. It doesn't even need to run on multiple OSs (which seems to be a central tenet of Chef). It just needs to deploy/rollback with zero downtime, and ideally autoscale as quickly as possible. Is this it? Is there any way to know without spending weeks fleshing out how it works?
If they handled things like EBS integration, orchestration, ELB integration, and all of the usual stuff, I'd be sold in a second.
Frankly, I don't understand why people are so happy to lock themselves tighter into AWS.
Your cookbook is located /opt/aws/opsworks/current/site-cookbooks. If you run a command from the web console, you can repeat the command with a tailed log output using "opsworks-agent-cli run_command".
Yes. As a frequent Chef user, I was really excited about OpsWorks, but it feels quite beta, and as you said the build/test cycle is even worse than usual for config management.
Have you had any success developing your Chef scripts on Vagrant and then using them on OpsWorks? It seems like the real thing is just too different. The open source OpsWorks cookbooks don't match what's actually running, you've got a VPC environment around you, there are extra tweaks to the AMIs, etc.
For new projects I think CloudFormation + regular Chef is a better way to go.
I was far enough along in development by the time I started messing with Vagrant that I never finished it. I started debugging using the opsworks-agent-cli as mentioned in zackangelo's comment. I'd just been `git push`ing changes, updating cookbooks and testing again - his method of editing cookbooks [2] directly actually sounds rather workable. I imagine in the future I will mostly edit and test cookbooks this way.
1. https://github.com/wwestenbrink/vagrant-opsworks 2. https://news.ycombinator.com/item?id=8598255
instead of using rolling updates, it's a blue-green deploy -- essentially what netflix does. it also automates ami building, triggered by a jenkins plugin after a successful test run.
Blue/Green, while harder to use without tooling like CloudNative adds, has numerous benefits including near instant rollback to a previously known good state.
Netflix figured this out 5 years ago.
The CodeDeploy service seems to operate by you manually launching base ec2 instance with a code deploy agent and then this agent will checkout your git code on the live instance, run any provisioning steps and then if things break somehow rollback all that work, still on the live instance.
I'm sure this is still a big improvement to companies who are manually sshing into servers and running deployments by hand, but as someone who pre-bakes ami's and does rolling upgrades with autoscaling groups this service seems like a step backwards.
At my org, we currently use a very similar method of deployment that AWS CodeDeploy seems to provide, except that we wrote it in house and use some python fabric scripts to do it. It sounds like AWS CodeDeploy would help us to "AWSify" this method of deployment and also have some nice benefits of health checks/rollbacks, UI based management, and a deployment history log. However, we would essentially still be maintaining/writing bash/python scripts to do the heavy lifting.
However, we are in the process of moving to a method of deployment which uses SaltStack to prebake an AMI with everything that is required to run in production and then use Netflix's Asgard to manage the deployment of the prebuilt AMIs. We are very excited about this method of managing deployments to take advantage of AutoScaling groups and using a well defined/tested stack of tools.
Interested to hear thoughts from others using a deployment approach that they think would benefit from AWS CodeDeploy.
It's fair to say if you're already doing things in the way you describe, this service isn't for you.
While Immutable Infrastructure is also in our opinion (and I've written about this extensively) the way to go in the future updating systems in place is still the primary way to deploy systems and will be for a while. By providing a centralized systems to upload new released and manage the deployment (how many instances get the new deployment in which timeframe) you can take away some of the security problems of opening up ports for access and potential deployment errors where the SSH connection dies.
Especially when deploying into a large infrastructure connecting into each instance for update becomes painful. That's where an agent based services like CodeDeploy is really powerful and removes the single point of failure that is the machine/network that you deploy from.
With ElasticBeanstalk, Opsworks and Cloudformation they now really start to surround all the deployment workflows.
Definitely a great service that will in my opinion become very important to many many teams. You can also read more about our specific integration in our blog: http://blog.codeship.com/aws-codedeploy-codeship/
We use librato for monitoring our build server infrastructure and mostly only look at max/min values for metrics that could mean trouble. Generally we're able to separate data of different instances by their instance id so we could look into them individually.
We use NewRelic for our Rails application on Heroku and pump Heroku data into Librato as well (we love data and metrics)
And of course you can always send me an email to flo@codeship.com with questions.
In the failure case however, even with a fleet of only 20 instances, a rolling update that has issues after the 10th instance puts you in a world of pain.
Deploy and rollback doesn't happen on live instances. (Group of) Instances are taken off service for rolling deployment and you can configure what percentage of your fleet should be deployed to at once.
There's some discussion in that post of how it compares to pre-baking, etc. Of course there are trade-offs either way. CodeDeploy does require that your are careful with your lifecycle scripts to make deployments as atomic as possible. At least they provide a good selection of default lifecycle events for you to take advantage of.
Discussion on Deis from yesterday: https://news.ycombinator.com/item?id=8591209
1. https://mesosphere.github.io/marathon/ 2. https://mesos.apache.org/
Right now "nobody ever got fired for" setting up deployment via rsync and some ad-hoc shell scripts. That works for a single host, although it's not great for reproducibility. But as soon as you go to multiple hosts you need some degree of orchestration, monitoring, and integration with your load balancer to avoid downtime.
CodeDeploy offers those benefits, so if it turns out to be even slightly good, it could become the "nobody ever got fired for" choice, for any non-trivial app running on AWS.
This seems like a tiny step forward for orgs who are deploying code to boxes that they never take down, but for the orgs that have been doing it the AWS-prescribed (immutable) way, I'm having trouble seeing how this is useful at all.
tiny step forward for orgs who are deploying code to boxes that they never take down
That's exactly why this is a clever move - it's a better way to do what you already know how to do. This should get more teams using responsible deployment practices. If you have to first learn a whole new mindset about infrastructure, most people just won't bother, and will keep on rsyncing.
Beanstalk worker tiers are a nightmare. You need to place all your workers in separate repos, for example for git aws.push style workflow to work.
CodeDeploy is not available in EU (Ireland). Please select another region.
Supported Regions
US East (N. Virginia) US West (Oregon)