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
840
Golangで支えるハイパフォーマンスAPI
ktogo
6
2.9k
SIMD meets ES7
ktogo
0
97
Other Decks in Programming
See All in Programming
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
150
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
300
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
320
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
nekko cloudにおけるProxmox VE利用事例
irumaru
3
440
Exploring: Partial and Independent Composables
blackbracken
0
100
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
MCP with Cloudflare Workers
yusukebe
2
220
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
良いユニットテストを書こう
mototakatsu
8
3k
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Raft: Consensus for Rubyists
vanstee
137
6.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
How GitHub (no longer) Works
holman
311
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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!