CS263: RUNTIME SYSTEMS WINTER 2016



Similar documents
Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

The Cloud to the rescue!

PaaS - Platform as a Service Google App Engine

Google Cloud Platform The basics

appscale: open-source platform-level cloud computing

HYBRID CLOUD SUPPORT FOR LARGE SCALE ANALYTICS AND WEB PROCESSING. Navraj Chohan, Anand Gupta, Chris Bunch, Kowshik Prakasam, and Chandra Krintz

Lecture 6 Cloud Application Development, using Google App Engine as an example

Lecture 10 Fundamentals of GAE Development. Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

Cloud Computing. Chapter 3 Platform as a Service (PaaS)

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Systems Integration in the Cloud Era with Apache Camel. Kai Wähner, Principal Consultant

Cloud computing - Architecting in the cloud

Automating Big Data Benchmarking for Different Architectures with ALOJA

Budget Event Management Design Document

A programming model in Cloud: MapReduce

References. Introduction to Database Systems CSE 444. Motivation. Basic Features. Outline: Database in the Cloud. Outline

Introduction to Database Systems CSE 444

Getting Started with Google Cloud Platform

SOA, case Google. Faculty of technology management Information Technology Service Oriented Communications CT30A8901.

APP DEVELOPMENT ON THE CLOUD MADE EASY WITH PAAS

JAVA IN THE CLOUD PAAS PLATFORM IN COMPARISON

ACM Crossroads Student Magazine The ACM's First Electronic Publication

Scalable Architecture on Amazon AWS Cloud

WHITE PAPER. Migrating an existing on-premise application to Windows Azure Cloud

Alfresco Enterprise on AWS: Reference Architecture

Where We Are. References. Cloud Computing. Levels of Service. Cloud Computing History. Introduction to Data Management CSE 344

Networks and Services

Migrating SaaS Applications to Windows Azure

Enterprise Service Bus

Last time. Today. IaaS Providers. Amazon Web Services, overview

Big Data with the Google Cloud Platform

Cloudy with a chance of 0-day

Oracle WebLogic Server 11g Administration

An Enterprise Approach to Mobile File Access and Sharing

Application Interface Services Server for Mobile Enterprise Applications Configuration Guide Tools Release 9.2

Using the Push Notifications Extension Part 1: Certificates and Setup

CatDV Pro Workgroup Serve r

Assignment # 1 (Cloud Computing Security)

Cloud Powered Mobile Apps with Azure

Building Java Servlets with Oracle JDeveloper

A Web Base Information System Using Cloud Computing

White Paper. Anywhere, Any Device File Access with IT in Control. Enterprise File Serving 2.0

owncloud Architecture Overview

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Drupal Performance Tuning

How To Understand The 2013 Cio Agenda For A Cloud Server

Database FAQs - SQL Server

Developing Cloud Applications using IBM Bluemix. Brian DePradine (Development lead Liberty buildpack)

Azure Scalability Prescriptive Architecture using the Enzo Multitenant Framework

TG Web. Technical FAQ

A Comparison of Clouds: Amazon Web Services, Windows Azure, Google Cloud Platform, VMWare and Others (Fall 2012)

Amazon Glacier. Developer Guide API Version

Python and Google App Engine

Unit 2 Research Project. Eddie S. Jackson. Kaplan University. IT530: Computer Networks. Dr. Thomas Watts, PhD, CISSP

Integration Service Database. Installation Guide - Oracle. On-Premises

Introduction to Cloud Computing

WebSphere Performance Monitoring & Tuning For Webtop Version 5.3 on WebSphere 5.1.x

Research Paper Available online at: A COMPARATIVE STUDY OF CLOUD COMPUTING SERVICE PROVIDERS

24/11/14. During this course. Internet is everywhere. Frequency barrier hit. Management costs increase. Advanced Distributed Systems Cloud Computing

API documentation - 1 -

FileMaker 11. ODBC and JDBC Guide

Building a Continuous Integration Pipeline with Docker

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

Oracle WebLogic Server 11g: Administration Essentials

Application Security

Architecture and Mode of Operation

Cloud Powered Mobile Apps with Microsoft Azure

CARRIOTS TECHNICAL PRESENTATION

owncloud Enterprise Edition on IBM Infrastructure

Comparing SQL and NOSQL databases

Amazon Cloud Storage Options

SIEMENS. Teamcenter Windows Server Installation PLM

Sentinel Cloud V.3.6 Quick Start Guide

BASICS OF SCALING: LOAD BALANCERS

Cloud Computing with Windows Azure using your Preferred Technology

Background on Elastic Compute Cloud (EC2) AMI s to choose from including servers hosted on different Linux distros

Harnessing the Power of the Microsoft Cloud for Deep Data Analytics

HP OO 10.X - SiteScope Monitoring Templates

CLOUD COMPUTING & WINDOWS AZURE

Oracle WebLogic Server: Remote Monitoring and Management

Rational Application Developer Performance Tips Introduction

Transcription:

CS263: RUNTIME SYSTEMS WINTER 2016 http://www.cs.ucsb.edu/~cs263! Sign up for piazza now please (the link s on this page)!! Prof. Chandra Krintz! Laboratory for Research on! Adaptive Computing Environments (RACELab)! Computer Science Department! Harold Frank Hall (HFH) 2153! ckrintz@gmail.com!!

SUMMARY FROM LAST TIME Dennard scaling is ending! Demand for performance is not sa0ated Widespread belief (hope?) that parallelism will save the day! Too little attention to improving efficiency across the hardware-software stack! Need sustained focus on improving software performance! New tools, techniques, and hardware More attention to developing efficient systems, not individual components! 2

CS263 GOALS Learn and understand the various core functions of modern runtime systems! Gain hands-on experience with a modern distributed runtime system (cloud platform)! Understand the web-based so<ware architecture Dig deeper into the software stack that ultimately executes the program! Managed run0me system, aka (programming language) virtual machine We ll focus on Java (but I ll point out the diffs with other languages as appropriate) Programmer productivity aids that impact performance (and how we try to recover it)! Portability of apps Garbage collec0on 3

CS263 COURSE TOPICS Software, services, and their interoperation! Google App Engine modern cloud app plaoorms Modern languages and their managed runtime systems! OO review Implementa0ons Java focus Garbage collection! Execution: interpretation, dynamic/jit compilation! Adaptive (profile-driven) optimization! 4

External trends and influences have changed language/ runtime support -- Your project OUTLINE in this class takes advantage of each! Hardware/architecture evolution! Low cost, HPC, memory-rich, mul0core, virtualiza0on Moore s law (Dennard scaling is dead) Apps built by composition of components!! Components increasingly becoming web-accessible services APIs: gateway to digital assets, business opportuni0es

CHANGES IN SOFTWARE DEVELOPMENT Each component in its own managed runtime! Fault isola0on Separate concerns Can execute anywhere Same/different machine Op0mize/specialize run0me Emphasis moves to! Loca0ng/naming Coordina0on Data transfer and persistence Communica0on Interprocess communica0on (IPC) JVM=VM=MRE=Run0me =execu0on engine

External trends and influences have changed language/ runtime support -- Your project OUTLINE in this class takes advantage of each! Hardware/architecture evolution! Low cost, HPC, memory-rich, mul0core, virtualiza0on Moore s law (Dennard scaling is dead) Apps built by composition of components! Components increasingly becoming web-accessible services APIs: gateway to digital assets, business opportuni0es Distributed computing! Remote execu0on, mul0-tasking, containeriza0on, cloud The people who are developing applications/software! Produc2vity programmers vs specialists/experts Cloud platforms have emerged to simplify process! Automa0cally configure, deploy, manage apps, APIs, and services

External trends and influences have changed language/ runtime support -- Your project OUTLINE in this class takes advantage of each! Hardware/architecture evolution! Apps built by composition of components! Web services Distributed computing! Programmer productivity! High-level languages, garbage collec0on Cloud platforms bring it all together!

CS263 PROJECT 50% of class grade (1-2 person groups)! Java Google App Engine App (free 0er) Required APIs: datastore (no JPO/JDA,Slim3), task queue, and memcache (no Jcache) Must expose a GET and POST REST API for each GAE API/service REST APIs must use JSON to send/receive data Turnin includes curl commands that work on Linux to read (GET) and write (POST) each of the services Use of JAX-RS Use of maven to package and build the applica0on All Deadline Dates Posted on Website Schedule Selenium or other tool script that exercises app APIs, with usage in project README Public github repo, fully documented, commit (100+ lines/wk) required over 2me incl. tests 15-20 minute public, recorded (youtube, vimeo, ) demo and presenta0on Overviewing project, contribu0ons, novelty, experience, performance evalua0on, and demonstra0ng app execu0on Turnin: link to github repo, link to running app, link to video, file with tested curl commands App to be kept running un0l graded (Friday of finals week) 9

CS263 EVALUATION hgp://www.cs.ucsb.edu/~cs263/ 10% Class attendance and participation! Read papers, come prepared to ask/answer ques0ons on the topic Assignments (on schedule) in and out of class 40% Midterm! Review in class prior, midterm in class (closed notes/books/etc) 50% Project (1-2 person groups)! Weekly code commits (star0ng with Assignment 3) Public github repo Youtube presenta0on/demo at end 10

JAX-RS A standard Java API for developing RESTful services! Implement your service in plain old Java and add some annotations to expose it as a RESTful service! Supported by a variety of programming frameworks and runtimes! Jersey, Apache CXF, Apache Wink, IBM WebSphere, Oracle WebLogic, RESTEasy, RESTlet etc Links under today s schedule (required reading & other resources)! REST, JAX-RS, maven, App Engine

CURL Powerful command-line tool for testing HTTP endpoints! GET:! curl v hgp://test.com POST (Form):! curl v X POST d key=value hgp://test.com POST (XML):! curl v X POST d @test.xml H Content-type: applica0on/xml hgp://test.com

ASSIGNMENTS 1, 2, AND 3 Asgn1: in class next Tuesday! Setup App Engine and a simple app deployment locally (for tes0ng: dev app server) and on Google s resources Asgn2: in class next Thursday! Deploy a more complicated applica0on that uses the Datastore (guestbook) Asgn3: out of class (Due Thurs Jan 21 by start of class)! No class Jan 19 (work on this assignment): Add services, REST support Also part of this assignment: github, vision statement, etc. for your project See web page for details Lays the groundwork for project extend with your innovation! App Engine, key cloud services, REST/JAX-RS, curl, debugging/deployment Bring your laptops to class all next week!

An Introduction to Google App Engine Platform as-a-service (PaaS) Technologies Chandra Krintz, UCSB

Cloud Infrastructure (as a Service) Cloud Platform (as a Service) Your IT, Devs, DevOps Applications Runtimes Security & Integration Databases Servers Virtualization Server HW Storage Networking Managed by: Vendor software (public) e.g. AWS IaaS software (on-premise) Your Devs Applications Runtimes Security & Integration Databases Servers Virtualization Server HW Storage Networking Managed by: Vendor software (public) e.g. Google App Engine, Azure PaaS software (on-premise)

GOOGLE APP ENGINE Google s platform as-a-service one of the first public PaaS s! Hosting service for web apps, services, and mobile backends! No notion of server!

GOOGLE APP ENGINE Google s platform as-a-service one of the first public PaaS s! Hosting service for web apps, services, and mobile backends! The result of over a decade of studying Googlers! Make them more productive, innovative, and satisfied!

GOOGLE APP ENGINE Google s platform as-a-service one of the first public PaaS s! Hosting service for web apps, services, and mobile backends! The result of over a decade of studying Googlers! Preview release in 2008, GA in 2011! Now over 4 million active apps, ½ of all Internet accesses/week use it! Endpoints Application Backend Storage Compute Engine Web APIs

APP ENGINE DEVELOPMENT & DEPLOYMENT! Decouples app/innovation from common services! Share scalable services across apps! Automatically manages and scales apps + service ecosystem!

APP ENGINE DEVELOPMENT & DEPLOYMENT! Decouples app/innovation from common services! Share scalable services across apps! Automatically manages and scales apps + service ecosystem! App Engine APIs

APP ENGINE DEV/DEPLOYMENT MODEL Everything is a web request or background task! Sandboxed execution! Restrictions for scale/safety, quotas on free use! No file system access! Processing limits (frontends and tasks)! Data persistence via Datastore, memcache, and Cloud SQL! Language libraries limited to whitelist! Quotas (free and billed)! In/Out bandwidth! Datastore usage! Other APIs (Mail, messaging, URL Fetch, )!

APP ENGINE SYSTEM App Master Request Front End App Server Datastore Front End App Server Front End App Server Memcache Static Files Images Users URL Fetch Task Queue

TRADITIONAL WEBSITE IMPLEMENTATION Apache Reverse Proxy Apache MySQL Apache Reverse Proxy MySQL MySQL MySQL Apache Apache MySQL MySQL MySQL

APP SERVER SYSTEM Data Center #1 Data Center #2 App Engine (App Engine Management Layer) User ISP Edge Cache Google Front End Google s Fiber App Master: orchestrates everything AE Front End: provides load balancing on App Servers and Static Servers App Servers provide runtime environment for Application Instances Static Servers App Engine Front End App Servers Application Instances Application Instances Application Instances

APP SERVER OPTIONS Frontend instance (Application instances)! Computing units! Not an App Engine Front End! Automatically scaled (parameters controlled by you with defaults)! Dynamically created and deleted = low cost! Enforce fast response and stateless design! Suitable for processing short-lived requests! Deadlines: HTTP requests: 32MB, 60s; 10min background tasks! Different sizes (memory/cpu): F1,F2,F4,F4_1G! Default: F1 128MB, 600MHz, $0.05/hr; F4_1G 1GB, 2.4GHz, $0.30/hr! Billed on instance hours: minute time granularity (+15mins startup)!

APP SERVER OPTIONS Backend instance (also computing units)! Statically created and deleted = higher cost! Configurable memory, CPU, elasticity! No limit for response time, supports stateful design! Suitable for batch processing, run indefinitely (attempted)! Billed similarly to frontend instances! Quotas: free, billable, safety limits! Daily, refreshed at midnight Pacific time! Per minute quotas, resource requests are delayed/denied! Creates, API calls/operations, data transmitted/size, storage, indexes, files uploaded, logging, sockets, HTTPs!

APP ENGINE APIS AND SERVICES Datastore key/value object persistent storage! Fast, replicated, and scalable for large-scale data! Memcache key/value in-memory cache (not persistent)! Task queue, cron, pipelines, map reduce! Blobstore: key/value persistent storage for large objects! Users, mail, search, XMPP, URL fetch! ***Bold APIs are required to be included in your project/app.

APP ENGINE DATASTORE API Datastore key/value object persistent storage! Fast, replicated, and scalable for large-scale data! Easily extensible entity structures (kinds), less than 1MB in size! Simple API: put, get, delete, range_query (SQL subset)! Only simple queries supported, limited indexing support, no shared counters! Reads are cheap, writes are expensive,! Writes: parallelize and optimize low contention! Trade-off space for low contention, avoid sharing! Strongly consistent entity writes (row-level atomic updates) but eventually consistent across servers! Limited transaction support for multi-entity atomic updates! See also: http://highscalability.com/numbers-everyone-should-know! Category of obj Data store Kind Datastore API Megastore BigTable RDBMS Table Entry/obj Entity Row Unique id Key Primary Key Indiv. Data Property Field Google Data Center

Properties

DATASTORE CODE EXAMPLE Creating an Entity with Java Low-Level API DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); String name = Joe ; Key empkey = KeyFactory.createKey( Employee", name); Entity employee = new Entity(empKey); employee.setproperty( name,name); employee.setproperty( hiredate,new Date()); employee.setproperty( attendedtraining,true); datastore.put(employee); With Transactions DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Transaction txn = datastore.begintransaction(); try{ Key empkey = KeyFactory.createKey( Employee, Joe ); Entity emp = datastore.get(empkey); //read/write emp object Address addr = Address(parent=empKey); addr.setproperty( ); datastore.put(emp); datastore.put(addr); txn.commit(); } finally { if (txn.isactive()) { txn.rollback(); } }

DATASTORE CODE EXAMPLE Creating an Entity with Java Low-Level API With Transactions DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); String name = Joe ; Key empkey = KeyFactory.createKey( Employee", name); Entity employee = new Entity(empKey); employee.setproperty( name,name); employee.setproperty( hiredate,new Date()); employee.setproperty( attendedtraining,true); datastore.put(employee); Low-level API -- what you ll use for your project Best performance, more coding JDO/JPA More portability; Java standard APIs Third-party frameworks Objectify, Twig, Slim3, Sophisticated features with good performance DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Transaction txn = datastore.begintransaction(); try{ Key empkey = KeyFactory.createKey( Employee, Joe ); Entity emp = datastore.get(empkey); //read/write emp object Address addr = Address(parent=empKey); addr.setproperty( ); datastore.put(emp); datastore.put(addr); txn.commit(); } finally { if (txn.isactive()) { txn.rollback(); } }

DATASTORE QUERIES

DATASTORE QUERIES No joins, aggregate functions, search! No notion of total or partial counts! Sorts are performed ahead of time via index construction! Single property! Composite (multi-property)! Entity groups Restricted: 1 update per second! Defines the scope of a transaction! Hierarchical relationships: Parent->Child->GrandChild! ACID transactions within entity groups (optimistic locking)! Ancestor queries!

DATASTORE INDEXING All properties have single indexes auto-generated (both asc/desc)! All composite indexes must be specified explicitly! Note that Datastore data size (bytes, quota, billed)! Includes all of its indexes! Indexes in datastore-indexes-auto.xml! appname/target/appname-1.0-snapshot/web-inf/appengine-generated/datastore-indexes-auto.xml! Development server automatically adds suggestions by running app! An index is defined on a list of properties of a given kind (entity type) with a corresponding order (asc/desc)! For use with ancestor queries, the index may also optionally include an entity's ancestors!

DATASTORE INDEXING All properties have single indexes auto-generated (both asc/desc)! All composite indexes must be specified explicitly! Note that Datastore data size (bytes, quota, billed)! Includes all of its indexes! Indexes in datastore-indexes-auto.xml! <datastore-indexes> <datastore-index kind="greeting ancestor="true" source="manual"> <property name="date" direction="desc"/> </datastore-index> </datastore-indexes>

APP ENGINE APIS AND SERVICES Datastore key/value object persistent storage! Fast, replicated, and scalable for large-scale data!! Memcache key/value in-memory cache (not persistent)! Task queue, cron, pipelines, map reduce! Blobstore: key/value persistent storage for large objects! Users, mail, search, XMPP, URL fetch! ***Bold APIs are required to be included in your project/app.

APP ENGINE TASK QUEUES Task: unit of work! Write object to datastore! Send an email! All versions of an application share queues! Push queue for auto execution! Pull queues to programmatically consume tasks! Task have unique names! Generated automatically if not assigned! Insert new task with same name will fail!

APP ENGINE TASK QUEUES A simple way to perform work in your app, outside of a user request Features: Executed ASAP May cause new instances Frontend or Backend - 10min or unlimited - Max 100K task size Features: Task leased by worker REST interface with ACL - Can be outside App Engine - Max 1MB task size

APP ENGINE PUSH QUEUES Push Queues Queues are named and configurable (queue.xml/queue.yaml) Processing rate (e.g. 60/m == 1/s) Token bucket size (default = 5) Max concurrent requests (default = unlimited) Configurations can be overridden for individual tasks Unless specified otherwise, tasks are executed on the version of the app which spawned it

APP ENGINE PUSH QUEUES <!-- index.html file served from "/ --> <html> <body> <p>enqueue a value for worker.</p> <form action="/enqueue" method="post"> <input type="text" name="key"> <input type="submit"> </form> </body> </html> // The Worker servlet mapped to the "/worker public class Worker extends HttpServlet { protected void dopost(httpservletrequest req, HttpServletResponse res) throws ServletException, IOException { String key = req.getparameter("key"); // Do something with key. } } // The Enqueue servlet is mapped to "/enqueue import com...taskqueue.queue; import com taskqueue.queuefactory; import static com taskqueue.taskoptions.builder.*; public class Enqueue extends HttpServlet { protected void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { String key = request.getparameter("key"); } } // Add the task to the default queue. Queue queue = QueueFactory.getDefaultQueue(); queue.add(withurl("/worker").param("key", key)); response.sendredirect("/");

APP ENGINE PULL QUEUES Add task Queue q = QueueFactory.getQueue( pull-queue ); q.add(taskoptions.builder.withmethod(taskoptions.method.pull).payload( hello world )); Lease (here, 100 tasks) then delete tasks = q.leasetasks(3600, TimeUnit.SECONDS,100); //do the work q.deletetask(tasks);

PROGRAMMING APP ENGINE Download the SDK from Google! Create an app ID via the admin console: https://appengine.google.com/! Program your app! Including program configuration files!! Autogenerated with GoogleAppEngineLauncher (Mac, Windows)!

APP CONFIGURATION FILES app.yaml in top level app directory! # start single line comments! POSIX regex syntax! Autogenerated by development server!! WEB_INF/appengine-web.yaml! Autogenerates WAR xml files! Indexes autogenerated: WEB_INF/index.yaml! https://developers.google.com/appengine/docs/java/config/appconfig! https://cloud.google.com/appengine/docs/java/configyaml/appconfig_yaml! application: myapp version: 1 runtime: java api_version: 1 threadsafe: true handlers: - url: / script: home.app - url: /index\.html script: home.app - url: /stylesheets static_dir: stylesheets - url: /(.*\.(gif png jpg)) static_files: static/\1 upload: static/(.*\.(gif png jpg)) - url: /admin/.* script: admin.app login: admin - url: /.* script: not_found.app

DEPLOYING TO APP ENGINE Program your app, test with the SDK, generate Datastore indexes! Update configuration files (fine tune as needed)! Upload your app to Google s resources for execution! Command line or via Eclipse (we ll use the command line)!

ADMIN CONSOLE https:// console.developers.google.com/ project! Top left menu icon:! Usage! Debugging help! Datastore viewer!! Delete entities here! /_ah/admin in local dev server!

GOOGLE CLOUD PLATFORM & TECHNOLOGIES App Engine (PaaS)! Compute Engine (IaaS)! Cloud Storage! Cloud SQL! BigQuery! Technology APIs! Linked via service accounts! Billing must be enabled! https://developers.google.com/accounts/ docs/oauth2#serviceaccount!

HELPFUL HINTS AND REMINDERS Read EVERYTHING I ve written for you in the tutorials! Deploy to dev server (local test execution engine) http://localhost:8080! mvn appengine:devserver!!//rebuilds and deploys! /_ah/admin!!!!!!//local datastore direct access! Clean build and deploy also deletes your local database! mvn clean install! mvn appengine:devserver! Deploy to app engine (Google) only after local deploy works! mvn appengine:update!!!https://appid.appspot.com! Debug via Admin console; datastore data: Admin Console->Datastore->Entities!!https://console.developers.google.com/project!