Chef Habitat

Developer Resources

Chef Habitat is an open source automation solution for defining, packaging, and delivering applications to almost any environment regardless of operating system or platform.

Release notes

Application Definition, Packaging and Delivery Automation

Reusable Content
Hundreds of pre-defined application templates and a robust open source user community.
Codified Instructions
Automation is stored as coded artifacts that are easy to search and share.
Consistent Deployments
What is built and run in development will be exactly the same in production.
Advanced Features
Built-in automation for dynamic service bindings, clustering topologies, service discovery, and update strategies.

The Chef Habitat Studio is a development kit for creating automated build and deployment plans for any application and then testing them in a clean-room environment.

  • Define how your application is built, installed, and run with PowerShell or Bash and your code editor of choice.

  • Isolate dependencies into atomic plans and then build an Application Manifest which links to all direct & transitive runtime dependencies and provides tuneable instructions to install and run the app.

  • Leverage hundreds of pre-built plans for common dependencies such as .NET, jdk or gcc on the Chef Habitat community on GitHub.

Habitat packages the Application Manifest into an immutable artifact called the Habitat Application Artifact (.HART) file. Artifacts can be exported to run in a variety of runtimes with zero refactoring or rewriting.

  • Create a package in the local Studio or integrate with any automated pipeline solution using the same commands and build processes.

  • Simplify audit and compliance processes by explicitly defining application dependencies and packaging an application with only what is required.

  • Easily export to tarball, Docker, or directly to container registries (Azure Container Registry, Amazon Elastic Container Registry, or Docker Hub).

The Habitat Supervisor is a light-weight agent that runs on/in a server, virtual machine, or container and manages the application according to the instructions defined in the Habitat Plan. Tasks are defined via pre-set scripts called lifecycle hooks that are included as part of the application definition.

  • Deploy and upgrade an application to any environment on-demand

  • Automate health and compliance checks

  • Templatize your configuration settings and update them as needed during runtime.

Self-Learning Tutorials and Resources

Deliver Applications with Chef Habitat

Learn to automate application management with Chef Habitat by bundling build and runtime instructions alongside your application source code.

Go to course

Windows Resource Center

Chef Habitat provides a single way to deliver and manage Windows applications. Find ebooks, demos, and other resources to help you get started.

Windows resources

Automated Application Rollback Insurance for Release Teams

This paper provides an overview of rollback vs. rollforward and how to implement within Chef Habitat.

Download white paper

Getting started

1

Install Chef Habitat

Everything you need to get started packaging applications is included with the Chef Habitat Command-Line Interface (CLI). The Chef Habitat installer CLI is supported on Linux, Mac, and Windows.

2

Install Secondary Tools

In addition to installing Chef Habitat it is suggested you also install your favorite text editor (vim, emacs or nano), Git, and Docker Community Edition.

            
~$ sudo yum install -y vim-enhanced git
~$ sudo yum install docker-ce docker-ce-cli containerd.io
          

3

Create an Origin Keypair

Every package that you build with Chef Habitat belongs to an origin and is cryptographically signed with that origin’s private key. As part of the set-up you’ll need to generate or define a set of origin keys.

              
~$ export HAB_ORIGIN=’myinitials_tryhab’
~$ hab origin key generate
» Generating origin key for myinitials_tryhab
★ Generated origin key pair myinitials_tryhab-20200521200652
            

4

Clone and Unpack the Application

In this case we describe the application at a high level. What does it do, how does it work, and what bits of functionality might be configurable? This is where we basically map a manual runbook to an automation plan.

              
~ $ git clone https://github.com/chef-training/java-sample
            

5

Define and Package the Application with Habitat

The Habitat Manifest is typically added to the root of your application. It is typically structured into three folders: habitat/, hooks/, and a config.toml file used for templating. The contents of the Manifest will vary greatly depending on your application requirements.

          
Common Habitat Manifest Directory Structure
  |-- config.toml
  |-- habitat
  |   |-- README.md
  |   |-- config
  |   |-- default.toml
  |   |-- hooks
  |   `-- plan.sh
  |-- results
        

Chef Habitat Builder for Enterprise Wide Adoption

The Chef Habitat Builder provides a set of enterprise-class functionality that includes package storage, search, and automated API enabled services. Application binaries versioned and stored along with the corresponding Habitat Artifact. Clients have the option of leveraging the SaaS or on-premises version of Builder.

From the Chef Habitat Blog

Chef Habitat Joins the Greater Chef Community

Read more

Chef & Jenkins: Better Together

Read more

What is Application Definition?

Read more

Accelerate your business’s move to the cloud and adoption of container technology.