4. Agenda
§ What is Platform as a Service
§ Introducing Cloud Foundry
§ The benefits of being Open
§ Avoiding Vendor Lock-in
§ Demos
§ Under the Hood
§ Spring makes it Easy
§ Cloud Foundry BOSH
CONFIDENTIAL
8. What’s Happening with Applications Today?
§ Frameworks are what really matter
• Developer productivity and innovation
• Reduce time to market
§ New application types
• Mobile, Social, SaaS
• Apps released early and often
§ Data intensive
• Emerging requirements: elasticity, multi-cloud
• Web orientation drives exponential data volumes
§ Deployed on virtual and cloud infrastructures
• Virtualization, Cloud, PaaS
CONFIDENTIAL
9. Do your current apps look like this?
Tomcat
.war
Browser Apache MySQL
9
10. Chances are they will soon look like this..
Tomcat
search.
war
Desktop
Browser
Tomcat
Native users.
Node.js Message Bus war Mongo
Mobile
Front End e.g. RabbitMQ
App
HTML5
Mobile
App
Tomcat
orders.
war MySQL
10
11. Cloud Stack - Classic Pyramid
Software
as a Service
Platform as a Service
Infrastructure as a Service
12. Cloud Stack - By Value
Software
as a Service
Platform as a Service
Infrastructure
as a Service
14. Cloud Foundry – The Open Platform as a Service
Target a choice of
deployment clouds
Provide a choice of Bind a choice of
development application
frameworks services
github.com/cloudfoundry
CONFIDENTIAL
15. Why Cloud Foundry?
Developer Agility
• Friction-free way to develop, test and deploy applications
• Focus on writing applications, not meddling with middleware and infrastructure
Portability without changes
• Write once, test-scale-deploy to private/public clouds without code changes
• Quickly build and test on a laptop and scale to the cloud
Open - The freedom to choose
• Choice of clouds for deployment, industry frameworks, and application services
• Extensible architecture to “future proof” for rapid cloud innovation
• Community open-source project - access, evaluate and contribute
CONFIDENTIAL
17. Micro Cloud FoundryTM – Cloud on a Stick
Micro Cloud Foundry
Frameworks
Services
Your Laptop/PC
Single VM instance of
Cloud Foundry
that runs on a developer’s
MAC or PC
CONFIDENTIAL
27. Multi-Cloud Flexibility is Critical
§ Make use of both public and private clouds without rewriting your
applications
§ Protect against vendor lock-in
§ Meet different compliance and geographical needs
§ Manage your growth, accommodate peak loads & optimize costs
Public Private Micro
Clouds Clouds Clouds
CONFIDENTIAL
28. Main Risk: Lock In
Welcome to the hotel california
Such a lovely place
Such a lovely face
Plenty of room at the hotel california
Any time of year, you can find it here
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
’relax,’ said the night man,
We are programmed to receive.
You can checkout any time you like,
But you can never leave!
-the Eagles
CONFIDENTIAL
30. Cloud Foundry - Making Multi-Cloud a Reality
Private Cloud Management and Public Cloud
Distributions Deployment Operators
.COM
Bare metal
CONFIDENTIAL
31. Cloud Foundry: Clouds
§ AppFog.com
• community lead for PHP
• PaaS for PHP
§ Joyent
• community lead for Node.js
§ ActiveState
• community lead for Python, Perl
• Providers of Stackato private PaaS
CONFIDENTIAL
35. “ Environment Variables [...] unlike custom config
files, or other config mechanisms such as Java
System Properties, are a language- and OS-
agnostic standard
The Twelve Factor App, http://www.12factor.net
35
37. So, you could...
Use System.getEnv(“VCAP_SERVICES”)
but it’s better to:
<dependency>
<groupId>org.cloudfoundry</groupId>
<artifactId>cloudfoundry-runtime</artifactId>
<version>0.8.2</version>
</dependency>
37
38. CloudEnvironment & Friends
// Gives access to the VCAP_* variables
CloudEnvironment env = new CloudEnvironment();
if (env.isCloudFoundry()) {
// Parses and retrieves info about the service named "mydb"
RdbmsServiceInfo info =
env.getServiceInfo("mydb", RdbmsServiceInfo.class);
// From there, you can either...
info.getHost();
info.getPort();
// ...or create a DataSource with the given info
RdbmsServiceCreator creator = new RdbmsServiceCreator();
DataSource ds = creator.createService(info);
}
38
43. Auto-reconfiguration
§ Works for Spring, Node, Ruby
§ Spring: Uses a BeanFactoryPostProcessor
under the hood
• adds a jar to your app
• modifies web.xml to load the BFPP
• also adds correct jdbc driver jar
§ Only works if no ambiguity (80% of apps)
• One service of a kind
CONFIDENTIAL
44. Introducing the <cloud:x> namespace
§ For the remaining 20% of apps
• if your app uses e.g. 2 DataSources
• or if you want more control
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cloud="http://schema.cloudfoundry.org/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://schema.cloudfoundry.org/spring
http://schema.cloudfoundry.org/spring/cloudfoundry-
spring-0.8.xsd">
CONFIDENTIAL
45. <cloud:service-scan />
§ Scans all bound services and creates a bean for each
§ Use @Qualifier to disambiguate:
@Inject
@Qualifier("mysql-source")
private DataSource sourceDS;
@Inject
@Qualifier("mysql-destination")
private DataSource destDS;
CONFIDENTIAL
47. Using Profiles
§ Spring 3.1 introduced the concept of profiles
• A set of beans that can be activated as required
• Usually controlled by spring.profiles.active system property
• Cloud Foundry activates “cloud” profile for you
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<beans profile="profileA">
<bean id="someId" />
<bean id="onlyInProfileA"/>
</beans>
<beans profile="profileB">
<bean id="someId" />
</beans>
<bean id="always-present" />
</beans>
CONFIDENTIAL
50. Production Grade Cloud Foundry Clusters
§ 500 – 5,000 VMs cloudfoundry.com
§ 40+ unique node types
§ 75+ unique software packages
§ 75+ unique environments
§ 2x/week cf.com updates
§ 24x7x365 non-stop operation
§ No-downtime deployments
§ Reliable, robust, repeatable
deployments, updates, capacity
adjustments
§ Small teams manage many
production, staging, stress, qa, dev
instances
Google style problem è Google style solution
CONFIDENTIAL
51. Cloud Foundry BOSH
§ Cloud Foundry BOSH is an open source tool-chain for release
engineering, deployment, and lifecycle management of large scale
distributed services
• Prescriptive way of creating releases and managing systems and services
• It is not a collection of shell scripts, not a pile of Perl
§ Built to deploy and manage production-class, large scale clusters
• Production grade Cloud Foundry clusters: 500+ VMs, 40+ jobs, 75+ packages
• Multi-node, multi-tier, complex clusters: e.g., our Gerrit/Jenkins Cluster
§ Built for devops usage and scale by a crack team of veterans
• A project, not a product: command line interface, YAML, etc.
• Continuous improvement, iterative development, rough edges
github.com/cloudfoundry/bosh
CONFIDENTIAL
52. BOSH: under the hood
BOSH User
“BOSH is deployed by BOSH”
bosh cli director healthmon
cloudfoundry.com
db redis nats
workers blobs active jobs
agent
IaaS CPI stemcell disk
51 CONFIDENTIAL
53. IaaS neutral by design
vSphere: battle tested implementation,
thousands of deployments CPI: code complete
vCloud Director: “work in progress”, 2H 2012 functional status: “work in progress”
Cloud Foundry BOSH
Cloud Provider Interface (CPI)
github.com/piston/openstack-bosh-
cpi
contribute: github.com/cloudfoundry/bosh
52
CONFIDENTIAL
55. Key Takeaways
§ PaaS is the application platform for the Cloud era
§ Cloud Foundry is the Industry’s Open PaaS
• Developer agility
• Portability without changes
• Open system
§ What’s next?
• Free Signup: www.cloudfoundry.com (use “cloudtoday” as a promocode)
• Get started: docs.cloudfoundry.com/getting-started.html
• Learn more on the blog: blog.cloudfoundry.com
• Download your Micro Cloud Foundry: my.cloudfoundry.com/micro
• Get the source code: www.cloudfoundry.org
• Follow us: @cloudfoundry
• Watch us: www.youtube.com/cloudfoundry
CONFIDENTIAL