Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
スペックを上げてクラウドで殴るCI / pixiv TECH SALON #pixivTECH...
Search
sue445
March 05, 2019
Technology
10
15k
スペックを上げてクラウドで殴るCI / pixiv TECH SALON #pixivTECHSALON
pixiv TECH SALON (
https://techsalon.pixiv.co.jp/
)の発表資料です。
sue445
March 05, 2019
Tweet
Share
More Decks by sue445
See All by sue445
pixiv Cloud Journey #pixivmeetup
sue445
0
1.2k
Road to RubyKaigi Speaker (case sue445) #rubykaigi2023_after
sue445
0
1.7k
Fix SQL N+1 queries with RuboCop #rubykaigi
sue445
2
5.3k
sue445とOSSと社内ツール #subcul_dev
sue445
0
800
Sentry GKEに リプレイス 1年間の 知見見せます / Migrated to GKE Sentry #pixivdevmeetup
sue445
0
640
sue445謹製社内ツール十一選 / su445 in-house tools #pixivdevmeetup
sue445
1
440
Ruby on CI #ginzarails
sue445
3
2.5k
Best practices in web API client development #RubyKaigi
sue445
13
15k
OSS雑メンテ / OSS zatsu maintenance #railsdm
sue445
3
4.1k
Other Decks in Technology
See All in Technology
241130紅白ぺぱ合戦LT「編集の技術」
toya524287
5
580
MediaPipe と ML Kit ってどう ちがうの? / What is the difference between MediaPipe and ML Kit?
yanzm
0
310
間違いだらけのポストモーテム - ホントに役立つレビューはこうだ!
jacopen
5
930
Oracle Database 23c新機能 #5 データベース・パフォーマンス関連新機能前半
oracle4engineer
PRO
1
130
2024/12/05 AITuber本著者によるAIキャラクター入門 - AITuberの基礎からソフトウェア設計、失敗談まで
sr2mg4
2
250
2024/11/29_失敗談から学ぶ! エンジニア向けre:Invent攻略アンチパターン集
hiashisan
0
310
MySQL 8.0 から PostgreSQL 16 への移行と RLS 導入までの道のりと学び
baseballyama
0
160
40歲的我會給20歲的自己,關於軟體開發的7個建議
line_developers_tw
PRO
0
120
ミスが許されない領域にAIを溶け込ませる プロダクトマネジメントの裏側
t01062sy
0
340
開志専門職大学特別講義 2024 オープニング
1ftseabass
PRO
0
220
ソフトウェアエンジニアとしてキャリアの螺旋を駆け上がる方法 - 経験と出会いが人生を変える / Career-Anchor-Drive
soudai
1
230
大規模トラフィックを支える ゲームバックエンドの課題と構成の変遷 ~安定したゲーム体験を実現するために~
colopl
1
1.1k
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
1
230
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Building Applications with DynamoDB
mza
90
6.1k
How to Think Like a Performance Engineer
csswizardry
21
1.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
GraphQLとの向き合い方2022年版
quramy
44
13k
How to train your dragon (web standard)
notwaldorf
88
5.7k
What's new in Ruby 2.0
geeforr
343
31k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
770
Agile that works and the tools we love
rasmusluckow
327
21k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
εϖοΫΛ্͛ͯ ΫϥυͰԥΔCI pixiv.inc sue445
• HN: sue445 • ށ੶ωʔϜ: Go Sueyoshi • 20187݄ɹϐΫγϒೖࣾ ‣
ࠓճͷొஃऀͷதͰൺֱత৽ࢀऀ • Πϯϑϥ෦ • ϑϧελοΫΩϡΞΤϯδχΞ ‣ ϓϦΩϡΞͷΧόϨοδ100%ܧଓத go versionʢࣗݾհʣ
• SUE ≒ SRE • SREʹࣅͯΔࣄΛͬͯΔ go versionʢࣗݾհʣ
https://rubykaigi.org/2019/speakers ʲએʳRubyKaigi 2019ొஃ༧ఆ
ͷϐΫγϒͰͷϛογϣϯ
ʮશͯͷख࡞ۀΛࣗಈԽ͢Δʯ ͷϐΫγϒͰͷϛογϣϯ
• ػցʹͤΒΕΔ͜ͱػցʹશ෦ͤͯɺਓ͔ؒ͠Ͱ͖ͳ͍͜ͱΛਓ͕ؒ Δ͖ • ݱঢ়·ͩ΄Ͳԕ͍ͷͰ·ͣCIͰձࣾΛϋοΫ͍ͯ͠Δ • ʮಇ͔ͳ͍ͨΊʹશྗͰಇ͍͍ͯΔʯʢʁʣ ʮશͯͷख࡞ۀΛࣗಈԽ͢Δʯ
• ϐΫγϒͷCIࣄͱݱঢ়ͷCIͷ • Ͳ͏ͬͯվળ͔ͨ͠ • ϐΫγϒͳΒͰͷۤ࿑ ࠓ͢͜ͱ
• CIϨϕϧʢεϖοΫʣΛ্͛ͯཧʢΫϥυʣͰԥΔͷ͕େਖ਼ٛ • SaaS͍͍͚ͲࣗલͰΔͷӡ༻ܦݧ͕ஷ·ΔͷͰ͓͢͢Ί ‣ ͨͩ͠ສਓʹ͓͢͢Ί͠ͳ͍ ࠷ॳʹ·ͱΊ
• େલఏ ‣ ྺ࢙తܦҢʹΑΓGitHub.comͱGitLabʢΦϯϓϨʣ͕྆ํΘΕ͍ͯΔ ϐΫγϒͷCIࣄ
• GitHub.com ‣ RailsܥGitHubΛ͍ͬͯΔ ‣ ྫʣBOOTH, pixivFACTORY, pixiv PAY, pixivίϛοΫ
‣ CI: ͍͍ͩͨશ෦CircleCIΛͬͯΔ ϐΫγϒͷCIࣄ
• GitLabʢΦϯϓϨʣ ‣ pixivຊମʢ͍ΘΏΔΈΜͳ͕Αͬͯ͘Δpixivʣɺpixivຊମͱີ݁߹͍ͯ͠Δपลαʔ ϏεɺVRoid Studio ‣ CI: GitLab CI,
Jenkins ‣ ࠓGitLab CIͷ͕ϝΠϯͰ͢ ϐΫγϒͷCIࣄ
• ͦͷଞʢϦϙδτϦඇґଘʣ ‣ iOS/AndroidΞϓϦͷCIʹBitriseΛར༻ ‣ ৄ͍͜͠ͱɿϞόΠϧΞϓϦͷCIΛBitriseʹͯ͠1͕ܦͪ·ͨ͠ - pixiv inside -
https://inside.pixiv.blog/kwzr/6190ɹ ϐΫγϒͷCIࣄ
• VRoid StudioʢUnityʣͰϏϧυͷ͕͔͔͍࣌ؒͬͯͨ ‣ Ϗϧυ1ճ100ʢʂʣ ‣ ϋΠεϖοΫͳGitLab Runner͕΄͍͠ͱ͍͏ཁ ‣ ͔ͤͬ͘ͳͷͰVRoid
Studioઐ༻Ͱͳ͘ɺࣾGitLabͷશମͰ͑ΔRunnerʹͨ͠ ‣ CIͷվળ݁ՌɺΈΜͳͷੜ࢈ੑόΫ্͕Γʹͳͬͯͤʹͳͬͯ·͢ CIͷ
• Before ‣ MacMini ‣ ྻͰ100 ܶతϏϑΥʔΞϑλʔ
• Before ‣ MacMini ‣ ྻͰ100 • After ‣ EC2
c5.2xlargeΠϯελϯεʢvCPU 8, ϝϞϦ16GiBʣ ‣ 3ฒྻͰ25 ܶతϏϑΥʔΞϑλʔ
• લͰ5ɺޙͰ֤20લޙ • 100 -> 25ͳͷͰ4ഒͷੜ࢈ੑ ܶతϏϑΥʔΞϑλʔ
Ͱ͓ߴ͍ΜͰ͠ΐ͏ʁ
AWSඅ༻݄300υϧ͘Β͍ Ͱ͓ߴ͍ΜͰ͠ΐ͏ʁ
ࢀߟɿ1݄ͷඅ༻
ࢀߟɿ1݄ͷඅ༻
• https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/ ‣ AWSͷεϙοτΠϯελϯεͱdocker machineΛར༻ͨ͠ΦʔτεέʔϧRunnerΛߏங͢ ΔͨΊͷެࣜυΩϡϝϯτ • https://www.m3tech.blog/entry/advent-calendar-2018-2 ‣ M3͞ΜͷςοΫϒϩάɻຊޠͷઆ໌͕ΉͬͪΌৄ͍͠
‣ ʮGitLab Runner AWS spot instanceʯͰάάΕ͍͘ΒͰࢿྉग़ͯ͘Δ ৄ͍͜͠ͱ
• άάΕ͔Δ͜ͱʹ͍ͭͯͯ͠͠ΐ͏͕ͳ͍ͷͰɺϐΫγϒͳΒͰ ͷɺۤ࿑ɺӡ༻ݟͳͲΛόόʔϯͱհ͠·͢ʂ ϐΫγϒGitLabͱAWS Runner
• ͜Εݟ͔ͯΒͳ͍ͱࢥ͏ͷͰ͔͍ͭ·ΜͰઆ໌ AWSͷGitLab Runnerͷશମ૾
• εϙοτΠϯελϯε • Docker Machine • Ansible • Terraform •
Packer • Serverless Framework ओͳొਓ
• ҆͑͘ΔEC2ͷ༨Πϯελϯε ‣ ੑೳΦϯσϚϯυΠϯελϯεʢεϙοτΠϯελϯε͡Όͳ͍ී௨ͷͭʣͱશ͘ ಉ͡ͰɺՁ֨࠷େ9ׂҾ ‣ ྫʣc5.2xlargeͩͱΦϯσϚϯυ͕0.428USD/࣌ؒɺεϙοτ͕0.0779USD/࣌ؒલޙ • εϙοτΠϯελϯεͷՁ֨มಈ͢ΔͷͰɺࣄલʹઃఆͨ͠ೖࡳՁ֨Λ ͑Δͱ࡞Εͳ͍
‣ ଟগՁ্͕͕֨ͬͯೖࡳΤϥʔʹͳΒͳ͍Α͏ͳֹۚͰೖࡳ͢Δͷ͕͓͢͢Ί εϙοτΠϯελϯε
• ΞΧϯτ͝ͱʹ࡞Ͱ͖ΔεϙοτΠϯελϯεͷ্ݶ͕ܾ·ͬͯΔʢσϑΥϧ τ20ʣ • εϙοτΠϯελϯεΛআͨ͠Β·ͨ࡞Ͱ͖Δͣͳͷ͕ͩɺͨ·ʹআࡁͷ Πϯελϯε͕࡞্ݶΛѹഭ͢Δ͜ͱ͕͋Δ ‣ Α͘ʮεϙοτΠϯελϯεͷΰϛʯͱݴͬͯΔ • ϝΠϯͰ͏ΠϯελϯελΠϓҰʹཱͯΔΠϯελϯεΑΓଟΊʹ্ݶ
؇ਃΛͨ͠ํ͕͍͍ɻʢϐΫγϒͩͱ10ฒྻʹରͯ͠100ݸͰ্ݶ؇ʣ εϙοτΠϯελϯεʢҙʣ
• ϦϞʔταʔό্ʹdockerίϯςφΛߏங͢ΔΈ • DockerίϚϯυͷ࣮ߦݩͱίϯςφͷ࡞ઌ͕ผ • http://docs.docker.jp/machine/overview.html Docker Machine
• ௨ৗDockerͱ͍͏ͱͬͪ͜Λࢦ͢߹͕ଟ͍ʢDockerίϚϯυͷ࣮ߦݩͱί ϯςφͷ࡞ઌ͕ಉ͡ʣ ‣ http://docs.docker.jp/machine/overview.html ൺֱ༻ɿDocker Engine
GitLab Runner + Docker Machine GitLab Runner Docker Machine ΦϯϓϨڥ
ec2 ec2 ec2
• ͜ͷߏͷϝϦοτ ‣ Docker EngineʢαʔόͷϩʔΧϧʹίϯςφΛཱͯΔʣͱҧͬͯɺॏ͍δϣϒ͕1ͭ͋ͬ ͨ࣌ʹଞͷδϣϒʹӨڹ͕ແ͍ ‣ ϋΠεϖοΫͳϚγϯΛδϣϒ1ͭͰઐ༗Ͱ͖Δ ‣ Runner͕Α͠ͳʹΦʔτεέʔϧͯ͘͠ΕΔͷͰɺδϣϒ͕ੵ·Εͳ͚ΕEC2উखʹ
ফ͍͑ͯ͘ GitLab Runner + Docker Machine
• αʔόͷϓϩϏδϣχϯάπʔϧ • طଘͷRunnerʢDocker Engineར༻ʣͷplaybook͕͋ͬͨͷͰɺ৽͘͠Φʔτ εέʔϧRunner༻ͷઃఆΛ࡞ͬͨ Ansible
• AWSͳͲͷΫϥυͷߏཧπʔϧ • VPC, S3, IAMͳͲͷϓϩϏδϣχϯάͰར༻ • GitLabͷMergeRequestͰterraform planʢdry runʣΛ͠ɺmasterʹϚʔδ͞Ε
ͨΒapplyʢຊ࣮ߦʣ͢Δͱ͍͏ΠϯϑϥCIͰར༻͍ͯ͠Δ Terraform
• αʔόͷΠϝʔδʢAWSͳΒAMIʣΛ࡞ΔͨΊͷπʔϧ • ༧ΊϐΫγϒGitLab༻ͷઃఆΛೖΕͯAMIΛ࡞͠ʢޙड़ʣɺͦΕΛRunner Ͱ͍ͬͯΔ Packer
• ϩʔΧϧ։ൃ༻ʹVagrantಋೖ • VagrantPackerͰͷϓϩϏδϣχϯάʹ mitamaeΛ͍ɺϓϩϏδϣχϯάͨ͠༰Λ ServerspecͰςετΛ͍ͯ͠Δ • ͪΖΜGitLab CIͰCI/CD͍ͯ͠Δ •
ৄ͍͜͠ͱશ෦ https://sue445.booth.pm/items/ 1033989 ʹॻ͍ͯΔʢεςϚʣ ‣ CircleCIΛGitLab CIʹม͑ͨҎ֎αϯϓϧϦϙδτϦ Λ΄΅ؙύΫϦͰ͖ͯΉͬͪΌศརͩͬͨ Packer + Vagrant + mitamae + Serverspec
• ʢAWS͚ͩʹݶͬͯݴ͑ʣLambdaͱͦͷपลϦιʔεΛ͍͍ײ͡ʹཧ ͯ͠σϓϩΠ͢ΔͨΊͷπʔϧ • TerraformͰLambdaΛཧ͢Δͷ৭ʑͱେมͳͷͰɺͦ͜Λϥοϓͯ͘͠ Ε͍ͯΔͷ͕خ͍͠ • ࠓճɺAWSͷϞχλϦϯάΛLambda + RubyͰ࡞ͬͯɺServerless
Framework Ͱཧͯ͠Δ Serverless Framework
• ىಈͯ͠ΔΠϯελϯεͱGitLab CIͷδϣϒΛLambdaͰूܭͯ͠ CloudWatchͰ͍͍ײ͡ʹՄࢹԽͯ͠ ͍Δ • ͦͷ͏ͪιʔεΛެ։͍͕ͨ͠ RubyKaigiͷ४උ͕͕͕͕͕ Lambda +
Ruby + Serverless FrameworkͰ࡞ͬͨࢹπʔϧ
• AWS͔ΒGitLabʹΞΫηεͰ͖ΔΑ͏ʹͨ͠ • CIͷδϣϒؒͰେ༰ྔϑΝΠϧΛड͚ͤΔΑ͏ʹͨ͠ • Runnerͷىಈ࣌ؒνϡʔχϯά • εϙοτΠϯελϯεރׇରࡦ ϐΫγϒͳΒͰͷͳͲ
• લఏ ‣ ϐΫγϒGitLabssh༻ͷURLࣾDNSͰ͔͠ղܾͰ͖ͳ͍ͷͰɺAWS͔ΒͩͱΞΫηε Ͱ͖ͳ͍ - Ծʹ໊લղܾͰ͖ͯࣾ֎͔ΒͷΞΫηεΛड͚ΔGatewayαʔόʹผͷೝূ͕ڬ·ͬͯΔͷͰ ΞΫηεͰ͖ͳ͍ ‣ httpͷURLࣾ֎͔ΒͩͱGoogleͷOAuthೝূ͕ڬ·ΔͷͰAWS͔ΒGitLabͷAPI͕ୟ͚ͳ
͍ AWS͔ΒGitLabʹଓͰ͖ΔΑ͏ʹͨ͠
• RunnerͰ͏AMIʹ༧Ί /etc/hosts Λম͍͓͖ͯɺࣾDNSͷ໊લղܾ͕Ͱ ͖ΔΑ͏ʹͨ͠ • ͜͜ͰPackerΛར༻ ղܾࡦ1: ໊લղܾࡁͷ /etc/hostsΛম͘
• GatewayαʔόͷiptablesͰAWS͔Βͷ௨৴ΛڐՄ͢ΔΑ͏ʹͨ͠ • ͦͷ··ΔͱEC2Πϯελϯεͷ࡞Γ͠ͷʹૹ৴ݩͷIPΞυϨε͕ม ΘͬͯGatewayαʔόͰڐՄ͠Α͏͕ͳ͍ͷͰɺNAT GatewayΛͬͯAWSͷ VPC͔ΒGatewayαʔόग़Δ࣌ʹૹ৴ݩͷIPΞυϨεΛݻఆԽͨ͠ • NAT Gatewayʹ༩ͨ͠Elastic
IPΛGatewayαʔόͰڐՄ͍ͯ͠Δ ղܾࡦ2: ΦϯϓϨͷຯํNAT Gateway
• ಛఆͷIPΞυϨε(ࠓճͷ߹Gateway)ͷ௨৴Λશ෦NAT GatewayΛ௨͢͜ ͱʹΑΓɺૹ৴ݩͷIPΞυϨεΛݻఆԽ͍ͯ͠Δ "[ NAT GatewayͷΠϝʔδ Subnet GitLab ΦϯϓϨڥ
AmazonVPC ec2
• ಛఆͷIPΞυϨε(ࠓճͷ߹Gateway)ͷ௨৴Λશ෦NAT GatewayΛ௨͢͜ ͱʹΑΓɺૹ৴ݩͷIPΞυϨεΛݻఆԽ͍ͯ͠Δ "[ NAT GatewayͷΠϝʔδ Subnet Subnet NAT
Gateway GitLab ΦϯϓϨڥ Gateway ec2 *1ΞυϨεΛݻఆ AmazonVPC
• NAT GatewayͷElastic IPΛGatewayͷnginxͰڐՄͯ͠Δ͜ͱʹΑΓɺ GoogleͷOAuthೝূΛճආ͢ΔΑ͏ʹͨ͠ ղܾࡦ3: httpܦ༝ͷΞΫηεNAT GatewayΛ௨͢
CIͷδϣϒؒͰେ༰ྔϑΝΠϧΛड͚ͤΔΑ͏ʹͨ͠ • ܦҢ ‣ VRoid StudioνʔϜͷਓʮδϣϒ͕ऴΘͬͯGitLabʹArtifactsΛΞοϓϩʔυ͠Α͏ͱ͢ΔͱΤ ϥʔʹͳΔʯ ‣ sue445ʮGitLabͷϩάݟͨΒ413Τϥʔ(Request Entity
Too Large)ग़ͯ·͢ͶɻnginxͷΞοϓ ϩʔυ੍ݶʹҾ͔͔ͬͬͯΔΑ͏ͳͷͰGitLabଆͷΞοϓϩʔυαΠζ؇Ί·͕͢zipʹݻΊ ͨ࣌ͷϑΝΠϧαΠζͲΕ͘Β͍͋Γ·͢ʁʯ
CIͷδϣϒؒͰେ༰ྔϑΝΠϧΛड͚ͤΔΑ͏ʹͨ͠ VRoid StudioνʔϜͷਓ ʮ4GB΄͍͠Ͱ͢ʯʢݪจϚϚʣ sue445ʮʯ
• ͖ͬ͞ͷGatewayαʔόࣾ։ൃશൠͰ͍ͬͯΔͷͰɺGatewayͷଳҬ ͕٧·Δͱࣾͷ։ൃ͕શ෦ࢮ͵ • RailsΞϓϦͰ4GBͷϑΝΠϧͷΞοϓϩʔυͱ͔͢Δͱunicorn͕ṫࢮʹͳΔ ະདྷ͔͠ݟ͑ͳ͍ ‣ ʣGitLabRailsΞϓϦ • AWS͔Β֎ʢΦϯϓϨͷGitLabʣʹग़͍ͯ࣌͘ͷ௨৴අ͕͔͔Δ
ཁ͢Δͱී௨ͷWebΞϓϦʹڊେϑΝΠϧΛup͢Δͷਏ͍
• ΞϓϦ͔ΒಛผͳઃఆΛͤͣʹS3ʹΞΫηεͰ͖ΔΑ͏ʹͨ͠ • Γํ ‣ ಛఆͷS3όέοτͷΈʹΞΫηεͰ͖ΔIAMϩʔϧΛ࡞ ‣ Docker Machine͕EC2ΠϯελϯεΛىಈ͢Δ࣌ͷΠϯελϯεϓϩϑΝΠϧʹ͜ͷIAM ϩʔϧΛઃఆ
‣ ͜͏͢Δ͜ͱͰRunnerଆawscli͚ͩ༻ҙ͍ͯ͠ΕόέοτʹಡΈॻ͖Ͱ͖ΔɻʢΞϓ ϦଆͰΞΫηεΩʔͳͲͷઃఆෆཁʣ • ಉҰϦʔδϣϯͩͱEC2ͱS3ͰϑΝΠϧΓऔΓ͢Δ࣌ͷ௨৴අ͕͔͔Βͳ͍ͷ خ͍͠ ղܾࡦ: S3ʹΞοϓϩʔυ͢ΔʢԦಓʣ
• લఏ ‣ GitLab RunnerʹOffPeakͱ͍͏ઃఆ͕͋ͬͯɺʮۀ࣌ؒৗʹEC2ΠϯελϯεΛ1 ػ͢Δ͕ɺۀ࣌ؒ֎ػͤ͞ͳ͍͜ͱͰίετΛԼ͛Δʯͱ͍͏͜ͱ͕ Մೳ ‣ https://docs.gitlab.com/runner/configuration/autoscale.html ‣
https://docs.gitlab.com/runner/configuration/advanced-configuration.html Runnerͷىಈ࣌ؒνϡʔχϯά
• લఏ ‣ ϐΫγϒGitLabͷ߹ԼهͷΑ͏ͳઃఆ ‣ ฏ10:00ʙ18:59εϙοτΠϯελϯεΛ࠷1ػͯ͠ɺδϣϒ͕ੵ·ΕͨΒଈϏ ϧυ։࢝Ͱ͖ΔΑ͏ʹͯ͠Δ ‣ ۀ࣌ؒ֎ɾਖ਼݄ɾGWεϙοτΠϯελϯεΛػͤͣ͞ɺδϣϒ͕ੵ·Εͨ ࣌ͰΠϯελϯεΛىಈ
Runnerͷىಈ࣌ؒνϡʔχϯά
• ‣ δϣϒ͕ੵ·Ε͔ͯΒ࣮ࡍʹϏϧυ͕࢝·Δ·Ͱ࠷େ4͘Β͍͔͔ͬͯͨͷͰؤுͬ ͯνϡʔχϯά͔ͨͬͨ͠ ‣ ۀ࣌ؒͩͱEC2͕1Ҏ্ػͯ͠ΔͷͰؾʹͳΒͳ͍͚Ͳఆ࣌ա͗ͯpushͨ࣌͠ʹ Runnerͷ࣮ߦ·Ͱ͕͔͔࣌ؒΔ ‣ ىಈ͕͍ΑΓ͍ํ͕͍͍
‣ ͞ਖ਼ٛɺ࣌ۚͳΓ Runnerͷىಈ࣌ؒνϡʔχϯά
• Docker MachineϦϞʔτʹdocker͕Πϯετʔϧ͞Ε͍ͯͳ͍࣌ͷΈ dockerΠϯετʔϧͯͨ͠ͷͰɺdocker͕ΠϯετʔϧࡁͳΒ͜ͷॲཧΛε ΩοϓͰ͖Δͱ౿Μͩ ‣ https://github.com/docker/machine/blob/v0.16.0/libmachine/provision/utils.go#L30 ‣ Docker MachineͰىಈ͢ΔAMIʹdockerΛΠϯετʔϧ͓͚ͯͩ͘͠Ͱ4͔Β4ʹ
ॖͰ͖ͨ ղܾࡦ: AMIʹ༧ΊdockerΛೖΕ͓ͯ͘
• ݸਓతʹ͏ͪΐͬͱॖ͔͕ͨͬͨ͠ɺ͜ΕҎ্Ζ͏ͱ͢Δͱ Docker MachineຊମΛ͍͡Δඞཁ͕͋ͬͨͷͰஅ೦ • Machine࡞࣌ͷϩάΛશ෦ಡΜ͚ͩͲͲΕ͔1ͭͷॲཧ͕͍ͱ͍͏ΑΓ ɺࡉ͔͍ॲཧ͕ͨ͘͞Μ͋ͬͯνϦπϞͰ4͔͔ͬͯΔͱ͍͏ҹͩͬ ͨ ղܾࡦ: AMIʹ༧ΊdockerΛೖΕ͓ͯ͘
• લఏ ‣ εϙοτΠϯελϯεAWS্ͷ༨ΠϯελϯεΛ҆͑͘ΔΈͳͷͰɺAWSશମ ͷεϙοτΠϯελϯεͷࡏݿ͕ͳ͚ΕىಈͰ͖ͳ͍ ‣ ͔͠͠εϙοτΠϯελϯε͕ރׇͨ࣌͠ʹࣾͷ։ൃ͕શʹࢭ·Δͷ͖͍ͭ εϙοτΠϯελϯεރׇରࡦ
• εϙοτΠϯελϯε͕ރׇͨ࣌͠ʹผͷΠϯελϯελΠϓAZͰࢼ͢ ͳͲͷεϙοτΠϯελϯεΨνϟΛΔΑΓɺͬ͞͞ͱΦϯσϚϯυʹ શৼΓͨ͠ํ͕ૣ͘෮چͰ͖Δͱ͍͏அ • ࠓ·Ͱͷܦݧ্ɺͲ͔ͬ1ϲॴͰεϙοτΠϯελϯε͕ރׇͯ͠Δͱͦͷ पล͍͍ͩͨރׇͯ͠Δҹ ղܾࡦ: ΦϯσϚϯυΠϯελϯεΛ͏RunnerΛ࡞ͬͨ
• ΦϯσϚϯυΠϯελϯεΛ͏RunnerϗοτελϯόΠʢRunnerͱͯ͠ ಈ͍ͯΔ͕ཧը໘্ͰແޮͳͷͰδϣϒׂ͕ΓৼΒΕͳ͍ʣͰ༻ҙ͠ ͓͍ͯͯɺGitLabͷཧը໘্Ͱ༗ޮԽͨ࣌͠ͷΈΘΕΔΑ͏ʹͯ͠Δ ղܾࡦ: ΦϯσϚϯυΠϯελϯεΛ͏RunnerΛ࡞ͬͨ
• εϙοτΠϯελϯεΛ׆༻͢Δ͜ͱͰϋΠεϖοΫͳCIڥΛՁ֨Ͱӡ ༻Մೳ • CIʹݶΒͣ͜Ε͔ΒશྗͰࣗಈԽ͍͖ͬͯ·͢ ·ͱΊ