Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KompalWeather: Serverless Sauna Service with Cloud Run

KompalWeather: Serverless Sauna Service with Cloud Run

Serverless Meetup Japan Virtual #7の登壇資料です。 #serverlessjp
https://serverless.connpass.com/event/188880/

Toshinori Sugita

September 23, 2020
Tweet

More Decks by Toshinori Sugita

Other Decks in Technology

Transcript

  1. 自己紹介
 • 杉田 寿憲
 ◦ Toshinori Sugita / toshi0607
 ◦

    Software Engineer@メルカリ
 ◦ マイクロサービスを開発するプラットフォームの開発・運用 
 ◦ サウナ・スパ健康アドバイザー
 • 本
 ◦ 『Google Cloud Platformで学ぶTerraform』←NEW! 
 ◦ Knative本 × 3
 ◦ 『GoとSAMで学ぶAWS Lambda』 
 ◦ 『Extensive Xamarin(共著)』
 • 趣味
 ◦ 猫、サウナ、サーバーレス

  2. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー

  3. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー
 1 watch 2 fetch status 3 save status 4 post status change
  4. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー
 1 visualize 2 download graph 3 save graph
  5. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー
 1 trend 2 download graph 3 post graph
  6. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー

  7. Cloud Run + Cloud Scheduler
 • サーバーをCloud Runで HTTPサーバーをホスト
 ◦

    watch: 混雑状況取得・変化通知
 ◦ visualize: 混雑トレンドグラフ取得
 ◦ trend: 混雑トレンドグラフ投稿
 • Cloud Schedulerで用途別のエンドポイントにリクエスト
 ◦ 営業時間15分毎にwatch
 ◦ 営業日23:30にvisualize
 ◦ 営業日15:00にtrend

  8. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー
 1 watch 2 fetch status 3 save status 4 post status change
  9. Cloud Run Cloud Run App Engine Monitoring Cloud Storage Logging

    Cloud Scheduler Slack Twitter Secret Manager Google Sheets Kom-pal API Firebase Invoker Compute Storage UI KompalWeatherのアーキテクチャー

  10. CI/CD
 • masterブランチへのマージをトリガーにコンテナイメージビルド、 Google Container Registryへのプッシュ、Cloud Runへのデプロイを 実行
 • Cloud

    Runサービス設定時にリポジトリ、Dockerfileへのパス、トリ ガーを指定するだけで設定可能
 ◦ buildpacksを使ったDockerfileなしのデプロイも対応
 • CI/CD用の強めの権限を持たせたサービスアカウントファイルのダ ウンロード不要
 ※https://cloud.google.com/run/docs/continuous-deployment-with-cloud-build buildpacks日本語ページ未反映
  11. Cloud Runとエコシステム
 • プロダクトとして
 ◦ ブルーグリーンデプロイ、トラフィックスプリット、カスタムドメイ ン、gPRC(unary)
 • アーキテクチャの一部として
 ◦

    Scheduler、Events、Workflows、Cloud SQL, etc
 ◦ Serverless NEG、VPC接続(Shared含む)
 • 開発のライフサイクル
 ◦ ローカル開発(Cloud Code for VS Code、IntelliJ)
 ◦ CI/CD
 ※https://cloud.google.com/run/docs/release-notes
  12. 案内
 Cloud Runをもっと知りたい!
 • 入門ハンズオン
 ◦ https://cloud.google.com/run/docs/quickstarts
 • ドキュメント
 ◦

    https://cloud.google.com/run
 • もっと!
 ◦ https://github.com/steren/awesome-cloudrun
 ◦ https://github.com/ahmetb/cloud-run-faq