Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Poise: Reusable Cookbook Patterns
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Noah Kantrowitz
April 16, 2014
Programming
1
730
Poise: Reusable Cookbook Patterns
Noah Kantrowitz
April 16, 2014
Tweet
Share
More Decks by Noah Kantrowitz
See All by Noah Kantrowitz
The Long Hello World
coderanger
0
19
The Long Hello World (with notes)
coderanger
0
69
What Python Can Learn From Other Languages
coderanger
0
82
What Python Can Learn From Other Languages (with notes)
coderanger
0
200
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
320
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
81
How to look at space: PyCon AU
coderanger
0
140
Swiss Army Django: Small Footprint ETL
coderanger
0
120
Swiss Army Django: Small Footprint ETL (with notes)
coderanger
0
99
Other Decks in Programming
See All in Programming
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
510
Claude Codeログ基盤の構築
giginet
PRO
7
3.1k
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
180
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
Ruby and LLM Ecosystem 2nd
koic
1
670
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
730
TipKitTips
ktcryomm
0
160
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
410
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
780
A Modern Web Designer's Workflow
chriscoyier
698
190k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
350
Ruling the World: When Life Gets Gamed
codingconduct
0
170
How STYLIGHT went responsive
nonsquared
100
6k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Pragmatic Product Professional
lauravandoore
37
7.2k
First, design no harm
axbom
PRO
2
1.1k
Transcript
Cookbook Patterns Poise Noah Kantrowitz
Me •PSF + PyCon •Balanced •Chef •Making things
•What? •Why? •How?
None
None
None
cook·book A description of a piece of infrastructure
Role Cookbook Recipe Resource
None
leak·y ab·strac·tion Incomplete hiding of internal details
None
•Fork (and patch) •Wrapper •Rewind
Inheritance
None
10x
Poise
•Helpers •DSL extensions •Patterns
None
•jenkins •jenkins_job •jenkins_credential •jenkins_plugin
•ci_job •ci_pipeline •name_ci_pipeline
Using Poise
class Chef class ... ... end end
Resource::Foo < Resource Provider::Foo < Provider
•Foo => foo •FooBar => foo_bar •FOO => f_o_o
class ... include Poise ... end
action(:one, :two) attribute(:name, kind_of: String)
attribute(:opts, option_collector: true ) opts do foo 'bar' end
attribute(:path, default: lazy { ... })
attribute(:config, template: true) attribute('', template: true)
foo ... do source 'cfg.erb' end foo ... do content
'x=1' end
file ... do content nr.content end
class Provider... def action_one ... end end
notifying_block do ... end
include_recipe ...
Putting It Together
class Res::Foo < Res include Poise action(:one) attribute(:pkg) attribute(:ver) end
def action_one notifying_block do install_pkg write_config end end
def install_pkg package nr.pkg do version nr.ver end end
def install_pkg r = super r.package_name( 'my-thing') r end
Next Steps
Subresources
Cookbook Tiers
•poise-proxy •poise-appenv •poise-service?
•attribute(node: ...) •group do ... end •after(:one)
None
Thank You