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
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
みんなでプロポーザルを書いてみた
yuriko1211
0
260
ヤプリ新卒SREの オンボーディング
masaki12
0
130
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
初めてDefinitelyTypedにPRを出した話
syumai
0
420
CSC509 Lecture 13
javiergs
PRO
0
110
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Contemporary Test Cases
maaretp
0
140
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
CSC509 Lecture 11
javiergs
PRO
0
180
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
We Have a Design System, Now What?
morganepeng
50
7.2k
Scaling GitHub
holman
458
140k
The Cult of Friendly URLs
andyhume
78
6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
97
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
How to train your dragon (web standard)
notwaldorf
88
5.7k
The Invisible Side of Design
smashingmag
298
50k
Music & Morning Musume
bryan
46
6.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
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!