Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Cloud Runの紹介
Search
Yohei Iino
July 19, 2022
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cloud Runの紹介
- Cloud Runの紹介
- GAE→Cloud Runへの移行
- Cloud Run Jobsの紹介
Yohei Iino
July 19, 2022
More Decks by Yohei Iino
See All by Yohei Iino
1年半放置したExpo製アプリを最新化してみた
wheatandcat
0
120
作成中のFlutterアプリの中間発表
wheatandcat
0
98
最近読んだ技術書を簡単紹介
wheatandcat
0
120
ユニバーサルリンク/アプリリンクを使ってQRコードでゲストログインできるようにする
wheatandcat
0
400
Firebase App Checkを実装したので紹介
wheatandcat
0
370
PlanetScaleの無料プランがなくなるので、NeonとTiDBを試してみた
wheatandcat
0
440
Flutter HooksとRiverpodの解説
wheatandcat
0
610
T3 Stack(応用編: Next Auth & SSRの実装紹介)
wheatandcat
1
420
App Routerの紹介
wheatandcat
0
170
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
APNsからLive Activityを開始する話
yumnumm
0
170
ActionController meets Protocol Buffers
sorah
0
520
カツオ、ご期待ください
suneo3476
0
190
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
sbt 2.0: takeoff
eed3si9n
0
160
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
The Rails Doctrine Decade
koic
2
590
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
WENDY [Excerpt]
tessaabrams
14
40k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
First, design no harm
axbom
PRO
2
1.3k
Why Our Code Smells
bkeepers
PRO
340
58k
Transcript
Cloud Run の紹介 Press Space for next page
自己紹介 📝 飯野陽平(wheatandcat ) 🏢 フリーランスエンジニア(シェアフル株式会社CTO ) 💻 Blog: https://www.wheatandcat.me/
🛠 今までに作ったもの memoir ペペロミア Atomic Design Check List
Cloud Run とは Cloud Run は、スケーラブルなインフラストラクチャ上でコンテナを直接実行できるマネー ジド コンピューティング プラットフォーム。 コンテナ
イメージをビルドしてデプロイして使用できる。 構成、スケーリングは設定で即座に変更可能。
実行形式 Cloud Run には以下の2 つの実行形式がある Cloud Run Service 主な用途: API
サーバー、web サイト、イベント処理 できること 自動スケーリング、各種スケーリングの設定 Cloud Run Jobs 主な用途: バッチ処理、ツール Cloud Run Service との差は以下の通り 設定タイムアウトの時間を最大1 時間まで設定可能 最大再試行回数を設定できる 並列処理
Cloud Run の使い方 Cloud Run では以下の2 つの方法でコンテナイメージの作成が可能。 Dockerfile を使用する Buildpacks
を使用する
Buildpacks とは Buildpacks は、ソースコードから読み取りベストプラクティスに則ってDockerfile を書かずにイメージを生成 してくれるツールで、現状だと以下のプラットフォームで対応している。 Go Node.js Python Java
.NET Core Learn More
Cloud Run Service をデプロイしてみる① 以下のチュートリアルをベースに、デプロイを紹介 Cloud Run に Go サービスをデプロイする
Cloud Run Service をデプロイしてみる② 以下のコマンドでイメージを作成 上記で、GCP のArtifact Registry にイメージが作成されるので、以下のコマンドでCloud Run
にデプロイ Learn More $ gcloud builds submit --pack image=IMAGE_URL $ gcloud run deploy $SERVICE_NAME \ --project=$PROJECT_ID \ --image=$IMAGE_URL \ --region=$REGION
環境変数の設定 環境変数の設定はコンソールから設定可能 環境変数の設定 環境変数で機密情報を設定する場合はSecret Manager の値をマウントできる。 シークレットを使用する
継続的デプロイの方法 GitHub Actions を使用して実装したので紹介 ▪ Cloud Run へ移行 https://github.com/wheatandcat/memoir-backend/pull/117/files
Cloud Run Jobs を試してみる① 以下のチュートリアルをベースに紹介 Cloud Run で Go ジョブをビルドして作成する
Cloud Run Jobs を試してみる② 以下のコマンドでイメージをデプロイ 以下のコマンドで作成したコンテナを使用してジョブを作成する 以下のコマンドで実行 $ gcloud builds
submit --pack image=gcr.io/PROJECT_ID/logger-job $ gcloud beta run jobs create $JOB_NAME \ --image gcr.io/PROJECT_ID/logger-job \ --tasks 50 \ --set-env-vars SLEEP_MS=10000 \ --set-env-vars FAIL_RATE=0.5 \ --max-retries 5 \ --region REGION $ gcloud beta run jobs execute $JOB_NAME
Cloud Run Jobs を試してみる③ 結果は、コンソールで確認できる
並列実行 以下の記事を元に紹介 Cloud Run jobs を解説する
Cloud Scheduler にJob を設定する 以下のチュートリアルをベースに紹介 スケジュールに従ってジョブを実行する URL には以下を設定する https://REGION-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/PROJECT-ID/jobs/JOB-NAME:run
まとめ GCP の推しているサービスなだけあってスキの無い作りだった Cloud Run Jobs の登場でバッチ処理もカバーできるようになった Cloud Run Jobs
は、まだプレビューの状態なので注意
ご清聴ありがとうございました