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
開発するように運用するインフラ JAWS DAYS 2015
Search
mdoi
March 22, 2015
56
15k
開発するように運用するインフラ JAWS DAYS 2015
mdoi
March 22, 2015
Tweet
Share
More Decks by mdoi
See All by mdoi
Sensu と PagerDuty を使って眠れない日々を実装する
mdoi
11
2.8k
Pull Request ベースのインフラ運用と Cookbook CI
mdoi
23
3k
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
For a Future-Friendly Web
brad_frost
175
9.4k
Unsuck your backbone
ammeep
668
57k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
A Tale of Four Properties
chriscoyier
156
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
How to Ace a Technical Interview
jacobian
276
23k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Transcript
։ൃ͢ΔΑ͏ʹӡ༻͢Δ Πϯϑϥ ,BJ[FO1MBUGPSN*ODɹډɹਖ਼ߦ +"84%":4
ࣗݾհ ډɹਖ਼ߦ (@m_doi) Kaizen Platform Inc ΠϯϑϥΤϯδχΞ • ͜Ε·Ͱ •
ϑΟʔνϟʔϑΥϯͷιϑτΣΞ։ൃ • SNS/ιγϟήܥͷωοτϫʔΫ / αʔόΤϯδχΞ • ࢹγεςϜɺӡ༻ͷͨΊͷιϑτΣΞ։ൃ • ͓ؾʹೖΓͷAWSαʔϏε • DynamoDB ͱ Kinesis
ࠓͷ͓ • Kaizen Platform ͷ։ൃଆͷϫʔΫϑϩʔ • Kaizen Platform ͷӡ༻ଆͷϫʔΫϑϩʔ •
͜ΕΒͷϫʔΫϑϩʔʹࠐΊͨࢥ • ͓·͚
None
EC2 Instance VPC ELB Route 53 S3 Glacier CloudFront RDS
ElastiCache DynamoDB
• ཧը໘ • A/Bςετ࣮ߦ༻ͷ JavaScript ͷ৴ • A/Bςετͷܭଌ
None
None
None
։ൃଆͷϫʔΫϑϩʔ
• Work In Progress Ͱ Pull Request • ։ൃ •
ϨϏϡʔ • QA • ຊ൪ϦϦʔε ։ൃϓϩηε
• Work In Progress Ͱ Pull Request • ։ൃ •
ϨϏϡʔ • QA • ຊ൪ϦϦʔε ։ൃϓϩηε
master QA ຊ൪ ։ൃϒϥϯν 2"ϓϩηε։࢝ ຊ൪ڥʹσϓϩΠ ։ൃϓϩηε
Pull Request
ϨϏϡʔґཔ Pull Request ͷ ID Λఴ͑ͯϨϏϡʔґཔ
ϨϏϡʔ PRͰɺҙΛఴ͑ͯϨϏϡΞʔʹϝϯγϣϯ
ϨϏϡʔ
• Work In Progress Ͱ Pull Request • ։ൃ •
ϨϏϡʔ • QA • ຊ൪ϦϦʔε ։ൃϓϩηε
master QA ຊ൪ ։ൃϒϥϯν 2"ϓϩηε։࢝ ຊ൪ڥʹσϓϩΠ ϦϦʔεϓϩηε
ϦϦʔεϓϩηε E2E Test Deploy Unit Test
• CI ͷ SaaS • fooϒϥϯνʹpushͨ͠Βbar͢Δ • foo, bar ͷ෦Λࡉ੍͔͘ޚՄೳ
• ୯७ͳίϚϯυΛ࣮ߦ͢Δ • ࣗ࡞ͨ͠ҙͷγΣϧεΫϦϓτΛ࣮ߦ͢Δ CircleCI
• CI ͷ SaaS • fooϒϥϯνʹpushͨ͠Βbar͢Δ • foo, bar ͷ෦Λࡉ੍͔͘ޚՄೳ
• ୯७ͳίϚϯυΛ࣮ߦ͢Δ • ࣗ࡞ͨ͠ҙͷγΣϧεΫϦϓτΛ࣮ߦ͢Δ CircleCI ͭ·ΓɺGitHub ͷ ҙͷϒϥϯνͷ push Λܖػʹɺ ༷ʑͳϫʔΫϑϩʔΛఆٛͰ͖Δɻ
ϦϦʔεϓϩηε master ϒϥϯνͷ push Λܖػʹ Unit Test Λ࣮ߦ e2e ϒϥϯνͷ
push Λܖػʹ E2E Test Λ࣮ߦ E2E Test Deploy Unit Test deploy ϒϥϯνͷ push Λܖػʹ Deploy Λ࣮ߦ
ϦϦʔε࡞ۀ։࢝ σϓϩΠ༻ͷ Pull Request Λ࡞ νϟοτͰίϚϯυΛୟ͘ͱͬͯ͘ΕΔ
ϦϦʔε࡞ۀ QAڥʹσϓϩΠ͞ΕΔ ಉ࣌ʹຊ൪σϓϩΠͷ Pull Request ͕࡞͞ΕΔ
ϦϦʔε࡞ۀ ຊ൪σϓϩΠͷ Pull Request ʹνΣοΫϦετ͕Ͱ͖Δ ͦΕͧΕͷίϛοτͷಈ࡞֬ೝΛऴ͑ͨΒνΣοΫΛ͚Δ
E2E ςετ headless browser ͰγφϦΦΛςετ
E2E ςετ QAڥͰ࣮ࢪ
E2E ςετ ΠϯϑϥΤϯδχΞνϟοτ͔Β؆୯ʹ࣮ߦͰ͖Δ ͜Ε͕ޙʑʹཱͭ
ϦϦʔε࡞ۀ ͯ͢ͷ֬ೝ࡞ۀ͕ऴΘΔͱɺ ຊ൪σϓϩΠ༻ͷϒϥϯνΛmerge ຊ൪ڥʹσϓϩΠ͕։࢝͞ΕΔ
ϒϥϯνͷ push/merge ΛτϦΨʹ master QA ຊ൪ ։ൃϒϥϯν Unit Test ͕Δ
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ 2"ϓϩηε։࢝NBTUFS2"ͷ1VMM3FRVFTU࡞NFSHF 2"ڥʹσϓϩΠ
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ ֤ࣗɺಈ࡞֬ೝ &&ςετ࣮ߦ
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ 2"ຊ൪ͷ1VMM3FRVFTUΛNFSHF ຊ൪ڥʹσϓϩΠ
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ ֤ࣗɺಈ࡞֬ೝ &&ςετ࣮ߦ
• GitHub Λத৺ͱͨ͠։ൃϑϩʔ • CircleCI Λத৺ͱͨ͠ϦϦʔεϑϩʔ • GitHub ͱ CircleCI
ͱ νϟοτͷૢ࡞ Ͱ݁ ·ͱΊΔͱ
ӡ༻ଆͷϫʔΫϑϩʔ
ߏཧ
• Work In Progress Ͱ Pull Request • ߏมߋΛ Chef
recipe ʹམͱ͜͠Ή • ϨϏϡʔ • ߏஙςετ • ຊ൪ద༻ ӡ༻ϓϩηε
ߏཧ
ߏཧ 1. recipe ͷ࡞ 2. push 3. ࢼݧߏஙٴͼServerspec ʹΑΔݕূ 4.
ߏங༻ϒϥϯν ͷ merge Λܖػʹ ຊ൪ڥʹద༻
ߏཧ 1. recipe ͷ࡞ 2. push 3. push Λܖػʹࢼݧߏஙٴͼ Serverspec
ʹΑΔݕূ 5. ߏங༻ϒϥϯνͷ merge Λܖػʹ ຊ൪ڥʹద༻ 4. νϟοτͰ ߏங༻ϒϥϯνͷ merge Λࢦࣔ
ߏมߋΛมߋΛ Chef recipe ʹམͱ͜͠Ή ߏཧ
ߏมߋΛมߋΛ Chef recipe ʹམͱ͜͠Ή ߏཧ
push ͯ͠ CI Λ࣮ߦ & ͳ͚Ε master merge ߏཧ
Chat Ͱߏங༻ϒϥϯνͷ merge Λࢦࣔ ߏཧ
ߏཧ hubot ͕ ߏங༻ pull request Λ࡞Δ
ߏཧ hubot ͕ ߏங༻ pull request Λ࡞Δ
มߋͷৄࡉͯ͢pull request ͷதʹΔ ߏཧ
࡞ۀͷৄࡉͯ͢νϟοτͱCircleCIʹΔ ߏཧ
࡞ۀͷৄࡉͯ͢νϟοτͱCircleCIʹΔ ߏཧ
ߏཧ ࡞ۀͷৄࡉͯ͢νϟοτͱCircleCIʹΔ
ߏมߋޙͷE2E ςετ େ͖ͳߏมߋΛՃ͑ͯɺෆ҆ͳ߹ E2EςετΛࣗͰճͯ͠ɺαʔϏεͷਖ਼ৗੑΛ֬ೝ
ߏมߋޙͷE2E ςετ େ͖ͳߏมߋΛՃ͑ͯɺෆ҆ͳ߹ E2EςετΛࣗͰճͯ͠ɺαʔϏεͷਖ਼ৗੑΛ֬ೝ ΠϯϑϥΤϯδχΞతࢹͰɺ͜Ε͕ͱͯศར ΠϯϑϥΤϯδχΞ͚ͩͰɺ ͋ΔఔαʔϏεͷਖ਼ৗੑ͕֬ೝͰ͖Δ
ϒϥϯνͷ push/merge ΛτϦΨʹ master QA ຊ൪ ։ൃϒϥϯν ࢼݧߏங / Serverspec
ʹΑΔCI
ϒϥϯνͷ push / merge ΛτϦΨʹ master cook/QA DPPLຊ൪ ߏมߋΛ2"ڥʹద༻ͯ֬͠ೝ NBTUFSDPPL2"ͷ1VMM3FRVFTU࡞NFSHF
2"ڥʹ৽͍͠SFDJQFͰDPPL hubot cook run qa-***
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ ֤ࣗɺಈ࡞֬ೝ &&ςετ࣮ߦ
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ NBTUFSDPPLຊ൪ͷ1VMM3FRVFTUΛNFSHF ৽͍͠SFDJQFͰຊ൪ڥΛDPPL
ϒϥϯνͷ push / merge ΛτϦΨʹ master QA ຊ൪ ద༻݁Ռ֬ೝ &&ςετ࣮ߦ
• GitHub Λத৺ͱͨ͠ߏཧϑϩʔ • CircleCI Λத৺ͱͨ͠มߋద༻ϑϩʔ • GitHub ͱ CircleCI
ͱ νϟοτͷૢ࡞Ͱ ݁ ·ͱΊΔͱ
։ൃϓϩηεͱӡ༻ϓϩηε ͷൺֱ
• Work In Progress Ͱ Pull Request • ։ൃ •
ϨϏϡʔ • QA • ຊ൪ϦϦʔε ։ൃϓϩηε
• Work In Progress Ͱ Pull Request • ߏཧπʔϧΛ༻ͨ͠ߏஙखॱ࡞ •
ϨϏϡʔ • ߏஙςετ • ຊ൪ద༻ ӡ༻ϓϩηε
• ։ൃ • GitHub Λத৺ͱͨ͠։ൃϑϩʔ • CircleCI Λத৺ͱͨ͠ϦϦʔεϑϩʔ • GitHub
ͱ CircleCI ͱ νϟοτͷૢ࡞Ͱ݁ • ӡ༻ • GitHub Λத৺ͱͨ͠ߏཧϑϩʔ • CircleCI Λத৺ͱͨ͠มߋద༻ϑϩʔ • GitHub ͱ CircleCI ͱ νϟοτͷૢ࡞Ͱ݁ ൺֱ
ϓϩηεΛ߹ΘͤΔϝϦοτ • ։ൃଆΠϯϑϥͷมߋΛ͢Δ͜ͱ͕ग़དྷΔ • ٯ·ͨવΓ • ։ൃଆͰΓͨ͘ͳΔมߋ • ϦόʔεϓϩΩγͰ̋̋ϔομ͚͍ͨ •
̋̋ϑΝΠϧΛஔ͍ͨ͠ • ՃػೳͷͨΊʹ̋̋ύοέʔδΛೖΕ͍ͨ
ϓϩηεΛ߹ΘͤΔϝϦοτ • ։ൃଆΠϯϑϥͷมߋΛ͢Δ͜ͱ͕ग़དྷΔ • ։ൃଆͰΓͨ͘ͳΔมߋ • ϦόʔεϓϩΩγͰ̋̋ϔομ͚͍ͨ • ̋̋ϑΝΠϧΛஔ͍ͨ͠ •
ՃػೳͷͨΊʹ̋̋ύοέʔδΛೖΕ͍ͨ Dev < ͜ΕೖΕ͍ͨͰ͢ Ops < ҰճϛʔςΟϯά͠·͠ΐ͏͔ ʙϛʔςΟϯάʙ Dev < ͜ΕೖΕ͍ͨͰ͢ Ops < ͦͦͳΜͰඞཁͳΜͰ͚ͨͬ͠ Dev < ͔͔͔͔͘͘͠͡ Ops < Ͱௐͯ͠ɺ݄̋☓ʹೖΕ·͠ΐ͏ɻ୲ऀ̋̋͞ ΜΞαΠϯͰɻ ଓ͘…
ϓϩηεΛ߹ΘͤΔϝϦοτ • ։ൃଆΠϯϑϥͷมߋΛ͢Δ͜ͱ͕ग़དྷΔ • ։ൃଆͰΓͨ͘ͳΔมߋ • ϦόʔεϓϩΩγͰ̋̋ϔομ͚͍ͨ • ̋̋ϑΝΠϧΛஔ͍ͨ͠ •
ՃػೳͷͨΊʹ̋̋ύοέʔδΛೖΕ͍ͨ ɾͦ͜·ͰෳࡶͳมߋͰͳ͍ ɾಈ͖ʹΠϯύΫτΛ༩͑Δͱͯ͠ΠϯϑϥΤϯδχΞΛ ௨ͨ͠ϨϏϡʔͰνΣοΫ
KAIZEN ΤϯδχΞߦಈࢦ
KAIZEN ΤϯδχΞߦಈࢦ
ݖҖతʹͳΒͳ͍ DevOps Day Tokyo 2013 @mirakui ͞ΜͷεϥΠυΑΓҾ༻
• डཧͯ͠ڐՄΛग़ཱ͢ͷਓؒݖҖతʹͳ Γ͕ͪ • ීஈ͔Βҙࣝ͠ͳ͍ͱࣗͰͦ͏ͳΔ͕࣌ ͋Δ ݖҖతʹͳΒͳ͍
• ։ൃͱӡ༻ͷϓϩηεΛग़དྷΔ͚ͩ߹ΘͤΔ • ։ൃ͕ӡ༻ʹࢀՃ͢ΔෑډΛԼ͛Δ • Ζ͏ͱࢥ͑Ͱ͖Δͱ͍͏ڥ • ΠϯϑϥΤϯδχΞ͜Θ͘ͳ͍ ·ͱΊΔͱ
͔͜͜Β͓·͚
• ຊ৭ʑ͋Γ·ͨ͠ • དྷ৭ʑ͋ΔͰ͠ΐ͏ ηΩϡϦςΟΞοϓσʔτ
ηΩϡϦςΟΞοϓσʔτ νϟοτ͔ΒηΩϡϦςΟΞοϓσʔτΛࢦࣔ
ηΩϡϦςΟΞοϓσʔτ yum --secuity check-update ͷ݁ՌΛऔಘ
ηΩϡϦςΟΞοϓσʔτ ͦͷ༰͔Β Pull Request Λ࡞ͯ͠ɺΠϯϑϥϝϯόʔʹϝϯγϣϯ
ηΩϡϦςΟΞοϓσʔτ ϨϏϡʔͯ͠ͳ͚Ε୲ऀ͕ Pull Request Λ merge
ηΩϡϦςΟΞοϓσʔτ merge Λܖػʹɺରͷαʔόʹରͯ͠ yum --security -y update
ηΩϡϦςΟΞοϓσʔτ E2E ςετͷ࣮ߦChatܦ༝ͰՄೳͳͷͰɺಉ࣌ʹ࣮ߦ ࠓճͷߋ৽͕ΞϓϦέʔγϣϯͷಈ࡞ʹӨڹΛ༩͍͑ͯͳ͍͔νΣοΫ
ݱߦͷӡ༻ϓϩηεͷ՝
CircleCI ͕ϘτϧωοΫ
CircleCI ͕ϘτϧωοΫ
͍ͬͯΔ SaaS Ͱྑ͔ͬͨͷ
None
Bugsnag ΤϥʔΛݕͯ͠ɺݟ͘͢μογϡϘʔυʹ·ͱΊͯ͘ΕΔ
Bugsnag Slack ͷνϟοτʹ௨ग़ͤΔ Կճ·Ͱڐ༰͢Δ or ͜ͷύλʔϯεϧʔ͢Δ ͳͲͷௐՄೳ
Pingdom http(s) ͷΤϯυϙΠϯτͷ֎෦͔Βࢹ ෳͷڌ͔ΒࢹΛߦ͏
PagerDuty ো࣌ͷ௨Λߦͬͯ͘ΕΔαʔϏε on-call schedule ʹैͬͯి / SMS / εϚʔτϑΥϯΞϓϦͷ௨
PagerDuty Sensu Pingdom ͱͷ Integration ؆୯
PagerDuty ࠓ̋̋͞ΜٳΈ͔ͩΒɺon-call εέδϡʔϧม͓͑ͯ͜͏ ͳͲͷௐ༰қ
We’re Hiring! https://kaizenplatform.com/hiring/engineer.html