$30 off During Our Annual Pro Sale. View Details »

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

Omer Dawelbeit

July 29, 2016
Tweet

More Decks by Omer Dawelbeit

Other Decks in Technology

Transcript

  1. View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. flickr photos shared under a Creative Commons (BY) license

    View Slide

  8. View Slide

  9. Operating System
    Configurations
    Hardening
    Security Patches
    Tunning
    Scalability
    Maintenance
    Hardware Failures
    Applications
    Sharding
    Replication
    Indexes

    View Slide

  10. View Slide

  11. View Slide

  12. We’re sorry
    Our servers are over capacity and certain pages may be temporarily
    unavailable. We’re working quickly to resolve the issue.

    View Slide

  13. View Slide

  14. View Slide







  15. View Slide

  16. View Slide

  17. View Slide

  18. View Slide

  19. Java PHP Go
    Python

    View Slide

  20. View Slide

  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

    View Slide

  22. Ancestor path
    [Person:GreatGrandpa, Person:Grandpa, Person:Dad, Person:Me]

    View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. Image Service
    Users Service
    Memcache Task Queues

    View Slide

  30. View Slide





  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

    View Slide








  32. View Slide

  33. View Slide

  34. PaaS
    IaaS
    Flexibility Agility
    Your
    code
    Your
    code

    View Slide

  35. View Slide

  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

    View Slide

  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

    View Slide

  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 true

    View Slide

  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

    View Slide

  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

    com.google.appengine
    gcloud-maven-plugin
    2.0.9.111.v20160527

    purejetty9vmtrue



    com.google.cloud.tools
    appengine-maven-plugin
    0.1.1-beta



    View Slide

  41. View Slide

  42. View Slide











  43. View Slide

  44. View Slide

  45. View Slide



  46. View Slide

  47. View Slide

  48. View Slide

  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

    View Slide

  50. View Slide

  51. View Slide

  52. View Slide