Habitat & Amazon's ECS

415 views

Published on

AWS Sydney North User Group, October 25, 2016. http://www.meetup.com/Amazon-Web-Services-Sydney-North-User-Group/events/234184228/

This session provided an introduction and live demo of Habitat. The process of moving applications from build to Docker and then published to ECR and running on ECS were demonstrated.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Habitat & Amazon's ECS

  1. 1. AWS - Sydney North Shore October 25, 2016
  2. 2. Brent’s Desk database cluster
  3. 3. Infrastructure First Development
  4. 4. Cloud Native is code for “Rewrite the world”
  5. 5. What if you could defer infrastructure decisions until runtime?
  6. 6. Habitat Application automation that enables modern application teams to build, deploy, and run any application in any environment - from traditional data-centers to containerized microservices.
  7. 7. Build Service Plan Artifact Depot Build Service A Build Service with a workflow to describe the software and behavior for Habitat applications Explicit about dependencies Includes what is configurable about the application Packages are developed and built in an isolated build environment (hab studio) Built Artifacts are post-processed in one step to multiple formats including Docker Images Source Code Repo Habitat Technology
  8. 8. Post-process packaging
  9. 9. Automation travels with the app
  10. 10. Choreography
  11. 11. Topology aware
  12. 12. Security Code Quality Container Hosting Peer Discovery Config Changes Supervision Monitoring Rolling Deployment Networking Internal Registry Workload Placement Production The Container Learning Cliff Development
  13. 13. Habitat Technology Plan Artifact Depot Build Service Supervisor Supervisor Supervisor Supervisor Ring Bare Metal Containers AMI VM Depot Build Service & Workflow Package Format Artifact Distribution Server Artifact Distribution Server Intelligent Run-Time Supervisor w/REST API Source Code Repo
  14. 14. Applications run as distributed, fully automated, and capable autonomous actors Immutable applications, but flexible and easy to manage because automation travels with the application Bundles what your apps need to run and nothing else (new and legacy) Embedded automation choreographs application cluster topology/behavior A network with no reliance on external services and no single-point-of-failure Provides continuous deployment without traditional Application Release Automation (ARA) tooling Habitat’s approach
  15. 15. Infrastructure Automation Application Automation Compliance Automation Workflow Visibility Compliance
  16. 16. • Chef • Docker, Docker Swarm • Mesos, DC/OS • Kubernetes, Tectonic & OpenShift • Nomad • Rancher • GKE • ECS Habitat is complementary to
  17. 17. $ aws ecr get-login returns the command used by $ docker login… $ docker images $ aws ecr create-repository –repository-name mattray/redis AWS ECR setup
  18. 18. $ docker tag mattray/redis:latest aws_account_id.dkr.ecr.ap- southeast-2.amazonaws.com/mattray/redis:latest $ docker push aws_account_id.dkr.ecr.ap-southeast- 2.amazonaws.com/mattray/redis:latest $ docker pull aws_account_id.dkr.ecr.ap-southeast- 2.amazonaws.com/mattray/redis:latest Deleting… $ docker rmi mattray/redis:latest $ aws ecr batch-delete-image --repository-name mattray/redis -- image-ids imageTag=latest AWS ECR publishing
  19. 19. $ curl -o ~/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs- cli/ecs-cli-darwin-amd64-latest $ chmod +x ~/bin/ecs-cli $ ecs-cli configure --cluster habitat-demo stands up the cluster $ ecs-cli up --keypair mattray-apac --capability-iam --size 2 -- instance-type t2.medium --security-group habitat-demo provisions hosts for containers with SSH, 8080 and Habitat ports open AWS ECS setup
  20. 20. $ aws ecs list-clusters $ ecs-cli down –force take down the Cloudformation cluster $ ecs-cli compose --file redis.yml service rm remove the deployed service $ ssh -i ~/.ssh/mattray-apac ec2-user@12.34.56.78 connect to the running ECS host $ docker logs e1e7834c6ab2 AWS ECS cluster management
  21. 21. AWS ECS deploying tasks $ ecs-cli compose --file redis.yml -p habdemo up version: '2’ services: redis: image: aws_account_id.dkr.ecr.ap-southeast-2.amazonaws.com/mattray/redis:latest cpu_shares: 100 mem_limit: 524288000 environment: HAB_REDIS: 'tcp-backlog=128'
  22. 22. Try Habitat for yourself • https://www.habitat.sh/try • https://github.com/habitat-sh/ • Tutorials • Getting started guide • Extensive documentation • Support for Chef customers
  23. 23. Links from the Presentation • Redis plan – https://github.com/habitat-sh/core-plans • National Parks demo – https://github.com/billmeyer/national-parks-plan – https://github.com/billmeyer/national-parks
  24. 24. 27

×