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
600
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LT_Cloud_Functions.pdf
社内LT用
Masaki Iino
September 08, 2017
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
260
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.7k
GolangでAPIドキュメント自動生成
iinomasaki
0
770
Other Decks in Technology
See All in Technology
最高のシステムプロンプトを作るためにフィードバック機能を導入した話
alchemy1115
1
330
第3回しろおびセキュリティスポンサーセッション
log0417
0
140
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
16
5.7k
AI時代の強いチームの作り方
yuukiyo
23
15k
LLMリーダーボードアップデートに向けたAgentic Math_SWEのトレースについて
nejumi
0
210
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
270
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.7k
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.1k
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
250
Forza Horizon 6 のテレメトリ機能で 自動運転に使えそうな学習データを集める話
henjin0
0
120
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
19k
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
120
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
We Have a Design System, Now What?
morganepeng
55
8.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
320
YesSQL, Process and Tooling at Scale
rocio
174
15k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Unsuck your backbone
ammeep
672
58k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
410
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Technical Leadership for Architectural Decision Making
baasie
3
460
Six Lessons from altMBA
skipperchong
29
4.4k
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
デモ