O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Exploring Google (Cloud) APIs & Cloud Computing overview

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Exploring Google (Cloud) APIs
and cloud computing overview
Wesley Chun
Developer Advocate, Google
G Suite Dev Show
goo.gl/JpBQ40
About the speaker
Developer Advocate, Google Cloud
● Mission: enable current and future
dev...
01
Introduction to
APIs
Why are you here?
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Próximos SlideShares
Build with ALL of Google Cloud
Build with ALL of Google Cloud
Carregando em…3
×

Confira estes a seguir

1 de 65 Anúncio

Mais Conteúdo rRelacionado

Diapositivos para si (20)

Semelhante a Exploring Google (Cloud) APIs & Cloud Computing overview (20)

Anúncio

Mais de wesley chun (14)

Mais recentes (20)

Anúncio

Exploring Google (Cloud) APIs & Cloud Computing overview

  1. 1. Exploring Google (Cloud) APIs and cloud computing overview Wesley Chun Developer Advocate, Google
  2. 2. 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) Why and Agenda ● Cloud has taken industry by storm (all?) ● Not enough cloud computing in higher-ed curriculum ● How Google Cloud can help with your courses/research ● Provide hands-on how to get started with Google Cloud ● Help prep next-generation cloud-ready workforce ● We do many student events; faculty/staff: "What about us?!?" 1 Cloud computing overview 2 Google Cloud (GCP + G Suite) 3 Serverless platforms 4 Inspirational Ideas 5 Summary & wrap-up
  3. 3. 01 Introduction to APIs Why are you here?
  4. 4. BUT ... wait, there’s more...
  5. 5. The first word on Security Authentication ("authn") vs authorization ("authz") ● authn: you are who you say you are ○ login & passwd ○ handprint authentication ○ retina scan ● authz: okay, you are who you say you are, but can you haz data? ○ OAuth2 - mostly authz, but some authn ○ Mostly about 3rd-party access to data ○ Users must give YOUR code access to THEIR data ○ Most of the time when you see "auth", it refers to authz ● Some refer to this as "consent" vs. "credentials…" which is which? Cloud/GCP console console.cloud.google.com ● Hub of all developer activity ● Applications == projects ○ New project for new apps ○ Projects have a billing acct ● Manage billing accounts ○ Financial instrument required ○ Personal or corporate credit cards, Free Trial, and education grants ● Access GCP product settings ● Manage users & security ● Manage APIs in devconsole
  6. 6. ● View application statistics ● En-/disable Google APIs ● Obtain application credentials Using Google APIs goo.gl/RbyTFD API manager aka Developers Console (devconsole) console.developers.google.com & Google APIs client libraries for many languages; demos in developers.google.com/ api-client-library
  7. 7. SIMPLE AUTHORIZED Which do you choose? OAuth2 or API key HTTP-based REST APIs 1 HTTP 2 Google APIs request-response workflow ● Application makes request ● Request received by service ● Process data, return response ● Results sent to application (typical client-server model)
  8. 8. 02 Cloud Computing & Google Cloud What is cloud computing? spar
  9. 9. Google Compute Engine, Google Cloud Storage AWS EC2 & S3; Rackspace; Joyent Cloud service levels/"pillars" SaaS Software as a Service PaaS Platform as a Service IaaS Infrastructure as a Service Google BigQuery, Cloud SQL, Cloud Datastore, NL, Vision, Pub/Sub AWS Kinesis, RDS; Windows Azure SQL, Docker Google Apps Script, App Maker Salesforce1/force.com G Suite (Google Apps) Yahoo!Mail, Hotmail, Salesforce, Netsuite Google App Engine, Cloud Functions Heroku, Cloud Foundry, Engine Yard, AWS Lambda Summary of responsibility SaaS Software as a Service Applications Data Runtime Middleware OS Virtualization Servers Storage Networking Applications Data Runtime Middleware OS Virtualization Servers Storage Networking IaaS Infrastructure as a Service Applications Data Runtime Middleware OS Virtualization Servers Storage Networking PaaS Platform as a Service Managed by YOU Managed by cloud vendor Applications Data Runtime Middleware OS Virtualization Servers Storage Networking on-prem all you, no cloud
  10. 10. Theme - Spec/Reqs Logistics - Design app Space - Provision HW Food - Build & serve app Manage - Manage app on-prem (DIY) IaaS (Compute Engine) PaaS (App Engine/GCF) SaaS (G Suite) Pick theme Plan party Find space Cook On-call Pick theme Plan party Rent hall Cook On-call Pick theme Plan party Rent hall Hire Caterer Hire manager Pick theme Hire planner Rent hall Hire caterer Hire manager Imagine you’re hosting a party... YOUR NEXT APP? google.com/datacenter
  11. 11. All of Google’s technology infrastructure… now available to you
  12. 12. G Suite APIs Top-level documentation and comprehensive developers overview video at developers.google.com/gsuite
  13. 13. 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 Google Apps Script, App Maker Salesforce1/force.com 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, Docker Google Cloud Platform vs. G Suite G Suite APIs GCP APIs 03 Google Cloud APIs
  14. 14. G Suite Collaborate and be more productive with G Suite G Suite: Google Drive Drive API allows developers to read, write, control permissions/sharing, import/export files, and more! developers.google.com/drive
  15. 15. List (first 100) files/folders in Google Drive from __future__ import print_function from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly' store = file.Storage('storage.json') creds = store.get() if not creds or creds.invalid: flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) creds = tools.run_flow(flow, store) DRIVE = discovery.build('drive', 'v3', http=creds.authorize(Http())) files = DRIVE.files().list().execute().get('files', []) for f in files: print(f['name'], f['mimeType']) Listing your files goo.gl/ZIgf8k Back up your file archives Write your own or see github.com/gsuitedevs/drive-zipextractor (JS)
  16. 16. Automate photo albums OR G Suite: Google Sheets Sheets API gives you programmatic access to spreadsheets; perform (w/code) almost any action you can do from the web interface as a user developers.google.com/sheets
  17. 17. Try our Node.js customized reporting tool codelab: g.co/codelabs/sheets Why use the Sheets API? data visualization customized reports Sheets as a data source Migrate SQL data to a Sheet # read SQL data then create new spreadsheet & add rows into it FIELDS = ('ID', 'Customer Name', 'Product Code', 'Units Ordered', 'Unit Price', 'Status') cxn = sqlite3.connect('db.sqlite') cur = cxn.cursor() rows = cur.execute('SELECT * FROM orders').fetchall() cxn.close() rows.insert(0, FIELDS) DATA = {'properties': {'title': 'Customer orders'}} SHEET_ID = SHEETS.spreadsheets().create(body=DATA, fields='spreadsheetId').execute().get('spreadsheetId') SHEETS.spreadsheets().values().update(spreadsheetId=SHEET_ID, range='A1', body={'values': rows}, valueInputOption='RAW').execute() Migrate SQL data to Sheets goo.gl/N1RPwC
  18. 18. G Suite: Google Docs & Slides Docs & Slides APIs give you access to read or write documents and presentations programmatically so you can autogenerate them with data integrated from various sources developers.google.com/docs developers.google.com/slides Try our Node.js BigQuery GitHub license analyzer codelab: g.co/codelabs/slides Why use the Slides API? data visualization presentable reports
  19. 19. Try our Node.js Markdown-to-Google-Slides generator: github.com/gsuitedevs/md2googleslides Why use the Slides API? customized presentations Replace text & images from template deck requests = [ # (global) search-and-replace text {'replaceAllText': { 'findText': '{{TITLE}}', 'replaceText': 'Hello World!', }}, # replace text-based image placeholders (global) {'replaceAllShapesWithImage': { 'imageUrl': IMG_URL, # link to product logo 'replaceMethod': 'CENTER_INSIDE', 'containsText': {'text': '{{LOGO}}'}, }}, ] SLIDES.presentations().batchUpdate(body={'requests': requests}, presentationId=DECK_ID, fields='').execute() Replacing text and images goo.gl/o6EFwk
  20. 20. + Mail merge = G Suite: Google Calendar Calendar API allows developers to easily access, modify, and create events on your users' calendars developers.google.com/calendar
  21. 21. Creating events in Calendar # define event data, then create event TIMEZONE = 'America/Los_Angeles' EVENT = { 'summary': 'Dinner with friends', 'start': {'dateTime': '2017-06-14T19:00:00', 'timeZone': TIMEZONE}, 'end': {'dateTime': '2017-06-14T22:00:00', 'timeZone': TIMEZONE}, 'attendees': [ {'email': 'friend1@example.com'}, {'email': 'friend2@example.com'}, ], } GCAL.events().insert(calendarId='primary', body=EVENT, sendNotifications=True, fields='').execute() Modifying and recurring events goo.gl/J2XkXc Creating events goo.gl/KuYMiq G Suite: Gmail Gmail API lets developers access the power of Gmail by letting you read & send messages, work with labels, issue search queries, manage settings(email sig, OoO responder), and much more! developers.google.com/gmail
  22. 22. GCP Build, innovate, and scale with Google Cloud Platform Storage (where to put your data)
  23. 23. Storing Data: Cloud Storage & Cloud Filestore cloud.google.com/storage cloud.google.com/filestore Storing Data: Cloud SQL SQL servers in the cloud High-performance, fully-managed 600MB to 416GB RAM; up to 64 vCPUs Up to 10 TB storage; 40,000 IOPS Types: MySQL Postgres SQLServer (2019) cloud.google.com/sql
  24. 24. Storing Data: Cloud Datastore Cloud Datastore: a fully- managed, highly-scalable NoSQL database for your web and mobile applications cloud.google.com/datastore Storing Data: Firebase Firebase data is stored as JSON & synchronized in real-time to every connected client; other tools + FB == v2 mobile development platform firebase.google.com
  25. 25. Storing Data: Cloud Firestore The best of both worlds: the next generation of Cloud Datastore (w/product rebrand) plus features from the Firebase realtime database cloud.google.com/firestore Storing and Analyzing Data: BigQuery Google BigQuery is a fast, highly scalable, fully-managed data warehouse in the cloud for analytics with built-in machine learning (BQML); issue SQL queries across multi-terabytes of data cloud.google.com/bigquery
  26. 26. BigQuery: querying Shakespeare words TITLE = "The top 10 most common words in all of Shakespeare's works" QUERY = ''' SELECT LOWER(word) AS word, sum(word_count) AS count FROM [bigquery-public-data:samples.shakespeare] GROUP BY word ORDER BY count DESC LIMIT 10 ''' rsp = BQ.query(body={'query': QUERY}, projectId=PROJ_ID).execute() print('n*** Results for %r:n' % TITLE) for col in rsp['schema']['fields']: # HEADERS print(col['name'].upper(), end='t') print() for row in rsp['rows']: # DATA for col in row['f']: print(col['v'], end='t') print() Top 10 most common Shakespeare words $ python bq_shake.py *** Results for "The most common words in all of Shakespeare's works": WORD COUNT the 29801 and 27529 i 21029 to 20957 of 18514 a 15370 you 14010 my 12936 in 11722 that 11519
  27. 27. 04 Machine Learning and GCP ML APIs
  28. 28. AI & Machine Learning Puppy or muffin? Machine learning is learning from rules plus experience.
  29. 29. GCP Machine Learning APIs ● Gain insights from data using GCP's pre-trained machine learning models ● Leverage the same technology as Google Translate, Photos, and Assistant ● Requires ZERO prior knowledge of ML ● If you can call an API, you can use AI/ML! Vision Video Intelligence Speech (S2T & T2S) Natural Language Translation Full Spectrum of AI & ML Offerings App developer Data Scientist Data Scientist, Researcher w/access to infrastructure, GPUs... Use pre-built models Use/extend OSS SDK, build models, manage training infrastructure ML Engine Auto ML Build custom models, use/extend OSS SDK ML APIs App developer, data scientist Use/customize pre-built models
  30. 30. Machine Learning: Cloud Video Intelligence Google Cloud Video Intelligence API makes videos searchable, and discoverable, by extracting metadata. Other features: object tracking, shot change detection, and text detection cloud.google.com/video-intelligence Machine Learning: Cloud Speech Google Cloud Speech APIs enable developers to convert speech-to-text and vice versa cloud.google.com/speech cloud.google.com/text-to-speech
  31. 31. Machine Learning: Cloud Translation Access Google Translate programmatically through this API; translate an arbitrary string into any supported language using state-of-the-art Neural Machine Translation cloud.google.com/translate Machine Learning: Cloud Natural Language Google Cloud Natural Language API reveals the structure & meaning of text; also performs content classification and sentiment analysis; multi-lingual cloud.google.com/language
  32. 32. Simple sentiment & classification analysis from google.cloud import language TEXT = '''Google, headquartered in Mountain View, unveiled the new Android phone at the Consumer Electronics Show. Sundar Pichai said in his keynote that users love their new Android phones.''' NL = language.LanguageServiceClient() document = language.types.Document(content=TEXT, type=language.enums.Document.Type.PLAIN_TEXT) sentiment = NL.analyze_sentiment(document).document_sentiment print('TEXT:', TEXT) print('nSENTIMENT: score (%.2f), magnitude (%.2f)' % ( sentiment.score, sentiment.magnitude)) categories = NL.classify_text(document).categories print('nCATEGORIES:') for cat in categories: print('* %s (%.2f)' % (cat.name[1:], cat.confidence)) Simple sentiment & classification analysis $ python nl_sent_simple.py TEXT: Google, headquartered in Mountain View, unveiled the new Android phone at the Consumer Electronics Show. Sundar Pichai said in his keynote that users love their new Android phones. SENTIMENT: score (0.30), magnitude (0.60) CATEGORIES: * Internet & Telecom (0.76) * Computers & Electronics (0.64) * News (0.56)
  33. 33. Machine Learning: Cloud Vision Google Cloud Vision API enables developers to extract metadata & understand the content of an image cloud.google.com/vision from __future__ import print_function from google.cloud import vision image_uri = 'https://google.com/services/images/section-work-card-img_2x.jpg' client = vision.ImageAnnotatorClient() image = vision.types.Image() image.source.image_uri = image_uri response = client.label_detection(image=image) print('** Labels detected (and confidence score):') for label in response.label_annotations: print(label.description, '(%.2f%%)' % (label.score*100.)) response = client.face_detection(image=image) print('n** Facial features detected (and likelihood):') from pprint import pprint for label in response.face_annotations: for likelihood in dir(label): if likelihood.endswith('_likelihood'): llh = str(vision.enums.Likelihood( getattr(label, likelihood))).split('.')[1].replace('_', ' ') print('%s: %s' % (likelihood.split('_')[0].title(), llh)) Vision: image analysis & metadata extraction
  34. 34. $ python3 viz_demo.py ** Labels detected (and confidence score): Sitting (89.94%) Interior design (86.09%) Furniture (82.08%) Table (81.52%) Room (80.85%) White-collar worker (79.04%) Office (76.19%) Conversation (68.18%) Photography (62.42%) Window (60.96%) ** Facial features detected (and likelihood): Anger: VERY UNLIKELY Blurred: VERY UNLIKELY Headwear: VERY UNLIKELY Joy: VERY LIKELY Sorrow: VERY UNLIKELY Surprise: VERY UNLIKELY Under: VERY UNLIKELY Vision: image analysis & metadata extraction Machine Learning: AutoML AutoML: a suite of cloud APIs for developers with limited machine learning expertise; chooses the best models & allows for further training of those models for your data (Translation, Vision, Natural Language, Video Intelligence, Tables) cloud.google.com/automl cloud.google.com/automl-tables
  35. 35. ● General steps a. Prep your training data b. Create dataset c. Import items into dataset d. Create/train model e. Evaluate/validate model f. Make predictions Cloud AutoML: how to use 05 Compute VMs and serverless
  36. 36. Running Code: Compute Engine > Google Compute Engine delivers configurable virtual machines of all shapes and sizes, from "micro" to 416 vCPUs, 11.75 TB RAM, 64 TB HDD or SSD disk (Debian, CentOS, CoreOS, SUSE, Red Hat Enterprise Linux, Ubuntu, FreeBSD; Windows Server 2008 R2, 2012 R2, 2016) cloud.google.com/compute
  37. 37. > Google Compute Engine configurable VMs of all shapes & sizes, from "micro" to 416 vCPUs, 11.75 TB RAM, 64 TB HDD/SSD plus Google Cloud Storage for blobs/cloud data lake (Debian, CentOS, CoreOS, SUSE, Red Hat Enterprise Linux, Ubuntu, FreeBSD; Windows Server 2008 R2, 2012 R2, 2016) cloud.google.com/compute cloud.google.com/storage Yeah, we got VMs & big disk… but why*? Serverless computing: opinionated logic-hosting containers in the cloud
  38. 38. Serverless: what & why ● What is serverless? ○ Misnomer ○ "No worries" ○ Developers focus on writing code & solving business problems* ● Why serverless? ○ Fastest growing segment of cloud... per analyst research*: ■ $1.9B (2016) and $4.25B (2018) ⇒ $7.7B (2021) and $14.93B (2023) ○ What if you go viral? Autoscaling: your new best friend ○ What if you don't? Code not running? You're not paying. * in USD; source:Forbes (May 2018), 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, Docker Serverless: PaaS-y compute/processing Google Apps Script, App Maker Salesforce1/force.com
  39. 39. Running Code: App Engine Got a great app idea? Now what? VMs? Operating systems? Big disk? Web servers? Load balancing? Database servers? Autoscaling? With Google App Engine, you don't think about those. Just upload your code; we do everything else. > cloud.google.com/appengine Why does App Engine exist?
  40. 40. App Engine to the rescue!! ● Focus on app not DevOps ● Enhance productivity ● Deploy globally ● Fully-managed ● Auto-scaling ● Pay-per-use ● Familiar standard runtimes ● 2nd gen std platforms ○ Python 3.7 ○ Java 8, 11 ○ PHP 7.2 ○ Go 1.11 ○ JS/Node.js 8, 10 ○ Ruby 2.5 Not all apps user-facing or web-based!! ● Need backend processing? Want to build your own? ● No UI required... just need HTTP ● Optimal for user info (high scores, contacts, levels/badges, etc.) ● Better UI: move user data off phone so it's universally available
  41. 41. Hello World (3 files: Python "MVP") 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 Deploy: $ gcloud app deploy Access globally: https://PROJECT_ID.appspot.com Open source repo at github.com/GoogleCloudPlatform/python-docs-samples/ tree/master/appengine/standard_python37/hello_world Running Code: Cloud Functions Don't have an entire app? Just want to deploy small microservices or "RPCs" online globally? That's what Google Cloud Functions are for! (+Firebase version for mobile apps) cloud.google.com/functions firebase.google.com/products/functions
  42. 42. Why does Cloud Functions exist? ● Don't have entire app? ○ No framework "overhead" (LAMP, MEAN...) ○ Deploy microservices ● Event-driven ○ Triggered via HTTP or background events ■ Pub/Sub, Cloud Storage, Firebase, etc. ○ Auto-scaling & highly-available; pay per use ● Flexible development environment ○ Cmd-line or developer console ● Cloud Functions for Firebase ○ Mobile app use-cases ● Available runtimes ○ JS/Node.js 6, 8, 10 ○ Python 3.7 ○ Go 1.11, 1.12 ○ Java 8 main.py def hello_world(request): return 'Hello World!' Deploy: $ gcloud functions deploy hello --runtime python37 --trigger-http Access globally (curl): curl -X POST https://GCP_REGION-PROJECT_ID.cloudfunctions.net/hello -H "Content-Type:application/json" Access globally (browser): GCP_REGION-PROJECT_ID.cloudfunctions.net/hello Hello World (Python "MVP")
  43. 43. No cmd-line access? Use in-browser dev environment! ● setup ● code ● deploy ● test Google Apps Script (and App Maker) Customized JS runtime for automation, extension, and integration with G Suite and other Google or external services
  44. 44. +JavaScript -API “flavor” +built-in “flavor” -OAuth2 (you) != “Hello World!” in Apps Script
  45. 45. Sheets-bound “Hello World!” Apps Script intro goo.gl/1sXeuD What can you do with this?
  46. 46. 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); GmailApp.sendEmail('friend@example.com', 'Map', 'See below.', {attachments:[map]}); } JS
  47. 47. Running Code: Cloud Run Got a containerized app? Want its flexibility along with the convenience of serverless that's fully-managed plus auto-scales? Google Cloud Run is exactly what you're looking for! cloud.google.com/run Code, build, deploy .js .rb .go .sh.py ... ● Any language, library, binary ○ HTTP port, stateless ● Bundle into container ○ Build w/Docker OR ○ Google Cloud Build ○ Image ⇒ Container Registry ● Deploy to Cloud Run (managed or GKE) StateHTTP https://yourservice.run.app
  48. 48. Other Google APIs Leverage features of other Google products Search YouTube for videos from __future__ import print_function from googleapiclient import discovery from settings import API_KEY QUERY = 'python -snake' trim = lambda x, ct: ('%s%s' % (x[:ct], '...' if len(x)>ct else '')).ljust(ct+3) print('n** Searching for %r videos...' % QUERY) YOUTUBE = discovery.build('youtube', 'v3', developerKey=API_KEY) res = YOUTUBE.search().list(q=QUERY, type='video', part='id,snippet').execute().get('items', []) for item in res: print('http://youtu.be/%st%s' % ( trim(item['id']['videoId'], 24), trim(item['snippet']['title'], 48)))
  49. 49. ● Not just for conversations ● Create microservice utilities ● Build chat bots to... ○ Automate workflows ○ Query for information ○ Other heavy-lifting ● Plain text or rich UI "cards" ● Very flexible ("any") development environment ○ POST to HTTP port Hangouts Chat bots (bot framework & API) "Hello World" (echo bot) Python+Flask: GAE or other hosting from flask import Flask, request, json app = Flask(__name__) @app.route('/', methods=['POST']) def on_event(): event = request.get_json() msg = {} if event['type'] == 'MESSAGE': text = 'Hi {}. You sent: {}'.format( event['user']['displayName'], event['message']['text']) msg = {'text': text} return json.jsonify(msg) Hangouts Chat bots goo.gl/jt3FqK
  50. 50. "Hello World" (echo bot) JavaScript: Google Apps Script function onMessage(m) { return { 'text': 'Hi ' + m.sender.displayName + '. You sent: ' + m.text, 'thread': {'name': m.thread.name} }; } Hangouts Chat bots goo.gl/jt3FqK Traditional APIs vs. Bot architecture Traditional API workflow OAuth2 Bot architecture
  51. 51. Other Google APIs & platforms ● Firebase (mobile development platform + RT DB) ○ firebase.google.com ● Google Data Studio (data visualization, dashboards, etc.) ○ marketingplatform.google.com/about/data-studio ● Actions on Google/Assistant/DialogFlow (voice apps) ○ developers.google.com/actions ● YouTube (Data, Analytics, and Livestreaming APIs) ○ developers.google.com/youtube ● Google Maps (Maps, Routes, and Places APIs) ○ developers.google.com/maps ● Flutter (native apps [Android, iOS, web] w/1 code base[!]) ○ flutter.dev 06 All of Cloud (inspiration) Build powerful solutions with both GCP and G Suite
  52. 52. Custom intelligence in Gmail Analyze G Suite data with GCP
  53. 53. Gmail message processing with GCP Gmail Cloud Pub/Sub Cloud Functions Cloud Vision G Suite GCP Star message Message notification Trigger function Extract images Categorize images Inbox augmented with Cloud Function
  54. 54. ● Gmail API: sets up notification forwarding to Cloud Pub/Sub ● developers.google.com/gmail/api/guides/push ● Pub/Sub: triggers logic hosted by Cloud Functions ● cloud.google.com/functions/docs/calling/pubsub ● Cloud Functions: "orchestrator" accessing GCP APIs ● Combine all of the above to add custom intelligence to Gmail ● Deep dive code blog post ● cloud.google.com/blog/products/application-development/ adding-custom-intelligence-to-gmail-with-serverless-on-gcp ● Application source code ● github.com/GoogleCloudPlatform/cloud-functions-gmail-nodejs App summary Big data analysis to slide presentation Access GCP tools from G Suite
  55. 55. Store big data results
  56. 56. Visualize big data results Ingest data from Sheets
  57. 57. Link to chart in Sheets
  58. 58. Supercharge G Suite with GCP G Suite GCP BigQuery Apps Script Slides Sheets Application request Big data analytics App summary ● Leverage GCP and build the "final mile" with G Suite ● Driven by Google Apps Script ● Google BigQuery for data analysis ● Google Sheets for visualization ● Google Slides for presentable results ● "Glued" together w/G Suite serverless ● Build this app (codelab) ● g.co/codelabs/bigquery-sheets-slides ● Video and blog post ● bit.ly/2OcptaG ● Application source code ● github.com/googlecodelabs/bigquery-sheets-slides ● Presented at Google Cloud NEXT (Jul 2018 [DEV229] & Apr 2019 [DEV212]) ● cloud.withgoogle.com/next18/sf/sessions/session/156878 ● cloud.withgoogle.com/next/sf/sessions?session=DEV212
  59. 59. 07 Wrap-up ● Key GCP product code samples for students github.com/GoogleCloudPlatform/hackathon-toolkit ● Codelabs (self-paced, hands-on tutorials): gcplab.me ● GCP documentation - cloud.google.com/{appengine,functions,vision, language,speech,text-to-speech,translate,automl,firestore,bigquery} ● Like GCP? Wanna use it in class or your research lab? Send your profs to cloud.google.com/edu to apply for teaching or research credits! ● Other docs ○ Firebase - firebase.google.com ○ G Suite - developers.google.com/{gsuite,drive,docs,sheets,slides} ○ Free trial (ignore) and Always Free (FYI) - cloud.google.com/free Resources
  60. 60. 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 ■ Request free credits ("tokens") at cloud.google.com/edu ● Official GCP documentation ○ cloud.google.com/gcp/getting-started ○ Recommended: Getting Started, Cloud Console, Cloud Shell, Cloud SDK, Community ● YouTube video series: ○ youtube.com/GoogleCloud ○ Recommended: Cloud Minute shorts & Cloud NEXT videos ○ G Suite Dev Show: goo.gl/JpBQ40 QwikLabs codelabs ● Codelabs == self-paced, hands-on tutorials ● "Quests" == group of codelabs arranged in a "learning path" ● No Google account ( provisioned on-the-fly) ● Apply for QwikLabs coupons at cloud.google.com/edu ○ Individual grant 200 credits … OR ○ Request 5000 credits for use in courses ● Special for attendees of this event! ○ Credits (15 credits) to complete a pair of quests: ■ GCP Essentials and one other; recommended: "Baseline" series ○ Sign up today at bit.ly/2kJL39T … link expires 2019 Dec 20
  61. 61. Resources for Higher Education ● Education grant program ○ Teaching grants (per-course basis) ■ $50USD for students & $100USD for faculty & TAs ■ Must exceed "Always Free" daily/monthly quota to incur billing ■ Students will barely use it… average utilization: <25% ■ KEY: not giving Google your personal credit card ○ Research grants ■ Larger amounts; consider as seed funding ■ Over a longer period of time (more than a single term) ○ Apply at cloud.google.com/edu ○ Turnaround time: "within a few business days" ○ Redeem at console.cloud.google.com/edu Career Readiness: Associate Cloud Engineer track On-demand Get free access to “Architecting with Google Cloud Platform” specialization on-demand on Coursera. (100% discount: 6 courses, 4 months access) Self-paced labs Get free access to “Cloud Architecture Quest” & other self-paced labs on Qwiklabs. (100% discount: 10+ labs) Google Cloud Certified Prepare to take the exam and earn your Associate Cloud Engineer Certification. (100% discount for faculty, 50% discount for students per adherence to timelines and other criteria) Prepare your students for careers in a cloud-first world. Apply now. See Career Readiness tab under cloud.google.com/edu
  62. 62. 2019 | Confidential and Proprietary 2019 | Confidential and Proprietary
  63. 63. 2019 | Confidential and Proprietary people enrolled in the first year of learners do not have a college degree completion rate compared to other courses on Coursera 50,000 > 1/2 2.5X More than half of learners said the course helped advance their careers or job search after just 4 months More information available at grow.google/itcert of these students are women, minorities and veterans 69% IT Support Professional Certificate Thank you! Questions? Wesley Chun @wescpy Progress bars: goo.gl/69EJVw Slides: bit.ly/2SHybQg

×