automating applications with habitat - sydney cloud native meetup

56
Application Automation with Habitat Sydney Cloud Native Meetup August 22, 2017

Upload: matt-ray

Post on 22-Jan-2018

168 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Automating Applications with Habitat - Sydney Cloud Native Meetup

Application Automation with HabitatSydney Cloud Native Meetup

August 22, 2017

Page 2: Automating Applications with Habitat - Sydney Cloud Native Meetup

Matt RayManager, Solutions Architect – APJChef [email protected]@mattray

Page 3: Automating Applications with Habitat - Sydney Cloud Native Meetup

Consumption Models have Changed

● Standard “IT Shared Services” approach no longer viable

● Dev teams have spoken; they want agility and self-service

● Various dev teams assemble their own toolchains to move quickly

● Thrashing on toolchains prevents cross-organizational success

● Traditional centralized decision making isn’t going to work

Page 4: Automating Applications with Habitat - Sydney Cloud Native Meetup

Problems with Shared Services

● Slow

● Inflexible

● Enforce “control” vs enabling “access”

● Creates a barrier that slows down time to market

Page 5: Automating Applications with Habitat - Sydney Cloud Native Meetup

Consumption Models

Old Create a helpdesk ticket Send an email Submit a Change Request

New API-driven interaction SDK for developers to build on top of APIs CLI tools for ease of use Slack (searchable real-time communication)

Page 6: Automating Applications with Habitat - Sydney Cloud Native Meetup

LOBLOB

FOCUS ON SPEED

Tension caused by the demands placed on teams…

…can be resolved by vertical integration and automation…

…to deliver a future of developer services and software at speed

SHARED SERVICES

Vertical Integration is key to velocityA balance of increasing speed, improved efficiency and decreasing risk

FOCUS ON RISK

SHARED SERVICES

LOBLine of

Business

LOBLine of

BusinessLOB

SHARED SERVICES

LOB

DEVELOPER SERVICESBUILD • DEPLOY • MANAGE • COLLABORATE

Page 7: Automating Applications with Habitat - Sydney Cloud Native Meetup

”Business Value with Developer ServicesShifting capabilities to match business requirements

Developer Services EngineerLine of Business Development TeamI provide services that developers and development teams use to build and deliver applications.

Developer Services TeamsTraditional Central IT

System AdministratorCentralized Enterprise IT TeamI manage and deliver infrastructure required to run software in my organization.

Enabling development teams to get insights into speed, efficiency and risk of delivery of their software

Reducing risk to my organization from my infrastructure and software that runs on it

Enabling development teams to ship software at speed while maintaining quality and reducing risk

Reliably managing changes to infrastructure requirements

Providing on-demand, self-service infrastructure and services tailored to developer needs

Managing and lowering costs of running, configuring, and maintaining infrastructure

DEPLOY

MANAGE

Don’t measure me on traditional IT metrics, but on the metrics of the businessJim Fowler, CIO, GE Capital

BUILD

Reducing friction by enabling full stack transparency and management capability with separation of duties

Delivering configured infrastructure and handing off responsibility to development teams COLLABORATE

Page 8: Automating Applications with Habitat - Sydney Cloud Native Meetup

Modern Architecture Trends

Page 9: Automating Applications with Habitat - Sydney Cloud Native Meetup

Modern Architecture Principles

12 Factor Apps/Cloud NativeMicroservicesServerlessContainers

Page 10: Automating Applications with Habitat - Sydney Cloud Native Meetup

12 Factor/Cloud Native

https://12factor.net/

“The twelve-factor app is a methodology for building software-as-a-service apps that:● Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;● Have a clean contract with the underlying operating system, offering maximum portability between execution environments;● Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration;● Minimize divergence between development and production, enabling continuous deployment for maximum agility;● And can scale up without significant changes to tooling, architecture, or development practices.”

Page 11: Automating Applications with Habitat - Sydney Cloud Native Meetup

Microservices

“…the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms…”

- Martin Fowler and James Harris

https://martinfowler.com/articles/microservices.html

Page 12: Automating Applications with Habitat - Sydney Cloud Native Meetup

Microservices Characteristics

● Componentization via Services● Organized around Business Capabilities● Products not Projects● Smart endpoints and dumb pipes● Decentralized Governance● Decentralized Data Management● Infrastructure Automation● Design for failure● Evolutionary Design

Page 13: Automating Applications with Habitat - Sydney Cloud Native Meetup

Serverless

“Serverless architecture replaces long-running virtual machines with ephemeral compute power that comes into existence on request and disappears immediately after use.”

- Thoughtworks Tech Radar, March 2017

Page 14: Automating Applications with Habitat - Sydney Cloud Native Meetup

Containers

Package the application and dependencies in a deployable formatReduce/remove dependency on underlying OS/InfraSmall Area of ConcernSingle process

Page 15: Automating Applications with Habitat - Sydney Cloud Native Meetup

Common themes

Reduced Area of ConcernService IndependenceInfrastructure IndependenceDecentralized Management

Page 16: Automating Applications with Habitat - Sydney Cloud Native Meetup

Monolith ServerlessMicroservicesA

pp

licat

ion

Ap

plic

atio

nS

erv

ice

s

Centralized Highly Distributed

Page 17: Automating Applications with Habitat - Sydney Cloud Native Meetup

Monolith ServerlessMicroservicesA

pp

licat

ion

Ap

plic

atio

nS

erv

ice

s

Few Large Artifacts Thousands of Small Artifacts

Page 18: Automating Applications with Habitat - Sydney Cloud Native Meetup

Complexity Cliff

Scale Increases - Number of services under management increases

Efficiency Declines - Number of ways to manage each service is different

Risk Exposure Increases -Confidence that each service is secure, compliant, updated, etc.

Page 19: Automating Applications with Habitat - Sydney Cloud Native Meetup

Developer Services

“The services required for application developers to effectively run applications. This consists of the underlying infrastructure, compute runtimes, language runtimes, and application services to persist and retrieve data. These services should be available via a common API, with a focus on making the service easy to consume.”

- Me

Page 20: Automating Applications with Habitat - Sydney Cloud Native Meetup

Application Services

What Developers Need

Application Runtimes

Page 21: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat is automation for Application Runtimes & Application Services to deliver Cloud Native Developer Services

Page 22: Automating Applications with Habitat - Sydney Cloud Native Meetup

Building Developer Services With Habitat

Page 23: Automating Applications with Habitat - Sydney Cloud Native Meetup

Lifecycle of any software

Build Deploy Run

Page 24: Automating Applications with Habitat - Sydney Cloud Native Meetup

Build Lifecycle

Page 25: Automating Applications with Habitat - Sydney Cloud Native Meetup

The dreaded build cycle

wget https://some.place/package.tar.gz

tar xfzv package.tar.gz

cd package

./configure

make

make install

Page 26: Automating Applications with Habitat - Sydney Cloud Native Meetup

The dreaded build cycle

Page 27: Automating Applications with Habitat - Sydney Cloud Native Meetup

The dreaded build cycle

Page 28: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat Defines the Build Lifecycle

● Default implementation is C/C++ Build Lifecycle

● Other default implementations provided by Scaffolding

○ core/scaffolding-ruby

○ core/scaffolding-node

○ core/scaffolding-go

● Build dependencies explicitly declared

● Runtime dependencies explicitly declared.

Page 29: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat Artifacts

● Dependencies declared

○ Libraries

○ External Services

● Services/Port-bindings Exported

● Signed

Page 30: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat Build Cycle

USER ARTIFACTPLAN DEPOT

Page 31: Automating Applications with Habitat - Sydney Cloud Native Meetup

DEMO

Page 32: Automating Applications with Habitat - Sydney Cloud Native Meetup

Deploy Lifecycle

Page 33: Automating Applications with Habitat - Sydney Cloud Native Meetup

Deploying Artifacts

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

DEPOT ARTIFACT

BARE METAL

CONTAINERS

AMI

VM

Page 34: Automating Applications with Habitat - Sydney Cloud Native Meetup

Libraries

Operating System

Application

Traditionallythe domain of the OS Vendor

Application Libraries

Config Changes

Bot

tom

to T

op D

epen

denc

y R

esol

utio

n

Page 35: Automating Applications with Habitat - Sydney Cloud Native Meetup

Application &Libraries

Minimized OS

Top

to B

otto

m D

epen

denc

y R

esol

utio

n

Page 36: Automating Applications with Habitat - Sydney Cloud Native Meetup
Page 37: Automating Applications with Habitat - Sydney Cloud Native Meetup

Export Deployable Artifacts

● Docker

● ACI

● Mesos

● TAR

Page 38: Automating Applications with Habitat - Sydney Cloud Native Meetup

Run Lifecycle

Page 39: Automating Applications with Habitat - Sydney Cloud Native Meetup

What do applications need to run?

Page 40: Automating Applications with Habitat - Sydney Cloud Native Meetup

What do applications need to run?

• Process Supervisor• Lifecycle events

• Start, Stop, Reconfigure, etc

• Environment specific configuration• Knowledge of peers• Knowledge of dependent services

Page 41: Automating Applications with Habitat - Sydney Cloud Native Meetup

The Habitat Supervisor

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

SERVICE

SUPERVISOR

Page 42: Automating Applications with Habitat - Sydney Cloud Native Meetup

Lifecycle Hooks

• init• run• health_check• file_updated• reload• reconfigure• post-run• suitability

Page 43: Automating Applications with Habitat - Sydney Cloud Native Meetup

Peers

Service Groups

Gossip

Availability increases with

scale

Supervisors Form a Ring

Page 44: Automating Applications with Habitat - Sydney Cloud Native Meetup

Configuration

• Config files stored in ./config• Default values provided by

• Scaffolding

• default.toml

• Override defaults through• ENV variable

• user.toml

• Over the network

Page 45: Automating Applications with Habitat - Sydney Cloud Native Meetup

What do applications need to run?

Page 46: Automating Applications with Habitat - Sydney Cloud Native Meetup

Dynamic configuration

Service group level

Uses the ring

Supervisors Support Clustering Topologies

Page 47: Automating Applications with Habitat - Sydney Cloud Native Meetup

Self Organizing Applications

• Habitat applications can self organize

• Typical container pattern• Bake intent into the container• Redis-master container image• Redis-follower container image• Introduces image sprawl

Page 48: Automating Applications with Habitat - Sydney Cloud Native Meetup

Self Organizing Applications

•Habitat pattern• One container image• Launch images with knowledge of peers• Application self organizes

Page 49: Automating Applications with Habitat - Sydney Cloud Native Meetup

External Actors

Health and Status

Supervisor Debugging

Supervisors provide a REST API

Page 50: Automating Applications with Habitat - Sydney Cloud Native Meetup

What Habitat brings to Containers:

• Build containers from the Application down• Build the minimal viable container by default• Export containers in a variety of deployable formats• Automatically export containers with:

• Service Discovery• Configuration Management• Supervisor API• Clustering Topology Support

Page 51: Automating Applications with Habitat - Sydney Cloud Native Meetup

What about those Developer Services?

Page 52: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat and Developer Services

● Define How Software is Built○ Language Agnostic

● Define How Software is Deployed○ Export software to a variety of deployable formats (like containers)

● Define How Software is Run○ Common management plane for any software○ Common protocol for

■ Config■ Cluster

○ Common API for monitoring

Page 53: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat and Developer Services

Quickly and easily build, deploy, and run any software across a variety of compute runtimes.

Page 54: Automating Applications with Habitat - Sydney Cloud Native Meetup

Habitat is automation for Application Runtimes & Application Services to deliver Cloud Native Developer Services

Page 55: Automating Applications with Habitat - Sydney Cloud Native Meetup

It’s all open source

Apache License

Page 56: Automating Applications with Habitat - Sydney Cloud Native Meetup

Questions

• Join the Habitat Slack Team - http://slack.habitat.sh/ • Work through the tutorial at https://www.habitat.sh/tutorials/• Explore Habitat packages on the depot - https://app.habitat.sh/• Explore the Habitat projects - https://github.com/habitat-sh • Read Habitat Blog posts - https://blog.chef.io/?s=habitat • Join the Habitat Forums - https://forums.habitat.sh/