Commit 5768428a authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Initial checkin of RSpec 0.1 source files. xsdgen will now generate xsd files for them.

parent 62d7fb6d
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Prototype of an advertisement RSpec, to be used by ProtoGENI
#
default namespace = "http://www.protogeni.net/resources/rspec/0.1"
include "protogeni-rspec-common.rnc"
NodeContents &=
# Component identifiers
ComponentName &
# Information about the physical location of the node.
Location? &
# Indicate whether or not this node is available - the idea is that a
# full dump of the static physical topology will not include this, but
# that we can later get updates that include only this attribute (and a
# UUID) Just binary for now - probably will include more things, such
# as a number of "free slots", later
element available { xsd:boolean } &
# Indicates whether the node is in sharing mode: exclusive is true if
# the component manager will agree to promise not to share it.
element exclusive { xsd:boolean }
LinkContents &=
# Component identifiers
ComponentName &
# Characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics?
InterfaceDecl &=
ComponentInterfaceDeclName &
element monitoring { attribute user_traffic { text }? }?
InterfaceRef &=
ComponentInterfaceRefName
RSpecContents &=
attribute type { "advertisement" }
start = RSpec
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Common definitions for advertisements, requests, and tickets
#
include "top.rnc"
NodeSpec = element node { NodeContents }
LinkSpec = element link { LinkContents }
NodeContents =
# Each node has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }? &
# Node type list
NodeTypeList &
# List of interfaces on this node. Interfaces are declared here. So
# all information about a particular interface including types
# belongs in the declaration. Other references to interfaces
# should just uniquely identify them and refer back here.
element interface {
InterfaceDecl
}*
LinkContents =
# Each link has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }? &
# Link types
LinkTypeList &
# The interfaces which this link spans.
element interface_ref {
InterfaceRef
}*
NodeTypeList = NodeTypeSpec+
LinkTypeList = LinkTypeSpec+
VirtualName = attribute virtual_id { text }
ComponentName =
# This is the uuid of the aggregate that this node or link belongs
# to. It is required in an advertisement.
attribute component_manager_uuid { text } &
# User-readable name for the component
attribute component_name { text }? &
# The uuid of the physical component.
attribute component_uuid { text }
ComponentInterfaceDeclName = attribute component_id { text }
ComponentInterfaceRefName =
attribute component_node_uuid { text } &
attribute component_interface_id { text }
InterfaceDecl = empty
InterfaceRef = empty
Location = element location {
# The two-letter ISO 3166 code for the country the node is in.
attribute country { text } &
# Longitude and Lattitude coordinates of the node using the
# WGS 84 standard.
attribute longitude { text }? &
attribute lattitude { text }?
}
RSpec = element rspec {
RSpecContents
}
RSpecContents =
# When this RSpec was generated - optional, can be used for determining
# staleness
attribute generated { xsd:dateTime }? &
# How long this rspec is valid - in the case of a ticket, this indicates
# how long the holder may use the resources. For a resource request, it's
# how long we want the resources. For an advertisement, it might be a hint
# as to how long it's okay to cache this rspec.
attribute valid_until { xsd:dateTime }? &
# One or more nodes/links
NodeSpec* &
LinkSpec*
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Prototype of a request RSpec, to be used by ProtoGENI
#
default namespace = "http://www.protogeni.net/resources/rspec/0.1"
include "protogeni-rspec-common.rnc"
# The ComponentName will only be available after an assignment
NodeContents &=
VirtualName &
ComponentName? &
attribute colocate { text }? &
# TODO: Remove and replace with something more exensible
attribute virtualization_subtype { text }? &
attribute exclusive { text }?
# The LinkMapping will only be available after an assignment
LinkContents &=
attribute link_type { text }? &
VirtualName &
LinkMapping? &
# Characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics?
# The ComponentInterfaceDeclName will only be available after an assignment
InterfaceDecl &=
ComponentInterfaceDeclName? &
VirtualName
# The ComponentInterfaceRefName will only be available after an assignment
InterfaceRef &=
attribute tunnel_ip { text }? &
attribute virtual_node_id { text } &
attribute virtual_interface_id { text }
RSpecContents &=
attribute type { "request" }
# A request link is mapped to an arbitrary topology which represents
# the virtual LAN/link which embodies it. Note that nodes do not
# provide any additional information and can be derived from the
# interface mapping.
LinkMapping =
element component_hop { ComponentName, InterfaceMapping* }+
# Each interface represents a particular physical interface. If that
# interface is one of the link end points, it is also mapped to that
# virtual interface name.
InterfaceMapping = element interface_ref {
ComponentInterfaceRefName |
(attribute virtual_node_id { text } &
attribute virtual_interface_id { text })
# VirtualName ?
}
start = RSpec
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-2007 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Definition of common data structures used for representing topologies -
# shared between vtop (virtual topology) and ptop (physical topology)
# formats.
#
## Representation of a single node type
NodeTypeSpec = element node_type {
## Name of the type - will almost certainly not be unique
attribute type_name { text } &
## How many virtual nodes of this type this physical node can
## handle.
attribute type_slots { xsd:integer { minInclusive = "0" } | "unlimited" } &
##element unlimited { empty }?,
## A flag that indicates that this physical node *always*
## has this type - a node is only allowed to have one dynamic
## (ie. not flagged as static) type at a time, but any number
## of static types at a time
## element static { empty }?
attribute static { "true" }? &
NodeTypeContents
}
NodeTypeContents = empty
## Link types are currently just a siple string. They will almost certainly
## have to get more complicated, for two reasons:
## First, I want to allow virtual links to specify more than one type, so
## that we can ask for links that are, say, 'ethernet or loopback'
## Second, I want to have a lot more control over links that get mapped to
## multi-hop paths
## TODO: MAYBE this should be combined with NodeTypeSpec
LinkTypeSpec = element link_type {
attribute type_name { text }
}
## A link has two endpoints. Right now, they are order
## independent. But they might become order-dependant later.
LinkEndPoints =
## First interface for this link
element source_interface { InterfaceSpec },
## Second interface for this link
element destination_interface { InterfaceSpec }
## Link characterstics which affect traffic.
## TODO: In the future, the bandwidth, latency, and packet loss will be
## moved to features and/or properties
LinkCharacteristics =
## Bandwidth of the link in kbps
element bandwidth { xsd:float { minExclusive = "0.0" } },
## Latency of the link in ms
element latency { xsd:float { minInclusive = "0.0" } },
## Static packet loss probability of the link as a fraction
## (ie. 0.01 == 1%)
element packet_loss { xsd:float { minInclusive = "0.0" } }
## "Legacy" assign features and desires - will be phased out in favor of
## properties
FeatureDesireSpec = element fd {
## Name of this feature or desire
## element fd_name { text },
attribute fd_name { text },
## Weight assocated with the feature or desire
## element fd_weight { xsd:float },
attribute fd_weight { text },
## A flag indicating whether or not a failure to match the desire with a
## a feature is a constraint violation
##element violatable { empty }?,
attribute violatable { "true" }?,
## Type information expressed in features and desires
(GlobalSpec | LocalSpec)?
}
## GlobalSpec = element global {
## element operator { "OnceOnly" | "FirstFree" }
##}
GlobalSpec = attribute global_operator { "OnceOnly" | "FirstFree" }
## LocalSpec = element local {
## element operator { "+" }
## attribute local_operator { "+" }
##}
LocalSpec = attribute local_operator { "+" }
## Interfaces
## InterfaceSpec = element interface { InterfaceContents }
InterfaceSpec =
attribute node_name { text },
attribute interface_name { text },
attribute physical_node_name { text }?,
attribute physical_interface_name { text }?,
PropertySpec*
InterfaceContents =
## Name of the node, which must match one of the nodes in this topology
element node_name { text },
## Name of the interface itself
element interface_name { text },
## Properties of the interface
PropertySpec*
## Properties - new: replacements for features and desires. Not yet implemented
## in assign, and not yet fully fleshed out in this schema.
PropertySpec = element property {
## Name of this property
element property_name { text },
## Value associated with this property
## TODO: Add ranges and other types from rspec
element property_value { text | xsd:float },
## The penalty associated with this property
element property_penalty { xsd:float { minInclusive = "0.0" } },
## If this flag is present, not having the property is considered a violation
element violatable { empty }?,
## TODO: Add more operators - equality, range test, etc
## Flags for special types of operators
(GlobalSpec | LocalSpec)?
}
......@@ -4,12 +4,14 @@ TRANGCMD="java -jar ${TRANG:-/usr/local/share/java/classes/trang.jar}"
rm -f *.xsd
for schema in rspec-ad rspec-request; do
$TRANGCMD ${schema}.rnc ${schema}.xsd
mv top.xsd ${schema}-top.xsd
sed "s/top.xsd/${schema}-top.xsd/" protogeni-rspec-common.xsd > ${schema}-common.xsd
rm protogeni-rspec-common.xsd
sed "s/protogeni-rspec-common.xsd/${schema}-common.xsd/" ${schema}.xsd > ${schema}.tmp
mv ${schema}.tmp ${schema}.xsd
for path in 0.1; do
for schema in ad request; do
$TRANGCMD ${path}/${schema}.rnc ${path}/${schema}.xsd
mv ${path}/top.xsd ${path}/${schema}-top.xsd
sed "s/top.xsd/${schema}-top.xsd/" ${path}/common.xsd > ${path}/${schema}-common.xsd
rm ${path}/common.xsd
sed "s/common.xsd/${schema}-common.xsd/" ${path}/${schema}.xsd > ${path}/${schema}.tmp
mv ${path}/${schema}.tmp ${path}/${schema}.xsd
done
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment