CDDLM XML-CDL
description
Transcript of CDDLM XML-CDL
1
CDDLM XML-CDL
Jun TatemuraNEC Laboratories Amercia
GGF10, March 2004
2
Background: Components and Component Services How applications are deployed on top of
infrastructure
LinuxComponent
ServiceService
Requester
applicationApplication
serverComponent
ServiceService
Requester
J2EE app
3
User (who deploys)
CDL’s Role in Deployment Example: Three-tier web applications
Resource provider
Appserver
Appserver
Appserver
DBserver
DBserver
DBserver
Webserver
Webserver
WebserverComponent
service
Componentservice
Componentservice
CDLTemplateCDL
Template
CDLTemplate
ApplicationWrapper
Provider (developer)CDL TemplateFor 3tier app
CDLFor a specificdeployment
request
ResourceBroker
Info from agreement
CDDLMprocessor
BasicService
+
4
Issues Overview [1] Attribute set description model [2] Component description model [3] Lifecycle management model [4] Dependencies and assertions [1-4] Relationship with SmartFrog
5
CDL Top-Level Structure Divided into sections (similar to WSDL)
Cf. SmartFrog has a uniform language structure and utilizes predefined names and frameworks (e.g., sfConfig, Prim)
Configuration on a system can be described in multiple CDL files
<import> and <include>
<cdl targetNamespace=“xsd:anyURI”> <types …/>? <!-- schema definition --> <configuration …/>? <!-- configuration data --> <system …/>? <!-- system structure --> <services …/>? <!-- service endpoints --></cdl>
6
Import and Include Similar to XML Schema <import namespace=“xsd:anyURI” location=“xsd:anyURI” />
Import of external namespaces <include location=“xsd:anyURI” />
Inclusion of XML Data Similar to SmartFrog’s #include but may be more r
estrictive due to validity as XML data
7
Issue 1: Attribute Set Description Model
8
Attribute Sets Configuration is a set of attribute-value pairs Inheritance: the “extends” operation (from SmartFrog) for extensibility of co
nfiguration Every attribute set can be referred to with a QName
extendsoverride additionreuse
9
Using QName for Attribute Set Name Namespace realizes a globally unique
reference to specify an attribute set
<cdl targetNamespace=“uri1”><attributeSet name=“abc” .../></cdl><cdl xmlns:tmpl=“uri1”>
<attributeSet name=“myabc” extends=“tmpl:abc” .../></cdl>
A template CDL providedby the application provider
CDL specified by the applicationuser
10
Two Design Alternativesof Attribute Description [Alt-1] CDL specific attribute e
lements (current draft)<cdl:attributeSet cdl:name=“apache” cdl:extends=“ex:httpd”> <cdl:attribute> <cdl:name>hostname </cdl:name> <cdl:value> example.com </cdl:value> </cdl:attribute></cdl:attributeSet>
[Alt-2] Configuration specific schema
<tns:apache cdl:name=“apache” cdl:extends=“ex:httpd”> <tns:hostname cdl:use=“…” …> example.com </tns:hostname></tns:apache>
11
[Alt-1] Attribute Sets <attributeSet> element
@name defines QName of this set @extends specifies a prototype set
<attributeSet name=“xsd:NCName” extends=“xsd:QName”?> <attribute …/>*</attributeSet>
12
[Alt-1] Attributes A pair of name and value Augmented by <type>, <lifetime>, <use>, etc.
type: type definition (XML Schema) lifetime: deployment | runtime | dynamic use: required | optional | readonly -- discussed later as another issue
<attribute> <name>host</name> <type>xns:ipAddress</type> <lifetime>deployment</lifetime> <use>required</use> <value>15.144.56.243</value></attribute>
<attribute> <name>xsd:string</name> <type/>? <lifetime/>? <use/>? <value/>?</attribute>
13
[Alt-1] Nested Attribute Sets An attribute can have an attribute set as its value Nesting of attribute sets is flattened and linked with r
eferences (QNames)
<attribute> <name>database-server</name> <type>cdl:refToAttributeSet</type> <lifetime>deployment</lifetime> <use>required</use> <value>tns:database</value></attribute>
<attributeSet name=“database” extends=“oracle” > <attribute .../> ...</attributeSet>
14
[Alt-1] Reference to Attribute An attribute is identified with the QName of an attribut
e set + the name (string) of an attribute This is one reason why attribute sets are flattened
<reference><attributeSet>xsd:QName</attributeSet>?<attributeName>xsd:string</attributeName></reference>
(alternative expression)<reference set=“xsd:QName”?>xsd:string</reference>
15
[Alt-2] Fully-bound Configuration Documents After references are resolved and values are fixed, a document becomes
a simple and natural XML data based on application-specific schema Similar to WS-ResourceProperties
<apache cdl:name=“xsd:NCName”> <MaxClients>150</MaxClients> <HostName>example.com</HostName> …</apache><apache cdl:name=“xsd:NCName”
cdl:extends=“xsd:QName”> <HostName /> …</apache>
resolution
Schema for a particular
configuration document
16
[Alt-2] CDL Functionalities Functionalities same as Alt-1 are achieved
with attributes (@name, @extends,…)
<apache cdl:name=“myapacheconfig” cdl:extends=“tmpl:apachetmpl”> <HostName>myuri.com</HostName> …</apache>
<apache cdl:name=“apachetmpl” cdl:extends=“x:httpd”> <MaxClients>150</MaxClients> <HostName cdl:lifetime=“deployment” cdl:use=“optional” /> …</apache>
extends
A template CDL providedby the application provider
CDL specified by the applicationuser
17
[Alt-2] Drawback: Schema Definition Is Mandatory Schema is required to assure a valid CDL
document is also a valid XML document
<apache cdl:name=“myapache” …/>
<apache cdl:name=“template” …/>
<httpd cdl:name=“template” …/>
Schema for generic http
d
Schema for vendor specific h
ttpd
CDL for generichttpd template
CDL for vendor specifichttpd template
CDL for user deployment
Redefinitionof schema
New elements
added
18
[Alt-2] Nested Attribute Sets Nested structure can be applied Better readability More powerful inheritance and reference models
<webapp cdl:name=“mywebapp” cdl:extends=“tmpl:webapp”> <webtier> <MaxClients>100</MaxClients> </webtier> <apptier> <MaxThreads>100</MaxThreads> </apptier> <dbtier> <MaxConnection>150</MaxConnection> </dbtier> …</webapp>
<reference root=“xsd:QName”> xpath</reference>
extends
includes
Inheritance (recursive)
Reference (QName+Xpath)
19
Pros and Cons [Alt-1] CDL specific attri
bute elements Pros:
Schema is optional Semantically similar to S
martFrog Cons:
Bad readability Configuration data must b
e given in a different style from other WS-RF based resources
[Alt-2] Configuration specific schema
Pros: Readability Syntactically similar to S
martFrog Better match with WS-RF Xpath reference model
Dependencies and assertions can use XPath
Cons: Schema is required
20
Issue 2: Component (Wrapper) Model
21
Component Model A system is a tree which leafs are components A component refers to an attribute set A component is deployed through a Component Service
(CDDLM wrapper)
<system>
<system>
<component><component>
<component>
ComponentService
endpoint WS-Resource
<configuration>
<attributeSet> <attributeSet>
ComponentService
endpoint WS-Resource
ComponentService
endpoint WS-Resource
22
Binding to Component Service Endpoints A <services> element binds components to
component service endpoints Similar definition structure to WSDL
<system>
<system>
<component><component>
<component>
ComponentService
endpoint WS-Resource
<services><service component=“xsd:QName”>wsa:EndpointReference</service>…</services>
Typically given after resource assignment agreement
Typically given before resource assignment agreement
23
Component Model Discussion Component Service endpoint may be either W
S-RF-based or OGSI-based Nice to have a transparent description in CDL WS-Addressing’s EndPointReference may be used
Do we standardize: How to identify content of application (e.g., URL, p
ath within an archive file) How to transfer content of application -- May be component service specific
24
Issue 3: Lifecycle Management Model
25
Lifecycle Management in CDDLM CDDLM Processor must manage deployment
lifecycle of multiple components
ComponentService
endpoint
ComponentService
endpoint
ComponentService
endpoint
CDDLMProcessor
CDDLM-Serviceendpoint
CDDLM Client(e.g.,
Job Manager)
•deploy•start•stop•undeploy•get/set•getStatus
•deploy•start•stop•undeploy•get/set•getStatus
Consistency among components should be maintained
26
Constraints on Attributes For better management of consistency Lifetime: deployment|runtime|dynamic
When value should be fixed Use: required|optional|readonly
Whether value should be given Read-only value is assigned only by Component services (only get
operation is valid on this attribute) (e.g., a port number may be dynamically assigned)
Lifetime must be specified when use is specified Type: QName of schema [Alt-1] SmartFrog has only deployment and dynamic (LAZY) lifeti
me. CDDLM does not know when a lazy value is resolved.
27
Lifecycle Dependency in a System Restriction on the order of lifecycle man
agement operations <deployAfter> <startAfter>
If lifecycle dependency is only from data dependency, we may not need these notations (order can be inferred from data dependency)
28
Issue 4: Dependencies and Assertions
29
Dependencies An attribute value is derived from other
attribute values
<assign><to><reference …/></to><from>{<reference …/>|<expression …/>|<value …/>}</from></assign>
<attribute><name>xsd:string</name>{<reference …/>|<expression …/>|<value …/>}?</attribute>
and/or
30
Assertions An assertion specifies a condition which must be satisfi
ed by given attribute values An assertion has QName so that it can be overridden
<assert name=“xsd:NCName” language=“xsd:anyURI”?> xsd:any</assert>
31
Issues on Dependencies and Assertions Expression languages?
Specified with URI There should be one normative expression We may let Xpath 1.0 be the default normative exp
ression. http://www.w3.org/TR/1999/REC-xpath-19991116 Later we may add Xpath 2.0 as an alternative URI
Where to place Within an attribute set Outside of attribute sets
32
Example of XPath-based Expression Any attribute value can be assigned to xpath VariableR
eference ($QName) by using <reference> and <let>
<cdl:expression><xp:root><cdl:reference …/></xp:root>?<xp:let name=“NCName”> * <cdl:reference …/></xp:let><xp:return>xpath</xp:return></cdl:expression>
variable bindings
the context node
xpath pattern
33
Relationship with Attribute Description Alternatives If we take [Alt-2] for attribute description, Xpath-ba
sed dependencies and assertion would be more powerful and intuitive
<apache cdl:name=“apachetmpl”> <MaxClients>150</MaxClients> <HostName/> … <cdl:assert> boolean(MaxClients > 0) </cdl:assert></apache>
The parent of <assert> (i.e., <apache>) is regarded as the context node o
f XPath
34
Action Items Completion of the first draft by GGF11 More discussion on Issues Evaluation on design alternatives
based on examples (from our use cases)
CDDLM-Services “basic” services and component services
LM requirements Partial (re) deployment, etc.