Top Banner
Developing portable PaaS applications @jclouds
37

Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

Jul 09, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

Developing portable PaaS applications

@jclouds

Page 2: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

First Things First

Thanks!

Page 3: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Agenda?

?

Page 4: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

• PaaS in a very small nutshell

• Introducing TweetStore

• Making TweetStore portable

• Integration Testing

• Continuous Integration & Deployment

• Portable PaaS: make sense (yet)?

Agenda

Page 5: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

PaaS in a Nutshell

Page 6: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

PaaS in a Nutshell

Page 7: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

PaaS in a Nutshell

Page 8: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

• “Application-scoped” deliverable

• Platform handles scaling, monitoring, deployment

• App service catalogue

• Multi-language eventually

• Pluggable eventually

• Hybrid eventually

PaaS in a Nutshell

Page 9: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

PaaS in a Nutshell

Deployment

Runtime Status

Monitoring

Billing

Persistence

Delayed Jobs

Scheduling

Messaging

Access via library

Access via console or command line API

Page 10: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Introducing TweetStore

Page 11: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Introducing TweetStore

Page 12: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

• jclouds demo web application

• Guice & Spring versions

• Originally written for Google App Engine

• Now also on RUN@cloud, OpenShift Express, Cloud Foundry

• In progress: Heroku Cedar, DotCloud, Amazon Elastic BeanStalk

Introducing TweetStore

Page 13: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Introducing TweetStore

Page 14: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Introducing TweetStore

DB icon

StoreTweets EnqueueStores

Scheduler Delayed Job

GetTweets

User

Page 15: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

• Using “in-application code” for persistence

• No messaging

Introducing TweetStore

Page 16: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

Page 17: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

• Different app services available

• How to separate from business logic?

Page 18: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

• Different app services available

• How to separate from business logic?

• DI layer as boundary

• “native” for some PaaSes

• Supporting Guice & Spring

Page 19: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Controllers Controllers

Making TweetStore Portable

Controllers

Servlets Container

Page 20: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Controllers Controllers

Making TweetStore Portable

Controllers

Servlets Container Now with

PlatformServicesInitializer!

Page 21: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

1. Listener retrieves information from platform and instantiates PlatformServices

2. “Application” DI layer uses PlatformServices as a factory

Page 22: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

1. Listener retrieves information from platform and instantiates PlatformServices

2. “Application” DI layer uses PlatformServices as a factory

• Essentially “platform” DI layer

• Keeps platform knowledge isolated

Page 23: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Making TweetStore Portable

• Essentially “platform” DI layer

• Keeps platform knowledge isolated

• TODO: Create service abstraction?

• TODO: Spring namespace?

• TODO: Guice module?

Page 24: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Integration Testing

• One option: different app instance in the PaaS

• Cost? Access? Debugging?

• Would like to test offline

• Would like to test from build

• Would like to test from IDE

Page 25: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Integration Testing

• Use provided “local” emulators/servers

• Create your own emulator

• Use local test image

Page 26: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Integration Testing

• Use provided “local” emulators/servers

• Create your own emulator

• Use local test image

• Test support varies widely

• Arquillian PaaS containers would be nice!

Page 27: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Integration Testing

• Use provided “local” emulators/servers

• Create your own emulator

• Use local test image

• Test support varies widely

• Arquillian PaaS containers would be nice!

hint hint ;-)

Page 28: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Continuous Integration & Deployment

Page 29: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Continuous Integration & Deployment

?

Page 30: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Continuous Integration & Deployment

• Relatively easy with deployment-via-SDK

• Maven plugins make it even nicer

• Trickier with the “git push” model if you want your source elsewhere

• Can handle with build-store-checkout-commit

Page 31: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Continuous Integration & Deployment

• Release management/change control still open questions

• Use deploy and post-deploy hooks?

• Pluggable PaaS service?

Page 32: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Portable PaaS: make sense (yet)?

• For PaaS apps generally

• You’ll probably write it differently when writing for PaaS

• Good for greenfield

• For existing apps, see if you can just run

?

Page 33: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Portable PaaS: make sense (yet)?

• For PaaS apps generally

• You’ll probably write it differently when writing for PaaS

• Good for greenfield

• For existing apps, see if you can just run

• “Porting to PaaS”? Hm.

?

Page 34: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Portable PaaS: make sense (yet)?

• Portable PaaS apps?

• Want to avoid lock-in

• Need multiple instances, not necessarily multiple platforms

• PaaS services will standardize over time

?

Page 35: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Portable PaaS: make sense (yet)?

• Portable PaaS apps?

• Want to avoid lock-in

• Need multiple instances, not necessarily multiple platforms

• PaaS services will standardize over time

• Probably not yet.

?

Page 36: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

More Info

• http://www.jclouds.org

• http://github.com/jclouds/jclouds

• https://github.com/jclouds/jclouds/tree/master/demos/tweetstore

Page 37: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration

@jclouds

Come Hang Out!

• MEETUP TONIGHT!! http://bit.ly/wpfoeS Citerus AB, Barnhusgatan 16, 111 23, 17:30

[email protected]

• @jclouds

• IRC #jclouds on freenode