Slide 1

Slide 1 text

8FC؟٦ؽأ׾傈㔐 رفٗ؎ׅ׷׋׭ך《׶穈׫ 43&/&95 !GVKJXBSB

Slide 2

Slide 2 text

!GVKJXBSB 43&ث٦ي HJUIVCDPNGVKJXBSB TGVKJXBSBIBUFOBCMPHDPN WEB+DB Press vol.111ʙ SREνʔϜ࿈ࡌ ΈΜͳͷGoݴޠ

Slide 3

Slide 3 text

(BNF$PNNVOJUZ

Slide 4

Slide 4 text

"HFOEB • σϓϩΠͷߏ੒ཁૉͱߴ଎Խͷྺ࢙ 1. CI 2. ഑෍ 3. Τϥʔݕ஌ 4. ϩʔϧόοΫ • ͩΕͰ΋σϓϩΠͰ͖Δ࢓૊Έͱ؅ཧ • ίϯςφҠߦޙͷσϓϩΠ

Slide 5

Slide 5 text

⟗꟦ְָ׷ה؜٦يָ׮׏ה꬗涯ֻז׷ ιʔγϟϧήʔϜϢʔβʔ޲͚ͷίϛϡχςΟαʔϏε άϧʔϓνϟοτɺϘΠενϟοτɺ഑৴ػೳͳͲΛఏڙ

Slide 6

Slide 6 text

-PCJךءأذيך娖〷 2010೥ ʮφΧϚοϓʯͱͯ͠ϦϦʔε (AWS us-east-1) 2011೥ ΦϯϓϨ؀ڥ΁Ҡߦ 2013೥ ʮLobiʯʹվ໊ɺAWS (ap-northeast-1) ʹҠߦ 2019೥ EC2 → ECS Ҡߦ։࢝ (ਐߦத) ΋͏͙͢10೥બख 30ʙ40ਓͷνʔϜɺΤϯδχΞ͕൒਺ఔ౓ SRE 2໊(݉೚)

Slide 7

Slide 7 text

-PCJךءأذي圓䧭 • APIαʔό Perl on EC2 • ϚΠΫϩαʔϏεతͳ΋ͷ Go (͔ͭͯ͸Nodeɺ࠷ۙશഇʹ੒ޭ) • σʔλετΞ MySQL (on EC2... ΋͏͙͢ Aurora ʹͳΔ༧ఆ) Redis (ElastiCache) • ϒϥ΢β޲͚ϑϩϯτΤϯυ Nuxt.js (Vue.js) (͔ͭͯ͸ Angular.JS 1.x ࡢ೥ Nuxt ʹҠߦ) • iOS, Android ޲͚ωΠςΟϒΞϓϦ

Slide 8

Slide 8 text

傈ח㔐رفٗ؎׃׋ְ ͜͜Ͱ͍͏σϓϩΠ = ҎԼͷ͢΂ͯ • αʔόΞϓϦέʔγϣϯ (ຊମAPIɺϚΠΫϩαʔϏε) • ϑϩϯτΤϯυ (Nuxt.JS) • EC2 ͷϓϩϏδϣχϯά (Chef) • AWSͷߏ੒มߋ (Terraform) मਖ਼΍ػೳ௥Ճɺ࡟আ͸͙͢ʹσϓϩΠ͍ͨ͠ Ұ౓ͷࠩ෼Λখࣦͯ͘͞͠ഊΛڐͤΔΑ͏ʹɾӨڹൣғΛݶఆ ৗʹσϓϩΠ͍ͯ͠Ε͹ɺرفٗ؎ָ䙳ֻזֻז׷

Slide 9

Slide 9 text

傈ח⡦儗꟦⢪ִ׷ַ Ӧۀ࣌ؒ 9:29ʙ18:29 (9࣌ؒ) Ӧۀ࣌ؒ֎ɺٳલ೔(ޕޙ)͸جຊతʹσϓϩΠ͠ͳ͍ ٳલ೔ʹσϓϩΠ͢Δͱͦͷ࣌఺Ͱ͸໰୊͕ͳͯ͘΋… → ͦͷ໷ͷϐʔΫλΠϜʹ໰୊͕ൃ֮ → ࣍ͷ໷ؒɾૣேͷόονॲཧʹ໰୊͕ൃੜ → Ϣʔβʔͷ໰͍߹Θ͕ͤٳ೔தʹ૿͑Δ ͲΕ΋ٳ೔ରԠ͕ඞཁʹͳΔ սٕ٦ٕվͲ͏ͯ͠΋ٳલ೔ʹσϓϩΠ͍ͨ͠৔߹͸ ରԠͰ͖ΔਓһΛࣄલ֬อ͢Δ(ٳ೔ग़ۈͯ͠΋Β͏)

Slide 10

Slide 10 text

儗꟦ד㔐رفٗ؎ׅ׷׋׭חכ 1ճͷσϓϩΠʹ࢖͑Δ࣌ؒ͸30෼ҎԼ ߴස౓ʹσϓϩΠ͢ΔͨΊʹ → 1ճ1ճͷσϓϩΠΛߴ଎Խ͢Δ ୭Ͱ΋σϓϩΠͰ͖ΔΑ͏ʹ → ઐ೚ͷ୲౰ऀΛ࡞Βͳ͍ ͍ͭԿ͕σϓϩΠ͞Ε͔ͨ؅ཧͰ͖ΔΑ͏ʹ → ࣗಈͰه࿥ɺՄࢹԽ͢Δ

Slide 11

Slide 11 text

չرفٗ؎պך銲稆 1. CI → ςετ͕௨͍ͬͯͳ͍΋ͷ͸ϦϦʔεͰ͖ͳ͍ 2. Ϗϧυ/഑෍ (ڱٛͷσϓϩΠ) 3. Τϥʔݕ஌ → ໰୊͸͙͢ʹݕ஌͍ͨ͠ 4. ϩʔϧόοΫ → ଈ࠲ʹ໭ͯ͠μϝʔδΛ࠷খݶʹ ͜ΕΒׅץגך銲稆׾넝鸞⻉͍ͯ͘͠

Slide 12

Slide 12 text

رفٗ؎넝鸞⻉ך娖〷$*箟 1. $* 2. ഑෍ 3. Τϥʔݕ஌ 4. ϩʔϧόοΫ

Slide 13

Slide 13 text

$*넝鸞⻉ך娖〷 ຊମ API = Perl ͷΘΓͱେ͖͍ϞϊϦε ΞϓϦέʔγϣϯ 26ສߦ ʴ ςετ 26ສߦ (Cookpad ຊମͷRuby͕27ສߦ1 ϥΠϒυΞϒϩάͷίʔυ͕41ສߦ2) ࣮ࡍʹ MySQL ΍ Redis Λىಈͯ͠ςετ͍ͯ͠Δ ςετΛ۪௚ʹ΍Δͱ΋ͷֻ͍͕͔࣌ؒ͢͝Δ ۩ମతʹ͸Կ΋ߟ͑ͣ௚ྻʹ΍Δͱ೔͕฻ΕΔϨϕϧ 2 https://logmi.jp/tech/articles/322235 1 https://employment.en-japan.com/engineerhub/entry/2019/09/17/103000

Slide 14

Slide 14 text

$*넝鸞⻉ך娖〷 Jenkins master + slave (ڧ͍EC2Πϯελϯε) Perl ͷςετ͸جຊతʹγϯάϧϓϩηε ίΞ͕͍ͭ͋ͬͯ͘΋ͦͷ··Ͱ͸଎͘ͳΒͳ͍ͨΊࣗલͰฒྻԽ MySQL / Redis / etc ΋ฒྻͰىಈ͠ͳ͍ͱεέʔϧ͠ͳ͍ (͕ɺίΞ਺෼ىಈ͢Δͷ͸ແཧ) 1ϓϩηεͷ MySQL Λ8ϓϩηεͷ Perl Ͱར༻͢Δ = 1ηοτ ͦΕΛ͞Βʹ8ฒྻͰಈ͔͢ = ߹ܭ64ฒྻ 64ίΞϚγϯͰ10෼͙Β͍ͰऴΘΔঢ়ଶͰ͸͋ͬͨ

Slide 15

Slide 15 text

$*ָ鹼ְֿהח״׷أزٖأ push ͯ͠΋୭͔͕ςετΛճ͍ͯ͠Δͱ10෼Ҏ্଴ͭ ෳ਺଴͕ͪ͋Δͱ਺े෼ ϩʔΧϧͰͦͷςετ͚ͩճͨ͠Γ͍ͯ྇͠Ͱ͍͕ͨ pushͯ͠ΈͨΒϩʔΧϧͰճ͍ͯ͠ͳ͍ςετ͕ίέͨΓ͢Δ ࠷ऴతʹ͸͢΂ͯ௨͔ͯ͠ΒσϓϩΠ͢Δඞཁ͕͋Δ ۓٸରԠ࣌ʹ΋Ͳ͔͍͠

Slide 16

Slide 16 text

$JSDMF$*ְְָ׵׃ְ׊ CircleCI Performance Plan (౰࣌) ͷମݧ͕Α͍ͱ͍͏࿩Λฉ͍ͨͷͰಋೖ 2019೥5݄ʙ ࠷େ8ίΞ (౰࣌) ͷίϯςφΛฒྻͰىಈͰ͖Δ ىಈ͍ͯ͠Δίϯςφ਺ × ࣌ؒͰར༻ྉ͕ܾ·Δ (+ΞΫςΟϒϢʔβʔ՝ۚ)

Slide 17

Slide 17 text

$JSDMF$*חذأز׾䭯׏גְֻ 8ίΞίϯςφΛ20ฒྻ × 1ίϯςφ಺Ͱ8ฒྻ = 160ฒྻ 10෼ → 3෼ʹʂ

Slide 18

Slide 18 text

$*ך넝鸞⻉٥أ؛٦ٓؽٔذ؍ך栻䖤 1. ίʔυͱςετΛॻ͘ 2. commit & push 3. GitHub Ͱ PR Λ࡞ͬͯઆ໌Λॻ͍͍ͯΔ͏ͪʹ… 4. CI ͕ऴΘ͍ͬͯΔ ετϨε͕ͳ͍ ࠓޙςετ͕૿͑ͯ΋ฒྻ਺Λ্͛ͯεέʔϧͰ͖Δ

Slide 19

Slide 19 text

UJQT$JSDMF$*ךذأز؎ً٦آꂁ縧㜥䨽 Lobi ͷαʔό͸͢΂ͯ AWS ౦ژϦʔδϣϯ (ap-northeast-1) ʹ͋Δ Կ΋ߟ͑ͣʹ ECR (ίϯςφϨδετϦ) ΋౦ژϦʔδϣϯΛ࢖͍͕ͬͯͨ CircleCI ͷ࣮ߦ؀ڥ͸ us-east-1 ʹ͋Δ (ݱ࣌఺) → CI ࣮ߦ͝ͱʹόʔδχΞ͔Β౦ژͷίϯςφΠϝʔδΛ Pull (×ฒྻ਺)

Slide 20

Slide 20 text

את׶ֲֿ

Slide 21

Slide 21 text

$JSDMF$*ךذأز欽؎ً٦آכVTFBTUח縧ֻ ౦ژʹ͋Δͱ͍Ζ͍Ζίετ͕ߴ͍ • ίϯςφͷىಈ࣌ؒ ⏰ • Ϧʔδϣϯؒసૹྉۚ " ͜Ε͚ͩͰίϯςφىಈ͕ߴ଎ʹ

Slide 22

Slide 22 text

رفٗ؎넝鸞⻉ך娖〷ꂁ䋒箟 1. CI 2. ꂁ䋒 3. Τϥʔݕ஌ 4. ϩʔϧόοΫ

Slide 23

Slide 23 text

ؿ؋؎ٕꂁ䋒넝鸞⻉ך娖〷 2010೥ʙ σϓϩΠαʔό(EC2) ͔Β֤ϗετ͕ git pull • ୆਺͕૿Ճ͢Δͱ Git ͷෛՙ͕όΧʹͳΒͳ͍ • όΠφϦͷ੒Ռ෺Λ commit ͨ͘͠ͳ͍ 2013೥ʙ σϓϩΠαʔό͔Β֤ϗετʹฒྻ rsync (push) • AWSʹҠߦͯ͠ϗετ୆਺΋૿Ճɺ਺े୆ʹσϓϩΠ͕ඞཁʹ • 10ฒྻͰ rsync ͯ͠΋ऴΘΔ·Ͱ3ʙ4෼(Ջ)

Slide 24

Slide 24 text

ؔ٦زأ؛٦ٕפך㼎䘔 2014೥ήʔϜಈը࿥ըαʔϏεΛSDKఏڙ։࢝(ݱࡏ͸ऴྃ) ࠷ॳ͸ Elastic Transcoder Λར༻ ϞϯελʔετϥΠΫʹಋೖ → Elastic Transcoder Ͱ͸嫣剢㹺ָ䒉אꆃ겘ח ΠϯελϯεΛେྔʹىಈͯࣗ͠લͰಈըม׵͢Δ࡞ઓʹมߋ → ؔ٦زأ؛٦ٕ׃׋ְ (੾࣮) ͋Δϗετ͔ΒϑΝΠϧΛ഑ΔઓུͰ͸Φʔτεέʔϧ΁ͷରԠ͕ࠔ೉ AMI Λຖճ࡞͍ͬͯͨΒ1೔ʹ10ճσϓϩΠͰ͖ͳ͍

Slide 25

Slide 25 text

4USFUDIFS׾Ꟛ涪 HJUIVCDPNGVKJXBSBTUSFUDIFS ഑෍Λ push → pull ʹ σϓϩΠͷ഑෍෺ (tar.gz)Λ͋Β͔͡Ί S3 ʹஔ͘ ֤ϗετͷ Stretcher(ίϚϯυ) ͕ S3 ͔Β औಘɺ ల։ɺϓϩηε࠶ىಈΛߦ͏ ΦʔτεέʔϧͰىಈͨ͠ϗετ͸࠷৽ͷtarΛS3 ͔Βऔಘͯ͠ΞϓϦέʔγϣϯΛىಈ͢Δ ࢥ૝తʹ͸ίϯςφͷσϓϩΠͱࣅͨΑ͏ͳ΋ͷ ίϯςφ࣮ӡ༻͸·ͩૣ͍(2014೥຤) ͔͠͠Φʔτεέʔϧ΁ͷରԠ͸ࠓ͙͍ͨ͢͠ ં஭Ҋ

Slide 26

Slide 26 text

4USFUDIFSח״׷넝鸞⻉⸬卓 • rsync ࣌୅ 3ʙ4෼ • tar࡞੒ / S3 ΁Ξοϓϩʔυ 30ඵ • શ୆ʹΠϕϯτ௨஌ͯ͠ Stretcher ͕σϓϩΠΛ׬ྃ͢Δ·Ͱ 30ඵ ߹ܭ1෼ఔ౓ʹ୹ॖ 1෼ͳΒͦͷ··଴ͯΔ 3ʙ4෼Ջͩͱͦͷؒʹଞͷ͜ͱΛͨ͘͠ͳΔ

Slide 27

Slide 27 text

4USFUDIFSח״׷أ؛٦ٓؽٔذ؍ך栻䖤 rsync: ഑෍ݩͷϗετͷ CPU / ωοτϫʔΫͰ཯଎ ୆਺͕૿͑ΔͱΠϯελϯεΛڧ͘͢Δඞཁ͕͋Δ Stretcher: S3 ͷڧ͞ʹґଘ S3 ͕଱͑ͯ͘ΕΔݶΓεέʔϧ͢Δ

Slide 28

Slide 28 text

رفٗ؎넝鸞⻉ך娖〷ؒٓ٦嗚濼箟 1. CI 2. ഑෍ 3. ؒٓ٦嗚濼 4. ϩʔϧόοΫ

Slide 29

Slide 29 text

ؒٓ٦嗚濼ךꅾ銲䚍 σϓϩΠޙɺΤϥʔ͕ͳ͍͜ͱΛ֬ೝ͔ͯ͠ΒͰͳ͍ͱ׬ྃͰ͖ͳ͍ ൃ֮લʹผͷσϓϩΠΛߦͬͯ͠·͏ͱϩʔϧόοΫ͕൥ࡶʹͳΔ ϩά͔Β໰୊͕ൃੜͨ͠৔߹ʹߴ଎ʹݕ஌ͯ͠௨஌͢Δ࢓૊ΈΛ੔͑Δ 1෼ఔ౓Ͱݕ஌͍ͨ͠

Slide 30

Slide 30 text

/PSJLSBח״׷ؚٗפךؙؒٔ norikra.github.io Stream processing with SQL for everybody ετϦʔϛϯάσʔλʹରͯ͠SQLͰΫΤϦΛ࣮ߦͰ͖Δ αʔό → Fluentd → Norikra → ௨஌

Slide 31

Slide 31 text

،فٔ؛٦ءّٝךַؚٗ׵ז׿׵ַךؒٓ٦׾嗚濼 app_exception count:1 app-i-0ad5e77d [613][667331357105553408] [WARN]error: Can't call method "as_json_for_invitation" on an undefined value ... SELECT 'app_exception' AS title, count(*) AS count, last(_hostname) AS _hostname, last(message) AS message FROM app.win:time_batch(1 min) WHERE (message LIKE '%Caught exception%' OR message LIKE '%error:%' OR message LIKE '%limit exceeded:%') AND (message NOT LIKE '%[INFO]%') ͜ͷΫΤϦͰϚον͢Δͱ1෼ʹ1౓௨஌͕དྷΔ

Slide 32

Slide 32 text

ؚٗ嗚濼׾黝ⴖזXJOEPXד㹋遤ׅ׷ Τϥʔ͕େྔൃੜͯ͠΋1෼ʹ1ճ͚ͩ௨஌͢Δ (௨஌Λരൃͤ͞ͳ͍) • Τϥʔͷൃੜ਺ • ൃੜͨ͠ϗετ • ۩ମతͳϝοηʔδ Λ௨஌ʹࡌͤͯɺৄࡉʹݟΔ͔Ͳ͏͔Λ൑அ͢Δ ϩάू໿ͱݕ஌ΛετϦʔϛϯάͰߦ͍ɺΠϕϯτൃੜޙ1෼Ͱ௨஌͕དྷΔΑ͏ʹ

Slide 33

Slide 33 text

رفٗ؎넝鸞⻉ך娖〷ٗ٦ٕغحؙ箟 1. CI 2. ഑෍ 3. Τϥʔݕ஌ 4. ٗ٦ٕغحؙ

Slide 34

Slide 34 text

ٗ٦ٕغحؙ σϓϩΠͯ͠໰୊͕ൃ֮ͨ͠Βଈ࠲ʹ໭͍ͨ͠ 稆劰זٗ٦ٕغحؙرفٗ؎׾׮ֲ㔐 1. ϦόʔτPR࡞੒ɺϨϏϡʔ ؒҧͬͨίϛοτΛϦόʔτ͍ͯ͠ͳ͍͔ 2. ϦϦʔεϒϥϯνʹϚʔδ CI΋଴͍ͪͨ 3. σϓϩΠ͠௚͠ Ͳ͏ٸ͍Ͱ΋5෼Ҏ্ֻ͔Δ PRΛϦόʔτ͢Δͷ͸ਓؒͳͷͰϛε͕ࠞೖ͢Δ༨஍͕͋Δ

Slide 35

Slide 35 text

4USFUDIFSח״׷넝鸞ٗ٦ٕغحؙ pullܕσϓϩΠ = ࠓճͷσϓϩΠ௚લ·ͰσϓϩΠ͞Ε͍ͯͨ੒Ռ෺͸S3ʹ͋Δ σϓϩΠ࣌ʹࣗಈͰ௚લͷ੒Ռ෺ͷURLΛه࿥ ϩʔϧόοΫ = ௚લͷURLΛࢦఆ࣮ͯ͠ߦ͢Δ͚ͩ • tar࡞੒/S3 upload 30ඵ • શ୆ʹΠϕϯτ௨஌ͯ͠ Stretcher ͕σϓϩΠΛ׬ྃ͢Δ·Ͱ 30ඵ 30ඵͰϩʔϧόοΫ͕׬ྃ ਓ͕ؒհࡏ͠ͳ͍ͷͰϛεΛ͠ͳ͍

Slide 36

Slide 36 text

رفٗ؎넝鸞⻉תה׭ 1. CI: Jenkins ࣌୅ 10෼ → $JSDMF$*ⴓ 2. ഑෍: rsync ࣌୅ 3ʙ4෼ → 4USFUDIFSⴓ 3. Τϥʔݕ஌: /PSJLSBⴓ 4. ϩʔϧόοΫ: ϦόʔτPR 5෼ → 4USFUDIFS猱 ຖճͷσϓϩΠΛ5෼ఔ౓Ͱ׬ྃͰ͖ΔΑ͏ʹͳͬͨ

Slide 37

Slide 37 text

铩ד׮رفٗ؎דֹ׷➬穈׫ה盖椚

Slide 38

Slide 38 text

铩ד׮رفٗ؎דֹ׷➬穈׫ה盖椚 رفٗ؎ך孖⚺⻉ ❌ ಛఆͷ୲౰ऀ͕σϓϩΠ ⭕ ίʔυΛॻ͍ͨਓ͕ͩΕͰ΋σϓϩΠͰ͖Δ (1೔10ճσϓϩΠͨ͠Β୲౰ऀ͸ͦΕ͔͠Ͱ͖ͳ͘ͳΔ) ୭Ͱ΋㸜ⰋחσϓϩΠͰ͖Δ࢓૊ΈΛ੔͑Δ

Slide 39

Slide 39 text

3VOEFDLח״׷رفٗ؎㹋遤

Slide 40

Slide 40 text

3VOEFDL www.rundeck.com/open-source Job ఆٛɺ࣮ߦΛߦ͑Δ Automation Software ϦϞʔτϗετ΁ͷ࣮ߦ΍εέδϡʔϧ࣮ߦ΋(LobiͰ͸࢖͍ͬͯͳ͍) σϓϩΠʹඞཁͳίϚϯυΛୟͨ͘Ίͷ Web UI ͱͯ͠ར༻ • EC2, ECS, Lambda ͷσϓϩΠ / ϩʔϧόοΫ • Chef ʹΑΔϓϩϏδϣχϯά • Terraform ʹΑΔߏ੒มߋ • ΦʔτεέʔϦϯάͷૢ࡞(୆਺Λ૿΍͢ͳͲ)

Slide 41

Slide 41 text

رفٗ؎㾶娖׾盖椚ׅ׷ ͍ͭԿ͕σϓϩΠ͞Εͨͷ͔Λه࿥͍ͨ͠ • ໰୊ൃੜ࣌ ԿΛσϓϩΠͨ͠ޙʹൃੜͨ͠ͷ͔ • ͍ͭσϓϩΠ͍ͯ͠Δͷ͔ (ۀ຿࣌ؒ֎/ٳલ೔ɺٳ೔) github.com/Songmu/ghch Git ͷཤྺ͔Β ChangeLog Λࣗಈੜ੒͢Δπʔϧ Git TagΛݩʹɺ௚લͷσϓϩΠͱࠓճͷσϓϩΠ·Ͱͷࠩ෼Λ࡞Δ

Slide 42

Slide 42 text

HIDIדرفٗ؎חろת ׸׷13׾《䖤׃ג鎸ꐮ ghch --from $recent_tag { "pull_requests": [ { "number": 23013, "state": "closed", "title": "...........", Google ΧϨϯμʔʹه࿥ Mackerel ͷάϥϑΞϊςʔγϣϯʹه࿥

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

4MBDLCPUח״׷ رفٗ؎ך盖椚 ຊདྷ͸ϨϏϡʔΞαΠϯ/ PR ͷϥϕϧ෇͚Λα ϙʔτ͢Δ Slack App (bot) ςετ͕௨͍ͬͯͳ͔ͬͨΓ ࣌ؒ֎ͷσϓϩΠΛߦ͓͏ͱ͢Δͱܯࠂ͢Δ

Slide 45

Slide 45 text

؝ٝذش獳遤䖓ךرفٗ؎

Slide 46

Slide 46 text

؝ٝذش獳遤䖓ךرفٗ؎ ݱࡏγεςϜશମΛ EC2 ͔Β Amazon ECS ʹҠߦத Կ͕มΘΔ͔ CI: มΘΒͳ͍ Ϗϧυ: EC2 → CircleCI (image build) ꂁ䋒ծٗ٦ٕغحؙ4USFUDIFS̔&$4 ؒٓ٦嗚濼/PSJLSB̔'JSFIPTF4-BNCEB

Slide 47

Slide 47 text

&$4חֶֽ׷رفٗ؎ 1. ίϯςφΠϝʔδΛ࡞Δ 2. λεΫఆٛΛొ࿥ 3. αʔϏε͕ར༻͢ΔλεΫఆٛΛߋ৽ 4. ECS ͕αʔϏε಺ͷλεΫΛೖΕ׵͑Δ 2, 3 Λߦ͏σϓϩΠπʔϧΛ։ൃ github.com/kayac/ecspresso

Slide 48

Slide 48 text

FDTQSFTTP github.com/kayac/ecspresso γϯϓϧ / ϛχϚϧͳ ECS σϓϩΠπʔϧ (Go੡) • λεΫͱαʔϏεఆٛΛ JSON ͔Βੜ੒, ొ࿥ • σϓϩΠ = αʔϏεͷλεΫఆٛΛೖΕ׵͑Δ • ϩʔϧόοΫ = ௚લͷλεΫఆٛʹࠩ͠ସ͑Δ AWS SDK Go ͷߏ଄ମΛ࢖͏͜ͱͰ৽ػೳͷΩϟονΞοϓΛ༰қʹ (ྫ: EFSϚ΢ϯτػೳ 1/18ϦϦʔε → 1/20ରԠ൛ ecspresso ϦϦʔε) Blue/Green deployment ͸ CodeDeploy ͱ࿈ܞ͢Δ͜ͱͰαϙʔτ

Slide 49

Slide 49 text

傀㶷&$4؟٦ؽأ׾盖椚⻉ח init αϒίϚϯυΛ࣮ߦ͢Δͱ $ ecspresso init --region ap-northeast-1 --cluster default --service myservice --config config.yaml 2019/10/12 01:31:48 myservice/default save service definition to ecs-service-def.json 2019/10/12 01:31:48 myservice/default save task definition to ecs-task-def.json 2019/10/12 01:31:48 myservice/default save config to config.yaml config.yaml, ecs-service-def.json, ecs-task-def.json ͕ੜ੒͞ΕΔ λεΫఆٛΛదٓॻ͖׵͑ͯ deploy ͢Δ͚ͩͰҠߦՄೳ $ ecspresso deploy --config config.yaml ଞͷπʔϧ΍ίϯιʔϧͰ࡞ͬͨ ECS λεΫ/αʔϏε΋ ؆୯ʹίʔυ؅ཧʹམͱ͠ࠐΊΔ

Slide 50

Slide 50 text

أ؛٦ٓـٕזؒٓ٦嗚濼 Norikra ͸εέʔϧ͕೉͍͠ 1. ϩάΛ Firehose ͔Β S3 ʹ1෼͝ͱʹอଘ 2. S3 ͷΠϕϯττϦΨͰ Lambda Λىಈ 3. ϩάͷதʹ͋ΔΤϥʔΛݕग़ͯ͠௨஌ 1෼୯ҐͰݕग़ͯ͠௨஌Λൃੜͤ͞Δཁ݅Λ อͪͭͭϚωʔδυʹ ྲྀྔ͕૿͑ͯ΋ Firehose / S3 / Lambda ͸εέʔϧ͢Δ

Slide 51

Slide 51 text

תה׭ ߏ੒ཁૉΛ͢΂ͯߴ଎Խ͢Δ͜ͱͰσϓϩΠαΠΫϧΛߴ଎Խ͢Δ CI / ഑෍ / Τϥʔݕ஌ / ϩʔϧόοΫ ͩΕͰ΋҆શʹɺଈ࠲ʹσϓϩΠͰ͖Δ࢓૊Έ͸։ൃମݧʹॏཁ EC2 ͔Β ECS(ίϯςφ)ʹͳͬͯ΋ߟ͑ํ͸ಉ͡ ΑΓεέʔϧ͠΍͍͢ߏ੒ʹ͍ͯ͘͠