SlideShare a Scribd company logo
1 of 13
Download to read offline
Introduction to serverless
computing on Google Cloud
Wesley Chun
Developer Advocate, Google
Contribute
questions at:
goo.gl/Rq6ABI
G Suite Dev Show
goo.gl/JpBQ40
About the speaker
Developer Advocate, Google Cloud
● Mission: enable current and future
developers everywhere to be
successful using Google Cloud and
other Google developer tools & APIs
● Videos: host of the G Suite Dev Show
on YouTube
● Blogs: developers.googleblog.com &
gsuite-developers.googleblog.com
● Twitters: @wescpy, @GoogleDevs,
@GSuiteDevs
Previous experience / background
● Software engineer & architect for 20+ years
● One of the original Yahoo!Mail engineers
● Author of bestselling "Core Python" books
(corepython.com)
● Technical trainer, teacher, instructor since
1983 (Computer Science, C, Linux, Python)
● Fellow of the Python Software Foundation
● AB (Math/CS) & CMP (Music/Piano), UC
Berkeley and MSCS, UC Santa Barbara
● Adjunct Computer Science Faculty, Foothill
College (Silicon Valley)
Serverless: what & why
● What is serverless?
○ Misnomer: of course there's a server somewhere
○ You just don't have to worry about it!
○ Forbes (May 2018): Serverless... [helps] developers focus on writing code without having to
worry about infrastructure... servers (physical & virtual) completely abstracted away from the
user. [Developers] ... focused on solving business problems (e.g., faster app deployment)
● Why serverless?
○ Fastest growing segment of cloud... per 2 analysts*:
■ $1.9B (2016) and $4.25B (2018) ⇒ $7.7B (2021) and $14.93B (2023)
○ Unless focused on DevOps... VMs, networking, load balancing, web servers,
database servers, frontends/proxies, etc. less relevant for app-builders
○ What if you go viral? Autoscaling: your new best friend
○ What if you don't? Code not running? You're not paying. (No VMs to shutdown.)
* in USD; source: MarketsandMarkets™ & CB Insights (Aug 2018)
Google Compute Engine, Google Cloud Storage
AWS EC2 & S3; Rackspace; Joyent
SaaS
Software as a Service
PaaS
Platform as a Service
IaaS
Infrastructure as a Service
G Suite (Google Apps)
Yahoo!Mail, Hotmail, Salesforce, Netsuite
Google App Engine, Cloud Functions
Heroku, Cloud Foundry, Engine Yard, AWS Lambda
Google BigQuery, Cloud SQL,
Cloud Datastore, NL, Vision, Pub/Sub
AWS Kinesis, RDS; Windows Azure SQL Database
Serverless: PaaS-y compute/processing
Google Apps Script, App Maker
Salesforce1/force.com
Google App Engine
App-hosting in the cloud
Why does App Engine exist?
App Engine to the rescue!!
●Easy to build
●Easy to manage
●Easy to scale
● Enables greater developer productivity!
● Focus on building your app, not sys admin
● Let us wear the pagers!
● BUT don't confuse App Engine w/IaaS services!
Not all apps user-facing or web-based!!
● Need backend server processing? Want to build your own?
● No UI needed for app to talk to App Engine, just need HTTP
● Great place for user info e.g., high scores, contacts, levels/badges, etc.
● Better UI: move user data off phone & make universally available
Hello World (3 files)
app.yaml
runtime: python37
main.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!'
requirements.txt
Flask==1.0.2
App hosting plus a domain name!
$ gcloud app deploy
browser URL:
https://APP_ID.appspot.com
Ex: https://wescpy-apitest.appspot.com
How to deploy and where to run it
$ gcloud app deploy
● Browser
● cURL
● Mobile apps (backend, no UI needed!)
● etc.
browser URL:
https://APP_ID.appspot.com
Ex: https://wescpy-apitest.appspot.com
Languages supported
Languages
● Python 2.7 & 3.6
● Node.js
● Ruby
● Java 8 / Servlet 3.1
● Jetty 9
● PHP 5.6, 7
● Go 1.8, 1.9, 1.10
● C#/.NET
● custom
Open Capabilities
Flexible Runtime
Languages
● Python 2.7, 3.7
● Java 7, 8
● PHP 5.5, 7.2
● Go 1.6, 1.8, 1.11
● Node.js 8
"Constrained" Capabilities
Incredibly rapid scale
Bold == 2nd generation
Standard Runtime
Google Cloud Functions
Function-hosting in the cloud
"Hello World" Python Cloud Function
main.py
def hello_world(request):
return 'Hello World!'
$ gcloud functions deploy hello --runtime python37 --trigger-http
curl:
curl -X POST https://[GCP_REGION]-[PROJECT_ID].cloudfunctions.net/hello 
-H "Content-Type:application/json" --data '{"value": "123"}'
browser:
http://[GCP_REGION]-[PROJECT_ID].cloudfunctions.net/hello?value=123
Ex: https://us-central1-myproject-ccsc.cloudfunctions.net/hello
Google Cloud Functions
Languages Supported
● Node.js 6, 8 (JavaScript)
● Python 3.7
Deploying Cloud Functions
● Create locally then deploy on cmd-line OR
● Edit and deploy from developer web console
Triggering Cloud Functions (response to events)
● HTTP — via HTTP request
● Cloud Storage — bucket object/metadata CRUD
● Cloud Pub/Sub — new message
● Firebase (DB, Storage, Analytics, Auth)
Test tool
Google Apps Script (and App Maker)
Customized JS runtime for G Suite automation, extension, and integration
Sheets-bound “Hello World!”
Apps Script intro
goo.gl/1sXeuD
Sheets-bound “Hello World!”
What can you do with this?
Accessing maps from
spreadsheets?!?
goo.gl/oAzBN9
This… with help from Google Maps & Gmail
function sendMap() {
var sheet = SpreadsheetApp.getActiveSheet();
var address = sheet.getRange("A2").getValue();
var map = Maps.newStaticMap().addMarker(address);
MailApp.sendEmail(EMAIL, "Map", map.getMapUrl());
}
JS
Session Summary
● Why go cloud?
○ Cloud computing has taken the world by storm
○ You're behind if you're not already using it… it's not too late!
○ Help train the next generation cloud-ready workforce!
● Google Cloud and why serverless?
○ Many features: compute, storage, AI/ML, NW, data processing, etc.
○ Serverless lets users focus on just their logic (apps or functions)
○ Interesting possibilities using both platforms (GCP + G Suite)
References
● G Suite and Google Apps Script documentation
○ developers.google.com/gsuite
○ developers.google.com/apps-script
● GCP docs source code (i.e., App Engine & Cloud Functions quickstarts)
○ github.com/GoogleCloudPlatform/python-docs-samples
○ github.com/GoogleCloudPlatform/nodejs-docs-samples
● Inspirational demo apps' resources
○ cloud.withgoogle.com/next18/sf/sessions/session/156878
■ cloud.google.com/blog/products/application-development/
adding-custom-intelligence-to-gmail-with-serverless-on-gcp
■ bit.ly/2OcptaG
○ NEXT '19: cloud.withgoogle.com/next/sf/sessions?session=DEV212
Learning resources
● Codelabs: self-paced hands-on tutorials
○ Google codelabs: need a Gmail account, always free
■ g.co/codelabs/cloud
○ Qwiklabs codelabs: don't need a Gmail acct; typically not free
■ google.qwiklabs.com
■ Individuals can request 200 more credits; 5000 credits for use in courses
● Official GCP docs: cloud.google.com
○ Recommended: Getting Started, Cloud Console, Cloud Shell, Cloud SDK, GCP
Free Tier (need a credit card), Community
● YouTube video series: youtube.com/GoogleCloud
○ Recommended: Cloud Minute shorts & Cloud NEXT videos
○ G Suite Dev Show: goo.gl/JpBQ40
Resources for Higher Education
● Education grant program
○ Teaching grants (per-course basis)
■ $50USD for students
■ $100USD for faculty & TAs
■ You'll barely use any of it… key: no need to give Google a credit card
○ Research grants
■ Larger amounts, granted for longer period of time
○ Turnaround time: 3-4 business days
● Teacher center
○ teachercenter.withgoogle.com/gcp
○ Apply here for education grants
○ Apply here for Qwiklabs credits
Thank you! Questions?
Wesley Chun
@wescpy

More Related Content

What's hot

What's hot (20)

Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 
Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)
 
Build with ALL of Google Cloud
Build with ALL of Google CloudBuild with ALL of Google Cloud
Build with ALL of Google Cloud
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
 
Drupal contributor HOWTO
Drupal contributor HOWTODrupal contributor HOWTO
Drupal contributor HOWTO
 
Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)Easy path to machine learning (Spring 2020)
Easy path to machine learning (Spring 2020)
 
Google App Engine Overview and Update
Google App Engine Overview and UpdateGoogle App Engine Overview and Update
Google App Engine Overview and Update
 
JHipster Code 2020 keynote
JHipster Code 2020 keynoteJHipster Code 2020 keynote
JHipster Code 2020 keynote
 
World is changed. i feel it in the front end
World is changed. i feel it in the front endWorld is changed. i feel it in the front end
World is changed. i feel it in the front end
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
 
How to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the CloudHow to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the Cloud
 
Drupal core indeas - Andy Postnikov
Drupal core indeas  - Andy PostnikovDrupal core indeas  - Andy Postnikov
Drupal core indeas - Andy Postnikov
 
Using Google (Cloud) APIs
Using Google (Cloud) APIsUsing Google (Cloud) APIs
Using Google (Cloud) APIs
 
Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...
Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...
Build Your Blazing Fast Site with Gatsby and WordPress @ WordSesh by Muhammad...
 
Google App Engine Developer - Day1
Google App Engine Developer - Day1Google App Engine Developer - Day1
Google App Engine Developer - Day1
 
Rapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for JavaRapid Application Development on Google App Engine for Java
Rapid Application Development on Google App Engine for Java
 
Building Integrated Applications on Google's Cloud Technologies
Building Integrated Applications on Google's Cloud TechnologiesBuilding Integrated Applications on Google's Cloud Technologies
Building Integrated Applications on Google's Cloud Technologies
 
JHipster overview
JHipster overviewJHipster overview
JHipster overview
 
Building Integrated Applications on Google's Cloud Technologies
Building Integrated Applications on Google's Cloud TechnologiesBuilding Integrated Applications on Google's Cloud Technologies
Building Integrated Applications on Google's Cloud Technologies
 

Similar to Introduction to serverless computing on Google Cloud

Similar to Introduction to serverless computing on Google Cloud (20)

Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
 
G Suite & Google APIs coding workshop
G Suite & Google APIs coding workshopG Suite & Google APIs coding workshop
G Suite & Google APIs coding workshop
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
How Google Cloud Platform can help in the classroom/lab
How Google Cloud Platform can help in the classroom/labHow Google Cloud Platform can help in the classroom/lab
How Google Cloud Platform can help in the classroom/lab
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloud
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)
 
Cloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google CloudCloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google Cloud
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Google Cloud Platform Update
Google Cloud Platform UpdateGoogle Cloud Platform Update
Google Cloud Platform Update
 
Google Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScriptGoogle Apps Script: Accessing G Suite & other Google services with JavaScript
Google Apps Script: Accessing G Suite & other Google services with JavaScript
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Google... more than just a cloud
Google... more than just a cloudGoogle... more than just a cloud
Google... more than just a cloud
 
Cloud computing overview & running your code on Google Cloud (Jun 2019)
Cloud computing overview & running your code on Google Cloud (Jun 2019)Cloud computing overview & running your code on Google Cloud (Jun 2019)
Cloud computing overview & running your code on Google Cloud (Jun 2019)
 
Intro to cloud computing & running your code on Google Cloud
Intro to cloud computing & running your code on Google CloudIntro to cloud computing & running your code on Google Cloud
Intro to cloud computing & running your code on Google Cloud
 
Build with all of Google Cloud
Build with all of Google CloudBuild with all of Google Cloud
Build with all of Google Cloud
 
Cloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google CloudCloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google Cloud
 
Google Developers Overview Deck 2015
Google Developers Overview Deck 2015Google Developers Overview Deck 2015
Google Developers Overview Deck 2015
 
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
 

More from wesley chun

More from wesley chun (11)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)
 
Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)
 
Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Python
 
Easy path to machine learning (2022)
Easy path to machine learning (2022)Easy path to machine learning (2022)
Easy path to machine learning (2022)
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Google Cloud @ Hackathons (2020)
Google Cloud @ Hackathons (2020)Google Cloud @ Hackathons (2020)
Google Cloud @ Hackathons (2020)
 
Easy path to machine learning
Easy path to machine learningEasy path to machine learning
Easy path to machine learning
 

Recently uploaded

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Recently uploaded (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 

Introduction to serverless computing on Google Cloud

  • 1. Introduction to serverless computing on Google Cloud Wesley Chun Developer Advocate, Google Contribute questions at: goo.gl/Rq6ABI G Suite Dev Show goo.gl/JpBQ40 About the speaker Developer Advocate, Google Cloud ● Mission: enable current and future developers everywhere to be successful using Google Cloud and other Google developer tools & APIs ● Videos: host of the G Suite Dev Show on YouTube ● Blogs: developers.googleblog.com & gsuite-developers.googleblog.com ● Twitters: @wescpy, @GoogleDevs, @GSuiteDevs Previous experience / background ● Software engineer & architect for 20+ years ● One of the original Yahoo!Mail engineers ● Author of bestselling "Core Python" books (corepython.com) ● Technical trainer, teacher, instructor since 1983 (Computer Science, C, Linux, Python) ● Fellow of the Python Software Foundation ● AB (Math/CS) & CMP (Music/Piano), UC Berkeley and MSCS, UC Santa Barbara ● Adjunct Computer Science Faculty, Foothill College (Silicon Valley)
  • 2. Serverless: what & why ● What is serverless? ○ Misnomer: of course there's a server somewhere ○ You just don't have to worry about it! ○ Forbes (May 2018): Serverless... [helps] developers focus on writing code without having to worry about infrastructure... servers (physical & virtual) completely abstracted away from the user. [Developers] ... focused on solving business problems (e.g., faster app deployment) ● Why serverless? ○ Fastest growing segment of cloud... per 2 analysts*: ■ $1.9B (2016) and $4.25B (2018) ⇒ $7.7B (2021) and $14.93B (2023) ○ Unless focused on DevOps... VMs, networking, load balancing, web servers, database servers, frontends/proxies, etc. less relevant for app-builders ○ What if you go viral? Autoscaling: your new best friend ○ What if you don't? Code not running? You're not paying. (No VMs to shutdown.) * in USD; source: MarketsandMarkets™ & CB Insights (Aug 2018) Google Compute Engine, Google Cloud Storage AWS EC2 & S3; Rackspace; Joyent SaaS Software as a Service PaaS Platform as a Service IaaS Infrastructure as a Service G Suite (Google Apps) Yahoo!Mail, Hotmail, Salesforce, Netsuite Google App Engine, Cloud Functions Heroku, Cloud Foundry, Engine Yard, AWS Lambda Google BigQuery, Cloud SQL, Cloud Datastore, NL, Vision, Pub/Sub AWS Kinesis, RDS; Windows Azure SQL Database Serverless: PaaS-y compute/processing Google Apps Script, App Maker Salesforce1/force.com
  • 3. Google App Engine App-hosting in the cloud Why does App Engine exist?
  • 4. App Engine to the rescue!! ●Easy to build ●Easy to manage ●Easy to scale ● Enables greater developer productivity! ● Focus on building your app, not sys admin ● Let us wear the pagers! ● BUT don't confuse App Engine w/IaaS services! Not all apps user-facing or web-based!! ● Need backend server processing? Want to build your own? ● No UI needed for app to talk to App Engine, just need HTTP ● Great place for user info e.g., high scores, contacts, levels/badges, etc. ● Better UI: move user data off phone & make universally available
  • 5. Hello World (3 files) app.yaml runtime: python37 main.py from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'Hello World!' requirements.txt Flask==1.0.2 App hosting plus a domain name! $ gcloud app deploy browser URL: https://APP_ID.appspot.com Ex: https://wescpy-apitest.appspot.com How to deploy and where to run it $ gcloud app deploy ● Browser ● cURL ● Mobile apps (backend, no UI needed!) ● etc. browser URL: https://APP_ID.appspot.com Ex: https://wescpy-apitest.appspot.com
  • 6. Languages supported Languages ● Python 2.7 & 3.6 ● Node.js ● Ruby ● Java 8 / Servlet 3.1 ● Jetty 9 ● PHP 5.6, 7 ● Go 1.8, 1.9, 1.10 ● C#/.NET ● custom Open Capabilities Flexible Runtime Languages ● Python 2.7, 3.7 ● Java 7, 8 ● PHP 5.5, 7.2 ● Go 1.6, 1.8, 1.11 ● Node.js 8 "Constrained" Capabilities Incredibly rapid scale Bold == 2nd generation Standard Runtime Google Cloud Functions Function-hosting in the cloud
  • 7. "Hello World" Python Cloud Function main.py def hello_world(request): return 'Hello World!' $ gcloud functions deploy hello --runtime python37 --trigger-http curl: curl -X POST https://[GCP_REGION]-[PROJECT_ID].cloudfunctions.net/hello -H "Content-Type:application/json" --data '{"value": "123"}' browser: http://[GCP_REGION]-[PROJECT_ID].cloudfunctions.net/hello?value=123 Ex: https://us-central1-myproject-ccsc.cloudfunctions.net/hello Google Cloud Functions Languages Supported ● Node.js 6, 8 (JavaScript) ● Python 3.7 Deploying Cloud Functions ● Create locally then deploy on cmd-line OR ● Edit and deploy from developer web console Triggering Cloud Functions (response to events) ● HTTP — via HTTP request ● Cloud Storage — bucket object/metadata CRUD ● Cloud Pub/Sub — new message ● Firebase (DB, Storage, Analytics, Auth)
  • 8. Test tool Google Apps Script (and App Maker) Customized JS runtime for G Suite automation, extension, and integration
  • 9. Sheets-bound “Hello World!” Apps Script intro goo.gl/1sXeuD Sheets-bound “Hello World!”
  • 10. What can you do with this? Accessing maps from spreadsheets?!? goo.gl/oAzBN9 This… with help from Google Maps & Gmail function sendMap() { var sheet = SpreadsheetApp.getActiveSheet(); var address = sheet.getRange("A2").getValue(); var map = Maps.newStaticMap().addMarker(address); MailApp.sendEmail(EMAIL, "Map", map.getMapUrl()); } JS
  • 11. Session Summary ● Why go cloud? ○ Cloud computing has taken the world by storm ○ You're behind if you're not already using it… it's not too late! ○ Help train the next generation cloud-ready workforce! ● Google Cloud and why serverless? ○ Many features: compute, storage, AI/ML, NW, data processing, etc. ○ Serverless lets users focus on just their logic (apps or functions) ○ Interesting possibilities using both platforms (GCP + G Suite)
  • 12. References ● G Suite and Google Apps Script documentation ○ developers.google.com/gsuite ○ developers.google.com/apps-script ● GCP docs source code (i.e., App Engine & Cloud Functions quickstarts) ○ github.com/GoogleCloudPlatform/python-docs-samples ○ github.com/GoogleCloudPlatform/nodejs-docs-samples ● Inspirational demo apps' resources ○ cloud.withgoogle.com/next18/sf/sessions/session/156878 ■ cloud.google.com/blog/products/application-development/ adding-custom-intelligence-to-gmail-with-serverless-on-gcp ■ bit.ly/2OcptaG ○ NEXT '19: cloud.withgoogle.com/next/sf/sessions?session=DEV212 Learning resources ● Codelabs: self-paced hands-on tutorials ○ Google codelabs: need a Gmail account, always free ■ g.co/codelabs/cloud ○ Qwiklabs codelabs: don't need a Gmail acct; typically not free ■ google.qwiklabs.com ■ Individuals can request 200 more credits; 5000 credits for use in courses ● Official GCP docs: cloud.google.com ○ Recommended: Getting Started, Cloud Console, Cloud Shell, Cloud SDK, GCP Free Tier (need a credit card), Community ● YouTube video series: youtube.com/GoogleCloud ○ Recommended: Cloud Minute shorts & Cloud NEXT videos ○ G Suite Dev Show: goo.gl/JpBQ40
  • 13. Resources for Higher Education ● Education grant program ○ Teaching grants (per-course basis) ■ $50USD for students ■ $100USD for faculty & TAs ■ You'll barely use any of it… key: no need to give Google a credit card ○ Research grants ■ Larger amounts, granted for longer period of time ○ Turnaround time: 3-4 business days ● Teacher center ○ teachercenter.withgoogle.com/gcp ○ Apply here for education grants ○ Apply here for Qwiklabs credits Thank you! Questions? Wesley Chun @wescpy