Commit 4cb50ced authored by Jonathon Duerig's avatar Jonathon Duerig

Removed obsolete files from rspec directory. Added Makefiles and README.

parent 72286001
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2011 University of Utah and the Flux Group.
# All rights reserved.
#
ifdef TRANG
TRANGCMD = java -jar ${TRANG}
else
TRANGCMD = java -jar /usr/local/share/java/classes/trang.jar
endif
SCHEMAS = ad.xsd request.xsd manifest.xsd
all: $(SCHEMAS)
clean:
rm $(SCHEMAS)
%.xsd: %.rnc
mkdir -p tmp
$(TRANGCMD) $< tmp/$@
mv tmp/top.xsd $(@:.xsd=)-top.xsd
sed "s/top.xsd/$(@:.xsd=)-top.xsd/" tmp/common.xsd > $(@:.xsd=)-common.xsd
rm tmp/common.xsd
sed "s/common.xsd/$(@:.xsd=)-common.xsd/" tmp/$@ > $@
rm tmp/$@
if [ $< = manifest.rnc ]; then \
sed "s/common.xsd/manifest-common.xsd/" tmp/request.xsd > manifest-request.xsd; \
rm tmp/request.xsd; \
sed "s/request.xsd/manifest-request.xsd/" manifest.xsd > manifest.tmp; \
mv manifest.tmp manifest.xsd; \
fi
rmdir tmp
.PHONY: clean
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2011 University of Utah and the Flux Group.
# All rights reserved.
#
ifdef TRANG
TRANGCMD = java -jar ${TRANG}
else
TRANGCMD = java -jar /usr/local/share/java/classes/trang.jar
endif
SCHEMAS = ad.xsd request.xsd manifest.xsd
all: $(SCHEMAS)
clean:
rm $(SCHEMAS)
%.xsd: %.rnc
mkdir -p tmp
$(TRANGCMD) $< tmp/$@
mv tmp/top.xsd $(@:.xsd=)-top.xsd
sed "s/top.xsd/$(@:.xsd=)-top.xsd/" tmp/common.xsd > $(@:.xsd=)-common.xsd
rm tmp/common.xsd
sed "s/common.xsd/$(@:.xsd=)-common.xsd/" tmp/$@ > $@
rm tmp/$@
if [ $< = manifest.rnc ]; then \
sed "s/common.xsd/manifest-common.xsd/" tmp/request.xsd > manifest-request.xsd; \
rm tmp/request.xsd; \
sed "s/request.xsd/manifest-request.xsd/" manifest.xsd > manifest.tmp; \
mv manifest.tmp manifest.xsd; \
fi
rmdir tmp
.PHONY: clean
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2011 University of Utah and the Flux Group.
# All rights reserved.
#
ifdef TRANG
TRANGCMD = java -jar ${TRANG}
else
TRANGCMD = java -jar /usr/local/share/java/classes/trang.jar
endif
SCHEMAS = ad.xsd request.xsd manifest.xsd
all: $(SCHEMAS)
clean:
rm $(SCHEMAS)
%.xsd: %.rnc common.rnc
mkdir -p tmp
$(TRANGCMD) $< tmp/$@
sed "s/any-extension.xsd/any-extension-schema.xsd/" tmp/common.xsd > $(@:.xsd=)-common.xsd
rm tmp/common.xsd
sed "s/common.xsd/$(@:.xsd=)-common.xsd/" tmp/$@ > $@
rm tmp/$@
sed "s/any-extension.xsd/any-extension-schema.xsd/" $@ > tmp/$@
mv tmp/$@ $@
if [ $< = manifest.rnc ]; then \
sed "s/common.xsd/manifest-common.xsd/" tmp/request.xsd > manifest-request.xsd; \
rm tmp/request.xsd; \
sed "s/request.xsd/manifest-request.xsd/" manifest.xsd > manifest.tmp; \
mv manifest.tmp manifest.xsd; \
fi
rm tmp/any-extension.xsd
rmdir tmp
.PHONY: clean
#
# 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)?
}
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2011 University of Utah and the Flux Group.
# All rights reserved.
#
SUBDIRS = 0.1 0.2 2
all: all-subdirs
clean: clean-subdirs
%.MAKE:
@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
--------
Manifest
--------
There are four directories:
0.1, 0.2, and 2 are all versions of the core rspec. These are all
stable versions and should only be changed if there is a
backwards-compatible bugfix.
In these directories, the *.rnc files are human-readable source and
*.xsd are generated schemas. The exception to the rule is the file
'2/any-extension-schema.xsd' which is a hand-made conversion of
'any-extension.rnc' because Trang imperfectly translates the rnc file.
The ext directory houses extensions meant for general
publication. Each extension is maintained by the institution described
in the MAINTENANCE file. You should only change an extension if it is
maintained by you or if you have the approval of the maintainer.
---------
rspeclint
---------
rspeclint is a standalone perl script which can be used to verify a
core schema and zero or more extension schemas against an XML
file. The command line to run it is:
./rspeclint [[<namespace> <schema>] ...] <document>
It will verify the XML document using the pairs of namespace, schema
to verify particular namespaces against schema paths or URLs against a
document. It will also use the schemaLocation tag inside of the XML
document to verify. If the command line namespace/schema pairs do not
match those in the schemaLocation tag, it will flag an error.
--------
Building
--------
To build the schemas, run
gmake all
This will create .xsd files from the .rnc files in the 0.1, 0.2, and 2
directories. To build the .xsd files, you will need to have Trang
installed. When running Make, the TRANG environment variable should be
set to the Java command line that should be used to execute TRANG.
The ad/request/manifest files can be removed with:
gmake clean
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Example RSpec used to request for a ticket on a "regular" emulab node -->
<!-- TODO: Do we want to include how long we're requesting it for?
Probably. -->
<rspec xmlns:"http://protogeni.net/resources/rspec/0.1">
<node uuid="00000000-0000-0000-0000-000000000002"
virtualization_type="raw">
</node>
</rspec>
<!-- Example RSpec used to request for a ticket on a VINI-like node -->
<rspec>
<node uuid="00000000-0000-0000-0000-000000000002"
virtualization_type="trellis-vserver">
</node>
</rspec>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- What might be returned by a query asking for which resources are
currently available -->
<rspec xmlns:"http://protogeni.net/resources/rspec/0.1">
<node uuid="00000000-0000-0000-0000-000000000002">
<available>true</available>
</node>
<node uuid="00000000-0000-0000-0000-000000000003">
<available>false</available>
</node>
<node uuid="00000000-0000-0000-0000-000000000004">
<available>true</available>
</node>
</rspec>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Example ticket for a "regular" emulab node -->
<!-- Note, I'm using the 'standard' UUID text representation, we need to
agree on exactly what we're going to use -->
<ticket xmlns="http://protogeni.net/resources/ticket/0.1"
redeem_before="2008-05-08T09:00:00"
valid_until="2008-05-10T09:00:00"
issued_to="00000000-0000-0000-0000-000000000001">
<rspec>
<node uuid="00000000-0000-0000-0000-000000000002"
virtualization_type="raw">
</node>
</rspec>
</top>
<!-- Example ticket for a VINI-like node -->
<ticket xmlns="http://protogeni.net/resources/ticket/0.1"
redeem_before="2008-05-08T09:00:00"
valid_until="2008-05-10T09:00:00"
issued_to="00000000-0000-0000-0000-000000000001">
<rspec>
<node uuid="00000000-0000-0000-0000-000000000002"
virtualization_type="trellis-vserver">
</node>
</rspec>
</top>
Maintained by the Flux Research Group at the University of Utah
Maintained by the Flux Research Group at the University of Utah
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Common definitions for advertisements, requests, and tickets
#
include "../../assign/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" | "bgpmux" }? &
# Each node may be the subnode of (physically located within) another.
# In advertisements, this is the URN of the other component.
# In requests, this is the virtual_id of the other sliver.
element subnode_of { text }? &
# 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
LinkType+ &
# The interfaces which this link spans.
element interface_ref {
InterfaceRef
}*
NodeTypeList = NodeTypeSpec+
NodeTypeContents &= TypeField*
LinkType = element link_type {
attribute name { text }? &
attribute type_name { text }? &
TypeField*
}
TypeField = element field {
attribute key { text } &
attribute value { text }
}
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 }? &
attribute component_manager_urn { text }? &
# User-readable name for the component
attribute component_name { text }? &
# The uuid of the physical component.
attribute component_uuid { text }? &
attribute component_urn { text }?
ComponentInterfaceDeclName = attribute component_id { text }
ComponentInterfaceRefName =
attribute component_node_uuid { text }? &
attribute component_node_urn { 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 Latitude coordinates of the node using the
# WGS 84 standard.
attribute longitude { text }? &
attribute latitude { text }?
}
RSpec = element rspec {
RSpecContents
}
RSpecContents =
# When this RSpec was generated - optional, can be used for determining
# staleness
attribute generated { xsd:dateTime }? &
# Who/what generated the rspec. This is purely informative and
# should not be used for any policy consideration. The format is
# not fixed.
attribute generated_by { text }? &
# 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.
#
#
# Simple prototype of an RSpec, to be used by ProtoGENI
# Just a wrapper around the 'common' rpsec patterns, so that we don't have
# to define a start symbol in that file (so that it can easily be referenced
# by others.)
#
default namespace = "http://www.protogeni.net/resources/rspec/0.1"
include "protogeni-rspec-common.rnc"
start = RSpec
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Simple prototype of an ticket, to be used by ProtoGENI
# NOTE: This is deprecated: See credential.rnc instead
#
default namespace = "http://www.protogeni.net/resources/ticket/0.1"
#
# Include the whole rspec, in its own namespace
#
namespace rs = "http://www.protogeni.net/resources/rspec/0.1"
start = element ticket {
# If this ticket is not "cashed in" by this time (UTC), it is invalid
attribute redeem_before { xsd:dateTime },
# How long the holder may keep the specified resources
attribute valid_until { xsd:dateTime},
# The slice this ticket has been issued to (UUID)
attribute issued_to { text },
# The set of resources being promised by this ticket
element rs:rspec
# Question: Do we need a unqiue identifer for the ticket itself?
# Question: Do we need to include information about who issued this ticket?
# TODO: Need to include an XML signature, don't know quite what that looks
# like
}
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/rspec/0.1" xmlns:rspec="http://www.protogeni.net/resources/rspec/0.1">
<xs:include schemaLocation="rspec-ad-top.xsd"/>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2008 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Common definitions for advertisements, requests, and tickets
-->
<xs:element name="node" type="rspec:NodeContents"/>
<xs:element name="link" type="rspec:LinkContents"/>
<xs:complexType name="NodeContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="rspec:subnode_of"/>
<xs:group ref="rspec:NodeTypeList"/>
<xs:element ref="rspec:interface"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:location"/>
<xs:element ref="rspec:available"/>
<xs:element ref="rspec:exclusive"/>
<xs:element ref="rspec:cloud"/>
<xs:element ref="rspec:services"/>
</xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
<xs:enumeration value="bgpmux"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attributeGroup ref="rspec:ComponentName"/>
</xs:complexType>
<xs:element name="subnode_of" type="xs:string"/>
<xs:element name="interface" type="rspec:InterfaceDecl"/>
<xs:element name="available" type="xs:boolean"/>
<xs:element name="exclusive" type="xs:boolean"/>
<xs:element name="cloud">
<xs:complexType/>
</xs:element>
<xs:element name="services" type="rspec:ServiceContents"/>
<xs:complexType name="LinkContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:group ref="rspec:LinkType"/>
<xs:element ref="rspec:interface_ref"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:bandwidth"/>
<xs:element ref="rspec:latency"/>
<xs:element ref="rspec:packet_loss"/>
</xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attributeGroup ref="rspec:ComponentName"/>
</xs:complexType>
<xs:element name="interface_ref">
<xs:complexType>
<xs:attributeGroup ref="rspec:InterfaceRef"/>
</xs:complexType>
</xs:element>
<xs:element name="bandwidth">
<xs:annotation>
<xs:documentation>Bandwidth of the link in kbps</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minExclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="latency">
<xs:annotation>
<xs:documentation>Latency of the link in ms</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="packet_loss">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group name="NodeTypeList">
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="rspec:node_type"/>
</xs:sequence>
</xs:group>
<xs:group name="LinkType">
<xs:sequence>
<xs:element name="link_type">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="rspec:field"/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attribute name="type_name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:element name="field">
<xs:complexType>
<xs:attribute name="key" use="required"/>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="VirtualName">
<xs:attribute name="virtual_id" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentName">
<xs:attribute name="component_manager_uuid"/>
<xs:attribute name="component_manager_urn"/>
<xs:attribute name="component_name"/>
<xs:attribute name="component_uuid"/>
<xs:attribute name="component_urn"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentInterfaceDeclName">
<xs:attribute name="component_id" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentInterfaceRefName">
<xs:attribute name="component_node_uuid"/>
<xs:attribute name="component_node_urn"/>
<xs:attribute name="component_interface_id" use="required"/>
</xs:attributeGroup>
<xs:complexType name="InterfaceDecl">
<xs:sequence>
<xs:element minOccurs="0" ref="rspec:monitoring"/>
</xs:sequence>
<xs:attributeGroup ref="rspec:ComponentInterfaceDeclName"/>
<xs:attribute name="role">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="control"/>
<xs:enumeration value="experimental"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="public_ipv4"/>
</xs:complexType>
<xs:element name="monitoring">
<xs:complexType>
<xs:attribute name="user_traffic"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="InterfaceRef">
<xs:attributeGroup ref="rspec:ComponentInterfaceRefName"/>
</xs:attributeGroup>
<xs:element name="location">
<xs:complexType>
<xs:attribute name="country" use="required"/>
<xs:attribute name="longitude"/>
<xs:attribute name="latitude"/>
</xs:complexType>
</xs:element>
<xs:element name="rspec" type="rspec:RSpecContents"/>
<xs:complexType name="RSpecContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="rspec:node"/>
<xs:element ref="rspec:link"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:external_ref"/>
<xs:element ref="rspec:bgp_prefix"/>
</xs:choice>
</xs:choice>
<xs:attribute name="generated" type="xs:dateTime"/>
<xs:attribute name="generated_by"/>
<xs:attribute name="valid_until" type="xs:dateTime"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="advertisement"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>