SlideShare une entreprise Scribd logo
1  sur  100
Télécharger pour lire hors ligne
Extending Cloud Foundry
With Custom Integration
Cornelia Davis
Scott Frederick
© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Thursday, November 21, 13
Who and What...

2
Thursday, November 21, 13
Who and What...

Extending the
set of services
Customizing
application containers
2
Thursday, November 21, 13
Services

© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Thursday, November 21, 13
Demo

4
Thursday, November 21, 13
When you cf push
VM for Service
Instances

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

up to you

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

up to you

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

up to you

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

bind (HTTP)

Router

CLI

Browse

5

Thursday, November 21, 13

Service
Broker
(i.e. mysql)

DEA

up to you

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

bind (HTTP)

Router

CLI

Browse

5

Thursday, November 21, 13

bind (HTTP)

DEA

Service
Broker
(i.e. mysql)

up to you

MySQL
(process)
When you cf push
VM for Service
Instances
provision (HTTP)

provision (HTTP)

Cloud
Controller

bind (HTTP)

Router

CLI

Browse

5

Thursday, November 21, 13

bind (HTTP)

DEA

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

Cloud
Controller

bind (HTTP)

Router

CLI

Browse

5

Thursday, November 21, 13

bind (HTTP)

DEA

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

Cloud
Controller

bind (HTTP)

Router

CLI

Browse

5

Thursday, November 21, 13

bind (HTTP)

DEA

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

CLI

Cloud
Controller

bind (HTTP)

bind (HTTP)

go ahead and
deploy (HTTP)

Browse

5

Thursday, November 21, 13

Router

...

DEA

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

CLI

Cloud
Controller

bind (HTTP)

bind (HTTP)

go ahead and
deploy (HTTP)

Browse

5

Thursday, November 21, 13

Router

...

DEA
Droplet
credentials

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

CLI

Cloud
Controller

bind (HTTP)

bind (HTTP)

go ahead and
deploy (HTTP)

Browse

5

Thursday, November 21, 13

Router

...

DEA
Droplet
credentials

Service
Broker
(i.e. mysql)

up to you

up to you

MySQL
(process)
When you cf push
VM for Service
Instances

credentials

provision (HTTP)

provision (HTTP)

CLI

Cloud
Controller

bind (HTTP)

bind (HTTP)

go ahead and
deploy (HTTP)

Browse

5

Thursday, November 21, 13

Router

...

Service
Broker
(i.e. mysql)

up to you

MySQL
(process)

up to you

DEA
Droplet
credentials

Note:
• Don’t call ‘em “Gateways” anymore
• Broker only used during
•(un)provision
•(un)bind
Demo

6
Thursday, November 21, 13
Agenda
§Extending services offerings within run.pivotal.io
–Partnering

§Building services
–Into your own Cloud Foundry

§User-provided service instances
–For access to pre&externally-provisioned services

Thursday, November 21, 13
run.pivotal.io Marketplace Services

run.pivotal.io

8

Thursday, November 21, 13
run.pivotal.io Marketplace Services

run.pivotal.io

Contact Nima Badiey
(nbadiey@gopivotal.com)
to play

8

Thursday, November 21, 13
run.pivotal.io Marketplace Services

Cloud
Controller

AppDirect
Service
Broker
Browser

9

Thursday, November 21, 13

DEA
run.pivotal.io Marketplace Services

Cloud
Controller

credentials

AppDirect
Service
Broker
Browser

DEA
Droplet
credentials

9

Thursday, November 21, 13
run.pivotal.io Marketplace Services

Cloud
Controller

credentials

AppDirect
Service
Broker
Browser

DEA
Droplet
credentials

9

Thursday, November 21, 13
Demo

10
Thursday, November 21, 13
Cloud Foundry Services
• There is only one built in - mysql
– or many more depending on how you count

• How to build them - the evolution:
– CF v1, subclass Ruby base classes
– CF v2, a RESTful protocol (which is itself evolving)

Polyglot!
• There are three parts to the protocol...

11
Thursday, November 21, 13
1Broker Registers Offerings
On Broker Startup...

Browser
12

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
1Broker Registers Offerings
On Broker Startup...

Authenticate

Browser
12

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
1Broker Registers Offerings
On Broker Startup...

CLI

Authenticate

Thursday, November 21, 13

UAA

Router
Browser
12

Service
Broker
(i.e. mysql)

token

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
1Broker Registers Offerings
On Broker Startup...

CLI

Authenticate
token

Browser
12

Thursday, November 21, 13

UAA

Router

Services Catalog

Ge

ta
t ca

log

P)
TT
(H

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
1Broker Registers Offerings
On Broker Startup...

CLI

Authenticate
token

Browser
12

Thursday, November 21, 13

UAA

Router

Services Catalog

Ge

Cloud
Controller

ta
t ca

da
Up

te

log

P)
TT
(H

alo
cat

g

Service
Broker
(i.e. mysql)

VM for Service
Instances

P)
TT
(H

DEA

My Service
(process)
2Broker Services (un)provision and (un)bind
Prerequisite...

13

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

Cloud
Controller

VM for Service
Instances
My Service
(process)
2Broker Services (un)provision and (un)bind
Prerequisite...

shared secret

13

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

Cloud
Controller

VM for Service
Instances
My Service
(process)
2Broker Services (un)provision and (un)bind
Prerequisite...

vid

es

ha

13

Thursday, November 21, 13

red

sec
ret

Service
Broker
(i.e. mysql)
(H

UAA

pro

Router

CLI

shared secret

VM for Service
Instances

TT
P)

Cloud
Controller

My Service
(process)
2Broker Services (un)provision and (un)bind

Browser
14

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
2Broker Services (un)provision and (un)bind

Browser
14

Thursday, November 21, 13

UAA

Router

CLI

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
Browser
14

Thursday, November 21, 13

UAA

Router

CLI

2Broker Services (un)provision and (un)bind

(un

)

vi
pro

sio

n

P)
TT
(H

Service
Broker
(i.e. mysql)

up to you

VM for Service
Instances
My Service
(process)

Cloud
Controller
DEA
CLI

2Broker Services (un)provision and (un)bind

Browser
14

Thursday, November 21, 13

UAA

Router

credentials

(un

Cloud
Controller

)

vi
pro

)b
(un

ind

sio

n

P)
TT
(H

P)
TT
(H

DEA
Droplet
credentials

Service
Broker
(i.e. mysql)

up to you

VM for Service
Instances
My Service
(process)
CLI

2Broker Services (un)provision and (un)bind

Browser
14

Thursday, November 21, 13

UAA

Router

credentials

(un

Cloud
Controller

)

vi
pro

)b
(un

ind

sio

n

P)
TT
(H

P)
TT
(H

DEA
Droplet
credentials

Service
Broker
(i.e. mysql)

up to you

VM for Service
Instances
My Service
(process)
3Orphan Management

CLI

Broker is responsible for eventual consistency...

15

Thursday, November 21, 13

UAA

Router

Services Catalog

Cloud
Controller

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)
3Orphan Management
Broker is responsible for eventual consistency...

CLI

Authenticate
token

15

Thursday, November 21, 13

UAA

Router

Services Catalog

Cloud
Controller

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)
3Orphan Management
Broker is responsible for eventual consistency...

CLI

Authenticate
token

15

Thursday, November 21, 13

UAA

Router

Services Catalog

Ge

Cloud
Controller

ta
t ca

log

P)
TT
(H

Service
Broker
(i.e. mysql)

VM for Service
Instances
My Service
(process)
3Orphan Management
Broker is responsible for eventual consistency...

CLI

Authenticate
token

15

Thursday, November 21, 13

UAA

Router

Services Catalog

Ge

Cloud
Controller

ta
t ca

log

P)
TT
(H

Service
Broker
(i.e. mysql)

up to you

VM for Service
Instances
My Service
(process)
New (V2) Services API
• Simplifies things a bunch!
• Unidirectional - everything initiated from Cloud Controller
• Asynchronous provisioning
• From V1 RESTful Services API:
– Replace offerings registration with endpoint that allows the CC to
GET the offerings
– Remove orphan management

16
Thursday, November 21, 13
It’s Up To YOU Patterns
One option (CF v1 services)...
VM for Service
Instances
My Service
(process)

VM for Service
Broker
Service
Broker

VM for Service
Instances
My Service
(process)

Node

Node
VM for Service
Instances

NATS
17

Thursday, November 21, 13

My Service
(process)
Node
It’s Up To YOU Patterns
One option (CF v1 services)...
VM for Service
Instances
My Service
(process)

VM for Service
Broker

provision

Service
Broker

VM for Service
Instances
My Service
(process)

Node

Node
VM for Service
Instances

NATS
17

Thursday, November 21, 13

My Service
(process)
Node
It’s Up To YOU Patterns
One option (CF v1 services)...
VM for Service
Instances
My Service
(process)

VM for Service
Broker

provision

Service
Broker

VM for Service
Instances
My Service
(process)

Node

Node
VM for Service
Instances

NATS
17

Thursday, November 21, 13

My Service
(process)
Node
It’s Up To YOU Patterns
One option (CF v1 services)...
VM for Service
Instances
My Service
(process)

VM for Service
Broker

provision

Service
Broker

VM for Service
Instances
My Service
(process)

Node

Node
VM for Service
Instances

NATS
17

Thursday, November 21, 13

My Service
(process)
Node
It’s Up To YOU Patterns
One option (CF v1 services)...
VM for Service
Instances
My Service
(process)

VM for Service
Broker

provision

Service
Broker

VM for Service
Instances
My Service
(process)

Node

Node
VM for Service
Instances

NATS
17

Thursday, November 21, 13

My Service
(process)
Node
It’s Up To YOU Patterns
Another...
VM for Service
Instances
VM for Service
Broker

VM for Service
Instances
Warden
Warden
Svc Process
Svc Process

Service
Broker

Node

Node
VM for Service
Instances
Warden

NATS
18

Thursday, November 21, 13

Svc Process
Node
It’s Up To YOU Patterns
Another...
VM for Service
Instances
VM for Service
Broker

provision

VM for Service
Instances
Warden
Warden
Svc Process
Svc Process

Service
Broker

Node

Node
VM for Service
Instances
Warden

NATS
18

Thursday, November 21, 13

Svc Process
Node
It’s Up To YOU Patterns
Another...
VM for Service
Instances
Warden

VM for Service
Broker

provision

Svc Process
Svc Process

Svc Process

Service
Broker

VM for Service
Instances
Warden
Warden

Node

Node
VM for Service
Instances
Warden

NATS
18

Thursday, November 21, 13

Svc Process
Node
It’s Up To YOU Patterns
Another...
VM for Service
Instances
Warden

VM for Service
Broker

provision

Svc Process
Svc Process

Svc Process

Service
Broker

VM for Service
Instances
Warden
Warden

Node

Node
VM for Service
Instances
Warden

NATS
18

Thursday, November 21, 13

Svc Process
Node
It’s Up To YOU Patterns
And another...
VM for Service
Instances

VM for Service
Instances

VM for Service
Broker
Service
Broker

Node

Node
VM for Service
Instances

NATS
19

Thursday, November 21, 13

Node
It’s Up To YOU Patterns
And another...
VM for Service
Instances

VM for Service
Instances

VM for Service
Broker

provision

Service
Broker

Node

Node
VM for Service
Instances

NATS
19

Thursday, November 21, 13

Node
It’s Up To YOU Patterns
And another...
VM for Service
Instances

VM for Service
Instances

VM for Service
Broker

provision

Service
Broker

Node

Node
VM for Service
Instances

NATS
19

Thursday, November 21, 13

Node
It’s Up To YOU Patterns
And another...
VM for Service
Instances
Warden

VM for Service
Broker

provision

VM for Service
Instances
Warden
Svc Process

Svc Process

Service
Broker

Node

Node
VM for Service
Instances
Warden

NATS
19

Thursday, November 21, 13

Svc Process
Node
It’s Up To YOU Patterns
And another...
VM for Service
Instances
Warden

VM for Service
Broker

provision

VM for Service
Instances
Warden
Svc Process

Svc Process

Service
Broker

Node

Node
VM for Service
Instances
Warden

NATS
19

Thursday, November 21, 13

Svc Process
Node
BOSH deployment
packages
- service broker
- your impl

- service node
- services binaries
- services warden
- your node impl

Provisions
broker VMs

jobs
- service broker
- ref service broker pkg
- start web service
- service node
- ref service node pkg
- start node

Configure shared secret (for example)
20
Thursday, November 21, 13

Provisions
service VMs
But what about...
core

AppDirect
Service
Broker

Service Service
Broker Broker

MySQL

21
Thursday, November 21, 13

MySvc
But what about...
core

AppDirect
Service
Broker

Service Service
Broker Broker

?
ERP

21
Thursday, November 21, 13

Oracle

MySQL

MySvc
User-provided Service Instances

CLI

Prerequisite...

Browser
22

Thursday, November 21, 13

UAA

Router

ERP

Cloud
Controller
DEA

Oracle
User-provided Service Instances

vid

es

erv

Browser
22

Thursday, November 21, 13

ice

cre

de

nti

UAA

pro

Router

CLI

Prerequisite...

als

credentials

(H

ERP

TT
P)

Cloud
Controller
DEA

Oracle
User-provided Service Instances

pro

vid

es

erv

)bi

Browser

Router

(un

ice

22

Thursday, November 21, 13

nd

cre
(H

de

nti

TT
P)

UAA

CLI

Prerequisite...

als

credentials

(H

ERP

TT
P)

Cloud
Controller
DEA
Droplet
credentials

Oracle
User-provided Service Instances

pro

vid

es

erv

)bi

Browser

Router

(un

ice

22

Thursday, November 21, 13

nd

cre
(H

de

nti

TT
P)

UAA

CLI

Prerequisite...

als

credentials

(H

ERP

TT
P)

Cloud
Controller
DEA
Droplet
credentials

Oracle
Demo

23
Thursday, November 21, 13
Tell ‘em what you told ‘em...
§Extending services offerings within run.pivotal.io
–Partnering

§Building services
–Into your own Cloud Foundry

§User-provided service instances
–For access to pre&externally-provisioned services

Thursday, November 21, 13
Buildpacks

© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Thursday, November 21, 13
Deploying to Cloud Foundry

26
Thursday, November 21, 13
Staging and Buildpacks
Buildpacks are responsible for preparing
the machine image for an application
Application
Buildpack
DEA

Container

Libraries
Runtime

Operating System

27
Thursday, November 21, 13

}

Droplet
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

28
Thursday, November 21, 13
Built-in or BYO
cf push

cf push --buildpack <url>

The application is tested
against a set of curated
buildpacks

The buildpack is
referenced by a Git URL

29
Thursday, November 21, 13
Built-in Buildpacks

→
→
→

30
Thursday, November 21, 13
Tested Buildpacks
https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks

Containers

Languages
Haskell

31
Thursday, November 21, 13
Buildpack API
/bin/detect app_directory
Inspect app bits to determine buildpack applicability

/bin/compile app_directory cache_directory
Download and install runtime, container, packages, libraries;
install app bits as necessary

/bin/release app_directory
Build app start command

32
Thursday, November 21, 13
/bin/detect
Inspect the app bits to determine if the buildpack knows how
to handle the application
Gemfile exists
package.json exists
setup.py exists

On match, return exit code 0 and
write to STDOUT a string identifying the buildpack
(often just the name of the language supported)
33
Thursday, November 21, 13
/bin/detect
$ cf push

DEA iterates over built-in
buildpacks calling
/bin/detect scripts
until one of them returns
exit code 0

34
Thursday, November 21, 13

$ cf push --buildpack <url>

/bin/detect is
not called
/bin/compile
Download and install any necessary
runtime (Java VM, Ruby interpreter, JavaScript interpreter)
container (web server)
support libraries, packages, modules (Ruby gems, NPM packages)

...and then installing the app bits into the runtime or container

35
Thursday, November 21, 13
/bin/compile Caching
Runtime, container, and support packages are downloaded
from sources external to Cloud Foundry
DEA provides a location for storing downloaded artifacts to
speed subsequent staging operations

36
Thursday, November 21, 13
/bin/release
Build a YAML-formatted hash with three possible keys
addons: []
config_vars: {}
default_process_types:
web: <start command>

On Cloud Foundry, currently only the web: value
is used to get the start command for the app

37
Thursday, November 21, 13
Java Buildpack
Supports a variety of JVM languages, containers, and
frameworks with a modular, configurable, and extensible design

38
Thursday, November 21, 13
Java Buildpack Concepts

Containers

Frameworks

How an application is run

Additional application
transformations

JREs
Java Runtimes

39
Thursday, November 21, 13
Java Buildpack Concepts
Containers

Frameworks

Java main()
Tomcat
Groovy
Spring Boot CLI
Play

Spring config
Play config
Play JPA config
New Relic

JREs
OpenJDK

40
Thursday, November 21, 13
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
41
Thursday, November 21, 13
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
42
Thursday, November 21, 13
/bin/compile Output Example
-----> Downloaded app package (18M)
-----> Downloading OpenJDK 1.7.0_21 JRE (17.5s)
Expanding JRE to .java (1.4s)
-----> Downloading Auto Reconfiguration 0.7.1 (1.4s)
Modifying /WEB-INF/web.xml for Auto Reconfig
-----> Downloading Tomcat 7.0.42 (3.5s)
Expanding Tomcat to .tomcat (0.2s)
Downloading Buildpack Tomcat Support 1.1.1 (0.0s)
-----> Uploading droplet (55M)

43
Thursday, November 21, 13

DEA

Buildpack

DEA
See What’s Going On
$ cf files <app-name> app
.buildpack-diagnostics/
.java/
.lib/
.tomcat/

Buildpack-installed runtime
Buildpack-installed support libraries
Buildpack-installed container

META-INF/
WEB-INF/
assets/

44
Thursday, November 21, 13

DEA-downloaded application files
See What’s Going On
$ cf files <app-name> staging_info.yml
detected_buildpack: openjdk-1.7.0_21, tomcat-7.0.42,
spring-auto-reconfiguration-0.7.1
start_command: JAVA_HOME=.java
JAVA_OPTS="-Dhttp.port=$PORT
-Djava.io.tmpdir=$TMPDIR -XX:MaxPermSize=52428K
-XX:OnOutOfMemoryError=./.buildpack-diagnostics/killjava
-Xmx384M -Xss1M" .tomcat/bin/catalina.sh run

45
Thursday, November 21, 13
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

46
Thursday, November 21, 13
Customization by Configuration
Configuration files in java-buildpack/config determine the
behavior of a JRE, Container, or Framework
# http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/index.yml
--1.6.0_27: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.6.0_27.tar.gz
1.7.0_21: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.7.0_21.tar.gz
1.7.0_25: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.7.0_25.tar.gz
1.8.0_M6: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.8.0_M6.tar.gz
1.8.0_M7: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.8.0_M7.tar.gz

# cloudfoundry/java-buildpack/config/openjdk.yml
--version: 1.7.0_+
repository_root: "http://download.pivotal.io.s3.amazonaws.com/openjdk/{platform}/{architecture}"
memory_sizes:
memory_heuristics:
  heap: 0.75
  permgen: 0.1
  stack: 0.05
  native: 0.1

47
Thursday, November 21, 13
Customization by Configuration
Example: customizing the Tomcat artifact for download
# http://files.example.com/tomcat-custom/index.yml
--7.0.40: http://files.example.com/tomcat-custom/tomcat-7.0.40.tar.gz
7.0.41: http://files.example.com/tomcat-custom/tomcat-7.0.41.tar.gz
7.0.42: http://files.example.com/tomcat-custom/tomcat-7.0.42.tar.gz

# cloudfoundry/java-buildpack/config/tomcat.yml
--version: 7.0.42
repository_root: "http://files.example.com/tomcat-custom"
support:
  version: 1.1.+
  repository_root: "http://files.example.com/tomcat-buildpack-support"

48
Thursday, November 21, 13
Customization by Configuration
Tomcat container supports simple customization of
context.xml and server.xml.
cloudfoundry/java-buildpack/resources/tomcat/conf
context.xml
server.xml

49
Thursday, November 21, 13
Customization by Extension
Implement a JRE, Container, or Framework support class as
one Ruby file in the appropriate directory
cloudfoundry/java-buildpack/lib/java_buildpack
jre
container
framework
(with additional support classes as necessary)

50
Thursday, November 21, 13
Customization by Extension
Support class types have similar interfaces, following the
buildpack scripts naming conventions
# initialize the support class with platform information provided in context
# context includes app_dir, lib_dir, environment, java_home, java_opts, vcap_application, vcap_services
def initialize(context)
# return a String or an Array<String> that uniquely identifies the container/framework/jre, or nil
def detect
# download and unpack the container/framework/jre, and transform the application as necessary
def compile
# create and return the command to run the application with (containers) or add options to
context[:java_opts] (frameworks)
def release

51
Thursday, November 21, 13
Customization by Extension
Add new support class to config/components.yml
--containers:
  - "JavaBuildpack::Container::Groovy"
  - "JavaBuildpack::Container::Main"
  - "JavaBuildpack::Container::SpringBootCli"
  - "JavaBuildpack::Container::Tomcat"
  - "JavaBuildpack::Container::Play"
jres:
  - "JavaBuildpack::Jre::OpenJdk"
frameworks:
  - "JavaBuildpack::Framework::JavaOpts"
  - "JavaBuildpack::Framework::NewRelic"
  - "JavaBuildpack::Framework::PlayAutoReconfiguration"
  - "JavaBuildpack::Framework::PlayJpaPlugin"
  - "JavaBuildpack::Framework::SpringAutoReconfiguration"
52
Thursday, November 21, 13
Customization
Much more information and documentation included in the
GitHub repository
https://github.com/cloudfoundry/java-buildpack

53
Thursday, November 21, 13
Cornelia Davis
cdavis@gopivotal.com
@cdavisafc

Scott Frederick
sfrederick@gopivotal.com
@scottyfred

Community Engineer, Cloud Foundry at Pivotal
© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Thursday, November 21, 13

Contenu connexe

Plus de cornelia davis

Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-nativeKubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-nativecornelia davis
 
Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Softwarecornelia davis
 
Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Softwarecornelia davis
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cachecornelia davis
 
Devops: Who Does What? - Devops Enterprise Summit 2016
Devops: Who Does What? - Devops Enterprise Summit 2016Devops: Who Does What? - Devops Enterprise Summit 2016
Devops: Who Does What? - Devops Enterprise Summit 2016cornelia davis
 
Velocity NY 2016 - Devops: Who Does What?
Velocity NY 2016 - Devops: Who Does What?Velocity NY 2016 - Devops: Who Does What?
Velocity NY 2016 - Devops: Who Does What?cornelia davis
 
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...cornelia davis
 
Linux Collaboration Summit Keynote: Transformation: It Takes a Platform
Linux Collaboration Summit Keynote: Transformation: It Takes a PlatformLinux Collaboration Summit Keynote: Transformation: It Takes a Platform
Linux Collaboration Summit Keynote: Transformation: It Takes a Platformcornelia davis
 
Devops: Enabled Through a Recasting of Operational Roles
Devops: Enabled Through a Recasting of Operational RolesDevops: Enabled Through a Recasting of Operational Roles
Devops: Enabled Through a Recasting of Operational Rolescornelia davis
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...cornelia davis
 
Removing Barriers Between Dev and Ops
Removing Barriers Between Dev and OpsRemoving Barriers Between Dev and Ops
Removing Barriers Between Dev and Opscornelia davis
 
Declarative Infrastructure with Cloud Foundry BOSH
Declarative Infrastructure with Cloud Foundry BOSHDeclarative Infrastructure with Cloud Foundry BOSH
Declarative Infrastructure with Cloud Foundry BOSHcornelia davis
 
Cloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and moreCloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and morecornelia davis
 
Cloud Foundry Platform Operations - CF Summit 2015
Cloud Foundry Platform Operations - CF Summit 2015Cloud Foundry Platform Operations - CF Summit 2015
Cloud Foundry Platform Operations - CF Summit 2015cornelia davis
 
Competing with Software: It Takes a Platform -- Devops @ EMC World
Competing with Software: It Takes a Platform -- Devops @ EMC WorldCompeting with Software: It Takes a Platform -- Devops @ EMC World
Competing with Software: It Takes a Platform -- Devops @ EMC Worldcornelia davis
 
Pivotal Cloud Platform Roadshow Keynote
Pivotal Cloud Platform Roadshow KeynotePivotal Cloud Platform Roadshow Keynote
Pivotal Cloud Platform Roadshow Keynotecornelia davis
 
Evolving Devops: The Benefits of PaaS and Application Dial Tone
Evolving Devops: The Benefits of PaaS and Application Dial ToneEvolving Devops: The Benefits of PaaS and Application Dial Tone
Evolving Devops: The Benefits of PaaS and Application Dial Tonecornelia davis
 
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...Software Quality in the Devops World: The Impact of Continuous Delivery on Te...
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...cornelia davis
 
Cloud Foundry Introduction (w Demo) at Silicon Valley Code Camp
Cloud Foundry Introduction (w Demo) at Silicon Valley Code CampCloud Foundry Introduction (w Demo) at Silicon Valley Code Camp
Cloud Foundry Introduction (w Demo) at Silicon Valley Code Campcornelia davis
 

Plus de cornelia davis (20)

Cloud-native Data
Cloud-native DataCloud-native Data
Cloud-native Data
 
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-nativeKubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
 
Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Software
 
Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Software
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
Devops: Who Does What? - Devops Enterprise Summit 2016
Devops: Who Does What? - Devops Enterprise Summit 2016Devops: Who Does What? - Devops Enterprise Summit 2016
Devops: Who Does What? - Devops Enterprise Summit 2016
 
Velocity NY 2016 - Devops: Who Does What?
Velocity NY 2016 - Devops: Who Does What?Velocity NY 2016 - Devops: Who Does What?
Velocity NY 2016 - Devops: Who Does What?
 
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...
Devops Enterprise Summit: My Great Awakening: 
Top “Ah-ha” Moments As Former ...
 
Linux Collaboration Summit Keynote: Transformation: It Takes a Platform
Linux Collaboration Summit Keynote: Transformation: It Takes a PlatformLinux Collaboration Summit Keynote: Transformation: It Takes a Platform
Linux Collaboration Summit Keynote: Transformation: It Takes a Platform
 
Devops: Enabled Through a Recasting of Operational Roles
Devops: Enabled Through a Recasting of Operational RolesDevops: Enabled Through a Recasting of Operational Roles
Devops: Enabled Through a Recasting of Operational Roles
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
 
Removing Barriers Between Dev and Ops
Removing Barriers Between Dev and OpsRemoving Barriers Between Dev and Ops
Removing Barriers Between Dev and Ops
 
Declarative Infrastructure with Cloud Foundry BOSH
Declarative Infrastructure with Cloud Foundry BOSHDeclarative Infrastructure with Cloud Foundry BOSH
Declarative Infrastructure with Cloud Foundry BOSH
 
Cloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and moreCloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and more
 
Cloud Foundry Platform Operations - CF Summit 2015
Cloud Foundry Platform Operations - CF Summit 2015Cloud Foundry Platform Operations - CF Summit 2015
Cloud Foundry Platform Operations - CF Summit 2015
 
Competing with Software: It Takes a Platform -- Devops @ EMC World
Competing with Software: It Takes a Platform -- Devops @ EMC WorldCompeting with Software: It Takes a Platform -- Devops @ EMC World
Competing with Software: It Takes a Platform -- Devops @ EMC World
 
Pivotal Cloud Platform Roadshow Keynote
Pivotal Cloud Platform Roadshow KeynotePivotal Cloud Platform Roadshow Keynote
Pivotal Cloud Platform Roadshow Keynote
 
Evolving Devops: The Benefits of PaaS and Application Dial Tone
Evolving Devops: The Benefits of PaaS and Application Dial ToneEvolving Devops: The Benefits of PaaS and Application Dial Tone
Evolving Devops: The Benefits of PaaS and Application Dial Tone
 
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...Software Quality in the Devops World: The Impact of Continuous Delivery on Te...
Software Quality in the Devops World: The Impact of Continuous Delivery on Te...
 
Cloud Foundry Introduction (w Demo) at Silicon Valley Code Camp
Cloud Foundry Introduction (w Demo) at Silicon Valley Code CampCloud Foundry Introduction (w Demo) at Silicon Valley Code Camp
Cloud Foundry Introduction (w Demo) at Silicon Valley Code Camp
 

Dernier

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Dernier (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Extending Cloud Foundry with Custom Services and Buildpacks

  • 1. Extending Cloud Foundry With Custom Integration Cornelia Davis Scott Frederick © 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission. Thursday, November 21, 13
  • 2. Who and What... 2 Thursday, November 21, 13
  • 3. Who and What... Extending the set of services Customizing application containers 2 Thursday, November 21, 13
  • 4. Services © 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission. Thursday, November 21, 13
  • 6. When you cf push VM for Service Instances Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA MySQL (process)
  • 7. When you cf push VM for Service Instances provision (HTTP) Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA MySQL (process)
  • 8. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA MySQL (process)
  • 9. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA up to you MySQL (process)
  • 10. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA up to you MySQL (process)
  • 11. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA up to you MySQL (process)
  • 12. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller bind (HTTP) Router CLI Browse 5 Thursday, November 21, 13 Service Broker (i.e. mysql) DEA up to you MySQL (process)
  • 13. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller bind (HTTP) Router CLI Browse 5 Thursday, November 21, 13 bind (HTTP) DEA Service Broker (i.e. mysql) up to you MySQL (process)
  • 14. When you cf push VM for Service Instances provision (HTTP) provision (HTTP) Cloud Controller bind (HTTP) Router CLI Browse 5 Thursday, November 21, 13 bind (HTTP) DEA Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 15. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) Cloud Controller bind (HTTP) Router CLI Browse 5 Thursday, November 21, 13 bind (HTTP) DEA Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 16. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) Cloud Controller bind (HTTP) Router CLI Browse 5 Thursday, November 21, 13 bind (HTTP) DEA Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 17. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) CLI Cloud Controller bind (HTTP) bind (HTTP) go ahead and deploy (HTTP) Browse 5 Thursday, November 21, 13 Router ... DEA Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 18. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) CLI Cloud Controller bind (HTTP) bind (HTTP) go ahead and deploy (HTTP) Browse 5 Thursday, November 21, 13 Router ... DEA Droplet credentials Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 19. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) CLI Cloud Controller bind (HTTP) bind (HTTP) go ahead and deploy (HTTP) Browse 5 Thursday, November 21, 13 Router ... DEA Droplet credentials Service Broker (i.e. mysql) up to you up to you MySQL (process)
  • 20. When you cf push VM for Service Instances credentials provision (HTTP) provision (HTTP) CLI Cloud Controller bind (HTTP) bind (HTTP) go ahead and deploy (HTTP) Browse 5 Thursday, November 21, 13 Router ... Service Broker (i.e. mysql) up to you MySQL (process) up to you DEA Droplet credentials Note: • Don’t call ‘em “Gateways” anymore • Broker only used during •(un)provision •(un)bind
  • 22. Agenda §Extending services offerings within run.pivotal.io –Partnering §Building services –Into your own Cloud Foundry §User-provided service instances –For access to pre&externally-provisioned services Thursday, November 21, 13
  • 24. run.pivotal.io Marketplace Services run.pivotal.io Contact Nima Badiey (nbadiey@gopivotal.com) to play 8 Thursday, November 21, 13
  • 29. Cloud Foundry Services • There is only one built in - mysql – or many more depending on how you count • How to build them - the evolution: – CF v1, subclass Ruby base classes – CF v2, a RESTful protocol (which is itself evolving) Polyglot! • There are three parts to the protocol... 11 Thursday, November 21, 13
  • 30. 1Broker Registers Offerings On Broker Startup... Browser 12 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) VM for Service Instances My Service (process) Cloud Controller DEA
  • 31. 1Broker Registers Offerings On Broker Startup... Authenticate Browser 12 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) VM for Service Instances My Service (process) Cloud Controller DEA
  • 32. 1Broker Registers Offerings On Broker Startup... CLI Authenticate Thursday, November 21, 13 UAA Router Browser 12 Service Broker (i.e. mysql) token VM for Service Instances My Service (process) Cloud Controller DEA
  • 33. 1Broker Registers Offerings On Broker Startup... CLI Authenticate token Browser 12 Thursday, November 21, 13 UAA Router Services Catalog Ge ta t ca log P) TT (H Service Broker (i.e. mysql) VM for Service Instances My Service (process) Cloud Controller DEA
  • 34. 1Broker Registers Offerings On Broker Startup... CLI Authenticate token Browser 12 Thursday, November 21, 13 UAA Router Services Catalog Ge Cloud Controller ta t ca da Up te log P) TT (H alo cat g Service Broker (i.e. mysql) VM for Service Instances P) TT (H DEA My Service (process)
  • 35. 2Broker Services (un)provision and (un)bind Prerequisite... 13 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) Cloud Controller VM for Service Instances My Service (process)
  • 36. 2Broker Services (un)provision and (un)bind Prerequisite... shared secret 13 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) Cloud Controller VM for Service Instances My Service (process)
  • 37. 2Broker Services (un)provision and (un)bind Prerequisite... vid es ha 13 Thursday, November 21, 13 red sec ret Service Broker (i.e. mysql) (H UAA pro Router CLI shared secret VM for Service Instances TT P) Cloud Controller My Service (process)
  • 38. 2Broker Services (un)provision and (un)bind Browser 14 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) VM for Service Instances My Service (process) Cloud Controller DEA
  • 39. 2Broker Services (un)provision and (un)bind Browser 14 Thursday, November 21, 13 UAA Router CLI Service Broker (i.e. mysql) VM for Service Instances My Service (process) Cloud Controller DEA
  • 40. Browser 14 Thursday, November 21, 13 UAA Router CLI 2Broker Services (un)provision and (un)bind (un ) vi pro sio n P) TT (H Service Broker (i.e. mysql) up to you VM for Service Instances My Service (process) Cloud Controller DEA
  • 41. CLI 2Broker Services (un)provision and (un)bind Browser 14 Thursday, November 21, 13 UAA Router credentials (un Cloud Controller ) vi pro )b (un ind sio n P) TT (H P) TT (H DEA Droplet credentials Service Broker (i.e. mysql) up to you VM for Service Instances My Service (process)
  • 42. CLI 2Broker Services (un)provision and (un)bind Browser 14 Thursday, November 21, 13 UAA Router credentials (un Cloud Controller ) vi pro )b (un ind sio n P) TT (H P) TT (H DEA Droplet credentials Service Broker (i.e. mysql) up to you VM for Service Instances My Service (process)
  • 43. 3Orphan Management CLI Broker is responsible for eventual consistency... 15 Thursday, November 21, 13 UAA Router Services Catalog Cloud Controller Service Broker (i.e. mysql) VM for Service Instances My Service (process)
  • 44. 3Orphan Management Broker is responsible for eventual consistency... CLI Authenticate token 15 Thursday, November 21, 13 UAA Router Services Catalog Cloud Controller Service Broker (i.e. mysql) VM for Service Instances My Service (process)
  • 45. 3Orphan Management Broker is responsible for eventual consistency... CLI Authenticate token 15 Thursday, November 21, 13 UAA Router Services Catalog Ge Cloud Controller ta t ca log P) TT (H Service Broker (i.e. mysql) VM for Service Instances My Service (process)
  • 46. 3Orphan Management Broker is responsible for eventual consistency... CLI Authenticate token 15 Thursday, November 21, 13 UAA Router Services Catalog Ge Cloud Controller ta t ca log P) TT (H Service Broker (i.e. mysql) up to you VM for Service Instances My Service (process)
  • 47. New (V2) Services API • Simplifies things a bunch! • Unidirectional - everything initiated from Cloud Controller • Asynchronous provisioning • From V1 RESTful Services API: – Replace offerings registration with endpoint that allows the CC to GET the offerings – Remove orphan management 16 Thursday, November 21, 13
  • 48. It’s Up To YOU Patterns One option (CF v1 services)... VM for Service Instances My Service (process) VM for Service Broker Service Broker VM for Service Instances My Service (process) Node Node VM for Service Instances NATS 17 Thursday, November 21, 13 My Service (process) Node
  • 49. It’s Up To YOU Patterns One option (CF v1 services)... VM for Service Instances My Service (process) VM for Service Broker provision Service Broker VM for Service Instances My Service (process) Node Node VM for Service Instances NATS 17 Thursday, November 21, 13 My Service (process) Node
  • 50. It’s Up To YOU Patterns One option (CF v1 services)... VM for Service Instances My Service (process) VM for Service Broker provision Service Broker VM for Service Instances My Service (process) Node Node VM for Service Instances NATS 17 Thursday, November 21, 13 My Service (process) Node
  • 51. It’s Up To YOU Patterns One option (CF v1 services)... VM for Service Instances My Service (process) VM for Service Broker provision Service Broker VM for Service Instances My Service (process) Node Node VM for Service Instances NATS 17 Thursday, November 21, 13 My Service (process) Node
  • 52. It’s Up To YOU Patterns One option (CF v1 services)... VM for Service Instances My Service (process) VM for Service Broker provision Service Broker VM for Service Instances My Service (process) Node Node VM for Service Instances NATS 17 Thursday, November 21, 13 My Service (process) Node
  • 53. It’s Up To YOU Patterns Another... VM for Service Instances VM for Service Broker VM for Service Instances Warden Warden Svc Process Svc Process Service Broker Node Node VM for Service Instances Warden NATS 18 Thursday, November 21, 13 Svc Process Node
  • 54. It’s Up To YOU Patterns Another... VM for Service Instances VM for Service Broker provision VM for Service Instances Warden Warden Svc Process Svc Process Service Broker Node Node VM for Service Instances Warden NATS 18 Thursday, November 21, 13 Svc Process Node
  • 55. It’s Up To YOU Patterns Another... VM for Service Instances Warden VM for Service Broker provision Svc Process Svc Process Svc Process Service Broker VM for Service Instances Warden Warden Node Node VM for Service Instances Warden NATS 18 Thursday, November 21, 13 Svc Process Node
  • 56. It’s Up To YOU Patterns Another... VM for Service Instances Warden VM for Service Broker provision Svc Process Svc Process Svc Process Service Broker VM for Service Instances Warden Warden Node Node VM for Service Instances Warden NATS 18 Thursday, November 21, 13 Svc Process Node
  • 57. It’s Up To YOU Patterns And another... VM for Service Instances VM for Service Instances VM for Service Broker Service Broker Node Node VM for Service Instances NATS 19 Thursday, November 21, 13 Node
  • 58. It’s Up To YOU Patterns And another... VM for Service Instances VM for Service Instances VM for Service Broker provision Service Broker Node Node VM for Service Instances NATS 19 Thursday, November 21, 13 Node
  • 59. It’s Up To YOU Patterns And another... VM for Service Instances VM for Service Instances VM for Service Broker provision Service Broker Node Node VM for Service Instances NATS 19 Thursday, November 21, 13 Node
  • 60. It’s Up To YOU Patterns And another... VM for Service Instances Warden VM for Service Broker provision VM for Service Instances Warden Svc Process Svc Process Service Broker Node Node VM for Service Instances Warden NATS 19 Thursday, November 21, 13 Svc Process Node
  • 61. It’s Up To YOU Patterns And another... VM for Service Instances Warden VM for Service Broker provision VM for Service Instances Warden Svc Process Svc Process Service Broker Node Node VM for Service Instances Warden NATS 19 Thursday, November 21, 13 Svc Process Node
  • 62. BOSH deployment packages - service broker - your impl - service node - services binaries - services warden - your node impl Provisions broker VMs jobs - service broker - ref service broker pkg - start web service - service node - ref service node pkg - start node Configure shared secret (for example) 20 Thursday, November 21, 13 Provisions service VMs
  • 63. But what about... core AppDirect Service Broker Service Service Broker Broker MySQL 21 Thursday, November 21, 13 MySvc
  • 64. But what about... core AppDirect Service Broker Service Service Broker Broker ? ERP 21 Thursday, November 21, 13 Oracle MySQL MySvc
  • 65. User-provided Service Instances CLI Prerequisite... Browser 22 Thursday, November 21, 13 UAA Router ERP Cloud Controller DEA Oracle
  • 66. User-provided Service Instances vid es erv Browser 22 Thursday, November 21, 13 ice cre de nti UAA pro Router CLI Prerequisite... als credentials (H ERP TT P) Cloud Controller DEA Oracle
  • 67. User-provided Service Instances pro vid es erv )bi Browser Router (un ice 22 Thursday, November 21, 13 nd cre (H de nti TT P) UAA CLI Prerequisite... als credentials (H ERP TT P) Cloud Controller DEA Droplet credentials Oracle
  • 68. User-provided Service Instances pro vid es erv )bi Browser Router (un ice 22 Thursday, November 21, 13 nd cre (H de nti TT P) UAA CLI Prerequisite... als credentials (H ERP TT P) Cloud Controller DEA Droplet credentials Oracle
  • 70. Tell ‘em what you told ‘em... §Extending services offerings within run.pivotal.io –Partnering §Building services –Into your own Cloud Foundry §User-provided service instances –For access to pre&externally-provisioned services Thursday, November 21, 13
  • 71. Buildpacks © 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission. Thursday, November 21, 13
  • 72. Deploying to Cloud Foundry 26 Thursday, November 21, 13
  • 73. Staging and Buildpacks Buildpacks are responsible for preparing the machine image for an application Application Buildpack DEA Container Libraries Runtime Operating System 27 Thursday, November 21, 13 } Droplet
  • 74. 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 28 Thursday, November 21, 13
  • 75. Built-in or BYO cf push cf push --buildpack <url> The application is tested against a set of curated buildpacks The buildpack is referenced by a Git URL 29 Thursday, November 21, 13
  • 78. Buildpack API /bin/detect app_directory Inspect app bits to determine buildpack applicability /bin/compile app_directory cache_directory Download and install runtime, container, packages, libraries; install app bits as necessary /bin/release app_directory Build app start command 32 Thursday, November 21, 13
  • 79. /bin/detect Inspect the app bits to determine if the buildpack knows how to handle the application Gemfile exists package.json exists setup.py exists On match, return exit code 0 and write to STDOUT a string identifying the buildpack (often just the name of the language supported) 33 Thursday, November 21, 13
  • 80. /bin/detect $ cf push DEA iterates over built-in buildpacks calling /bin/detect scripts until one of them returns exit code 0 34 Thursday, November 21, 13 $ cf push --buildpack <url> /bin/detect is not called
  • 81. /bin/compile Download and install any necessary runtime (Java VM, Ruby interpreter, JavaScript interpreter) container (web server) support libraries, packages, modules (Ruby gems, NPM packages) ...and then installing the app bits into the runtime or container 35 Thursday, November 21, 13
  • 82. /bin/compile Caching Runtime, container, and support packages are downloaded from sources external to Cloud Foundry DEA provides a location for storing downloaded artifacts to speed subsequent staging operations 36 Thursday, November 21, 13
  • 83. /bin/release Build a YAML-formatted hash with three possible keys addons: [] config_vars: {} default_process_types: web: <start command> On Cloud Foundry, currently only the web: value is used to get the start command for the app 37 Thursday, November 21, 13
  • 84. Java Buildpack Supports a variety of JVM languages, containers, and frameworks with a modular, configurable, and extensible design 38 Thursday, November 21, 13
  • 85. Java Buildpack Concepts Containers Frameworks How an application is run Additional application transformations JREs Java Runtimes 39 Thursday, November 21, 13
  • 86. Java Buildpack Concepts Containers Frameworks Java main() Tomcat Groovy Spring Boot CLI Play Spring config Play config Play JPA config New Relic JREs OpenJDK 40 Thursday, November 21, 13
  • 87. 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 41 Thursday, November 21, 13
  • 88. 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 42 Thursday, November 21, 13
  • 89. /bin/compile Output Example -----> Downloaded app package (18M) -----> Downloading OpenJDK 1.7.0_21 JRE (17.5s) Expanding JRE to .java (1.4s) -----> Downloading Auto Reconfiguration 0.7.1 (1.4s) Modifying /WEB-INF/web.xml for Auto Reconfig -----> Downloading Tomcat 7.0.42 (3.5s) Expanding Tomcat to .tomcat (0.2s) Downloading Buildpack Tomcat Support 1.1.1 (0.0s) -----> Uploading droplet (55M) 43 Thursday, November 21, 13 DEA Buildpack DEA
  • 90. See What’s Going On $ cf files <app-name> app .buildpack-diagnostics/ .java/ .lib/ .tomcat/ Buildpack-installed runtime Buildpack-installed support libraries Buildpack-installed container META-INF/ WEB-INF/ assets/ 44 Thursday, November 21, 13 DEA-downloaded application files
  • 91. See What’s Going On $ cf files <app-name> staging_info.yml detected_buildpack: openjdk-1.7.0_21, tomcat-7.0.42, spring-auto-reconfiguration-0.7.1 start_command: JAVA_HOME=.java JAVA_OPTS="-Dhttp.port=$PORT -Djava.io.tmpdir=$TMPDIR -XX:MaxPermSize=52428K -XX:OnOutOfMemoryError=./.buildpack-diagnostics/killjava -Xmx384M -Xss1M" .tomcat/bin/catalina.sh run 45 Thursday, November 21, 13
  • 92. 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 46 Thursday, November 21, 13
  • 93. Customization by Configuration Configuration files in java-buildpack/config determine the behavior of a JRE, Container, or Framework # http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/index.yml --1.6.0_27: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.6.0_27.tar.gz 1.7.0_21: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.7.0_21.tar.gz 1.7.0_25: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.7.0_25.tar.gz 1.8.0_M6: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.8.0_M6.tar.gz 1.8.0_M7: http://download.pivotal.io.s3.amazonaws.com/openjdk/lucid/x86_64/openjdk-1.8.0_M7.tar.gz # cloudfoundry/java-buildpack/config/openjdk.yml --version: 1.7.0_+ repository_root: "http://download.pivotal.io.s3.amazonaws.com/openjdk/{platform}/{architecture}" memory_sizes: memory_heuristics:   heap: 0.75   permgen: 0.1   stack: 0.05   native: 0.1 47 Thursday, November 21, 13
  • 94. Customization by Configuration Example: customizing the Tomcat artifact for download # http://files.example.com/tomcat-custom/index.yml --7.0.40: http://files.example.com/tomcat-custom/tomcat-7.0.40.tar.gz 7.0.41: http://files.example.com/tomcat-custom/tomcat-7.0.41.tar.gz 7.0.42: http://files.example.com/tomcat-custom/tomcat-7.0.42.tar.gz # cloudfoundry/java-buildpack/config/tomcat.yml --version: 7.0.42 repository_root: "http://files.example.com/tomcat-custom" support:   version: 1.1.+   repository_root: "http://files.example.com/tomcat-buildpack-support" 48 Thursday, November 21, 13
  • 95. Customization by Configuration Tomcat container supports simple customization of context.xml and server.xml. cloudfoundry/java-buildpack/resources/tomcat/conf context.xml server.xml 49 Thursday, November 21, 13
  • 96. Customization by Extension Implement a JRE, Container, or Framework support class as one Ruby file in the appropriate directory cloudfoundry/java-buildpack/lib/java_buildpack jre container framework (with additional support classes as necessary) 50 Thursday, November 21, 13
  • 97. Customization by Extension Support class types have similar interfaces, following the buildpack scripts naming conventions # initialize the support class with platform information provided in context # context includes app_dir, lib_dir, environment, java_home, java_opts, vcap_application, vcap_services def initialize(context) # return a String or an Array<String> that uniquely identifies the container/framework/jre, or nil def detect # download and unpack the container/framework/jre, and transform the application as necessary def compile # create and return the command to run the application with (containers) or add options to context[:java_opts] (frameworks) def release 51 Thursday, November 21, 13
  • 98. Customization by Extension Add new support class to config/components.yml --containers:   - "JavaBuildpack::Container::Groovy"   - "JavaBuildpack::Container::Main"   - "JavaBuildpack::Container::SpringBootCli"   - "JavaBuildpack::Container::Tomcat"   - "JavaBuildpack::Container::Play" jres:   - "JavaBuildpack::Jre::OpenJdk" frameworks:   - "JavaBuildpack::Framework::JavaOpts"   - "JavaBuildpack::Framework::NewRelic"   - "JavaBuildpack::Framework::PlayAutoReconfiguration"   - "JavaBuildpack::Framework::PlayJpaPlugin"   - "JavaBuildpack::Framework::SpringAutoReconfiguration" 52 Thursday, November 21, 13
  • 99. Customization Much more information and documentation included in the GitHub repository https://github.com/cloudfoundry/java-buildpack 53 Thursday, November 21, 13
  • 100. Cornelia Davis cdavis@gopivotal.com @cdavisafc Scott Frederick sfrederick@gopivotal.com @scottyfred Community Engineer, Cloud Foundry at Pivotal © 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission. Thursday, November 21, 13