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
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
5
The Long Hello World (with notes)
coderanger
0
26
What Python Can Learn From Other Languages
coderanger
0
70
What Python Can Learn From Other Languages (with notes)
coderanger
0
180
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
260
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
69
How to look at space: PyCon AU
coderanger
0
120
Swiss Army Django: Small Footprint ETL
coderanger
0
100
Swiss Army Django: Small Footprint ETL (with notes)
coderanger
0
88
Other Decks in Programming
See All in Programming
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
710
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
900
業務でAIを使いたい話
hnw
0
220
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
340
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
300
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
1
210
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
640
ALL CODE BASE ARE BELONG TO STUDY
uzulla
28
6.9k
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
17k
contribution to astral-sh/uv
shunsock
0
570
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
A designer walks into a library…
pauljervisheath
209
24k
The World Runs on Bad Software
bkeepers
PRO
72
11k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Rails Girls Zürich Keynote
gr2m
95
14k
Code Reviewing Like a Champion
maltzj
526
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
210
Being A Developer After 40
akosma
91
590k
GraphQLとの向き合い方2022年版
quramy
49
14k
Become a Pro
speakerdeck
PRO
29
5.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
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