37
© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission. Ramnivas Laddad Scott Andrews Tal Salmona VMware Cloud Foundry Team Cloud Foundry With Spring Part One: Applications

Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

  • Upload
    buitram

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Ramnivas LaddadScott AndrewsTal Salmona

VMware Cloud Foundry Team

Cloud Foundry With SpringPart One: Applications

Page 2: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Agenda

• Cloud Foundry Introduction• A Developers Perspective• An Operations Perspective• Getting Insight into Applications• Future Direction

2

Page 3: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

SaaSSoftware as a Service

PaaSPlatform as a Service

IaaSInfrastructure as a

Service

Three layers of Cloud Computing

3

Page 4: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Cloud Foundry Big Picture

4

Clou

d Pr

ovid

er In

terfa

ceApplication Service Interface

Private Clouds

PublicClouds

MicroCloud Foundry

Data Services

Other Services

Msg Services

.js

Page 5: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Cloud Foundry Open PaaS

• Multiple languages and frameworks• Multiple deployment options• A variety of services

5

Open Source

Extend it to meet your needs

Page 6: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Inside Cloud Foundry

6

Router

vSphere 5

Health Manager

Execution environment Services

user apps Cloud Controller user apps

vmc client STS plugin browser (user app access)

Page 7: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Saying Hello

7

Page 8: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Agenda

• Cloud Foundry Introduction• A Developers Perspective• An Operations Perspective• Getting Insight into Applications• Future Direction

8

Page 9: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Real life developing a web product

9

Page 10: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Broad support for application frameworks

• JVM– Spring, Grails, Roo, Lift, plain Java

• Ruby– Rails, Sinatra

• Node.js• Community contributions

– Erlang, Python, PHP

10

Page 11: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

JVM Frameworks

• Unit of deployment: Java WARs– Can run any standard WAR file– Servlet 2.5

• don’t assume a particular container• Spring, Grails, Lift framework

– Auto-reconfiguration goodies

11

Page 12: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Building a Spring Application

Page 13: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Building a Grails Application

Page 14: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Inside Staged Applications

• Stager packages applications into executable droplets– provides a runtime container– can rewrite configuration files– can add libraries

14

Page 15: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Inside Staged Applications (continued)

• For Spring/Grails applications– provides a servlet container– deploys the app into the container– configures the container to listen on the correct port– adds auto-reconfiguration lib to the class path– rewrites web.xml

• registers auto-reconfiguration BeanFactoryPostProcessor• registers CloudApplicationContextInitializer

– adds JDBC drivers to class path• MySQL or PostgreSQL depending on bound services

15

Page 16: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Inspecting a staged application

Page 17: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

“Hey you! Leave my app alone!”

• No Problem• Plain Java framework

– bare minimum staging– no manipulation of configuration files– no additions to the class path– just your application

17

Page 18: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Staging, or lack thereof, for Plain Java Application

Page 19: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Agenda

• Cloud Foundry Introduction• A Developers Perspective• An Operations Perspective• Getting Insight into Applications• Future Direction

19

Page 20: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Real life developing a web product

20

Page 21: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Growing with Demand

• Scale up in seconds– vmc instances myapp +2

• Scale down in seconds– vmc instances myapp -2

• Monitor your application instances– per instance: memory, CPU, disk, uptime– vmc stats myapp

21

Page 22: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Application Scaling

22

Page 23: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Surviving Disaster

• Applications crash– impossible to avoid– it will happen, sooner or later

• Optimize for mean time to recovery– mean time between failures is not as important

23

Page 24: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Recovering from Failure

24

Page 25: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Agenda

• Cloud Foundry Introduction• A Developers Perspective• An Operations Perspective• Getting Insight into Applications• Future Direction

25

Page 26: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Spring Insight

• A tool for developers to learn about their apps at dev. time

• A tool for Ops to learn about apps at production

• See response times, errors, execution traces

• “Understands” Spring

26

Page 27: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Announcing...

• Invitation to join the private beta of Spring Insight for Cloud Foundry.

• For developers of Spring applications.

27

Page 28: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Spring Insight for Cloud Foundry

• Same experience as desktop version

• With some Cloud Foundry specific functionality

• Easy to get started

28

Page 29: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Why Insight for Cloud Foundry

• Monitor the quality of your application

• Manage your users experience

29

Page 30: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Demo

Spring Insight for Cloud Foundry

30

Page 31: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

What's next for Insight

• Extend language and framework support• Support for more services as they become available• An option to run the dashboard as a service• Support for Micro Cloud Foundry• Extended management capabilities

31

Page 32: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Go to http://insight.cloudfoundry.com(Use your private token)

32

Page 33: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Agenda

• Cloud Foundry Introduction• A Developers Perspective• An Operations Perspective• Getting Insight into Applications• Future Direction

33

Page 34: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Wider Application support

• Non-web applications– Background tasks– Batch jobs, scheduling

• Web applications– Servlet 3.0– WebSockets– Session management– Embedded web servers

34

Page 35: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

Application Staging Plugins

• Hook into the Application Staging lifecycle• Provide advanced configuration and features

• Examples:– Spring Insight– AspectJ pre-weaving– Add-on ecosystem

35

Page 37: Cloud Foundry With Spring - whiteship.mewhiteship.me/wp-content/uploads/2011/11/CloudFoundryWithSpringPart... · Agenda • Cloud Foundry Introduction • A Developers Perspective

© 2011 SpringOne 2GX 2011. All rights reserved. Do not distribute without permission.

Q&A

37