Introduction to Google App Engine

Introduction to Google App Engine

An introduction to Google App Engine. Presented @ Google Developer Group North East.

https://www.eventbrite.co.uk/e/introduction-to-google-app-engine-tickets-26308106254

81f81af7cc5d1e767303b83bd76a1e46?s=128

Omer Dawelbeit

July 29, 2016
Tweet

Transcript

  1. None
  2. None
  3. None
  4. None
  5. None
  6. None
  7. flickr photos shared under a Creative Commons (BY) license

  8. None
  9. Operating System Configurations Hardening Security Patches Tunning Scalability Maintenance Hardware

    Failures Applications Sharding Replication Indexes
  10. None
  11. None
  12. We’re sorry Our servers are over capacity and certain pages

    may be temporarily unavailable. We’re working quickly to resolve the issue.
  13. None
  14. None
  15. ◦ ◦ ◦ ◦ ◦ ◦

  16. None
  17. None
  18. None
  19. Java PHP Go Python

  20. None
  21. Key id firstName lastName dateOfBirth age Person:1219989 1219989 John Smith

    10/07/1976 40 Person:1529889 1529889 Jane Doe 23/01/1985 Person Kind vs. Table Indexed Property vs. Column Key vs. Primary key Entity vs. Row namespace:Kind:ancestor_path:id
  22. Ancestor path [Person:GreatGrandpa, Person:Grandpa, Person:Dad, Person:Me]

  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. Image Service Users Service Memcache Task Queues

  30. None
  31. ◦ ◦ ◦ ◦ http://my-app.appspot.com http://admin.my-app.appspot.com http://v1.admin.my-app.appspot.com http://v2.admin.my-app.appspot.com

  32. ◦ ◦ ◦ ◦ ◦ ◦ ◦

  33. None
  34. PaaS IaaS Flexibility Agility Your code Your code

  35. None
  36. App Engine App Engine Flexible What VM means for customers

    Execution Environment Where the code runs Optimised Sandbox Secured 0 to N scaling GA GCE VM-Based Docker containers based in Beta Flexibility Any language, framework, or library Performance Up to 32 vCPUS or 208 GB of mem Networking stack Custom Cloud Platform networking stack One network • VPN, direct, carrier connection options • Connect App Engine instances to Compute Engine on private network Load balancer Autoscaler Custom Cloud Load Balancer Cloud Autoscaler More control Configure lower-level infrastructure services as necessary NoSQL Tasks & cron Integrated Decoupled More control • Access NoSQL Datastore from any compute product • Utilize Task Queues or Pub/Sub to facilitate intra-project communication Managed runtime support constrained Fully open-source compliant New runtimes Managed Node.js, Python 3, Java 8, PHP, Go
  37. • Docker images hosted on gcr.io • Pure openjdk8: deploy

    a jar • Springboot, Vertx, SparkJava, etc… • Simple app.yaml • Pure Servlet 3.1: deploy a war • Jetty9, collaboration with the Jetty project • Simple app.yaml • For GAE Standard Apps: Jetty9 +Sandbox compatibility layer • Run Standard apps as is, • needs appengine-web.xml
  38. The Java 8 Runtime Dockerfile FROM gcr.io/google_appengine/openjdk8 ADD myspringbootapp.jar /app

    app.yaml runtime: custom / java vm: true api_version: 1 runtime_config: jdk: openjdk8 The Java 8 / Jetty 9.3 Runtime Dockerfile FROM gcr.io/google_appengine/jetty9 ADD root.war $JETTY_BASE/webapps/ app.yaml runtime: custom / java vm: true api_version: 1 runtime_config: jdk: openjdk8 server: jetty9 The Java 8 / Jetty 9.3 Compact Runtime Dockerfile FROM gcr.io/google_appengine/jetty9-compat ADD . /app/ appengine-web.xml <vm>true</vm>
  39. app.yaml now controls Java runtimes (The compat runtime still needs

    appengine-web.xml) runtime: java vm: true api_version: 1 handlers: - url: .* script: dynamic resources: cpu: .5 memory_gb: 1.3 disk_size_gb: 10 automatic_scaling: min_num_instances: 1 max_num_instances: 20 cool_down_period_sec: 60 cpu_utilization: target_utilization: 0.5 env_variables: OAUTH2_CALLBACK: http://your-project-id.appspot.com/oauth2callback LOG_PATH: /var/log/app_engine/custom_logs
  40. New tooling • Cloud SDK • fingerprinting • deploy app.yaml

    configurations • Maven Plugin for Cloud SDK • Automatic staging phase for GAE sandbox compat applications • or put app.yaml and Dockerfile in src/main/appengine directory <plugin> <groupId>com.google.appengine</groupId> <artifactId>gcloud-maven-plugin</artifactId> <version>2.0.9.111.v20160527</version> <configuration> <version>purejetty9vmtrue</version> </configuration> </plugin> <plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>0.1.1-beta</version> <configuration> </configuration> </plugin>
  41. None
  42. None
  43. ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦

  44. None
  45. None
  46. ◦ ◦

  47. None
  48. None
  49. git clone https://github.com/omerio/spring-boot-container-demo.git cd spring-boot-container-demo/ mvn clean package mvn docker:build

    mvn exec:java mvn gcloud:deploy -Dgcloud.project=gde-demos -Dapp.version=v2
  50. None
  51. None
  52. None