Andy Piper | @andypiper | apiper@gopivotal.com
Cloud Foundry Developer Advocate, Pivotal

Run Your Java Apps on
Cloud Foun...
Hello

I’m Andy
Developer Advocate @ Cloud Foundry
social web enthusiast
maker, educator, LEGO fan
OSS contributor
Eclipse Project Lead (P...
Developer Advocate?

hellz to the yeah!
@andypiper
!
[works on]
!

#cloudfoundry
!
[at]
!

@gopivotal
1. Why is an Open Cloud Platform important?
2. What is Cloud Foundry?
3. Java support in the open cloud
Why is an Open Cloud Platform important?
From: torvalds@klaava.Helsinki.FI
Newsgroups: comp.os.minix
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsi...
~21 years later: Linux has won
#P0WN ALL
TEH
GADGETZ !

Linux runs everywhere

(even old versions, on crashy
airline entertainment systems...)
It works.
Don’t be locked-in

do you know what is coming
tomorrow?
What is Cloud Foundry?
Software

Gmail, Salesforce,
Flickr, Google Docs...

Platform

Google AppEngine,
Heroku, Cloud Foundry,
EngineYard, Appren...
Cloud Foundry - the Open PaaS
Public&
Clouds

Private&
Clouds

CUSTOM 

RUNTIMES

Micro&
Clouds

CUSTOM 

SERVICES

Open S...
“… we believe that
the best solution
should be available
on top of any cloud
and not just be
locked into EC2”
!
- Mike Sob...
All the pieces to make
your own!

“if you can’t open it, you
don’t own it” (O’Reilly MAKE)
Open & public from the start

Code all on Github
Why is it so hard...?

A real deployment flow (!)
DEVELOPER

OPERATOR
cf#iaas.yml+

target+<my+cloud>+

provision+<my+cloud>+

push+<my+app>+

add_capacity+<my+cloud>

crea...
CLOUD FOUNDRY

Demo



Java (and JVM language) support
in Cloud Foundry
From VM-centric to Application Centric

App

App

App

App

Dev Framework

Dev Framework

Dev Framework

Configurations

C...
Buildpacks
Buildpacks are responsible for preparing the
machine image for an application

Application
Buildpack

Container...
Compatibility

Cloud Foundry buildpacks follow the 

Heroku buildpack design

Cloud Foundry and Heroku buildpacks are comp...
Built-in Buildpacks

→
→
→
Tested Buildpacks
https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks

Containers

Languages
Haskell
Java Buildpack
Supports a variety of JVM languages, containers,
and frameworks with a modular, configurable, and
extensible...
“The primary objective of the Java buildpack is to be
the easiest way to run a Java application. The word
easiest can mean...
Java Buildpack Concepts

Containers

Frameworks

Java main()

Spring config
Play config
Play JPA config
New Relic

Tomcat
...
Container Detection Criteria
Java main()

META-INF/MANIFEST.MF exists
with Main-class attribute set

Tomcat

WEB-INF direc...
Framework Detection Criteria

Spring

spring-core*.jar exists

Play config

Play application detected

Play JPA config

play...
Customization
Two ways to customize the Java buildpack

Configure artifacts used by standard
JREs, Containers, and Framewor...
Choice!
• IBM donated WebSphere Liberty Buildpack

http://blog.cloudfoundry.com/2013/09/09/ibm-websphereliberty-buildpack-...
Tooling support

$ mvn clean package cf:push!
$ gradle clean assemble cf-push

http://blog.cloudfoundry.com/2013/10/29/jav...
the new Spring

spring.io
XD

BOOT

Stream, Taps, Jobs

GRAILS

Bootable, Minimal, Ops-Ready

Full-stack, Web

INTEGRATION

BATCH

BIG DATA

WEB

Ch...
Groovy and Spring Boot
Groovy and Spring Boot
Groovy and Spring Boot
Spring and the Cloud
• Goal: deploy Spring apps to the cloud without
changing a single line of code

• Cloud Foundry autom...
Portability
SPRING




Demo
… and finally …
Try It!

http://run.pivotal.io
Join us!

... a pull request is all it
takes!
Connect
http://twitter.com/andypiper
http://andypiper.co.uk
http://slideshare.net/andypiper


Credits
• Padlock http://www.flickr.com/photos/bpc009/3328427457/

• Other images are author’s own, or royalty-free and CC-...
Run your Java apps on Cloud Foundry
Upcoming SlideShare
Loading in...5
×

Run your Java apps on Cloud Foundry

1,328

Published on

Talk presented at JAX London 2013

Published in: Technology, Education

Run your Java apps on Cloud Foundry

  1. 1. Andy Piper | @andypiper | apiper@gopivotal.com Cloud Foundry Developer Advocate, Pivotal Run Your Java Apps on Cloud Foundry
  2. 2. Hello I’m Andy
  3. 3. Developer Advocate @ Cloud Foundry social web enthusiast maker, educator, LEGO fan OSS contributor Eclipse Project Lead (Paho / MQTT) excited by “what’s next”, Internet of Things, etc. ! ! @andypiper apiper@gopivotal.com a few things about me
  4. 4. Developer Advocate? hellz to the yeah!
  5. 5. @andypiper ! [works on] ! #cloudfoundry ! [at] ! @gopivotal
  6. 6. 1. Why is an Open Cloud Platform important? 2. What is Cloud Foundry? 3. Java support in the open cloud
  7. 7. Why is an Open Cloud Platform important?
  8. 8. From: torvalds@klaava.Helsinki.FI Newsgroups: comp.os.minix Date: 25 Aug 91 20:57:08 GMT Organization: University of Helsinki 1991 An important year in software Hello everybody out there using minix ! I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones.
  9. 9. ~21 years later: Linux has won
  10. 10. #P0WN ALL TEH GADGETZ ! Linux runs everywhere (even old versions, on crashy airline entertainment systems...)
  11. 11. It works.
  12. 12. Don’t be locked-in do you know what is coming tomorrow?
  13. 13. What is Cloud Foundry?
  14. 14. Software Gmail, Salesforce, Flickr, Google Docs... Platform Google AppEngine, Heroku, Cloud Foundry, EngineYard, Apprenda... Infrastructure 3 layers Amazon EC2, Google CE, OpenStack, vSphere, Joyent, Cloud Stack, Eucalyptus... IaaS, PaaS, SaaS
  15. 15. Cloud Foundry - the Open PaaS Public& Clouds Private& Clouds CUSTOM 
 RUNTIMES Micro& Clouds CUSTOM 
 SERVICES Open Source
  16. 16. “… we believe that the best solution should be available on top of any cloud and not just be locked into EC2” ! - Mike Soby in JAX Magazine Special Edition
  17. 17. All the pieces to make your own! “if you can’t open it, you don’t own it” (O’Reilly MAKE)
  18. 18. Open & public from the start Code all on Github
  19. 19. Why is it so hard...? A real deployment flow (!)
  20. 20. DEVELOPER OPERATOR cf#iaas.yml+ target+<my+cloud>+ provision+<my+cloud>+ push+<my+app>+ add_capacity+<my+cloud> create+<my+services>+ bind+<my+services>+ scale+<my+app>++100 Cloud Deployment: 2-4 hours An alternative approach... App Deployment: 30-90 seconds Cloud Foundry can make it simpler!
  21. 21. CLOUD FOUNDRY Demo 

  22. 22. Java (and JVM language) support in Cloud Foundry
  23. 23. From VM-centric to Application Centric App App App App Dev Framework Dev Framework Dev Framework Configurations Configurations Manifests, Automations JVM JVM App Server App Server VM VM Infrastructure
 One Infrastructure
 Two Container 1 JVM Container 2 JVM App Server App Server Infrastructure
 One Infrastructure
 Two
  24. 24. Buildpacks Buildpacks are responsible for preparing the machine image for an application Application Buildpack Container Libraries DEA Runtime Operating System } Droplet
  25. 25. Compatibility Cloud Foundry buildpacks follow the 
 Heroku buildpack design Cloud Foundry and Heroku buildpacks are compatible
 (if you take care to make them compatible) ! Other PaaS providers are adopting the 
 buildpack design - emerging convention
  26. 26. Built-in Buildpacks → → →
  27. 27. Tested Buildpacks https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks Containers Languages Haskell
  28. 28. Java Buildpack Supports a variety of JVM languages, containers, and frameworks with a modular, configurable, and extensible design
  29. 29. “The primary objective of the Java buildpack is to be the easiest way to run a Java application. The word easiest can mean a lot of things, but to me it means that a developer can push an application and have an “it just works™” experience.” ! - Ben Hale, Java buildpack engineer http://blog.cloudfoundry.com/2013/09/06/introducing-the-cloud-foundry-java-buildpack/
  30. 30. Java Buildpack Concepts Containers Frameworks Java main() Spring config Play config Play JPA config New Relic Tomcat Groovy Spring Boot CLI Play JREs OpenJDK, etc.
  31. 31. Container Detection Criteria Java main() META-INF/MANIFEST.MF exists with Main-class attribute set Tomcat WEB-INF directory exists Groovy .groovy file with a main() method, or! .groovy file with no classes, or! .groovy file with a shebang (#!) declaration Spring Boot CLI one or more POGO .groovy files with no main() method, and no WEB-INF directory Play start and lib/play.play_*.jar exist Choose zero or one
  32. 32. Framework Detection Criteria Spring spring-core*.jar exists Play config Play application detected Play JPA config play-java-jpa plugin exists in app New Relic New Relic service bound to app Choose all that apply
  33. 33. Customization Two ways to customize the Java buildpack Configure artifacts used by standard JREs, Containers, and Frameworks Extend the buildpack with your own JREs, Containers, and Frameworks Customization is done by forking the buildpack →
  34. 34. Choice! • IBM donated WebSphere Liberty Buildpack
 http://blog.cloudfoundry.com/2013/09/09/ibm-websphereliberty-buildpack-contributed-to-cloud-foundry/ • Other forks add additional containers and frameworks Jonas, Dropwizard, Karaf, etc
  35. 35. Tooling support $ mvn clean package cf:push! $ gradle clean assemble cf-push http://blog.cloudfoundry.com/2013/10/29/java-tooling/
  36. 36. the new Spring spring.io
  37. 37. XD BOOT Stream, Taps, Jobs GRAILS Bootable, Minimal, Ops-Ready Full-stack, Web INTEGRATION BATCH BIG DATA WEB Channels, Adapters,
 Filters, Transformers Jobs, Steps,
 Readers, Writers Ingestion, Export,
 Orchestration, Hadoop Controllers, REST,
 WebSocket DATA RELATIONAL NON-RELATIONAL CORE FRAMEWORK SECURITY GROOVY REACTOR
  38. 38. Groovy and Spring Boot
  39. 39. Groovy and Spring Boot
  40. 40. Groovy and Spring Boot
  41. 41. Spring and the Cloud • Goal: deploy Spring apps to the cloud without changing a single line of code • Cloud Foundry automatically re-configures bean definitions to bind to cloud services • Works with Spring and Grails
  42. 42. Portability
  43. 43. SPRING 
 Demo
  44. 44. … and finally …
  45. 45. Try It! http://run.pivotal.io
  46. 46. Join us! ... a pull request is all it takes!
  47. 47. Connect http://twitter.com/andypiper http://andypiper.co.uk http://slideshare.net/andypiper 

  48. 48. Credits • Padlock http://www.flickr.com/photos/bpc009/3328427457/ • Other images are author’s own, or royalty-free and CC-licensed works 
 from Wikimedia Commons • Thanks to Scott Frederick, Josh Long and Guillaume Laforge for content

×