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
Introduction to Cloud Run 2021
Search
sakajunquality
February 04, 2021
Technology
3
1.5k
Introduction to Cloud Run 2021
https://gdg-tokyo.connpass.com/event/201523/
sakajunquality
February 04, 2021
Tweet
Share
More Decks by sakajunquality
See All by sakajunquality
DevFest Tokyo 2023: Google Cloudでチームで安全にデプロイをする
sakajunquality
10
1.7k
Cloud Spanner Monitoring 入門 / Cloud Spanner Monitoring Introduction
sakajunquality
1
1.2k
GKE Overview March 2021: Introducing Autopilot
sakajunquality
1
780
Building Reliable Distributed Systems on GCP
sakajunquality
1
220
Istio 1.5 Updates
sakajunquality
4
1.9k
GCP 101: Getting Started through Cloud Run
sakajunquality
6
3.5k
Seeking Observability, Getting Started with Service Mesh
sakajunquality
0
130
Fastly Yamagoya Meetup: Leveraging Cloud Portability with Fastly
sakajunquality
0
15k
GCLB Traffic Management: envoy inside
sakajunquality
0
590
Other Decks in Technology
See All in Technology
音声AIエージェントの世界とRetell AI入門 / Introduction to the World of Voice AI Agents and Retell AI
rkaga
5
920
株式会社M2X エンジニアチーム紹介資料
m2xsoftware
0
620
効果的なオンコール対応と障害対応
ryuichi1208
5
2.7k
技術ブログや登壇資料を秒で作るコツ伝授します
minorun365
PRO
23
5.5k
不動産売買取引におけるAIの可能性とプロダクトでのAI活用
zabio3
0
230
四国クラウドお遍路 2024 in 高知 エンディング
yukataoka
0
190
LandingZoneAccelerator と学ぶ 「スケーラブルで安全なマルチアカウントAWS環境」と 私たちにもできるベストプラクティス
maimyyym
1
130
スタッフエンジニアの道: The Staff Engineer’s Path
snoozer05
PRO
41
13k
社内の学びの場・コミュニティ形成とエンジニア同士のリレーションシップ構築/devreljapan2024
nishiuma
3
240
四国のあのイベントの〇〇システムを45日間で構築した話 / cloudohenro2024_tachibana
biatunky
0
310
AWS SAW を広めたい @四国クラウドお遍路
kazzpapa3
0
220
EitherT_with_Future
aoiroaoino
1
1.1k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
What the flash - Photography Introduction
edds
67
11k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Speed Design
sergeychernyshev
22
420
The Invisible Customer
myddelton
119
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
48
2.8k
The Cost Of JavaScript in 2023
addyosmani
42
5.2k
The Pragmatic Product Professional
lauravandoore
31
6.2k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
Statistics for Hackers
jakevdp
793
220k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
Transcript
Jun Sakata Google Developers Expert, Cloud @sakajunquality Cloud Run 入門
2021.02.04 #gdgtokyo GDG Tokyo New Year LT大会 2021
アジェンダ Cloud Run - Cloud Runとは - 使い方 - 他のプロダクトとの比較
- まとめ
Cloud Runとは コンテナを秒単位で本番環境にデプロイ
Cloud Run - フルマネージドのサーバーレスのプラットフォーム - 時間課金 / Scale to 0
- 任意コンテナイメージをデプロイ - HTTP / gRPC / WebSocket
Cloud Run - サーバーレスのアプリケーション - 任意コンテナイメージをデプロイ - HTTP / gRPC
/ WebSocket Cloud Run HTTP
Cloud Run - サーバーレスのアプリケーション - 任意コンテナイメージをデプロイ - HTTP / gRPC
/ WebSocket Cloud Run gRPC
使い方
Containers? - i.e. Docker Image
コンテナのリリース ソースコード コンテナ イメージ 実行環境
コンテナのリリース ソースコード コンテナ イメージ 実行環境 ビルド デプロイ
Dockerfile?
// 書く vim Dockerfile // ビルド gcloud builds submit --tag
[image] . // デプロイ gcloud run deploy --image [image]
Dockerfile書きたくない?
Google Cloud buildpacks - Dockerfileなしにコンテナイメージを作成 - CNCFのBuildpacksをベースとしたOSS - https://github.com/GoogleCloudPlatform/buildpacks
// けす rm Dockerfile // ビルド gcloud builds submit --pack
image=[image] // デプロイ gcloud run deploy --image [image]
1コマンドで?
// いらない rm Dockerfile // ビルドとデプロイ gcloud beta run deploy
--source .
コンテナのリリース(buildpacks) ソースコード コンテナ イメージ 実行環境
Dockerfileそれでも書いた ほうがいい場合も?
Cloud Runのリソース
Cloud Run リソース - CPU: 1,2,4 vCPU - Memory: max
8GB - 最大のリクエスト: 15m (GA), 60m (Preview) - インスタンス数: 0-1000 (最小も指定可能に) - インスタンスあたりの同時リクエスト: 1-250 - Custom Domain/Custom TLS Certificate - Cloud Traceとの連携
Cloud Run 簡易CIも - GitHubやCloud Source Repositiriesのソースコードに対してCloud Runに 対するデプロイのパイプラインをGUIで設定可能 -
https://cloud.google.com/run/docs/continuous-deployment-with-clo ud-build
Cloud Run w/ GitHub Actions - GitHub Actionsのヘルパーも公式で用意されている - https://github.com/google-github-actions/setup-gcloud
Cloud Runの連携 - Cloud Workflow - Cloud API Gateway -
Eventarc - etc...
Cloud Run Eventarc - Event driven trigger via Audit Logging
- https://cloud.google.com/blog/topics/developers-practitioners/event arc-unified-eventing-experience-google-cloud
他のGCPのプロダクト と比較?
v.s. App Engine (GAE) - 対応言語やバージョンの縛りがなくなる - Service Account が柔軟(複数サービス展開時)
- App Engineのがいいことも - Static Contents Server / Cloud CDN - Cloud IAP - (GAEの内部でも buildpack 使われてる)
v.s. Cloud Functions (GCF) - Runは各インスタンスが同時に複数リクエスト受けることができる - 主要言語に Functions フレームワークも提供しているのでRunをFaaSのよ
うな利用でも利用可能 - https://cloud.google.com/functions/docs/functions-framework?hl= en
v.s. Kubernetes Engine (GKE) - クラスター課金ではなくリクエストベースの課金 - クラスターが管理不要なので気軽に始められる - GKEのほうが柔軟性はある
- プロトコル, 実行時間の縛り, サイドカー, ローカルのディスクなど
まとめ Cloud Runはいいぞ!
まとめ - Cloud Runはフルマネージドのサーバーレスランタイム - BuildpacksによりDockerfileを書かなくてもよい - 日々アップデートされており柔軟なワークロードに対応 - リリースノート
- https://cloud.google.com/run/docs/release-notes?hl=en
Thank You! Jun Sakata Google Developers Expert, Cloud @sakajunquality