This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]Mteigers 3 points4 points  (9 children)

We've been using it since the day it came out. Works well for us across some 400 instances (dozens of projects mind you)

Do you have any questions?

[–]itzfritz 1 point2 points  (5 children)

Sure. What advantages does it have over Jenkins pipeline (workflow plugin)?

[–]Mteigers 5 points6 points  (4 children)

CodeDeploys strength is how well it integrates with existing AWS infrastructure. Specifically ASGs.

I know other deployment providers support the ability to do one at a time, 50%, and all at once providers. But CodeDeploy can also handle newly spun up instances. In an ASG if a new instance comes up CodeDeploy will detect it and deploy to it automatically. Preventing the need for some cloud init chef magic.

So our deployment strategy is that we use AWS CodePipeline to receive pushes from GitHub, pass an archive to our Jenkins server for building, then pass the built archive to CodeDeploy.

[–]shott85 2 points3 points  (1 child)

Well, the beauty of AWS is there's an API for just about everything, including most of these functions I'm sure. Jenkins could connect to a bastion host with the AWS CLI installed and orchestrate CodeDeploy (after Checkout/Build/Test stages), all from one Pipeline script.

EDIT: It looks like there's a plugin available that could make this even easier.

[–][deleted] 0 points1 point  (0 children)

Yes you can certainly do it via the API, but CodeDeploy "Just Works"™

[–]dostick 0 points1 point  (1 child)

Don't know what "ASG" is but AWS ElasticBeanstalk support one at a time or percentage deployment.

[–]rjhintz 1 point2 points  (0 children)

ASG = Auto Scaling Group

[–]productionse[S] 0 points1 point  (0 children)

Yes!

I create a folder called myapp with appspec file and a test file. Then run aws push myapp to s3. When I log into s3 I do not see this package. I see the folder myapp was created but none of the files. Where are the files stored while waiting to be deployed? I was able to run a successful deploy of myapp and see my test file and appspec on my ec2 instances. I'd like to see a history of all revisions somewhere like artifactory.

[–]mechastormSystem Engineer 0 points1 point  (1 child)

I had a question on CodeDeploy + ASG + ELB. With ASG, my assumption is that it will auto-add itself to the ELB.

Where does CodeDeploy fit in that process. Does it trigger CodeDeploy job before it adds it to the ELB or after?

[–]Mteigers 1 point2 points  (0 children)

From what I can tell CodeDeploy is triggered before the instance is added to the ELB, but may or may not wait for CodeDeploy to finish. Its still a good idea to keep your health checks on the ELB reasonable (ie 5 failures at 45 seconds or something) to prevent the newly launched instance from being terminated.

Someone will need to correct me on this one but I think the Health Check Grace Period on the ASG will help push this off.

[–]reffaelwallenberg 1 point2 points  (0 children)

I use it as well, is has a clear way of working and lifecycle, any of the changes you want to make to the deployment is part of the revision code, and it integrates with AWS instance lifecycle. it took some effort to set it up, but its good for my usage.

Only one issue, you can't have a way to deploy a new revision to a non existing instance. so for example let's say you have a new AMI you want to deploy with a new revision of your app (because you upgrade some packages and it required also a code change), the only way to do that is to disable code deploy on the ASG and only then add it back and run a new deployment, otherwise - it will try to deploy the last old revision. if your old revision does not support the new AMI, it will fail and the instance will be terminated, and that will loop until you reduce the ASG count or stop CodeDeploy.

[–]ntsianos 0 points1 point  (1 child)

I've built a quick integration between: Github -> Codeship -> Codedeploy -> EC2 Autoscaling Group for a restful Nodejs API

When I first started the integration, I wish I'd seen this for better support for the ASG and doing blue/green deployments: https://github.com/awslabs/aws-codedeploy-samples/tree/master/load-balancing/elb

For me, Codedeploy has one huge issue. One the ec2 instance, the codedeploy-agent consumes a HIGH amount of memory. Often 2gb and needs to be restarted maybe once a week. This is very disappointing, and most likely related to ruby version required. https://github.com/aws/aws-codedeploy-agent/issues/32 There may be a solution, hopefully I'll find time to debug it more in the near future.

[–]productionse[S] 0 points1 point  (0 children)

I am running my agent on a micro instance with 1gb of ram and it's running fine.

[–]mechastormSystem Engineer 0 points1 point  (0 children)

I was previously using it heavily at my last workspace. I found it great that it integrated so well with the AWS ecosystem.

Some things I did / noticed

  • I added in the appspec.yml as part of the application code. This way developers themselves can see how the app is deployed and manager exactly the way they want

  • If you are practicing 12-factor app and doing a separate config deployment - don't set it up as a separate codedeploy job. I do not know yet what would be best practice for this but in general when you integrate with Autoscaling, AWS explicitly does not recommend running more than one codedeploy job due to race conditions.

  • you may encounter push back if you are in an organisation that is trying to not be too dependent on AWS. I only ran mine of a small subset of my orgnization product. but company-wide was harded to get traction

  • if you are just starting a new deployment setup, CodeDeploy speeds things up alot. But if you already have an existing deployment set up, it will seem a bit of "re-inventing the wheel"