amazon ec2 - Continuous deployment & AWS autoscaling using Ansible (+Docker ?) -


my organization's website django app running on front end webservers + few background processing servers in aws.

we're using ansible both :

  • system configuration (from bare os image)
  • frequent manually-triggered code deployments.

the same ansible playbook able provision either local vagrant dev vm, or production ec2 instance scratch.

we want implement autoscaling in ec2, , requires changes towards "treat servers cattle, not pets" philosophy.

the first prerequisite move statically managed ansible inventory dynamic, ec2 api-based one, done.

the next big question how deploy in new world throwaway instances come & down in middle of night. options can think of :

  1. bake new fully-deployed ami each deploy, create new launch config , update group that. sounds very, cumbersome, reliable because of clean slate approach, , ensure system changes code requires here. also, no additional steps needed on instance bootup, & running more quickly.
  2. use base ami doesn't change often, automatically latest app code git upon bootup, start webserver. once it's manual deploys needed, before. if new code depends on change in system config (new package, permissions, etc) ? looks have start taking care of dependencies between code versions , system/ami versions, whereas "just full ansible run" approach more integrated , more reliable. more potential headache in practice ?
  3. use docker ? have strong hunch can useful, i'm not sure yet how fit our picture. we're relatively self-contained django front-end app rabbitmq + memcache services, we're never going run on same host anyway. benefits there in building docker image using ansible contains system packages + latest code, rather having ansible directly on ec2 instance ?

how do ? insights / best practices ? !

this question opinion based. give take, go prebaking amis ansible , use cloudformation deploy stacks autoscaling, monitoring , pre-baked amis. advantage of if have of application stack pre-baked ami autoscaling up happen faster.

docker approach in opinion adds layer in application may not need if using ec2. docker can useful if want containerize in single server. maybe have capacity in server , docker allow run application on same server without interfering existing ones.

having said people find docker useful not in sort of way optimize resources in single server rather in sort of way allows pre-bake applications in containers. when deploy new version or new code have copy/replicate these docker containers across servers, stop old container versions , start new container versions.

my 2 cents.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -