AWS - Sydney North Shore
October 25, 2016
Brent’s Desk
database cluster
Infrastructure First Development
Cloud Native is code for
“Rewrite the world”
What if you could
defer infrastructure
decisions until
runtime?
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.
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
Post-process packaging
Automation travels with the app
Choreography
Topology aware
Security
Code Quality
Container Hosting
Peer Discovery
Config Changes
Supervision
Monitoring
Rolling Deployment
Networking
Internal Registry
Workload Placement
Production
The Container Learning Cliff Development
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
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
Infrastructure Automation Application Automation Compliance Automation
Workflow
Visibility
Compliance
• Chef
• Docker, Docker Swarm
• Mesos, DC/OS
• Kubernetes, Tectonic & OpenShift
• Nomad
• Rancher
• GKE
• ECS
Habitat is complementary to
$ aws ecr get-login
returns the command used by
$ docker login…
$ docker images
$ aws ecr create-repository –repository-name mattray/redis
AWS ECR setup
$ 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
$ 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
$ 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
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'
Try Habitat for yourself
• https://www.habitat.sh/try
• https://github.com/habitat-sh/
• Tutorials
• Getting started guide
• Extensive documentation
• Support for Chef customers
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
27

Habitat & Amazon's ECS

  • 1.
    AWS - SydneyNorth Shore October 25, 2016
  • 4.
  • 5.
  • 6.
    Cloud Native iscode for “Rewrite the world”
  • 7.
    What if youcould defer infrastructure decisions until runtime?
  • 8.
    Habitat Application automation thatenables modern application teams to build, deploy, and run any application in any environment - from traditional data-centers to containerized microservices.
  • 9.
    Build Service Plan ArtifactDepot 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
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
    Security Code Quality Container Hosting PeerDiscovery Config Changes Supervision Monitoring Rolling Deployment Networking Internal Registry Workload Placement Production The Container Learning Cliff Development
  • 15.
    Habitat Technology Plan ArtifactDepot 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
  • 16.
    Applications run asdistributed, 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
  • 18.
    Infrastructure Automation ApplicationAutomation Compliance Automation Workflow Visibility Compliance
  • 19.
    • Chef • Docker,Docker Swarm • Mesos, DC/OS • Kubernetes, Tectonic & OpenShift • Nomad • Rancher • GKE • ECS Habitat is complementary to
  • 20.
    $ aws ecrget-login returns the command used by $ docker login… $ docker images $ aws ecr create-repository –repository-name mattray/redis AWS ECR setup
  • 21.
    $ docker tagmattray/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
  • 22.
    $ 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
  • 23.
    $ aws ecslist-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
  • 24.
    AWS ECS deployingtasks $ 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'
  • 25.
    Try Habitat foryourself • https://www.habitat.sh/try • https://github.com/habitat-sh/ • Tutorials • Getting started guide • Extensive documentation • Support for Chef customers
  • 26.
    Links from thePresentation • 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
  • 27.