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
Opening - Itamae Meetup#1
Search
Ryota Arai
December 09, 2015
Programming
3.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Opening - Itamae Meetup#1
http://itamae.connpass.com/event/22857/
Ryota Arai
December 09, 2015
More Decks by Ryota Arai
See All by Ryota Arai
Spot Instances in Cookpad #CookpadTechConf 2017
ryotarai
7
9k
Itamae - Infra as Code 現状確認会
ryotarai
55
20k
Introducing Infrataster
ryotarai
9
13k
Infrataster - Infra Behavior Testing Framework #oedo04
ryotarai
17
6.8k
グリーにおけるChef導入事例 ~既存の資産を活かし新しい技術を導入する~
ryotarai
27
7.1k
Other Decks in Programming
See All in Programming
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
240
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
250
RTSPクライアントを自作してみた話
simotin13
0
510
Agentic UI
manfredsteyer
PRO
0
110
AIとRubyの静的型付け
ukin0k0
0
540
GitHub Copilot CLIのいいところ
htkym
2
1.3k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
140
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
840
Oxcを導入して開発体験が向上した話
yug1224
4
290
Claspは野良GASの夢をみるか
takter00
0
170
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
190
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
620
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.9k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
The Limits of Empathy - UXLibs8
cassininazir
1
350
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The browser strikes back
jonoalderson
0
1.1k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
160
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Ethics towards AI in product and experience design
skipperchong
2
300
Transcript
Itamae Meetup #1 Ryota Arai
ߥҪ ྑଠ • ΫοΫύουͷΤϯδχΞ • Πϯϑϥ෦ॴଐ DevدΓͷOps • ItamaeInfratasterͷ࡞ऀ •
@ryotarai (GitHub), @ryot_a_rai (Twi>er)
Itamae • CFEngine • Puppet • Chef • Ansible •
Itamae
Itamae • Chefʹ͔ͭΕͨਓͷͨΊͷߏཧπʔϧ • ChefʹࣅͨRuby DSL • Chefʹൺγϯϓϧ • SSHܦ༝Ͱͷ࣮ߦΛαϙʔτ
• ࣮ߦରʹItamaeΛΠϯετʔϧ͠ͳ͍Ͱ࣮ߦͰ͖Δ
Chef vs Itamae • ֶ͍शίετ • ֮͑Δࣄฑ͕গͳ͍ • খͯ͘͞ϋϚΓͲ͜Ζ͕গͳ͍ •
͍͟ͱͳͬͨΒίʔυΛ͙͢ಡΊΔେ͖͞ • ChefDKͱ͔ͭΒ͍
Chef • Recipes • Cookbooks • Roles • Environments •
Berkshelf
Itamae • Recipes • Cookbooks -> Recipe • Roles ->
Recipe • Environments -> Recipe • Berkshelf -> Gem, Bundler
Itamae # recipe.rb package "nginx" service "nginx" template "/etc/nginx/nginx.conf" do
notifies :restart, "service[nginx]" end $ itamae local recipe.rb $ itamae ssh -h your-server recipe.rb
Itamaeͷݱঢ় • 513 stars • 802 commits • 38 plugin
gems • 35 contributors • ?? users
ͱ͜ΖͰ
Α͍͘ΘΕΔ͜ͱ ʮItamaeͷϩΰͳ͍ΜͰ͔͢ʙʯ
None
·ͱͳͭͰ͖·ͨ͠
None
ࣗ͝༝ʹ͓͍͍ͩ͘͞ github.com/itamae-kitchen/itamae-logos
ؓٳ
࣮ݧతػೳͷհ
Itamaeͷ࣮ݧతػೳ • ࣮ݧతػೳ: ͻΐͬͱͨ͠Βফ͑ͨΓ༷͕มΘͬͨΓ͢Δ͔ • --recipe-graphΦϓγϣϯ • --profileΦϓγϣϯ • Handler
--recipe-graphΦϓγϣϯ
--recipe-graphΦϓγϣϯ • ϨγϐͷґଘؔΛdotܗࣜͰग़ྗͰ͖Δ • include_recipeͨ͠Ϩγϐ • Ϩγϐ܊͕େ͖͘ͳͬͯ͘Δͱศར͔͠Εͳ͍
None
--recipe-graphΦϓγϣϯ Itamae v1.9.0Ҏ߱ʢv1.9.0Ҏલ--dotΦϓγϣϯʣ $ itamae local --recipe-graph /path/to/itamae-graph.dot recipe.rb $
dot -Tpng -o /path/to/itamae-graph.{png,dot}
--profileΦϓγϣϯ
--profileΦϓγϣϯ • ࣮ߦͨ͠ίϚϯυ͝ͱʹ͔͔͕ͬͨ࣌ؒऔಘͰ͖Δ • ݫີʹSpecinfraͷrun_commandʹ͔͔ͬͨ࣌ؒ • JSONͰग़ྗ͞ΕΔ • ϘτϧωοΫͷௐࠪʹ༗ޮ͔͠Εͳ͍
--profileΦϓγϣϯ $ itamae local --profile /path/to/profile.json recipe.rb $ cat /path/to/profile.json
| jq . | head [ { "command": "mkdir -p /tmp/itamae_tmp", "duration": 0.0037856101989746094 }, { "command": "chmod 777 /tmp/itamae_tmp", "duration": 0.0025980472564697266 }, {
--profileΦϓγϣϯ
Handler
Handler • ࣮ߦ࣌ͷΠϕϯτΛड͚औͬͯҙͷॲཧΛߦ͏ • action_started, attribute_updatedͳͲ • ChefͷHandlerʹࣅ͍ͯΔ • ಠࣗͷHandlerॻ͚Δ
• ࣮ݧతػೳͱ͍͏Ґஔ͚ͮɻͻΐͬͱ͢Δͱ༷͕มߋ͞ΕΔ ͔
$ cat config.yml handlers: - type: json path: /path/to/itamae-log.json $
itamae local -c config.yml recipe.rb $ cat /tmp/itamae-log.json | head {"time":"2015-12-08T15:47:55+09:00","event":"recipe_started", "payload":{"path":"/Users/ryota-arai/src/github.com/ryotarai/itamae/tmp/recipe.rb"}} {"time":"2015-12-08T15:47:55+09:00","event":"resource_started", "payload":{"resource_type":"execute","resource_name":"echo included"}} {"time":"2015-12-08T15:47:55+09:00","event":"action_started", "payload":{"action":"run"}} {"time":"2015-12-08T15:47:55+09:00","event":"attribute_changed", "payload":{"from":{"executed":false}, "to":{"action":"run","command":"echo included","executed":true}}}
Handler • debug handler • ϩάग़ྗ • json handler •
JSON per lineͰϑΝΠϧग़ྗ • fluentd handler • fluent-loggerͰFluentdʹग़ྗ
Handler Gem • lib/itamae/handler/<handler type>.rb͕ࣗಈతʹ require͞ΕΔ • itamae-handler-<type> gemΛͭͬͯ͘Gemfileʹॻ͍͓ͯ ͚ͩ͘ͰOK
Handler Gem # lib/itamae/handler/mail.rb module Itamae module Handler class Mail
< Base def event(type, payload = {}) super send_mail(subject: type.to_s, body: payload.inspect) end end end end
Handler Gem • ৄ͘͠ h$ps:/ /github.com/itamae-kitchen/itamae/tree/ master/lib/itamae/handler Λ
CookpadͱItamae
CookpadͰͷϫʔΫϑϩʔ • Jenkins͕Git্ͷϨγϐΛtar.gzʹ͔ͨΊͯS3ʹΞοϓϩʔυ • ֤ϗετͰS3͔Βμϯϩʔυ͠ItamaeΛ࣮ߦ͢Δckpd- itamaeίϚϯυΛ༻ҙ͍ͯ͠Δ • itamae sshւΛ͑Δͱॏ͍ͷͰϩʔΧϧ࣮ߦΛ͍ͬͯ Δ
• omnibus-itamaeͷdebύοέʔδΛར༻͍ͯ͠Δ
omnibus-itamae • Chef͕ࣾ։ൃ͍ͯ͠ΔOmnibusͱ͍͏ύοέʔδϯάπʔϧΛ ͬͯdeb, rpmύοέʔδΛ࡞ • /opt/itamaeҎԼʹRubyຊମؚΊͯΠϯετʔϧ͞ΕΔ • fat͚ͩͲɺsystem rubyͷόʔδϣϯʹࠨӈ͞Εͳ͍
• Fluentdʹ͓͚Δtd-agentͷΑ͏ͳͷ
omnibus-itamae • ϏϧυࡁΈύοέʔδˏBintray • Ubuntu 14.04, CentOS 7༻ • खݩͰϏϧυՄೳ
$ echo 'deb https://dl.bintray.com/itamae/itamae trusty contrib' | sudo tee /etc/apt/sources.list.d/itamae.list $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv D401AB61 $ sudo apt-get update $ sudo apt-get install itamae
՝ • ϨγϐΛมߋͨ͠ࡍʹશʹө͢ΔΘ͚Ͱͳ͍ • Ϩγϐͱϗετͷݱঢ়͕Εͯɺ͕ࠩେ͖͘ͳΔ • applyͨ͠ΒࢥΘ͵มߋͰোʹͳͬͨΓ • ಛఆͷϗετ͚ͩઃఆ͕ҟͳ͍ͬͯͯো͕ىͬͨ͜Γ •
ϦεΫ͕େ͖͘ͳΔ
Itamae Server • ݱࡏ։ൃதʢҰԠΦʔϓϯιʔεʹͳ͍ͬͯΔʣ • Itamaeͷ࣮ߦͱϩάͷӾཡ͕Ͱ͖Δαʔό • Itamae࣮ߦ෦ʢBackendʣࠩ͠ସ͑Մೳ • HandlerΛ͔ͭͬͯϩάૹ৴
• itamae-handler-itamae_server
None
ߏྫ
Itamae Server • ItamaeΛ࣮ߦ͢ΔBackendࠩ͠ସ͑Մೳ • ྫ͑ɺConsulɺSSHɺStretcherͳͲ • ඇಉظͰitamae-handler-itamae_server͕ϩάΛItamae Serverʹ ૹ৴͢Δ
Itamaeͷࠓޙ • όάϑΟοΫεɺػೳՃ • ֶशίετΛ্͛ͣεϞʔϧελʔτͰ͖ΔΑ͏ʹҡ࣋ • Itamae v2ʢ༧ఆʣ • ϦϑΝΫλɺॻ͖͠ʢಛʹResource::BaseΛࣺ͍ͯͨʣ
• ϨγϐɺϓϥάΠϯͷޙํޓੑҡ࣋ • όοΫΤϯυΛinfra_operatorҠߦ͢Δ͔
ϑΟʔυόοΫΛٻΊ͍ͯ·͢ • Twi%erͰ@ryot_a_rai • Slack: h%ps:/ /itamae-slackin.herokuapp.com/ • Issue: h%ps:/
/github.com/itamae-kitchen/itamae/issues • PR: h%ps:/ /github.com/itamae-kitchen/itamae/pulls