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
Serverspec at JTF2014
Search
Gosuke Miyashita
PRO
June 22, 2014
Technology
16
6.4k
Serverspec at JTF2014
Gosuke Miyashita
PRO
June 22, 2014
Tweet
Share
More Decks by Gosuke Miyashita
See All by Gosuke Miyashita
Serverspec(をつくった自分)のそれまでとその後
mizzy
PRO
8
3.1k
A method for separating policy definition and behavior control by an intermediate language to achieve optimal server configuration management according to the situation
mizzy
PRO
3
250
Past and future of Infrastructure as Code
mizzy
PRO
0
170
Configuration Managementツールのポリシー定義用中間言語に関する考察/Considerations about an intermediate language of configuration management tools
mizzy
PRO
0
440
Infrastructure as Codeのこれまでとこれから/Infra Study Meetup #1
mizzy
PRO
29
13k
エンジニアかつ研究者としての今後のキャリアについて/My Career As An Engineer And A Researcher
mizzy
PRO
0
390
Compare OCI Runtimes
mizzy
PRO
2
1.5k
Serverspec and OSS at IEICE Society Conference 2018
mizzy
PRO
2
290
House Meetup
mizzy
PRO
7
3.2k
Other Decks in Technology
See All in Technology
一人QA時代が終わり、 QAチームが立ち上がった話
ma_cho29
0
290
職種に名前が付く、ということ/The fact that a job title has a name
bitkey
1
240
LINEギフトのLINEミニアプリアクセシビリティ改善事例
lycorptech_jp
PRO
0
240
Symfony in 2025: Scaling to 0
fabpot
2
190
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
20k
Road to SRE NEXT@仙台 IVRyの組織の形とSLO運用の現状
abnoumaru
0
390
AIエージェントキャッチアップと論文リサーチ
os1ma
6
1.2k
React Server Componentは 何を解決し何を解決しないのか / What do React Server Components solve, and what do they not solve?
kaminashi
6
1.2k
大規模プロジェクトにおける 品質管理の要点と実践 / 20250327 Suguru Ishii
shift_evolve
0
280
IAMのマニアックな話 2025 ~40分バージョン ~
nrinetcom
PRO
8
920
ひまプロプレゼンツ 「エンジニア格付けチェック 〜春の公開収録スペシャル〜」
kaaaichi
0
130
頻繁リリース × 高品質 = 無理ゲー? いや、できます!/20250306 Shoki Hyo
shift_evolve
0
150
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
41
2.6k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Designing for Performance
lara
606
69k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
25k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
500
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
470
The Pragmatic Product Professional
lauravandoore
33
6.5k
How GitHub (no longer) Works
holman
314
140k
Transcript
ServerspecʹݟΔ ٕज़τϨϯυΛ ੜΈग़͢ώϯτ
ࣗݾհ 4 ٶԼ ߶ี 4 http://mizzy.org/ 4 mizzy@github 4 gosukenator@twitter
4 ϑϦʔϥϯεΤϯδχΞ/Serverspec Operations
ΞδΣϯμ 4 ࠷ۙͷΠϯϑϥܥٕज़τϨϯυ 4 Serverspecͱ 4 Serverspec͕ੜ·Εͨഎܠ 4 Serverspecͷೝ 4
ServerspecͷޭཁҼ 4 ·ͱΊ
࠷ۙͷΠϯϑϥؔ࿈ٕज़ τϨϯυৼΓฦΓ
: OS͔ΒϛυϧΣΞ ͱ͍ͬͨιϑτΣΞϨΠϠʔΛ ࢦ͢ݴ༿ͱͯ͠ͷΠϯϑϥͰ͢
Πϯϑϥؔ࿈ٕज़τϨϯυ 4 αʔόߏཧπʔϧ 4 Chefਓؾ 4 ࠓʹͳͬͯ4݄,5݄ͱཱͯଓ͚ʹॻ੶ൃץ 4 USͰ2014ʹPuppetͷγΣΞΛ͑ͨΒ͍͠ 4
Ansible 4 ChefͷΧϯλʔ
Πϯϑϥؔ࿈ٕज़τϨϯυʢ͖ͭͮʣ 4 ԾԽؔ࿈πʔϧ 4 Vagrant 4 Docker 4 ςετۦಈΠϯϑϥͱΠϯϑϥCI 4
Test Kitchen 4 Serverspec
Πϯϑϥؔ࿈ٕज़τϨϯυʢ͖ͭͮʣ 4 Immutable Infrastructure 4 Trash Your Servers and Burn
Your Code: Immutable Infrastructure and Disposable Components 4 WEB+DB PRESS Vol.81
ςετۦಈΠϯϑϥ ΠϯϑϥCI
None
ςετۦಈΠϯϑϥ/ΠϯϑϥCI 4 ΞϓϦέʔγϣϯ։ൃͷख๏ΛΠϯϑϥߏஙʹԠ༻ 4 @riywo͘Μ͕2012ʹΠϯϑϥCIʹ͍ͭͯॻ͍ͯΔ 4 http://blog.riywo.com/2012/05/27/145310 4 ࣗࣗߏ2007͙Β͍͔Β͋ͬͨ 4
ʮςετۦಈαʔόߏஙʯͱ͍͏ݴ༿Λߟ͍͑ͯͨ 4 http://d.hatena.ne.jp/dayflower/ 20070405/1175782564#c
ςετۦಈΠϯϑϥ/ΠϯϑϥCI 4 Ҏલ͔Β֓೦͋ͬͨͱ͍͑ʮΠϯϑϥΛςετՄೳʹ ͢Δʯͱ͍͏ੈքΛ͛ͨͷServerspec 4 ୯ʹςετՄೳʹ͢Δ͚ͩͰͳ͘ɺGitHub FlowʹΑΓ ΠϯϑϥมߋΛϓϧϦΫΤετ͠ɺCIαʔόʹΑΓܧଓత ʹςετ͢Δɺͱ͍͏ੈքΛ։͍ͨ
None
Serverspec
Serverspecͱ 4 20133݄ʹϦϦʔε 4 RSpecͰαʔόͷঢ়ଶΛςετ 4 ຊ࣭αʔόͷঢ়ଶΛهड़ͨ͠ίʔυΛςετ 4 PuppetϚχϑΣετChefϨγϐͳͲ 4
Πϯϑϥίʔυͷ։ൃϦϑΝΫλϦϯάΛޮྑ͘ߦ͏ ͨΊͷπʔϧ
ServerspecʹΑΔςετίʔυ describe package('nginx') do it { should be installed }
end describe service('nginx') do it { should be_enabled } it { should be_running } end
Serverspecͷεϖϧ 4 ਖ਼ 4 Serverspec/serverspec/SERVERSPEC 4 ޡ 4 ServerSpec/Server Spec
Serverspecͳͥ ੜ·Εͨͷ͔ʁ
ςετπʔϧ։ൃͷ͖͔͚ͬ 4 2006ʹPuppetΛ͍࢝Ίͨ 4 αʔόߏஙPuppetʹΑͬͯࣗಈԽͰ͖ͨ 4 ͡Ό͋࣍ߏஙޙͷνΣοΫΛࣗಈԽ͍ͨ͠ 4 ExcelνΣοΫγʔτͰͷࢹ֬ೝΊ͍ͨ
Assurer 4 2007ʹͭͬͨ͘PerlαʔόςετϑϨʔϜϫʔΫ 4 ϓϥάΠϯͰ֦ுՄೳ 4 PlaggerͷӨڹ 4 Filter, Format,
Notify, Publish, Test 4 make testͰςετΛ࣮ߦ/TAPܗࣜͰ݁Ռग़ྗ 4 CPAN AuthorͳͷͰPerlͰͷςετͷΓํΛ౿ऻ
AssurerͷഊҼ 4 Serverspecͱҧ͍ৼΔ͍Λςετ 4 ঢ়ଶͷςετΑΓཁ͕݅ෳࡶ 4 ཉுͬͯ৭ʑ٧ΊࠐΈ͗ͯ͢ߋʹෳࡶʹͳͬͨ 4 ϑΣʔζ͚/ϓϥΨϒϧ/ࢄॲཧ/γΣϧ 4
ίϯηϓτ͕Serverspec΄Ͳ໌֬Ͱͳ͔ͬͨ 4 ։ൃऀͰ͋Δࣗ͢ΒΘͳ͍ͷʹͳͬͨ
AssurerҎޙ 4 ࣌ʑࢥ͍ฦ͢͜ͱ͚͋ͬͨͲੵۃతʹԿ͔͠Α͏ͱ͠ ͳ͔ͬͨ 4 ݱ͔ΒएׯڑΛஔ͍͍ͯͯɺPuppetͳͲͦΜͳʹ৮ Βͳ͘ͳͬͨ
·ͨPuppet͞ΘΓ͡Ίͨ 4 ͕͔ࣗͭͯॻ͍ͨPuppetϚχϑΣετ͕ϨΨγʔίʔυ ʹͳ͍ͬͯͨ 4 ϦϑΝΫλϦϯάͨ͘͠ͳͬͨ 4 ϦϑΝΫλϦϯά͢ΔͳΒવςετ͕ඞཁͩ͠CIΓ ͍ͨ
Πϯϑϥςετͷલ४උ 4 ΠϯϑϥCIΖ͏ͱࢥͬͯɺ·ͣCIΛ࣮ߦ͢ΔڥΛ ͑ͨ 4 LXCίϯςφͰςετ͢ΔͨΊʹɺίϯςφΛͬ͘͞ͱͭ ͘ΕΔPuppetϚχϑΣετॻ͍ͨ 4 ͪΐ͏Ͳಉ͡λΠϛϯάͰDocker͕ग़͖ͯͯແ༻ͷ ʹͳͬͨ
ςετπʔϧ୳͠ 4 ڥॲ͕͍ͭͨͷͰ࣍ςετπʔϧ 4 ·ͣطଘͷͷͰΑ͛͞ͳͷ͕ͳ͍͔୳ͨ͠ 4 rspec-puppet͙Β͍͔͠PuppetͰ͑Δͷͳ͞ ͦ͏ 4 Chefपลͷํ͕ॆ࣮
4 ChefSpec, Test Kitchen, Cucumber-Chef, minitest-chef-handler
ࣗલͰͭ͘Δ͜ͱʹͨ͠ 4 ͨͩ͠rspec-puppet͖ͪΜͱϞδϡʔϧԽ͞Ε͍ͯͳ ͍ͱ͑ͳ͍ 4 ࣗͷϚχϑΣετϞδϡʔϧԽ͞Εͯͳ͍ϨϕϧͷϨ Ψγʔ͞ 4 rspec-puppet࣮ࡍͷαʔόͷঢ়ଶΛςετ͢ΔΘ͚ ͡Όͳ͍
4 ͡Ό͋ࣗͰ࡞Δ͔ɺͬͯ͜ͱʹ
Serverspecੜ 4 ࣌ͷಉ྅(@hiboma)͕LXCͷίϯςφΛςετ͢Δίʔ υΛRSpecͰॻ͍͍ͯͨ 4 Α͠ɺͦΕύΫͬͯ൚༻తʹ͑ΔΑ͏͠Α͏ 4 ϓϩτλΠϓΛҰͰͭ͘Γɺཌʹrubygems.orgͰ ެ։
ॳظͷServerspec 4 ࠷ॳRedHatܥLinuxͷΈରԠɺSSHόοΫΤϯυͷΈɻ ExecόοΫΤϯυͳ͔ͬͨɻ 4 @tkmr͞Μ͕ෳOSରԠͱDebianରԠͯ͘͠Εͨ 4 @raphink͞Μ͕όοΫΤϯυΓସ͑ରԠͯ͘͠Εͨ 4 ͜Μͳײ͡Ͱ৭ΜͳਓΛר͖ࠐΜͩ
Serverspecͦͷޙ 4 Star: 738, Fork: 149, Contributors: 69 4 ରԠOS૿͑ͨΓɺαϙʔτ͢Δػೳ૿͑ͨΓ
4 ݱࡏv2.0ʹ͚ͨ࡞ۀத 4 ΑΓ֦ு͘͢͢͠ΔͨΊͷϦϑΝΫλϦϯά͕ϝΠϯ
ຊʹ͘ ΘΕͯΔͷʁ
Serverspecͷೝ 4 Black Duck Open Source Rookies of the Year
2013 4 Docker, InfluxDB, AppiumͱฒΜͰड 4 Thought Works Technology Radar 2014 4 Provisioning Testingͷ߲ʹServerspecͷจࣈ͕ग़ ͯ͘Δ 4 rubygems.orgͰͷμϯϩʔυ30ສ 4 Chef͕400ສ
None
ࡶࢽʹ͓͚Δݴٴ 4 WEB+DB PRESS Vol.75 4 WEB+DB PRESS Vol.76 4
WEB+DB PRESS Vol.80 4 WEB+DB PRESS Vol.81
None
ॻ੶ʹ͓͚Δݴٴ 4 Test-Driven Infrastructure with Chef, 2nd Edition 4 Chef׆༻ΨΠυ
4 νʔϜ։ൃ࣮ફೖ 4 Chef࣮ફೖ 4 ύʔϑΣΫτRuby on Rails
None
None
None
None
None
ւ֎ͰͷԠ
None
None
None
None
None
None
ͳͥServerspec ޭͨ͠ͷ͔ʁ
ೳಈతͳཁҼ
ผྖҬͰޭ͍ͯ͠ΔϓϥΫςΟε Λ࣋ͪࠐΉ 4 ιϑτΣΞ։ൃͷੈքͷϓϥΫςΟε 4 ςετۦಈ։ൃ 4 ܧଓతΠϯςάϨʔγϣϯ 4 ಉ͡༻ޠ͏ͱΠϝʔδ͍͢͠
4 ςετۦಈΠϯϑϥ/ΠϯϑϥCI
໊લॏཁ 4 Server + RSpecͱ͍͏ٿͳ໊લ 4 ໊લ͔ΒԿΛ͢Δͷͳͷ͔͕ྨਪ͍͢͠ 4 ͍֮͑͢
ӳޠυΩϡϝϯτ 4 ຊࠃ֎Ͱ͘ೝͯ͠Β͓͏ͱࢥͬͨΒɺ͜Εେ લఏ 4 READMEserverspec.orgͳͲ࠷ॳ͔ΒӳޠͰॻ͍ͨ
ϝδϟʔͳΩʔϫʔυ/ϓϩμΫτ ʹͷ͔ͬΔ 4 PuppetChefͱ͍ͬͨϫʔυΛࢄΓΊΔ 4 ࣮ࡍʹؔ࿈͢Δπʔϧͩ͠ 4 PuppetChefͷதͷਓʹरΘΕͯɺ൴Β͕πΠʔτ͢Δ ͜ͱͰ·ͬͨײ
υΩϡϝϯτͷΘ͔Γ͢͞ 4 ӳޠͰυΩϡϝϯτΛॻ͍ͯɺϝδϟʔͳϫʔυࢄΓΊ ͯϦʔνϟϏϦςΟߴΊΔ͚ͩͰ·ͩෆे 4 ͬ͟ͱࣼΊಡΈ͚ͨͩ͠ͰԿ͕Ͱ͖Δπʔϧͳͷ͔͙͢ʹ Θ͔ΔΑ͏ʹ͢Δͷ͕ॏཁ 4 ͙͢ʹΘ͔Βͳ͍ͱɺڵຯΛࣦͬͯ͞ΕɺೋͱΒ ͳ͍͔͠Εͳ͍
πʔϧࣗମͷγϯϓϧ͞ 4 υΩϡϝϯτΛΘ͔Γ͘͢͢ΔͨΊʹɺπʔϧͦͷ ͷ͕γϯϓϧͰΘ͔Γ͍͢ඞཁ͕͋Δ 4 ServerspecςετͷΈʹಛԽͨ͠ 4 ଞͷπʔϧʹ͋Δߏཧπʔϧͱͷ࿈ܞVMͷૢ࡞ ল͍ͨ 4
Ώ͑ʹγϯϓϧͰΘ͔Γ͍͢
γϯϓϧ͚ͩͲ֦ு͍͢͠ 4 جຊతͳػೳ͋·Γ૿͞ͳ͍ํ 4 ͨͩ͠ϓϩάϥϜΛॻ͍֦ͯுͯ͘͢͠͠Δ 4 ଞͷπʔϧͱΈ߹Θ͍ͤ͢ 4 UNIXֶ 4
Keep It Simple, Stupid
ଞπʔϧͱͷΈ߹Θͤ 4 busser-serverspec 4 beaker-rspec 4 vagrant-serverspec 4 sensu-community-plugins/plugins/serverspec
ΤʔδΣϯτϨε 4 ͍͘ΒศརͰɺαʔόʹ৭ʑೖΕΔͷݏͰ͢ΑͶʁ 4 ServerspecςετΛ࣮ߦ͢ΔϚγϯʹRuby͕͋ΕOK 4 ςετରͷϚγϯʹSSHͰΞΫηεͰ͖ΕOK 4 Ruby͢Βඞཁͳ͍
͏·ͰͷෑډΛԼ͛Δ 4 ServerspecRuby 1.8.7Ҏ߱Λαϙʔτ 4 RedHat 6ܥͷύοέʔδΠϯετʔϧͰೖΔRubyʹରԠ 4 ผ్RubyΛμϯϩʔυͯ͠ίϯύΠϧɺͳͲ͢Δඞ ཁ͕ͳ͍
4 serverspec-initίϚϯυ 4 ίϚϯυҰൃͰͻͳܗΛੜ͙ͯ͢͠ʹࢼͤΔ
ࣗҰਓͰΓ͗͢ͳ͍ 4 ͕ࣗ͏ػೳ͔͠جຊతʹ࣮͠ͳ͍ 4 γϯϓϧʹอͭ͏͑Ͱେࣄ 4 ཉ͍͠ػೳ͕͋ΕࣗͰ࣮ͯ͘͠Εɺͱ͍͏ελϯε 4 OSSͳͷͰ 4
݁Ռͱͯ͠ଟ͘ͷਓΛר͖ࠐΊͨ
ೳಈతཁҼ·ͱΊ 4 ଞྖҬͷϓϥΫςΟεΛ࣋ͪࠐΉ 4 ໊લυΩϡϝϯτॏཁ 4 ϝδϟʔͳϓϩμΫτʹ͔ͬΔ 4 γϯϓϧ͔֦ͭுՄೳ 4
͏ෑډΛԼ͛Δ 4 ଞऀΛר͖ࠐΉ
ٕज़τϨϯυཁҼ
αʔόߏཧπʔϧͷख़ 4 Puppetొ͔Β9 4 Chefొ͔Β5 4 ΈΜͳ͕ͦͷ࣍Λݟਾ͑ͩͨ͠
Vagrantͷීٴ 4 ςετΛ࣮ߦ͢ΔͨΊʹखݩͰVMΛಈ͔ͤΔํ͕ḿΔ 4 VagrantʹΑΓखݩͰςετίʔυΛॻ͍࣮ͯߦ͢Δڥ ͕ͭ͘Γ͘͢ͳͬͨ
Chefք۾ͰͷςετͷΓ্͕Γ 4 ݩʑChefք۾ͷਓͨͪςετʹର͢Δҙ͕ࣝߴ͔ͬͨ 4 ChefSpec, Test Kitchen, Cucumber-Chef, minitest- chef-handlerͳͲςετܥπʔϧChefք۾͕ॆ࣮
JenkinsCI as a Serviceͷීٴ 4 Jenkins͕։ൃͷੈքͰͨΓલͷΑ͏ʹΘΕ͍ͯΔ 4 CI as a
Serviceͷීٴ 4 Travis, CircleCI, Drone, WerckerͳͲ
GitHubͷීٴ 4 GitHubͰΠϯϑϥίʔυΛཧ 4 ϓϧϦΫΤετϕʔεͰมߋ 4 CI as a Serviceͱͷ࿈ܞ
4 ςετۦಈΠϯϑϥ/CIͱ૬ੑ͕ྑ͍
ٕज़τϨϯυཁҼ·ͱΊ 4 ߏཧ+ԾԽ+ςετ+CIͱ͍͏τϨϯυ 4 GitHub͕͜ͷτϨϯυΛߋʹޙԡ͠ 4 ԾԽɺߏཧɺCIʹ͍ͭͯఆ൪͕Ͱ͖ͯͨ 4 ςετπʔϧܾఆ൛͕ͳ͔ͬͨ 4
ͦ͜ʹServerspec͕·ͬͨ 4 ͦΕʹΑΓ͜ͷτϨϯυΛߋʹՃͤ͞Δ͜ͱʹͳͬͨ
·ͱΊ
ServerspecͷޭཁҼ 4 ଞྖҬͰޭ͍ͯ͠ΔϓϥΫςΟεΛ࣋ͪࠐΉ 4 ςετۦಈ։ൃ/ܧଓతΠϯςάϨʔγϣϯ 4 ࠷ॳ͔ΒීٴΛҙࣝͨ͠׆ಈ 4 ໊લɺυΩϡϝϯτɺϝδϟʔϓϩμΫτʹͷ͔ͬΔ 4
γϯϓϧ͔֦ͭுՄೳʹ 4 UNIXֶ/Keep It Simple, Stupid
ServerspecͷޭཁҼ 4 ͑ͯ伱Λͭͬͯ͘ਓΛר͖ࠐΉ 4 τϨϯυʹͷ͔ͬΔ 4 ߏཧ+ԾԽ+ςετ+CI 4 ςετπʔϧҎ֎ͷఆ൪طʹ͋ͬͨ 4
伱ؒΛຒΊͨͷ͕Serverspec
ServerspecͷޭཁҼ 4 Өڹྗͷ͋ΔਓʹϦʔν͢Δ 4 ࠃͰҏ౻ࢯͷϒϩάΤϯτϦࡶࢽهࣄͷӨڹ ͕େ͖ͦ͏
ServerspecͷޭཁҼ 4 ٕज़τϨϯυΛੜΉͱ͔ߟ͑ͳ͍ 4 ੜ͏ͱࢥͬͯੜΊΔͷͰͳ͍ 4 ͕ࣗཉ͍͠ͷɺ͓͠Ζ͍ͱࢥ͏ͷΛࣗͷͨΊʹ ͭ͘Δ 4 ਓྨͷٕज़ൃలͨΊͷແঈ։ൃɺͱ͍͏ελϯεͰ͍
͍ͷͰ͖ͳ͍
·ͱΊ 4 ٕज़τϨϯυΛੜΈग़ۙ͢ಓͳ͍ 4 গͳ͘ͱࣗΒͳ͍ 4 ͕ͨͩࣗཉ͍͠ͷɺ͓͠Ζ͍ͱ͓͏ͷΛͭ͘Δ/ ެ։͢Δ 4 ͦͷੵΈॏͶ͕ૉΒ͍͠ͷΛੜΉ͜ͱʹͭͳ͕Δ
4 ͕ࣗͭͬͯ͘ެ։ͨ͠ͷɺখ͞ͳͷؚΊͯ100 Ҏ্͋Δ
Shut the fuck up and write some code Openness is
our driver for excellence ೭ऀෆ೭ऀ೭ऀෆᒜ೭ऀ