Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Application Automation & Containerization With Habitat - SCaLE 16x

Application Automation & Containerization With Habitat - SCaLE 16x

Habitat is a simple, flexible way to build, deploy, and manage applications. Build applications of any flavor, from microservices to traditional applications. Deploy applications in any operational environment from bare metal to containers. Habitat provides consistent, repeatable, auditable applications that lower operational complexity and simplify development workflows.

This hands-on workshop is for anyone involved in building, deploying, or managing applications. The workshop will give you experience running and building applications with Habitat and describe the application-first approach that Habitat provides. Find out more at habitat.sh.

Agenda

* Modern applications for modern application teams
* Introduction to Habitat
* Run a Habitat application
* Build a Habitat application
* Learning Objectives

By the end of this workshop, participants will be able to:

* Describe the various components that make up Habitat’s build- and run-time environments.
* Describe the workflow for building, deploying, and managing applications with Habitat
* Build application packages using the Habitat Builder service
* Publish Habitat packages to the Habitat depot
* Promote Habitat packages through various Habitat depot channels
* Install packages using the Habitat command line interface
* Run services in the Habitat Supervisor
* Modify the configuration of a running service

Nathen Harvey

March 08, 2018
Tweet

More Decks by Nathen Harvey

Other Decks in Technology

Transcript

  1. Application Automation &
    Containerization With Habitat
    Nathen Harvey | @nathenharvey

    View Slide

  2. View Slide

  3. http://slack.habitat.sh
    #scale-16x

    View Slide

  4. Shifts in Modern Application Architecture
    Demand an application-centric operations model
    Infrastructure
    Centric
    Operations
    Application
    Centric
    Operations
    Cloud
    Containers
    Microservices
    UNIT OF VALUE is App
    UNIT OF WORK is Deployment
    UNIT OF VALUE is Server
    UNIT OF WORK is Configuration
    Infrastructure Automation Compliance Automation Application Automation
    EXISTING BUSINESS
    NEW BUSINESS

    View Slide

  5. Application automation that
    enables modern application
    teams to build, deploy, and
    manage any application in
    any environment - from
    traditional to cloud native
    architectures.
    Delivering essential tools and services for cloud native operations
    What is Habitat?

    View Slide

  6. Lifecycle of any software
    Build Deploy Run

    View Slide

  7. $
    Log in to your remote workstation
    ssh [email protected]

    View Slide

  8. Using PuTTY on Windows

    View Slide

  9. $
    hab 0.54.0/20180221022026
    Habitat is installed
    hab --version

    View Slide

  10. Clean room environment
    Safe by default
    Installs dependences
    Habitat studio

    View Slide

  11. $
    Habitat CLI Setup
    =================
    Welcome to hab setup. Let's get started.
    Set up a default origin
    Every package in Habitat belongs to an origin, which indicates the
    person or organization responsible for maintaining that package. Each
    origin also has a key used to cryptographically sign packages in that
    origin.
    Selecting a default origin tells package building operations such as
    'hab pkg build' what key should be used to sign the packages produced.
    If you do not set a default origin now, you will have to tell package
    building commands each time what origin to use.
    For more information on origins and how they are used in building
    packages, please consult the docs at
    https://www.habitat.sh/docs/create-packages-build/
    Set up a default origin? [Yes/no/quit] Yes
    Set-up the Habitat Studio (1 of 7)
    hab setup

    View Slide

  12. $
    Enter the name of your origin. If you plan to publish your packages
    publicly, we recommend that you select one that is not already in use on
    the Habitat build service found at https://bldr.habitat.sh/.
    Origins must begin with a lowercase letter or number. Allowed characters
    include lowercase letters, numbers, _, -. No more than 255 characters.
    Default origin name: [default: chef] chef
    Set-up the Habitat Studio (2 of 7)

    View Slide

  13. $
    Create origin key pair
    It doesn't look like you have a signing key for the origin `chef'.
    Without it, you won't be able to build new packages successfully.
    You can either create a new signing key now, or, if you are building
    packages for an origin that already exists, ask the owner to give you
    the signing key.
    For more information on the use of origin keys, please consult the
    documentation at https://www.habitat.sh/docs/concepts-keys/#origin-keys
    Create an origin key for `chef'? [Yes/no/quit] yes
    Set-up the Habitat Studio (3 of 7)

    View Slide

  14. $
    Create origin key pair
    It doesn't look like you have a signing key for the origin `chef'.
    Without it, you won't be able to build new packages successfully.
    You can either create a new signing key now, or, if you are building
    packages for an origin that already exists, ask the owner to give you
    the signing key.
    For more information on the use of origin keys, please consult the
    documentation at https://www.habitat.sh/docs/concepts-keys/#origin-keys
    Create an origin key for `chef'? [Yes/no/quit] yes
    Set-up the Habitat Studio (4 of 7)

    View Slide

  15. $
    GitHub Access Token
    While you can build and run Habitat packages without sharing them on the
    public depot, doing so allows you to collaborate with the Habitat
    community. In addition, it is how you can perform continuous deployment
    with Habitat.
    The GitHub personal access token needs the user:email and read:org OAuth
    scopes. Habitat uses the information provided through these scopes for
    authentication and to determine features based on team membership. You
    can set this up at https://github.com/settings/tokens
    If you would like to share your packages on the depot, please enter your
    GitHub access token. Otherwise, just enter No.
    For more information on sharing packages on the depot, please read the
    documentation at https://www.habitat.sh/docs/share-packages-overview/
    Set up a default GitHub access token? [Yes/no/quit] no
    Set-up the Habitat Studio (5 of 7)

    View Slide

  16. $
    Analytics
    The `hab` command-line tool will optionally send anonymous usage data to
    Habitat's Google Analytics account. This is a strictly opt-in activity
    and no tracking will occur unless you respond affirmatively to the
    question below.
    We collect this data to help improve Habitat's user experience. For
    example, we would like to know the category of tasks users are
    performing, and which ones they are having trouble with (e.g. mistyping
    command line arguments).
    To see what kinds of data are sent and how they are anonymized, please
    read more about our analytics here:
    https://www.habitat.sh/docs/about-analytics/
    Enable analytics? [Yes/no/quit] yes
    Set-up the Habitat Studio (6 of 7)

    View Slide

  17. $
    CLI Setup Complete
    That's all for now. Thanks for using Habitat!
    Set-up the Habitat Studio (7 of 7)

    View Slide

  18. Lifecycle of any software
    Build

    View Slide

  19. Starts with a plan

    View Slide

  20. Plan
    ~/sample-node-app/habitat/plan.sh
    pkg_name=sample-node-app
    pkg_origin=your_origin
    pkg_origin=chef
    pkg_scaffolding="core/scaffolding-node"
    pkg_version="1.0.1"
    declare -A scaffolding_env
    # Define path to config file
    scaffolding_env[APP_CONFIG]="{{pkg.svc_config_path}}/config.json"
    -
    +

    View Slide

  21. Plan
    ~/sample-node-app/habitat/plan.sh
    pkg_name=sample-node-app
    pkg_origin=your_origin
    pkg_origin=chef
    pkg_scaffolding="core/scaffolding-node"
    pkg_version="1.0.1"
    declare -A scaffolding_env
    # Define path to config file
    scaffolding_env[APP_CONFIG]="{{pkg.svc_config_path}}/config.json"
    -
    +
    $ cp ~/new-plan.sh sample-node-app/habitat/plan.sh
    If you don’t like manually editing files…

    View Slide

  22. $
    Move to the Application’s Directory
    cd ~/sample-node-app

    View Slide

  23. $
    ∵ Missing package for core/hab-studio/0.54.0
    » Installing core/hab-studio/0.54.0 from channel 'stable'
    ↓ Downloading core/hab-studio/0.54.0/20180221023422
    3.17 MB / 3.17 MB - [===============================] 100.00 % 79.21 MB/s
    ☛ Verifying core/hab-studio/0.54.0/20180221023422
    ✓ Installed core/hab-studio/0.54.0/20180221023422
    ★ Install of core/hab-studio/0.54.0/20180221023422 complete with 1 new packages installed.
    hab-studio: Creating Studio at /hab/studios/home--chef--sample-node-app (default)
    ...
    --> To prevent a Supervisor from running automatically in your
    Studio, export 'HAB_STUDIO_SUP=false' before running
    'hab studio enter'.
    Enter the Habitat Studio
    hab studio enter

    View Slide

  24. #
    : Loading /src/habitat/plan.sh
    sample-node-app: Plan loaded
    sample-node-app: Validating plan metadata
    ...
    sample-node-app: Installed Path: /hab/pkgs/chef/sample-node-app/1.0.1/20180221155144
    sample-node-app: Artifact: /src/results/chef-sample-node-app-1.0.1-20180221155144-
    x86_64-linux.hart
    sample-node-app: Build Report: /src/results/last_build.env
    sample-node-app: SHA256 Checksum:
    811247255d0b53319f29f5090a72e186247fb000b8f8b362282a3761422a3cd3
    sample-node-app: Blake2b Checksum:
    bde6652ff19cd6ec8c336e466b200127aa7c60987bc3ba86917064237df0c421
    sample-node-app:
    sample-node-app: I love it when a plan.sh comes together.
    sample-node-app:
    sample-node-app: Build time: 0m39s
    Build the Application
    build

    View Slide

  25. Lifecycle of any software
    Build Run

    View Slide

  26. #
    No services loaded.
    Make Sure the Supervisor is Running
    hab sup status

    View Slide

  27. #
    No services loaded.
    Make Sure the Supervisor is Running
    hab sup status
    Yay!!
    This is what we expect!

    View Slide

  28. #
    The Supervisor is not running.
    [1]+ Done hab sup run $* > /hab/sup/default/sup.log 2>&1 (wd: /)
    (wd now: /hab/pkgs/chef/sample-node-app/1.0.1/20180308025017)
    Make Sure the Supervisor is Running
    hab sup status

    View Slide

  29. #
    The Supervisor is not running.
    [1]+ Done hab sup run $* > /hab/sup/default/sup.log 2>&1 (wd: /)
    (wd now: /hab/pkgs/chef/sample-node-app/1.0.1/20180308025017)
    Make Sure the Supervisor is Running
    hab sup status
    # exit
    $ hab studio enter

    View Slide

  30. #
    hab-sup(MN): The chef/sample-node-app service was successfully loaded
    Run the Application in the Studio
    hab sup load chef/sample-node-app

    View Slide

  31. #
    --> Tailing the Habitat Supervisor's output (use 'Ctrl+c' to stop)
    hab-sup(MR): Starting chef/sample-node-app
    sample-node-app.default(UCW): Watching user.toml
    sample-node-app.default(HK): init, compiled to /hab/svc/sample-node-app/hooks/init
    sample-node-app.default(HK): Hooks compiled
    sample-node-app.default(SR): Hooks recompiled
    default(CF): Updated app_env.sh
    9c88a9595def28f5914f08997b3cd3ba8d32f0e3eb2b4e4ea90264acd6acb66b
    default(CF): Updated config.json
    3f22842e8d737bbb107d9ac19afba42642eccf68a06ddfbdba70507b23b8498a
    sample-node-app.default(SR): Configuration recompiled
    sample-node-app.default(SR): Initializing
    sample-node-app.default(SV): Starting service as user=hab, group=hab
    Follow the Supervisor Log
    sup-log

    View Slide

  32. http://YOUR_IP:8000

    View Slide

  33. Managing with Habitat
    Habitat Supervisor manages the service.
    SERVICE
    SUPERVISOR

    View Slide

  34. Installs automatically
    Keeps things running
    Manages configuration
    Supervisor runs services

    View Slide

  35. #
    message = "Hello, World!"
    node_env = "production"
    [app]
    port = 8000
    Configuration Options
    hab sup config chef/sample-node-app

    View Slide

  36. #
    Write Configuration Options to a File
    hab sup config chef/sample-node-app > config.toml

    View Slide

  37. Update the configuration
    config.toml
    message = "Hello, World!"
    node_env = "production"
    [app]
    port = 8000
    port = 9000
    -
    +

    View Slide

  38. Update the configuration
    config.toml
    message = "Hello, World!"
    node_env = "production"
    [app]
    port = 8000
    port = 9000
    -
    +
    # cp new-config.toml config.toml
    If you don’t like manually editing files…

    View Slide

  39. Managing with Habitat
    Habitat Supervisor manages the service.
    SERVICE
    SUPERVISOR

    View Slide

  40. Managing with Habitat
    A RESTful API allows external services to integrate with Habitat Supervisors.
    SERVICE
    SUPERVISOR
    EXTERNAL
    SERVICES

    View Slide

  41. #
    Apply the New Configuration
    hab config apply --peer 127.0.0.1 sample-node-app.default 1 config.toml

    View Slide

  42. Applying Configuration
    hab config apply --peer 127.0.0.1 sample-node-app.default 1 config.toml
    •  peer - hostname or IP address of a running supervisor
    •  sample-node-app.default - the service group
    •  1 - the incarnation of this configuration
    •  config.toml - the file with the new configuration

    View Slide

  43. #
    ∵ Missing package for core/hab-butterfly/0.54.0
    » Installing core/hab-butterfly/0.54.0 from channel 'stable'
    ↓ Downloading core/hab-butterfly/0.54.0/20180221020301
    ...
    ★ Install of core/hab-butterfly/0.54.0/20180221020301 complete with 1 new packages
    installed.
    » Applying configuration for sample-node-app.default incarnation 1
    Ω Creating service configuration
    ✓ Verified this configuration is valid TOML
    ↑ Applying to peer 127.0.0.1:9638
    ★ Applied configuration
    Apply the New Configuration
    hab config apply --peer 127.0.0.1 sample-node-app.default 1 config.toml

    View Slide

  44. http://YOUR_IP:9000

    View Slide

  45. Docker
    tar
    Kubernetes
    Post-process packages

    View Slide

  46. #
    ∵ Missing package for core/hab-pkg-export-docker/0.54.0
    » Installing core/hab-pkg-export-docker/0.54.0 from channel 'stable'
    ↓ Downloading core/hab-pkg-export-docker/0.54.0/20180221020412
    2.40 MB / 2.40 MB - [===============================] 100.00 % 89.49 MB/s
    ☛ Verifying core/hab-pkg-export-docker/0.54.0/20180221020412
    ...
    Removing intermediate container 582430ddac0a
    ---> 0cb96cce166b
    Successfully built 0cb96cce166b
    Successfully tagged chef/sample-node-app:1.0.1-20180221155145
    Successfully tagged chef/sample-node-app:1.0.1
    Successfully tagged chef/sample-node-app:latest
    ☒ Deleting temporary files
    ★ Docker image 'chef/sample-node-app' created with tags: 1.0.1-20180221155145, 1.0.1,
    latest
    Ω Creating build report /src/results/last_docker_export.env
    Export to Docker
    hab pkg export docker results/chef-sample-node-app-*.hart

    View Slide

  47. #
    Leave the Studio
    exit

    View Slide

  48. $
    REPOSITORY TAG IMAGE ID CREATED SIZE
    chef/sample-node-app 1.0.1 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app 1.0.1-20180221155145 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app latest 0cb96cce166b 4 minutes ago 207MB
    Inspect the Local Docker Images
    docker images

    View Slide

  49. $
    REPOSITORY TAG IMAGE ID CREATED SIZE
    chef/sample-node-app 1.0.1 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app 1.0.1-20180221155145 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app latest 0cb96cce166b 4 minutes ago 207MB
    Run in a Docker Container
    docker run -it -p 8000:8000 chef/sample-node-app

    View Slide

  50. http://YOUR_IP:8000

    View Slide

  51. $
    REPOSITORY TAG IMAGE ID CREATED SIZE
    chef/sample-node-app 1.0.1 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app 1.0.1-20180221155145 0cb96cce166b 4 minutes ago 207MB
    chef/sample-node-app latest 0cb96cce166b 4 minutes ago 207MB
    Run in a Docker Container with Updated Configuration
    docker run -e HAB_SAMPLE_NODE_APP="$(cat config.toml)" -p 9000:9000 -it chef/sample-node-app

    View Slide

  52. http://YOUR_IP:9000

    View Slide

  53. $
    Copy the Origin Key to the Proper Location
    sudo cp ~/.hab/cache/keys/chef-*.pub /hab/cache/keys/

    View Slide

  54. $
    ∵ Missing package for core/hab-launcher
    » Installing core/hab-launcher from channel 'stable'
    ↓ Downloading core/hab-launcher/6925/20180202215752
    4.78 MB / 4.78 MB / [===============================] 100.00 % 31.47 MB/s
    ...
    sample-node-app.default(SR): Configuration recompiled
    sample-node-app.default(SR): Initializing
    sample-node-app.default(SV): Starting service as user=hab, group=hab
    Start the Application Locally
    sudo hab sup start results/chef-sample-node-app-*.hart

    View Slide

  55. http://YOUR_IP:8000

    View Slide

  56. Deploying with Habitat
    Habitat packages can be deployed to a variety of infrastructure platforms
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    BARE METAL
    CONTAINERS
    AMI
    VM
    ARTIFACT
    DEPLOYABLE
    ARTIFACT

    View Slide

  57. Lifecycle of any software
    Build Deploy Run

    View Slide

  58. Quick Aside - tmux
    •  Used to multiplex several virtual consoles
    •  Allows for multiple separate terminal sessions inside a single remote terminal session
    •  tmux new –s
    •  tmux detach
    •  tmux attach –t

    View Slide

  59. $
    tmux for the Supervisor
    tmux new –s sup

    View Slide

  60. $
    hab-sup(MR): Supervisor Member-ID 100b72aea4104c9ba52972622db4bda1
    hab-sup(MR): Starting chef/sample-node-app/1.0.1/20180222023512
    sample-node-app.default(UCW): Watching user.toml
    hab-sup(MR): Starting gossip-listener on 0.0.0.0:9638
    hab-sup(MR): Starting http-gateway on 0.0.0.0:9631
    sample-node-app.default(HK): Hooks compiled
    sample-node-app.default(SR): Initializing
    sample-node-app.default(SV): Starting service as user=hab, group=hab
    sample-node-app.default(HK): Hooks compiled
    Join My Supervisor Ring
    sudo hab sup run

    View Slide

  61. $
    NATHEN – UPDATE THIS
    Detach from that tmux Session
    Ctrl-b d

    View Slide

  62. $
    » Installing core/redis from channel 'stable'
    ↓ Downloading core/redis/3.2.4/20170514150022
    569.70 KB / 569.70 KB \ [=========] 100.00 % 55.69 MB/s
    ☛ Verifying core/redis/3.2.4/20170514150022
    → Using core/glibc/2.22/20170513201042
    → Using core/linux-headers/4.3/20170513200956
    ✓ Installed core/redis/3.2.4/20170514150022
    ★ Install of core/redis/3.2.4/20170514150022 complete with 1 new packages installed.
    hab-sup(MN): The core/redis service was successfully loaded
    Run Redis
    sudo hab sup load core/redis

    View Slide

  63. $
    -bash: redis-cli: command not found
    Verify Redis
    redis-cli ping

    View Slide

  64. $
    » Binlinking redis-benchmark from core/redis into /bin
    ★ Binlinked redis-benchmark from core/redis/3.2.4/20170514150022 to /bin/redis-benchmark
    » Binlinking redis-server from core/redis into /bin
    ★ Binlinked redis-server from core/redis/3.2.4/20170514150022 to /bin/redis-server
    » Binlinking redis-check-rdb from core/redis into /bin
    ★ Binlinked redis-check-rdb from core/redis/3.2.4/20170514150022 to /bin/redis-check-rdb
    » Binlinking redis-cli from core/redis into /bin
    ★ Binlinked redis-cli from core/redis/3.2.4/20170514150022 to /bin/redis-cli
    » Binlinking redis-sentinel from core/redis into /bin
    ★ Binlinked redis-sentinel from core/redis/3.2.4/20170514150022 to /bin/redis-sentinel
    » Binlinking redis-check-aof from core/redis into /bin
    ★ Binlinked redis-check-aof from core/redis/3.2.4/20170514150022 to /bin/redis-check-aof
    Binlink Redis
    sudo hab pkg binlink core/redis

    View Slide

  65. $
    PONG
    Verify Redis
    redis-cli ping

    View Slide

  66. $
    lrwxrwxrwx. 1 root root 55 Mar 8 03:25 /usr/bin/redis-cli -> /hab/pkgs/core/redis/
    3.2.4/20170514150022/bin/redis-cli
    What did binlink do?
    which redis-cli | xargs ls -l

    View Slide

  67. Habitat Depot, aka Builder, aka bldr

    View Slide

  68. $
    package type state uptime (s) pid group style
    chef/sample-node-app/1.0.1/20180308025017 standalone up 1487 15386 sample-node-app.default transient
    core/redis/3.2.4/20170514150022 standalone up 1345 15517 redis.default persistent
    Check Supervisor Status
    hab sup status

    View Slide

  69. $
    hab-sup(MN): Unloading "/hab/sup/default/specs/sample-node-app.spec"
    Stop Your Sample Node App
    sudo hab sup unload chef/sample-node-app

    View Slide

  70. $
    Run My Sample Node App
    hab-sup(MN): Missing package for nathenharvey/sample-node-app
    » Installing nathenharvey/sample-node-app from channel 'stable'
    ...
    ★ Install of nathenharvey/sample-node-app/1.0.19/20180228214110
    complete with 1 new packages installed.
    hab-sup(MN): The nathenharvey/sample-node-app service was successfully
    loaded
    sudo hab sup load nathenharvey/sample-node-app

    View Slide

  71. http://YOUR_IP:8000

    View Slide

  72. Managing with Habitat
    Habitat Supervisor manages the service.
    SERVICE
    SUPERVISOR

    View Slide

  73. Managing with Habitat
    Supervisors form Service Groups
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR

    View Slide

  74. $
    package type state uptime (s) pid group style
    core/redis/3.2.4/20170514150022 standalone up 2535 15517 redis.default persistent
    nathenharvey/sample-node-app/1.0.19/20180228214110 standalone up 1028 15386 sample-node-app.default persistent
    Check Supervisor Status
    hab sup status

    View Slide

  75. $
    hab-sup(MN): Unloading "/hab/sup/default/specs/redis.spec"
    Unload redis
    sudo hab sup unload core/redis

    View Slide

  76. $
    hab-sup(MN): Unloading "/hab/sup/default/specs/sample-node-app.spec"
    Unload sample-node-app
    sudo hab sup unload nathenharvey/sample-node-app

    View Slide

  77. $
    Stop the Supervisor
    sudo hab sup term

    View Slide

  78. Quick Aside - tmux
    •  Used to multiplex several virtual consoles
    •  Allows for multiple separate terminal sessions inside a single remote terminal session
    •  tmux new –s
    •  tmux detach
    •  tmux attach –t

    View Slide

  79. $
    Attach to the tmux for the Supervisor
    tmux new -s sup

    View Slide

  80. $
    hab-sup(MR): Supervisor Member-ID 100b72aea4104c9ba52972622db4bda1
    hab-sup(MR): Starting chef/sample-node-app/1.0.1/20180222023512
    sample-node-app.default(UCW): Watching user.toml
    hab-sup(MR): Starting gossip-listener on 0.0.0.0:9638
    hab-sup(MR): Starting http-gateway on 0.0.0.0:9631
    sample-node-app.default(HK): Hooks compiled
    sample-node-app.default(SR): Initializing
    sample-node-app.default(SV): Starting service as user=hab, group=hab
    sample-node-app.default(HK): Hooks compiled
    Join My Supervisor Ring
    sudo hab sup run –peer 172.31.0.251

    View Slide

  81. http://YOUR_IP:9631/
    butterfly

    View Slide

  82. $
    [detached (from session sup)]
    Detach from that tmux Session
    Ctrl-b d

    View Slide

  83. Lifecycle of any software
    Build Deploy Run

    View Slide

  84. Deploying a Change
    •  git branch
    •  Make the change
    •  Test the change locally – LGTM!
    •  Submit the Change

    View Slide

  85. Deploying a Change
    Submit
    Change

    View Slide

  86. Deploying a Change
    VERIFY
    Lint
    Syntax
    Unit
    Submit
    Change

    View Slide

  87. Deploying a Change
    VERIFY APPROVE
    Lint
    Syntax
    Unit
    Submit
    Change
    Does this
    code
    change
    look good?

    View Slide

  88. Deploying a Change
    VERIFY BUILD
    APPROVE
    Lint
    Syntax
    Unit
    Security
    Quality
    Publish
    Lint
    Syntax
    Unit
    Submit
    Change
    Does this
    code
    change
    look good?

    View Slide

  89. Deploying a Change
    VERIFY BUILD UNSTABLE
    ENVIRONMENT
    APPROVE
    Lint
    Syntax
    Unit
    Security
    Quality
    Publish
    Lint
    Syntax
    Unit
    Update
    Smoke
    Functional
    Submit
    Change
    Does this
    code
    change
    look good?

    View Slide

  90. Deploying a Change
    VERIFY BUILD UNSTABLE
    ENVIRONMENT
    APPROVE PROMOTE
    Lint
    Syntax
    Unit
    Security
    Quality
    Publish
    Lint
    Syntax
    Unit
    Update
    Smoke
    Functional
    Submit
    Change
    Does this
    code
    change
    look good?
    Do we
    want
    to ship
    this?

    View Slide

  91. Deploying a Change
    VERIFY BUILD UNSTABLE ENVIRONMENT
    APPROVE PROMOTE
    Lint
    Syntax
    Unit
    Security
    Quality
    Publish
    Lint
    Syntax
    Unit
    Smoke
    Functional
    Smoke
    Functional
    Submit
    Change
    Does this
    code
    change
    look good?
    Do we
    want
    to ship
    this?
    PROMOTE
    Do we
    want
    to ship
    this?
    ENVIRONMENT
    Update Update

    View Slide

  92. Deploying a Change
    VERIFY BUILD UNSTABLE ENVIRONMENT ENVIRONMENT
    APPROVE PROMOTE
    Lint
    Syntax
    Unit
    Security
    Quality
    Publish
    Lint
    Syntax
    Unit
    Smoke
    Functional
    Smoke
    Functional
    Smoke
    Functional
    Submit
    Change
    Does this
    code
    change
    look good?
    Do we
    want
    to ship
    this?
    PROMOTE
    Do we
    want
    to ship
    this?
    ENVIRONMENT
    Update Update
    Update

    View Slide

  93. Managing with Habitat
    Habitat applications can automatically update as new artifacts are published.
    SERVICE
    SUPERVISOR
    ARTIFACT DEPOT
    ALL AT ONCE ROLLING DEPLOY

    View Slide

  94. $
    hab-sup(MN): Missing package for nathenharvey/sample-node-app
    » Installing nathenharvey/sample-node-app from channel 'stable'
    ...
    ✓ Installed nathenharvey/sample-node-app/1.0.8/20180221181902
    ★ Install of nathenharvey/sample-node-app/1.0.8/20180221181902 complete with 1 new packages
    installed.
    hab-sup(MN): The nathenharvey/sample-node-app service was successfully loaded
    Launch My Sample App
    sudo hab sup load nathenharvey/sample-node-app -s rolling

    View Slide

  95. $
    Attach to the tmux for the Supervisor
    tmux attach -t sup

    View Slide

  96. Demo
    Deploy the new version around the room.

    View Slide

  97. http://YOUR_IP:8000

    View Slide

  98. View Slide

  99. $
    [detached (from session sup)]
    Detach from that tmux Session
    Ctrl-b d

    View Slide

  100. $
    hab-sup(MN): Unloading "/hab/sup/default/specs/sample-node-app.spec"
    Unload the Application
    sudo hab sup unload nathenharvey/chef-sample-node-app

    View Slide

  101. $
    Terminate the Supervisor
    sudo hab sup term

    View Slide

  102. $
    Attach to the tmux for the Supervisor
    tmux attach -t sup

    View Slide

  103. $
    [exited]
    Close the tmux for the Supervisor
    exit

    View Slide

  104. Automation travels with the
    application

    Existing & Cloud Native Software
    Application Automation

    View Slide

  105. What OS is your workstation?

    View Slide

  106. What’s Next?
    •  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://www.habitat.sh/blog/

    View Slide

  107. View Slide

  108. SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    USER ARTIFACT
    How we do it
    Packaging Applications
    Running Applications
    PLAN DEPOT
    DEPOT ARTIFACT
    BARE METAL
    CONTAINERS
    AMI
    VM

    View Slide

  109. Habitat Build Philosophy
    ● 
    Container formats recreate the
    traditional model of infrastructure and
    applications.
    ● 
    Poor at abstracting the Build + Run
    aspects of Applications
    Libraries
    Operating System
    Application
    Application &
    Libraries
    ● 
    Habitat builds from the application
    down
    ● 
    Small lightweight OS included
    ● 
    Embedded Supervisor for Application
    Management
    ● 
    Builds have strict dependency version
    control
    Application Libraries
    OS

    View Slide

  110. Application Centric Containers with Habitat
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    SERVICE
    SUPERVISOR
    CONTAINER
    ●  Provides a “DSL” for defining the build
    lifecycle of the application
    ●  Application run lifecycle is defined along
    side the application build lifecycle
    ●  Hab artifacts are based on application
    artifact, declared dependencies, and
    defined run lifecycle
    ●  Export hab artifacts to containers
    ●  Containers have built in supervisor for
    application operations concerns:
    ○  Configuration
    ○  Service Discovery
    ○  Clustering Topologies
    EXPORTS
    CONTAINER
    FORMATS

    View Slide

  111. Habitat + Container Orchestrators
    ●  Develop reusable
    application packages
    ●  Expose tunable settings
    ●  Export to your preferred
    Container Platform
    ●  Deploy your application
    in a scalable, topology
    aware format.
    BUILD DEPLOY MANAGE
    ●  Orchestrate and
    Automate your
    application config
    changes
    ●  Application lifecycle
    hooks respond to
    updates & events

    View Slide

  112. View Slide