6

We have several EC2 instances behind a load balancer. Each server has several ASP.NET applications deployed to it. I'm looking for an easy, realtime, automated way to deploy new compiled code to all instances simultaneously.

I've seen solutions using source control repositories like SVN or Git, but this doesn't seem like an appropriate use of the technology for us since we're deploying compiled code to the EC2 instances - not source code.

I've also set up Dropbox to accomplish the sync. It somewhat works, but has its quirks. For instance, you need to build your directory structure around the "one root sync folder" limitation. Any other reason why we definitely should NOT use dropbox for this?

Writing a custom application using the S3 API is an option, but we'd prefer a third party solution over writing more code.

This seems like a common scenario, but I haven't found any good solutions yet.

Cœur
  • 32,421
  • 21
  • 173
  • 232
jaminto
  • 3,645
  • 3
  • 28
  • 35

6 Answers6

4

Elastic Beanstalk seems to be the best route to go now. You simply push your web deploy project to an elastic beanstalk environment and it deploys code to all of your instances. (It manages auto scaling for you.) It also makes sure that new instances launched will have you latest code and it keeps previous versions which you can easily roll back to.

If your asp.net website needs to be auto scaled on AWS, Elastic Beanstalk is really the best end-to-end solution.

jaminto
  • 3,645
  • 3
  • 28
  • 35
  • What if you prefer to work on plain EC2 servers? Setting up Auto-scaling on EC2 servers is not incredibly hard to do. – digitaldavenyc Mar 18 '15 at 19:47
  • @digitaldavenyc, it's easy to do, but so is elastic beanstalk. autoscaling is a subset of the features you get for free with elastic beanstalk. you also get notifications from autoscaling events, as well as the code deployment part. – jaminto Mar 30 '15 at 20:17
  • AWS Code Deploy http://aws.amazon.com/codedeploy/ is just the deployment part of beanstalk. The question is what are you trying to do? if its run a web application, i don't know why you wouldn't use beanstalk. if it's run a command line application, then yes, beanstalk might not do it for you, but worker tiers on beanstalk may help http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html – jaminto Mar 30 '15 at 20:19
  • I wouldn't work with beanstalk because of the need to eventually get into the system administration level on the server for various reasons. This needs to happen far too often. Doing this on EB isn't really possible because the applications are rebuilt on new deploys to EB removing your sys admin changes. – digitaldavenyc Apr 02 '15 at 21:06
  • @digitaldavenyc not really sure what you're talking about specifically. you can use custom AMIs in EB. and if you're on linux, instead of using custom AMIs, you should probably be using docker with EB: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.html....if you're saying that you're modifying your code after every deployment, then you'd just need a better deployment strategy in general. and in the end, they're just servers and you can ssh or rdp to them at any time. – jaminto Apr 28 '15 at 19:13
1

Since these are ASP.Net applications and IIS, why not use Web deploy. It's MADE for this.

http://www.iis.net/download/webdeploy

Web Deploy allows you to efficiently synchronize sites, applications or servers across your IIS 7.0 server farm by detecting differences between the source and destination content and transferring only those changes which need synchronization. The tool simplifies the synchronization process by automatically determining the configuration, content and certificates to be synchronized for a specific site. In addition to the default behavior, you still have the option to specify additional providers for the synchronization, including databases, COM objects, GAC assemblies and registry settings.

Chris Kooken
  • 29,979
  • 14
  • 79
  • 113
  • 3
    The issue here is that web deploy needs to know the IPs of your servers to be able to deploy to them. With autoscaled instances, this isn't so easy - you don't know the public IPs of the instances that were launched automatically. looks like you need to get this info somehow using the AWS API – jaminto Apr 13 '12 at 13:51
1

You can use Git, Mercurial or SVN to push compiled code to the servers, or to have the servers fetch code. Source control is not only for source code - it can be used for files of any type.

Also, one way around the Dropbox issue is to use multiple DropBox accounts if that's the issue. But Dropbox is a pretty easy solution because then you never need to write any code. As long as Dropbox is up, it will work.

Daniel Williams
  • 8,003
  • 12
  • 59
  • 98
1

You might want to give AppHarbor a try. We take care of managing ASP.NET application servers, loadbalancers and all the other required infrastructure, leaving you to get on with developing your application. We also provide a convenient way for you to push new versions of your app using your choice of Git, Mercurial, Subversion and TFS.

friism
  • 18,110
  • 5
  • 72
  • 114
0

Git or mercurial will do a good job at that, subversion is bad at handling blobs.

And you get very nice control and assurance, that the code got deployed everywhere by looking at the revisions.

sleeplessnerd
  • 18,543
  • 1
  • 22
  • 29
0

Seems obvious but, shared filesystem? Or push out with scp or rsync?

Michael Closson
  • 863
  • 9
  • 13