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
creating infra / 新サービスのインフラ作ってた話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ryosms
November 03, 2020
Technology
1.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
creating infra / 新サービスのインフラ作ってた話
合同勉強会 in 大都会岡山 -2020 Winter Online-
ryosms
November 03, 2020
More Decks by ryosms
See All by ryosms
JetBrains Plugins / IDEと香辛料
ryosms
0
370
VS CodeでもGitKraken
ryosms
0
1.6k
量子コンピュータ完全に理解した / quantum computing perfect master
ryosms
1
320
Intro to Git GUI Client
ryosms
3
760
CloudGarageでJIRAを運用した感想
ryosms
1
760
再考 エンジニアの装備 〜武器編〜 / Weapon for Engineer
ryosms
2
200
AndroidをJUnit4でやる / Using JUnit4 with Android
ryosms
0
750
Other Decks in Technology
See All in Technology
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
360
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
500
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
180
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
190
Agentic ERPをどう設計するか ー 受発注エージェントを動かす、現場の知見と設計思想ー
recerqainc
1
1.5k
AIを「創る」と「使う」の循環 — HRテックが実践するリアルなAI組織実装
taketo957
0
1.5k
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
460
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
180
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.8k
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
2.5k
探して_入れて_作って_使う_Agent_Skills___LT.pdf
peintangos
2
160
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
200
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Mind Mapping
helmedeiros
PRO
1
230
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Language of Interfaces
destraynor
162
27k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Designing for Performance
lara
611
70k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
140
Transcript
新サービスのインフラ作ってた話 @合同勉強会 in 大都会岡山 -2020 Winter Online-
I am a GitKraken Ambassador, not a paid employee of
GitKraken by Axosoft. INTRODUCE MYSELF Ryo Sumasu @ryosms #gbdaitokai
拍手アプリ https://syobochim.hatenablog.com/entry/2020/10/31/205851 ⚫ ↓にアクセスすると拍手ができます ⚫ 拍手してもらえるとハゲみになります ⚫ https://dprn9mw3rdpyz.cloudfront.net/?id=c 466f4d0-00e3-4271-a626-93a09e705ce4
AGENDA ⚫ 前置き ⚫ インフラ構成 ⚫ デプロイ周り
会社・前業務・サービス内容 前置き
会社のこと https://www.rhizome-e.com/ ⚫ 株式会社リゾーム ⚫ 通称 #R社 ⚫ toB事業(主にショッピングセンター向け) ⚫
所属チームはRailsがメイン ⚫ 運用はAWS / heroku
前にやってた業務(抜粋) ⚫ toCサイト(閉鎖済み) ⚫ Spring Boot + Docker + Elastic
Beanstalk ⚫ Rundeck構築 ⚫ 社内システムの構築 ⚫ 主力商品(Rails)の検証環境構築の簡易化 ⚫ Vue.js + Cognito + AWS Amplify ⚫ API Gateway + AWS Lambda(Golang) + DynamoDB ⚫ Elastic Beanstalk (Docker multi container)
今回のサービスの概要 ⚫ ショッピングセンター向けWebサービス ⚫ 帳票出力有り ⚫ マルチテナントなクラウドサービス ⚫ もう少しでサービスイン
全体像 インフラ構成
None
個別 インフラ構成
Rails
帳票
ログ分析
ツールとか、デプロイ方法とか デプロイ周り
デプロイツール ⚫ CloudFormation ⚫ Terraform ⚫ ecspresso
CloudFormation https://aws.amazon.com/jp/cloudformation/ ⚫ インフラのガワを構築するのに利用 ⚫ VPC関連 ⚫ ECS Cluster ⚫
SQS ⚫ Elasticsearch ⚫ Lambda(sam cli) ⚫ CloudWatch Logs ロググループ ⚫ S3 ⚫ IAM ⚫ etc…
Terraform https://www.terraform.io/ ⚫ パラメータストアの管理に使用 ⚫ CloudFormationでは管理できないケースがある ⚫ https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/late st/UserGuide/aws-resource-ssm-parameter.html
ecspresso https://github.com/kayac/ecspresso ⚫ ECSサービスのデプロイに使用 ⚫ config.yml ⚫ service-def.json ⚫ task-def.json
ecspresso https://twitter.com/ryosms/status/1219871032485404675
ecspresso https://github.com/kayac/ecspresso ⚫ ECSサービスのデプロイに使用 ⚫ config.yml ⚫ service-def.json service-def.yml ⚫
task-def.json task-def.yml ⚫ yqを利用してyml→jsonに変換
デプロイ手順 ⚫ デプロイやDBのメンテ用にEC2を作成 ⚫ EC2の起動テンプレートとansibleで作り直し可能 ⚫ 手元で動かせるように同様のDockerイメージも作成 ⚫ 各手順はすべてコマンドで実行 ⚫
複雑なコマンドは手順をシェルスクリプトにしたりしている
デプロイ手順 ⚫ 最新ソースをgit pull ⚫ terraform applyでパラメータストア更新 ⚫ CFnのOutputから環境変数作成 ⚫
サービス定義・タスク定義のjson生成 ⚫ Dockerイメージのbuild・push ⚫ ECSサービスのデプロイ
もっと簡単にデプロイしたい めんどくさい
めんどくさい処理はRundeckにやらせよう Rundeck
Rundeckでのデプロイ手順 ⚫ RundeckのWebコンソールにログインする ⚫ 本プロジェクトのページに移動する ⚫ デプロイ用のJobを実行する
Rundeckでのデプロイ手順
I am a GitKraken Ambassador, not a paid employee of
GitKraken by Axosoft. Use my referral URL to be entered to win a Nintendo Switch! www.gitkraken.com/invite/xKSqCHYi