8. deploy node['dafne_online']['deploy_base'] do
repository "https://#{node['dafne_online']['git_user']}:#{git_pw}@dafneonline.git.cloudforge.com/dafneonline.git" rollback_on_error true
environment rails_user_env
restart_command 'sudo -H -u rails bash -c "export PATH=/opt/rubies/2.2.3/bin:$PATH && /etc/init.d/unicorn_dafneonline restart"’
action :deploy symlinks shared_hash
user node['dafne_online']['deploy_user']
group 'admin’
before_symlink do
execute 'bundle install' do
command "bundle install --path #{node['dafne_online']['deploy_base']}/shared/bundle --without development test --deployment --quiet”
user node['dafne_online']['deploy_user']
environment rails_user_env
cwd release_path
action :run
end
end
before_restart do
link '/etc/init.d/unicorn_dafneonline' do
to '/home/rails/apps/dafneonline/current/config/unicorn_init.sh’
end
template "#{node['dafne_online']['deploy_base']}/current/config/unicorn.rb" do
source 'unicorn.rb.erb' owner node['dafne_online']['deploy_user']
group 'admin’
mode 00744
end
execute 'compile assets' do
command "RAILS_ENV=#{node['dafne_online']['rails_env']} bundle exec rake assets:precompile”
user node['dafne_online']['deploy_user']
environment rails_user_env
cwd release_path
action :run
end
end
after_restart do
execute 'notify Airbrake of deployment' do
command "RAILS_ENV=#{node['dafne_online']['rails_env']} bundle exec rake airbrake:deploy TO=#{node['dafne_online']['rails_env']} REVISION=
REPO=https://dafneonline.git.cloudforge.com/dafneonline.git USER=#{node['dafne_online']['deploy_user']}”
environment rails_user_env
user node['dafne_online']['deploy_user']
cwd release_path
action :run
end
end
end
10. Habitat Technology
Plan Artifact Depot
Build
Service
Supervis
or
Supervis
or
Supervis
or
Supervis
or
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
Supervisor Supervisor
14. Improved Proxy Support
• Supports $http_proxy, $https_proxy, $no_proxy environment
variables
• Basic authentication
• Propagate into Studios
15. Iterate Service Configurations Quicker
using
–config-from
• Faster iteration of configuration templates during plan
development
• $ hab start yourorigin/yourpackage --config-from /path/to/config
• Intended only for development
16. Improved Root/Non-Root Behavior via
sudo
• Drop the need to prefix most hab commands with sudo
• Entering a Studio with sudo detects user’s key cache (not
root’s)
• $ hab setup; sudo hab studio enter
• Future release will “auto-sudo” when using Studio
subcommands
17. Better Mac Docker/Studio Upgrading
• Mac uses a Docker image for Linux Studio
• Runs Docker image with same version as hab CLI
• On upgrading hab CLI, new Docker image automatically pulled
18. Process: Release Train Model
• Userland tooling: hab CLI, Supervisor, Director
• Every second Thursday, cut from master
• Typically a minor version revision
• Features ship when ready and early features will hide behind
feature flags
19. Process: (Upcoming) Continuous
Deployment
• Platform infrastructure: web site, Depot, Builder
• Packages built off master and published to Depot
• Platform upgrades when new packages publish
• Decoupled release from userland tooling
20. Builder: A Distributed Build Service
• Micro service architecture, built with Habitat in mind
• Habitat runs on Habitat
• Upcoming: early access to build a package on the platform via
feature flag/invite
• Upcoming: building packages on pushes to GitHub
• Upcoming: dependent package rebuilding
• More details: “Habitat 301: Building Habitats” ChefConf 2016
Talk by Jamie Winsor
21. Expanding Horizons: Windows
• Bring Mac Habitat experience to Windows
• Building hab CLI
• Upcoming: ship first hab packages for Windows
• Upcoming: native Windows Habitat packages
• Upcoming: Supervisor running on Windows
22. Contribute to “Habtoberfest”!
• Habitat participating in Digital Ocean’s Hacktoberfest event
• Runs October 1st through 31st
• Make 4 pull requests (on any FOSS project), earn a limited
edition Hacktoberfest T-shirt
• Habitat repo has “Hacktoberfest” tagged issues
• http://hacktoberfest.digitalocean.com
23. Help Shape the Direction of Habitat
• Try out Habitat https://www.habitat.sh/try/
• Build a package
• Try out use cases, contact us when: you win, you come up
short, (i.e. anytime)
• Join us in HabiChat http://slack.habitat.sh/
• We’re at a Community Summit—let’s talk!
Editor's Notes
And that’s basically how it comes together. You, as a user, make plans that get turned into artifacts that are accessible via a depot. Supervisors then pick up and run those artifacts on a variety of platforms and are equipped to make decisions about how they’re configured as they are starting up their child process (i.e. at runtime). Your applications can act autonomously and are equipped to make decisions about how they manage and update themselves. They intercommunicate securely and the supervisors all constantly watch, update, and share the status of the entire cluster with each other.
Bam! That’s how Habitat works.