Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing...
Transcript of Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing...
![Page 1: Portable Cloud Storage with jclouds...@jclouds •PaaS in a very small nutshell •Introducing TweetStore •Making TweetStore portable •Integration Testing •Continuous Integration](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/2.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/3.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/4.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/5.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/6.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/7.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/8.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/9.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/10.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/11.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/12.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/13.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/14.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/15.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/16.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/17.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/18.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/19.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/20.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/21.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/22.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/23.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/24.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/25.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/26.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/27.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/28.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/29.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/30.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/31.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/32.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/33.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/34.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/35.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/36.jpg)
@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](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f32333043c0d9122d1d5368/html5/thumbnails/37.jpg)
@jclouds
Come Hang Out!
• MEETUP TONIGHT!! http://bit.ly/wpfoeS Citerus AB, Barnhusgatan 16, 111 23, 17:30
• @jclouds
• IRC #jclouds on freenode