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
Continuous Deployment with Go on AWS ECS
Search
Kazuhisa Togo
December 12, 2016
Programming
1
4k
Continuous Deployment with Go on AWS ECS
Kazuhisa Togo
December 12, 2016
Tweet
Share
More Decks by Kazuhisa Togo
See All by Kazuhisa Togo
AWS・Hubot・Slackで ChatOpsする話[実装編]
ktogo
0
830
Golangで支えるハイパフォーマンスAPI
ktogo
6
2.9k
SIMD meets ES7
ktogo
0
95
Other Decks in Programming
See All in Programming
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
受け取る人から提供する人になるということ
little_rubyist
0
250
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
3
1.2k
Arm移行タイムアタック
qnighy
0
340
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
A better future with KSS
kneath
238
17k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Docker and Python
trallard
40
3.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Transcript
Continuous Deployment with Go on AWS ECS Kazuhisa Togo
Kazuhisa Togo a backend developer works at kazuhisa.togo
Kazuhisa Togo some British financial company some web dev company
in Sydney freelancer, etc.
None
ෳͷϚΠΫϩαʔϏεʹ ౷ҰͷΞΧϯτΛఏڙ
Service Service Service Account Account Account Account Account Account ͕ͳ͍ͱ͖
Service Service Service O A uth 2 OAuth 2 OAuth
2 Account Account ͕͋Δͱ͖
API/Core → Go Backend → PHP Front end → Angular
ࠓͷ͓
Continuous Deployment
https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff
࠷ॳͷσϓϩΠखॱ
ϩʔΧϧͰςετ
ssh ϩʔΧϧͰςετ
ssh go get ϩʔΧϧͰςετ
ssh go get go build ϩʔΧϧͰςετ
ssh go get go build restart ϩʔΧϧͰςετ
ssh go get go build restart खಈ खಈ खಈ ϩʔΧϧͰςετ
खಈ
͍͚ͯͳ͍
ssh go get go build restart ϩʔΧϧͰςετ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → ةݥ →
͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → αʔόʔʹιʔεஔ͘ʁ →
ةݥ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → αʔόʔʹιʔεஔ͘ʁ →
ةݥ → αʔόʔͰΔʁ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → ڪා →
αʔόʔʹιʔεஔ͘ʁ → ةݥ → αʔόʔͰΔʁ → ͔͔࣌ؒΔ
ͦ͏ͩࣗಈԽ͠Α͏
CIͰςετࣗಈԽ
ssh go get go build restart ϩʔΧϧͰςετ ✔
͍ͭͰʹϏϧυ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
CodeDeployͱΈ߹Θͤͯ Continuous Deployment
CodeDeploy S3 EC2 ͓͓·͔ͳྲྀΕ
CodeD S3 ϦϙδτϦʹ git push
CodeD S3 GitHub Hook
CodeD S3 ϒϥϯνͷσʔλΛऔಘ Ϗϧυˍςετ
CodeDeploy S3 E σϓϩΠ༻ͷϑΝΠϧҰࣜΛΞʔΧΠϒ S3ʹసૹ
CodeDeploy S3 EC2 ४උ͕Ͱ͖ͨΒCodeDeployݺͼग़͠
CodeDeploy S3 EC2 S3͔ΒΞʔΧΠϒΛμϯϩʔυ ల։ɾΠϯετʔϧ
CodeDeploy S3 EC2 ΞϓϦέʔγϣϯͷ࠶ىಈ
CodeDeploy S3 EC2 git push ͰσϓϩΠ·Ͱ࣮ߦ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ʁ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ʁ → ·ͩڪා
ຊ൪≠ϩʔΧϧڥ
ຊ൪ΛϩʔΧϧͰ࠶ݱ͍ͨ͠
ίϯςφʹΑΔԾԽ
ຊ൪ͱαʔόʔͰಉ͡ڥ
͔͠͠…
None
GCP͡Όͳ͍
ͳʹ͔ΘΓʹͳΔͷ…ʁ
EC2 Container Service
EC2 ECS ECR ECSͷΈ
EC2 ECS ECR ؋Ϛγϯ DockerίϯςφΛΒͤΔ
EC2 ECS ECR DockerίϯςφͷϚωδϝϯτ ࢮ׆ࢹͳͲ
EC2 ECS ECR DockerΠϝʔδͷϓϥΠϕʔτஷଂݿ
EC2 ECS ECR 3ͭ߹ΘͤͯDockerίϯςφཧ
͜ΕͰઓ͑Δ…ʂʁ
͔͠͠ݱ࣮͔ͬͨ
Write Test Run Build Test Run
Write Test Run Build Test Run ✔
Write Test Run Build Test Run ✔ ✔
Write Test Run Build Test Run ✔ ✔ ✘ FAIL
ຊ൪ͱαʔόʔ ಉ͡ڥ ✔ ✔ ✘
ຊ൪ͱαʔόʔ ಉ͡ڥ Alpine Linux ✔ ✔ ✘
CircleCI࣮Dockerϕʔε ✔ ✔ ✘
ͨͩ͠Ubuntu ✔ ✔ ✘
Mac্ͷDockerͰಈ͔ͳ͍ ✘ ✔ ✘ FAIL
͕ͩMacͰϏϧυͨ͠ϑΝΠϧOK ✔ ✔ PASS
UbuntuͳΒಈ͘ ✔ ✔ ✔ PASS
ݪҼ͍ͭ͜ ✔ ✔ ✘
ڥґଘ ✔ ✔ ✘
͡Ό͋ಉ͡ڥʹ͠Α͏ ✔ ✔ ✘
ͰCircleCIͷίϯςφUbuntu͔͠ͳ͍ ✔ ✔ ✘
✔ Docker on Docker
✔ ✔ ڥΛશ౷Ұ
✔ ✔ ಈ͍ͨʂ ✔ PASS
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ✔
σϓϩΠ͏ා͘ͳ͍ʂ
ࣗಈԽͱڥ౷ҰͰ ແବͷͳ͍ΞδϟΠϧੜ׆Λ
Enjoy Fearless Deployment!