Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation on update strategy. Fix all navs in this section. #683

Merged
merged 1 commit into from
Jun 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions www/data/docs_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ sidebar_links:
link: "/docs/run-packages-security/"
- title: Topologies
link: "/docs/run-packages-topologies/"
- title: Update Strategy
link: "/docs/run-packages-update-strategy/"
- title: Run multiple packages
link: "/docs/run-packages-director/"
- title: Habitat internals
Expand Down
42 changes: 42 additions & 0 deletions www/source/docs/run-packages-update-strategy.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Update Strategy
---

# Update Strategy

The Habitat supervisor can be configured to implement an optional _update strategy_, which describes how the supervisor and its peers within a service group should respond when a new version of a package is available.

To use an update strategy, the supervisor be configured to watch a [depot](/docs/concepts-depot) for new versions. Habitat provides a public depot, but you can also run one inside your own datacenter using the `core/hab-depot` package.

## Configuring an Update Strategy

The current version of Habitat supports only one update strategy: `at-once`. This strategy does no peer coordination with other supervisors in the service group; it merely updates the underlying Habitat package whenever it detects that a new version has been published to a depot.

To start a supervisor with the auto-update strategy, pass the `--strategy` argument to a supervisor start command, and optionally specify the depot URL:

hab start yourorigin/yourapp --strategy at-once --url https://willem.habitat.sh/v1/depot

## Configuring an Update Strategy with a Depot View

A _view_ in a depot is a point-in-time snapshot of the state of the depot. In point of fact, it is a [materialized view](https://en.wikipedia.org/wiki/Materialized_view) of the depot, starting with the specific `origin/package/version/release` quad, and encapsulating all of the transitive dependencies of that quad. This is very useful for continuous deployment purposes:

* By convention, you name the view in the depot after the name of your service group (e.g. `myapp.production`)
* You deliver new versions of `myapp` as Habitat packages to the depot
* When you are ready to roll out a new version of the application, you update the view corresponding to the intended environment
* The supervisors in that service group, configured with an appropriate update strategy, update their underlying Habitat package, optionally coordinating with one another, and restart the service.

Configuring the supervisors' update strategy URL to point to a view ensures that new versions of the application do not get deployed until the view is updated, thereby preventing unstable versions from reaching environments for which they are not intended.

To start a supervisor with a strategy and pointing to a view, modify slightly the URL to the depot:

hab start yourorigin/yourapp --strategy at-once --url https://yourdepot.example.com/v1/depot/views/yourview

`yourview` represents the view you have created in the depot.

_At the moment, the `hab` command-line tool lacks the ability to create and manage views. To use views, you must run your own depot server and use the internal depot maintenance tool to manage views_.

<hr>
<ul class="main-content--link-nav">
<li>Continue to the next topic</li>
<li><a href="/docs/run-packages-director">Run multiple packages</a></li>
</ul>