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
580
1
Share
LT_Cloud_Functions.pdf
社内LT用
Masaki Iino
September 08, 2017
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
760
Other Decks in Technology
See All in Technology
Amazon S3 Filesについて
yama3133
2
190
Digitization部 紹介資料
sansan33
PRO
1
7.3k
Claude Code を安全に使おう勉強会 / Claude Code Security Basics
masahirokawahara
2
20k
Eight Engineering Unit 紹介資料
sansan33
PRO
3
7.2k
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
140
AzureのIaC管理からログ調査まで、随所に役立つSkillsとCustom-Instructions / Boosting IaC and Log Analysis with Skills
aeonpeople
0
190
AIエージェントの権限管理 2: データ基盤の Fine grained access control 編
ren8k
0
120
AI時代 に増える データ活用先
takahal
0
170
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
290
[最強DB講義]推薦システム | 基礎編
recsyslab
PRO
1
150
AIエージェントの権限管理 1: MCPサーバー・ツールの Fine grained access control 編
ren8k
3
490
最初の一歩を踏み出せなかった私が、誰かの背中を押したいと思うようになるまで / give someone a push
mii3king
0
160
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
570
The Invisible Side of Design
smashingmag
302
51k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
170
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
170
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
180
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
69
38k
Darren the Foodie - Storyboard
khoart
PRO
3
3.2k
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
デモ