IBM Software Group
1
http://tuscany.apache.org
High Performance Cloud-enabled SCA
Runtimes
Luciano Resende
lresende@apache.org
http://lresende.blogspot.com
Jean-Sebastien Delfino
jsdelfino@apache.org
http://jsdelfino.blogspot.com
IBM Software Group
2
http://tuscany.apache.org
Agenda
 SCA – Not just one Runtime
 Apache Tuscany and Sub-Projects
 SCA C++ Runtime
– Usage Scenarios
– How It Works
– Utility Components
– Demo
 SCA Python Runtime
 Usage Scenarios
 How It Works
 Demo
 Getting Involved
IBM Software Group
3
http://tuscany.apache.org
SCA – Not Just One Monolithic Runtime
IBM Software Group
4
http://tuscany.apache.org
Assembly
Implementation
Languages
Policy Framework Bindings
Java Java EE
Spring
C++
BPEL
Security
RM
Transactions
Web services
JMS
JCA
SCA Specifications
• SCA is going through a formal standardization process at
OASIS OpenCSA (http://www.oasis-opencsa.org)
IBM Software Group
5
http://tuscany.apache.org
OASIS Open CSA - http://www.oasis-opencsa.org/
IBM Software Group
6
http://tuscany.apache.org
SCA Assembly Model
Composite A
Component
AService
Service Binding
Web Service
JMS
SLSB
Rest
JSONRPC
JCA
…
Reference Binding
Web Service
JMS
SLSB
Rest
JSONRPC
JCA
…
Component
B
Service Interface
- Java
- WSDL
Reference Interface
Reference
property setting
Property
promotepromote wire
Implementation
Java
BPEL
PHP
SCA composite
Spring
EJB module
C
C++
Python
...
- Java
- WSDL
IBM Software Group
7
http://tuscany.apache.org
SCA Domain
A common assembly model
A distributed deployment
of the assembly
SCA nodes can use different
specialized runtimes, optimized
for specific component types
Java
JEE
BPEL
C / C++
Python
PHP
etc
IBM Software Group
8
http://tuscany.apache.org
Apache Tuscany
 Apache Tuscany provides a component based programming model
which simplifies development, assembly and deployment and
management of composite applications.
 Apache Tuscany implements SCA standards defined by OASIS
OpenCSA + extensions based on community feedback.
8
IBM Software Group
9
http://tuscany.apache.org
Tuscany SCA Native - C++ Runtime
IBM Software Group
10
http://tuscany.apache.org
SCA Native Runtime – Usage Scenarios
• Components written in Python or C++
• Integrated with HTTPD
• High Throughput and Scalable
– Stateless components
– Load balancing (mod_proxy_balancer)
• Small disk and memory footprint
– no JVM, not a lot of code, most dependencies optional
• Built-in Security
– HTTPS, OpenID, Oauth 1+2, mod_auth*
• HTTP-based Protocol Bindings
– JSON-RPC, ATOM + RSS
• Easy install + configuration + reconfiguration
• Multi-tenant
– currently using HTTPD mass dynamic virtual hosting
IBM Software Group
11
http://tuscany.apache.org
A Useful Subset of SCA
• Subset of SCA
– Simple one level assembly (no recursive composition)
– Simple wiring (no autowiring, no multiplicity)
– String-only properties
– No Policies
– No SCDL Includes
– No SCDL validation
– Stateless components, parameter injection only
– One SCA contribution directory per Runtime Instance
• Still Useful and Usable
– Runs apps similar to Tuscany Store / ShoppingCart Tutorial
– Same Python components run on
• Tuscany / Java
• Tuscany / C++
• Tuscany / Python
IBM Software Group
12
http://tuscany.apache.org
Sample Online Store App
Store
Catalog
Currency
Converter
currencyCode=USD
jsonrpc
ShoppingCart
atom
jsonrpc
Cart
Total
IBM Software Group
13
http://tuscany.apache.org
Sample Composite
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" … >
...
<component name="Catalog">
<t:implementation.python script="fruits-catalog.py"/>
<property name="currencyCode">USD</property>
<service name="Catalog">
<t:binding.jsonrpc uri="catalog"/>
</service>
<reference name="currencyConverter" target="CurrencyConverter"/>
</component>
<component name="ShoppingCart">
<t:implementation.python script="shopping-cart.py"/>
<service name="ShoppingCart">
<t:binding.atom uri="shoppingCart"/>
</service>
<service name="Total">
<t:binding.jsonrpc uri="total"/>
</service>
<reference name="cache" target="Cache"/>
</component>
<component name="CurrencyConverter">
<t:implementation.python script="currency-converter.py"/>
<service name="CurrencyConverter">
<t:binding.jsonrpc uri="currencyConverter"/>
</service>
</component>
</composite>
IBM Software Group
14
http://tuscany.apache.org
Sample Python Components
fruits-catalog.py
def items(converter, currency):
def convert(price):
return converter.convert("USD", currency, price)
symbol = converter.symbol(currency)
return (
(("'name", "Mango"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(2.99))),
(("'name", "Passion"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(3.55))),
(("'name", "Kiwi"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(1.55))))
store.py
def getall(catalog, shoppingCart, shoppingTotal):
return shoppingCart.getall()
def get(id, catalog, shoppingCart, shoppingTotal):
return shoppingCart.get(id)
def items(catalog, shoppingCart, shoppingTotal):
return catalog.items()
def total(catalog, shoppingCart, shoppingTotal):
return shoppingCart.gettotal()
IBM Software Group
15
http://tuscany.apache.org
How It Works
HTTPD
mod_wiring
mod_eval_cpp
mod_eval_python
curl
libxml2
apr json
oauth
openid
Store
Catalog
Currency
Converter
http
currencyCode=USD
jsonrpc
ShoppingCart
atom
jsonrpc
Collection
Total
IBM Software Group
16
http://tuscany.apache.org
Utility Components
• All these components are optional
• You just drop them in your SCA assembly as needed
• Simpler than having more built-in stuff in core SCA?
• Cache component using Memcached
• Log component using Facebook Scribe
• Queue component using Apache Qpid/C
• SQL DB component using PostgreSQL
• Web Service component using Axis2/C
• Key / value store component
• XMPP Chat component
• ...
IBM Software Group
17
http://tuscany.apache.org
Demo
• SCA Native Project Layout
• Samples
– C++ Store / Shopping Cart app
– Python Store / Shopping Cart app
– Multi-tenant app
IBM Software Group
18
http://tuscany.apache.org
SCA Python Runtime – Usage Scenarios
• Components written in Python
• Run on Google AppEngine
• Run on a Python WSGI Server
• Lightweight with very little code
• Stateless
• JSON-RPC, ATOM, RSS Bindings
• Same Programming Model as SCA Native runtime
IBM Software Group
19
http://tuscany.apache.org
How It Works
Google AppEngine
wiring eval httplib
xml etree
jsonusers
Store
Catalog
Currency
Converter
http
currencyCode=USD
jsonrpc
ShoppingCart
atom
jsonrpc
Collection
Total
Python WSGI
IBM Software Group
20
http://tuscany.apache.org
Demo
• Store / Shopping Cart app on Google AppEngine
IBM Software Group
21
http://tuscany.apache.org
Getting Involved
with Apache Tuscany
IBM Software Group
22
http://tuscany.apache.org
SCA - Resources
 Good introduction to SCA
 http://www.davidchappell.com/articles/Introducing_SCA.pdf
 OASIS Open CSA – http://www.oasis-opencsa.org
 V1.1 level specs
 http://www.oasis-opencsa.org/sca
 Open CSA Technical Committees
 http://www.oasis-opencsa.org/committees
 OSOA
 http://osoa.org/display/Main/Home
 More information on that site
 http://osoa.org/display/Main/SCA+Resources
IBM Software Group
23
http://tuscany.apache.org
Apache Tuscany Resources
 Apache Tuscany
 http://tuscany.apache.org
 Getting Involved
 http://tuscany.apache.org/getting-involved.html
 Tuscany Dashboard
 http://tuscany.apache.org/tuscany-dashboard.html
IBM Software Group
24
http://tuscany.apache.org
Getting Involved
with Apache Nuvem
IBM Software Group
25
http://tuscany.apache.org
Apache Nuvem Resources
 Apache Nuvem
 http://incubator.apache.org/nuvem/
 Getting Involved
 http://incubator.apache.org/nuvem/nuvem-getting-involved.html
IBM Software Group
26
http://tuscany.apache.org
Thank You !!!

ApacheCon NA 2010 - High Performance Cloud-enabled SCA Runtimes

  • 1.
    IBM Software Group 1 http://tuscany.apache.org HighPerformance Cloud-enabled SCA Runtimes Luciano Resende lresende@apache.org http://lresende.blogspot.com Jean-Sebastien Delfino jsdelfino@apache.org http://jsdelfino.blogspot.com
  • 2.
    IBM Software Group 2 http://tuscany.apache.org Agenda SCA – Not just one Runtime  Apache Tuscany and Sub-Projects  SCA C++ Runtime – Usage Scenarios – How It Works – Utility Components – Demo  SCA Python Runtime  Usage Scenarios  How It Works  Demo  Getting Involved
  • 3.
    IBM Software Group 3 http://tuscany.apache.org SCA– Not Just One Monolithic Runtime
  • 4.
    IBM Software Group 4 http://tuscany.apache.org Assembly Implementation Languages PolicyFramework Bindings Java Java EE Spring C++ BPEL Security RM Transactions Web services JMS JCA SCA Specifications • SCA is going through a formal standardization process at OASIS OpenCSA (http://www.oasis-opencsa.org)
  • 5.
    IBM Software Group 5 http://tuscany.apache.org OASISOpen CSA - http://www.oasis-opencsa.org/
  • 6.
    IBM Software Group 6 http://tuscany.apache.org SCAAssembly Model Composite A Component AService Service Binding Web Service JMS SLSB Rest JSONRPC JCA … Reference Binding Web Service JMS SLSB Rest JSONRPC JCA … Component B Service Interface - Java - WSDL Reference Interface Reference property setting Property promotepromote wire Implementation Java BPEL PHP SCA composite Spring EJB module C C++ Python ... - Java - WSDL
  • 7.
    IBM Software Group 7 http://tuscany.apache.org SCADomain A common assembly model A distributed deployment of the assembly SCA nodes can use different specialized runtimes, optimized for specific component types Java JEE BPEL C / C++ Python PHP etc
  • 8.
    IBM Software Group 8 http://tuscany.apache.org ApacheTuscany  Apache Tuscany provides a component based programming model which simplifies development, assembly and deployment and management of composite applications.  Apache Tuscany implements SCA standards defined by OASIS OpenCSA + extensions based on community feedback. 8
  • 9.
  • 10.
    IBM Software Group 10 http://tuscany.apache.org SCANative Runtime – Usage Scenarios • Components written in Python or C++ • Integrated with HTTPD • High Throughput and Scalable – Stateless components – Load balancing (mod_proxy_balancer) • Small disk and memory footprint – no JVM, not a lot of code, most dependencies optional • Built-in Security – HTTPS, OpenID, Oauth 1+2, mod_auth* • HTTP-based Protocol Bindings – JSON-RPC, ATOM + RSS • Easy install + configuration + reconfiguration • Multi-tenant – currently using HTTPD mass dynamic virtual hosting
  • 11.
    IBM Software Group 11 http://tuscany.apache.org AUseful Subset of SCA • Subset of SCA – Simple one level assembly (no recursive composition) – Simple wiring (no autowiring, no multiplicity) – String-only properties – No Policies – No SCDL Includes – No SCDL validation – Stateless components, parameter injection only – One SCA contribution directory per Runtime Instance • Still Useful and Usable – Runs apps similar to Tuscany Store / ShoppingCart Tutorial – Same Python components run on • Tuscany / Java • Tuscany / C++ • Tuscany / Python
  • 12.
    IBM Software Group 12 http://tuscany.apache.org SampleOnline Store App Store Catalog Currency Converter currencyCode=USD jsonrpc ShoppingCart atom jsonrpc Cart Total
  • 13.
    IBM Software Group 13 http://tuscany.apache.org SampleComposite <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" … > ... <component name="Catalog"> <t:implementation.python script="fruits-catalog.py"/> <property name="currencyCode">USD</property> <service name="Catalog"> <t:binding.jsonrpc uri="catalog"/> </service> <reference name="currencyConverter" target="CurrencyConverter"/> </component> <component name="ShoppingCart"> <t:implementation.python script="shopping-cart.py"/> <service name="ShoppingCart"> <t:binding.atom uri="shoppingCart"/> </service> <service name="Total"> <t:binding.jsonrpc uri="total"/> </service> <reference name="cache" target="Cache"/> </component> <component name="CurrencyConverter"> <t:implementation.python script="currency-converter.py"/> <service name="CurrencyConverter"> <t:binding.jsonrpc uri="currencyConverter"/> </service> </component> </composite>
  • 14.
    IBM Software Group 14 http://tuscany.apache.org SamplePython Components fruits-catalog.py def items(converter, currency): def convert(price): return converter.convert("USD", currency, price) symbol = converter.symbol(currency) return ( (("'name", "Mango"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(2.99))), (("'name", "Passion"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(3.55))), (("'name", "Kiwi"), ("'currency", currency), ("'currencySymbol", symbol), ("'price", convert(1.55)))) store.py def getall(catalog, shoppingCart, shoppingTotal): return shoppingCart.getall() def get(id, catalog, shoppingCart, shoppingTotal): return shoppingCart.get(id) def items(catalog, shoppingCart, shoppingTotal): return catalog.items() def total(catalog, shoppingCart, shoppingTotal): return shoppingCart.gettotal()
  • 15.
    IBM Software Group 15 http://tuscany.apache.org HowIt Works HTTPD mod_wiring mod_eval_cpp mod_eval_python curl libxml2 apr json oauth openid Store Catalog Currency Converter http currencyCode=USD jsonrpc ShoppingCart atom jsonrpc Collection Total
  • 16.
    IBM Software Group 16 http://tuscany.apache.org UtilityComponents • All these components are optional • You just drop them in your SCA assembly as needed • Simpler than having more built-in stuff in core SCA? • Cache component using Memcached • Log component using Facebook Scribe • Queue component using Apache Qpid/C • SQL DB component using PostgreSQL • Web Service component using Axis2/C • Key / value store component • XMPP Chat component • ...
  • 17.
    IBM Software Group 17 http://tuscany.apache.org Demo •SCA Native Project Layout • Samples – C++ Store / Shopping Cart app – Python Store / Shopping Cart app – Multi-tenant app
  • 18.
    IBM Software Group 18 http://tuscany.apache.org SCAPython Runtime – Usage Scenarios • Components written in Python • Run on Google AppEngine • Run on a Python WSGI Server • Lightweight with very little code • Stateless • JSON-RPC, ATOM, RSS Bindings • Same Programming Model as SCA Native runtime
  • 19.
    IBM Software Group 19 http://tuscany.apache.org HowIt Works Google AppEngine wiring eval httplib xml etree jsonusers Store Catalog Currency Converter http currencyCode=USD jsonrpc ShoppingCart atom jsonrpc Collection Total Python WSGI
  • 20.
    IBM Software Group 20 http://tuscany.apache.org Demo •Store / Shopping Cart app on Google AppEngine
  • 21.
  • 22.
    IBM Software Group 22 http://tuscany.apache.org SCA- Resources  Good introduction to SCA  http://www.davidchappell.com/articles/Introducing_SCA.pdf  OASIS Open CSA – http://www.oasis-opencsa.org  V1.1 level specs  http://www.oasis-opencsa.org/sca  Open CSA Technical Committees  http://www.oasis-opencsa.org/committees  OSOA  http://osoa.org/display/Main/Home  More information on that site  http://osoa.org/display/Main/SCA+Resources
  • 23.
    IBM Software Group 23 http://tuscany.apache.org ApacheTuscany Resources  Apache Tuscany  http://tuscany.apache.org  Getting Involved  http://tuscany.apache.org/getting-involved.html  Tuscany Dashboard  http://tuscany.apache.org/tuscany-dashboard.html
  • 24.
  • 25.
    IBM Software Group 25 http://tuscany.apache.org ApacheNuvem Resources  Apache Nuvem  http://incubator.apache.org/nuvem/  Getting Involved  http://incubator.apache.org/nuvem/nuvem-getting-involved.html
  • 26.