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
LT_Cloud_Functions.pdf
Search
Masaki Iino
September 08, 2017
Technology
1
580
LT_Cloud_Functions.pdf
社内LT用
Masaki Iino
September 08, 2017
Tweet
Share
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
250
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.6k
GolangでAPIドキュメント自動生成
iinomasaki
0
740
Other Decks in Technology
See All in Technology
Agent Skils
dip_tech
PRO
0
190
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
220
LiDARが変えたARの"距離感"
zozotech
PRO
0
260
AI駆動開発を事業のコアに置く
tasukuonizawa
1
1.6k
LLMOpsのこれまでとこれからを学ぶ
nsakki55
2
610
私たち準委任PdEは2つのプロダクトに挑戦する ~ソフトウェア、開発支援という”二重”のプロダクトエンジニアリングの実践~ / 20260212 Naoki Takahashi
shift_evolve
PRO
3
340
Amazon Rekognitionで 「信玄餅きなこ問題」を解決する
usanchuu
1
370
30分でわかる「ネットワーク図の描き方入門」/infraengbooks56
corestate55
1
340
器用貧乏が強みになるまで ~「なんでもやる」が導いたエンジニアとしての現在地~
kakehashi
PRO
1
150
デザインもAIに任せる!iPhoneで行うiOS開発
zozotech
PRO
0
280
Open Table Formatにおけるストレージ抽象化の比較
lycorptech_jp
PRO
1
180
なぜAIは チーム開発を 速くしないのか
tan_go238
6
3.1k
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
A Tale of Four Properties
chriscoyier
162
24k
Optimizing for Happiness
mojombo
379
71k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
My Coaching Mixtape
mlcsv
0
57
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
260
Code Review Best Practice
trishagee
74
20k
Test your architecture with Archunit
thirion
1
2.2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
250
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
First, design no harm
axbom
PRO
2
1.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
270
Transcript
Cloud Functions Masaki Iino
Cloud Functions Cloud Functions β版 βリリース時にFirebaseもサポートされた ぼちぼち、GAになるらしい
Cloud Functions • サーバレス • イベント駆動 • ステートレス • Node.js
料金体系
関数の種類 • HTTP Functions ◦ HTTPSリクエストがトリガー ◦ 同期実行 • Background
Functions ◦ Cloud Pub/Sub ◦ Cloud Storage ◦ 非同期実行
HTTP Functions Hello World するならこう 内部的にExpressを使用している exports.helloWorld = function helloWorld
(req, res) { res.send('Hello World!'); };
HTTP Functions デプロイ方法 アップロードするバケットとトリガーを指定 バケットは先に作っておく必要あり $ gcloud beta functions deploy
helloWorld \ --stage-bucket functions-helloWorld \ --trigger-http
Background Functions Hello World するならこう 最後にcallbackを呼ぶ exports.helloWorld = function helloWorld
(event, callback) { callback(); };
Background Functions デプロイ方法 アップロードするバケットとトリガーを指定 $ gcloud beta functions deploy helloWorld
\ --stage-bucket functions-helloWorld \ --trigger-bucket my-bucket $ gcloud beta functions deploy helloWorld \ --stage-bucket functions-helloWorld \ --trigger-topic my-topic
パッケージ package.jsonを記述すれば、クラウド上でnpm installされる。 "dependencies": { "request": "^2.81.0" }, const request
= require('request'); exports.helloWorld = function helloWorld (req, res) { request('http://www.google.com', (error, response, body) => { res.send('Hello World!'); } };
ログ Stackdriver Loggingに出力される(console.logを使う)
モニタリング 呼び出し回数 / 実行時間 / メモリ使用量
開発環境 公式のエミュレータがあります。(まだalpha
デモ