run your java code on cloud foundry
play

RUN YOUR JAVA CODE ON CLOUD FOUNDRY Andy Piper - @andypiper Cloud - PowerPoint PPT Presentation

RUN YOUR JAVA CODE ON CLOUD FOUNDRY Andy Piper - @andypiper Cloud Foundry Developer Advocate, Pivotal Hello Im Andy Developer Advocate @ Cloud Foundry social web enthusiast maker, educator, LEGO fan OSS contributor Eclipse Project Lead


  1. RUN YOUR JAVA CODE ON CLOUD FOUNDRY Andy Piper - @andypiper Cloud Foundry Developer Advocate, Pivotal

  2. Hello I’m Andy

  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. Developer Advocate? hellz to the yeah!

  5. @andypiper [works on] #cloudfoundry [at] @gopivotal

  6. openness, cloud computing, 3 themes and Java

  7. 1. Why be / do / think Open? 2. Why is an Open Cloud Platform important? 3. Why run Java on an open cloud?

  8. 1. Why be / do / think Open?

  9. From:&torvalds@klaava.Helsinki.FI Newsgroups:&comp.os.minix Date:&25&Aug&91&20:57:08&GMT Organization:&University&of&Helsinki Hello everybody out there using minix - 1991 I’m doing a (free) operating system An important year in software (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones.

  10. ~21 years later: Linux has won

  11. #P0WN ALL TEH GADGETZ ! (even old versions, on crashy Linux runs everywhere airline entertainment systems...)

  12. The Penguin is (maybe not this one…) triumphant!

  13. Linux is ubiquitous (but often invisible)

  14. It works.

  15. 2. What about Cloud?

  16. Gmail, Salesforce, Software Flickr, Google Docs... Google AppEngine, Heroku, Cloud Foundry, Platform EngineYard, Apprenda... Amazon EC2, Google CE, OpenStack, vSphere, Infrastructure Joyent, Cloud Stack, Eucalyptus... 3 layers IaaS, PaaS, SaaS

  17. How did we get here?

  18. Infrastructure Clouds - consumer web companies built out according to their own needs to support Software

  19. But - still need to build & manage Platform

  20. Why is it so hard...? A real deployment flow (!)

  21. OPERATOR DEVELOPER cf#iaas.yml target0<my0cloud> provision0<my0cloud> push0<my0app> add_capacity0<my0cloud> create0<my0services> bind0<my0services> scale0<my0app>0+100 App Deployment: 30-90 seconds Cloud Deployment: 2-4 hours Cloud Foundry can An alternative approach... make it simpler!

  22. C L O U D F O U N D R Y Demo

  23. Cloud Foundry - the Open PaaS Private& Micro& Public& Clouds Clouds Clouds CUSTOM CUSTOM RUNTIMES SERVICES Open Source

  24. All the pieces to make “if you can’t open it, you your own! don’t own it” (O’Reilly MAKE)

  25. Open & public from the start Code all on Github

  26. Google AppEngine, Heroku, Cloud Foundry, OpenShift, Stackato, Cloudbees, AppFog, Elastic Beanstalk, anyNines, Apprenda...

  27. Not all PaaSes are Run on: AWS, OpenStack, created equal... vSphere... more to come!

  28. All about Choice Build your own from Private github.com/cloudfoundry, Clouds buy from Pivotal, or run a compatible private version At run.pivotal.io Public or any Cloud Foundry- Clouds powered PaaS Run in a local virtual Micro machine with identical services and runtimes Clouds (MCF, Vagrant)

  29. (pause)

  30. 44 years since Mach 1

  31. 3. What about Java and the JVM?

  32. From VM-centric to Application Centric App App App App Dev Framework Dev Framework Dev Framework Configurations Configurations Manifests, Automations JVM JVM Container 1 Container 2 JVM JVM App Server App Server App Server App Server VM VM Infrastructure Infrastructure Infrastructure Infrastructure Two One One Two

  33. Buildpacks Buildpacks are responsible for preparing the machine image for an application } Application Droplet Buildpack Libraries Container DEA Runtime Operating System

  34. 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

  35. Built-in Buildpacks → → →

  36. Tested Buildpacks https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks Containers Languages Haskell

  37. Java Buildpack Supports a variety of JVM languages, containers, and frameworks with a modular, configurable, and extensible design

  38. Java Buildpack Concepts Containers Frameworks Java main() Spring config Tomcat Play config Groovy Play JPA config Spring Boot CLI New Relic Play JREs OpenJDK, etc.

  39. Container Detection Criteria META-INF/MANIFEST.MF exists Java main() with Main-class attribute set Tomcat WEB-INF directory exists .groovy file with a main() method, or Groovy .groovy file with no classes, or .groovy file with a shebang ( #! ) declaration one or more POGO .groovy files Spring Boot CLI with no main() method, and no WEB-INF directory start and lib/play.play_*.jar Play exist Choose zero or one

  40. 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

  41. 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

  42. Choice! • IBM donated WebSphere Liberty Buildpack • http://blog.cloudfoundry.com/2013/09/09/ibm- websphere-liberty-buildpack-contributed-to-cloud- foundry/

  43. the new Spring spring.io

  44. XD BOOT GRAILS Stream, Taps, Jobs Bootable, Minimal, Ops-Ready Full-stack, Web INTEGRATION BATCH BIG DATA WEB Channels, Adapters, Ingestion, Export, Controllers, REST, Jobs, Steps, Filters, Transformers Orchestration, Hadoop WebSocket Readers, Writers DATA RELATIONAL NON-RELATIONAL CORE FRAMEWORK SECURITY GROOVY REACTOR

  45. Groovy and Spring Boot

  46. Groovy and Spring Boot

  47. Groovy and Spring Boot

  48. 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

  49. Portability

  50. S P R I N G Demo

  51. 4. ... the end?

  52. ... a pull request is all it Join us! takes!

  53. Connect http://twitter.com/andypiper http://andypiper.co.uk http://slideshare.net/andypiper

  54. Image credits • Cloud cover slide http://www.flickr.com/photos/sjkingo/3150155150/ • Star Wars Cookies http://www.flickr.com/photos/betsyweber/4961703633/ (Geek Pride Day, May 25 - http://readwrite.com/2013/05/23/geek-pride-day-celebrate) • Happy Tux http://igloo.crystalxp.net/ZeNDaMs • Signpost http://www.flickr.com/photos/16002150@N08/2006266695/ • Other images are author’s own, or royalty-free and CC-licensed works from Wikimedia Commons • Build your own Heroku video http://www.youtube.com/watch?v=e0EprkBamvQ

Recommend


More recommend