22
Implementing your own Google App Engine Aleš Justin, Red Hat

Implementing your own Google App Engine

Embed Size (px)

Citation preview

Implementing your own Google App Engine

Aleš Justin, Red Hat

The goal

• Take an *existing* Google App Engine app

• Drop it into WildFly

• It just works!

• No vendor lock-in

• Enable cluster debugging / testing

• On-premises cloud!

• Designed to scale

• What’s Google App Engine?

• What is JBoss CapeDwarf?

• How do the two work together?

• The dirty details

• Demo

• Q&A

Agenda

• Aleš Justin

• CapeDwarf Project Founder & Lead

• Old School JBoss-ian; MC, CDI, Ceylon, ...

Who’s this guy?

“Google App Engine lets you run web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.”

It’s all about services and its API!

What is Google App Engine?

• Open source implementation of Google App Engine API

• It’s all about the API, not impl - for users

• Written on top of JBoss and other OS frameworks

• Infinispan, Hibernate Search, HornetQ, Lucene, ...

• Runs as a WildFly subsystem / extension

• Management, Clustering, ...

What is CapeDwarf?

• Super easy to setup locally - unzip & run

• Same way as any WildFly / JBossAS

• Trivial to setup cluster

• A way to debug scalable apps

• Integrated into OpenShift (Red Hat PaaS)

• Own CapeDwarf cartridge / image

• On-premises cloud env

What is CapeDwarf?

• 100% pure Java

• It’s all on GitHub

• https://github.com/capedwarf

What is CapeDwarf?

AppIdentity ✔ Multitenancy ✿

Blobstore ✔ OAuth ✔

Capabilities ✿ (Prospective)Search ✔

Channel ✔ Tasks ✔

Datastore ✔ URLFetch ✔

Files / GCS ✔ Users ✔

Images ✔ XMPP ✿

Logging ✔ Admin Console ✿

Mail ✿ JPA / JDO ✔

Memcache ✔ MapReduce ✔

Cron ✔ Warm-up ✔

Modules ✔ Endpoints ✔

Sockets ✔ SQL ✔

Current API matrix

... or how do we know CapeDwarf actually works ...

More about this in next slides :-)

Testing?

• Google App Engine Technology Compatibility Kit (TCK)

• Joint (initial) effort from Google and Red Hat

• http://www.appengine-tck.org

• 1000+ API tests

• Additional testing - Endpoints, DataNucleus, MapReduce, Modules, Concurrency, …

• GCloud support (aka Managed / Custom Runtimes)

Google App Engine & CapeDwarf

• Runs with Maven

• JUnit, Arquillian and ShrinkWrap based

• Nice API test coverage report

• Easy to add new containers / runtimes

• Using GitHub’ “community” power; pull-request, review, ...

About TCK

Switch screen!

TCK coverage report view

• Simply create new TCK test

• Plain JUnit @Test

• @RunWith(Arquillian.class)

• New ShrinkWrap @Deployment

• GitHub Pull-Request

Bugs?

• Few impl details

• Datastore → Infinispan & Co.

• TaskQueue → JMS / HornetQ

• Endpoints → Tweaking Endpoints code

• Modules

• Runtime → WildFly

• Subsystem → Deployers, Services, ...

How does CapeDwarf work?

Datastore Datastore

InfinispanQuery Search

LuceneFS Clustering

Datastore

Datastore

App AppApp

Async task

JMS

Invocation

Tx Balancing

Queue

• Standalone

• Properly map JEE .ear onto GAE Modules logic

• Setup virtual-servers for each module

• Domain (TODO)

• Custom DomainController

• Each module gets own app server instance

• Could share app servers

• Testing → new Arquillian Protocol

Modules

• Extending WildFly → New Subsystem

• It’s all about DeploymentUnitProcessors

• Remember JBoss Deployers? ;-)

• 10+ DUPs, per phase / purpose

• Almost zero configuration

• Few MSC services

• Fully modular

• in-line API jar or as-module

CapeDwarf Runtime

• Waiting for new WildFly9 release

• Improved Infinispan7

• Hibernate Search, Lucene upgrade

• CapeDwarf Managed sub-project

• Using GAE API directly in WildFly

• Managed / Custom Runtime

https://github.com/capedwarf/capedwarf-managed

CapeDwarf WIP

1. Download latest CapeDwarf release

• http://www.capedwarf.org/downloads/

2. Unzip & run

• <CAPEDWARF_HOME>/bin/capedwarf.sh

3. Deploy your GAE app

• Via WildFly management

• Drop app into deployments/ dir

Try it out!

• CapeDwarf

• JBoss.org forums

• #capedwarf on Freenode IRC

• capedwarf.org

[email protected]

Q&A