Commit ae95e0b9 authored by Tarun Prabhu's avatar Tarun Prabhu

Updated extensions for correct namespaces. Modified makefiles to install...

Updated extensions for correct namespaces. Modified makefiles to install different versions of the schemas in different directories. Modified the configure script to do the same thing. xsdgen has been modified as well, although it doesn't seem to have made it to this commit list.
parent 5ee4c96f
......@@ -6221,6 +6221,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
protogeni/scripts/GNUmakefile protogeni/etc/GNUmakefile \
protogeni/test/GNUmakefile protogeni/rspec/GNUmakefile \
protogeni/rspec/0.1/GNUmakefile \
protogeni/rspec/0.2/GNUmakefile \
protogeni/rspec/2/GNUmakefile \
collab/GNUmakefile \
collab/trac/GNUmakefile \
collab/jabber/GNUmakefile \
......
......@@ -1011,6 +1011,8 @@ outfiles="$outfiles Makeconf GNUmakefile \
protogeni/scripts/GNUmakefile protogeni/etc/GNUmakefile \
protogeni/test/GNUmakefile protogeni/rspec/GNUmakefile \
protogeni/rspec/0.1/GNUmakefile \
protogeni/rspec/0.2/GNUmakefile \
protogeni/rspec/2/GNUmakefile \
collab/GNUmakefile \
collab/trac/GNUmakefile \
collab/jabber/GNUmakefile \
......
......@@ -19,15 +19,15 @@ all:
include $(TESTBED_SRCDIR)/GNUmakerules
install: $(addprefix $(INSTALL_LIBDIR)/assign/, $(SCHEMATA))
install: $(addprefix $(INSTALL_LIBDIR)/assign/0.1/, $(SCHEMATA))
control-install:
clean:
rm -f *.o core
$(INSTALL_LIBDIR)/assign/%: %
$(INSTALL_LIBDIR)/assign/0.1/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBDIR)/assign
-mkdir -p $(INSTALL_LIBDIR)/assign/0.1
$(INSTALL) $< $@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../../..
SUBDIR = protogeni/rspec/0.2
include $(OBJDIR)/Makeconf
SCHEMATA = ad-common.xsd ad-top.xsd ad.xsd manifest-common.xsd \
manifest-request.xsd manifest-top.xsd manifest.xsd \
request-common.xsd request-top.xsd request.xsd
all:
include $(TESTBED_SRCDIR)/GNUmakerules
install: $(addprefix $(INSTALL_LIBDIR)/assign/0.2/, $(SCHEMATA))
control-install:
clean:
rm -f *.o core
$(INSTALL_LIBDIR)/assign/0.2/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBDIR)/assign/0.2
$(INSTALL) $< $@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../../..
SUBDIR = protogeni/rspec/2
include $(OBJDIR)/Makeconf
SCHEMATA = ad-common.xsd ad.xsd \
manifest-common.xsd manifest-request.xsd manifest.xsd \
request-common.xsd request.xsd
all:
include $(TESTBED_SRCDIR)/GNUmakerules
install: $(addprefix $(INSTALL_LIBDIR)/assign/2/, $(SCHEMATA))
control-install:
clean:
rm -f *.o core
$(INSTALL_LIBDIR)/assign/2/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_LIBDIR)/assign/2
$(INSTALL) $< $@
......@@ -11,7 +11,7 @@ SUBDIR = protogeni/rspec
include $(OBJDIR)/Makeconf
SUBDIRS = 0.1
SUBDIRS = 0.1 0.2 2
# xsdgen must be run manually if necessary.
all: all-subdirs
......@@ -20,6 +20,8 @@ include $(TESTBED_SRCDIR)/GNUmakerules
install:
@$(MAKE) -C 0.1 install
@$(MAKE) -C 0.2 install
@$(MAKE) -C 2 install
control-install:
......
# The default namespace for the ptop extension
default namespace = "http://www.emulab.net/resources/rspec/ext/ptop/1"
namespace emulab = "http://www.protogeni.net/resources/rspec/ext/emulab/1"
include "top_extension.rnc"
......@@ -8,17 +8,17 @@ NodeFlagSpec =
## interface. In the future, we will make the loopback interface/link
## explicit in the topology
## Valid only for physical nodes
(element trivial_bandwidth { xsd:integer })?,
(element emulab:trivial_bandwidth { xsd:integer })?,
## Specify that this node is a subnode of another node. We MIGHT
## try to do this with properties in the future
## Valid for both virtual and physical nodes
element subnode_of { text }?,
element emulab:subnode_of { text }?,
## Indicates that this node should never be considered identical to any
## other node. Could be done with a property
## Valid only for physical nodes
element unique { empty }?,
element emulab:unique { empty }?,
## Indicates that virtual links must either all be trivial (loopback), or
## none of them must be. Possibly expressible with properties?
element disallow_trivial_mix { empty }?
element emulab:disallow_trivial_mix { empty }?
start = NodeFlagSpec | FeatureDesireSpec
\ No newline at end of file
......@@ -10,20 +10,22 @@
# extensions.
#
TypeSlotsSpec = element ext_node_type {
namespace emulab = "http://www.protogeni.net/resources/rspec/ext/emulab/1"
TypeSlotsSpec = element emulab:node_type {
attribute type_slots { text },
attribute static { "true" }?
}
## "Legacy" assign features and desires - will be phased out in favor of
## properties
FeatureDesireSpec = element fd {
FeatureDesireSpec = element emulab:fd {
## Name of this feature or desire
## element fd_name { text },
attribute fd_name { text },
attribute name { text },
## Weight assocated with the feature or desire
## element fd_weight { xsd:float },
attribute fd_weight { text },
attribute 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 }?,
......@@ -45,14 +47,14 @@ LocalSpec = attribute local_operator { "+" }
## Properties - new: replacements for features and desires. Not yet implemented
## in assign, and not yet fully fleshed out in this schema.
PropertySpec = element property {
PropertySpec = element emulab:property {
## Name of this property
attribute property_name { text },
attribute name { text },
## Value associated with this property
## TODO: Add ranges and other types from rspec
attribute property_value { text | xsd:float },
attribute value { text | xsd:float },
## The penalty associated with this property
attribute property_penalty { xsd:float { minInclusive = "0.0" } },
attribute penalty { xsd:float { minInclusive = "0.0" } },
## If this flag is present, not having the property is considered a violation
attribute violatable { "true" }?,
## TODO: Add more operators - equality, range test, etc
......
......@@ -7,7 +7,7 @@
#
# Description of Emulab-specific extensions for a virtual topology
#
default namespace = "http://www.emulab.net/resources/rspec/ext/vtop/1"
namespace emulab = "http://www.protogeni.net/resources/rspec/ext/emulab/1"
#
# We include the common topology extension specification schema,
......@@ -15,9 +15,9 @@ default namespace = "http://www.emulab.net/resources/rspec/ext/vtop/1"
include "top_extension.rnc"
# For a fixed node - th
AssignedToSpec = element node_assigned_to { text }?
AssignedToSpec = element emulab:assigned_to { text }?
HintToSpec = element node_hint_to { text }?
HintToSpec = element emulab:hint_to { text }?
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
......@@ -25,38 +25,38 @@ NodeFlagSpec =
## Specify that this node is a subnode of another node. We MIGHT
## try to do this with properties in the future
## Valid for both virtual and physical nodes
element node_subnode_of { text }?,
element emulab:subnode_of { text }?,
## Indicates that this node should never be considered identical to any
## other node. Could be done with a property
## Valid only for physical nodes
element node_unique { empty }?,
element emulab:unique { empty }?,
## Indicates that virtual links must either all be trivial (loopback), or
## none of them must be. Possibly expressible with properties?
element node_disallow_trivial_mix { empty }?
element emulab:disallow_trivial_mix { empty }?
## "Legacy" link flags used by assign. Will be replaced by properties
LinkFlagSpec =
## Indicates that it is not okay to use a delay node to artificially
## shape/delay traffic for this link. Replace by using type system.
element link_nodelay { empty }?,
element emulab:nodelay { empty }?,
## Indicates whether it is okay to multiplex this link with other virtual
## links onto the same physical link (old name: emulated) Probably replace
## by using the type system (ie. have an 'Ethernet' type that can only
## hold one slot, and an 'Ethernet-tagged' type that can hold more).
element link_multiplex_ok { empty }?,
element emulab:multiplex_ok { empty }?,
## Indicates whether it is okay to satisfy this link with a trivial
## (loopback) link. Replace using type system.
element link_trivial_ok { empty }?,
element emulab:trivial_ok { empty }?,
## Gives the name of the interface that must be used to satisfy the source
## of this link - note that the interface name is given, not the node name
element link_fixsrciface { string }?,
element emulab:fixsrciface { string }?,
## Same as fixsrciface, for destination of the link
element link_fixdstiface { string }?
element emulab:fixdstiface { string }?
## Specify a virtual class - assign allows you to define classes for virtual
## nodes, and specify that all nodes using that class should, or must, be
## assigned to physical nodes of the same type
VclassSpec = element vtop_vclass {
VclassSpec = element emulab:vclass {
## Name of the virtual class
attribute name { text },
## Specify whether the vclass is hard (ie. all nodes *must* be of the same
......@@ -71,7 +71,7 @@ VclassSpec = element vtop_vclass {
## For the moment only 2 interface mappings are specified because
## every link only has 2 interfaces for the moment.
LinkMapping =
element link_component_hop {
element emulab:component_hop {
attribute assigned_to { text },
InterfaceMapping,
InterfaceMapping
......
......@@ -2985,10 +2985,13 @@ sub PrintRspec($;$)
my $expiration = $creation + 3600;
my $root = $doc->createElement("rspec");
$root->setAttribute("xmlns", "http://www.protgeni.net/resources/rspec/2");
$root->setAttribute("xmlns", "http://www.protogeni.net/resources/rspec/2");
$root->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
$root->setAttribute("xmlns:emulab", "http://www.protogeni.net/resources/rspec/ext/emulab/1");
### XXX: Change the URL
$root->setAttribute("xsi:schemaLocation",
"http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd");
"http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd http://www.protogeni.net/resources/rspec/ext/emulab/1 http://www.cs.utah.edu/~tarunp/code/vtop_extension.xsd");
$root->setAttribute("type", "request");
$root->setAttribute("generated",
POSIX::strftime("20%y-%m-%dT%H:%M:%S", gmtime($creation)));
......@@ -7103,7 +7106,7 @@ sub processNodeRspec ($$$$)
my $typecount = addNodeRspec($doc, $hardwarenode, 'emulab:node_type');
$typecount->setAttribute('type_slots', $nodetypeslots);
if ($isnodestatic == 1) {
addNodeRspec($doc, $hardwarenode, 'emulab:static');
$typecount->setAttribute('static', 'true');
}
# Create sliver type
......@@ -7111,25 +7114,15 @@ sub processNodeRspec ($$$$)
$slivernode->setAttribute('name', $slivertype);
my $diskimagenode = addNodeRspec($doc, $slivernode, 'disk_image');
#XXX: This is NOT correct at all. The disk image name should be a URN
# XXX: This is NOT correct at all. The disk image name should be a URN
# composed of the project name, and the name of the disk image obtained from
# the osinfo structure. It should NOT be the osid. This has been done merely
# as a placeholder to ensure that the vtop still validates.
#
# There should be only one "OS-*" desire for any given node.
# If there is more than one, only the first one will be used.
# This is a temporary measure anyway, so it should be fixed sooner
# rather than later.
while ( my ($desire, $desireval) = each (%{$node->{'desires'}})) {
if (index($desire, "OS-") == 0) {
$diskimagenode->setAttribute('name', $desire);
last;
}
}
$diskimagenode->setAttribute('name', 'diskimageurn');
# Deal with the disallow_trivial_mix flag
if (exists($node->{'disallow_trivial_mix'})) {
addNodeRspec($doc, $rspecnode, 'emulab:ext_disallow_trivial_mix');
addNodeRspec($doc, $rspecnode, 'emulab:disallow_trivial_mix');
}
# Deal with the subnode_of flag
......@@ -7148,7 +7141,7 @@ sub processNodeRspec ($$$$)
# Add all the desires as extensions
while ( my ($desire, $desireval) = each (%{$node->{'desires'}})) {
my $desirenode = addNodeRspec($doc, $rspecnode, 'emulab:desire');
my $desirenode = addNodeRspec($doc, $rspecnode, 'emulab:fd');
my $operator = $desireval->[0];
$desirenode->setAttribute('name', $desire);
$desirenode->setAttribute('weight', $desireval->[1]);
......@@ -7281,7 +7274,10 @@ sub processLinkRspec ($$$$)
my $rspeclink = addNodeRspec($doc, $root, 'link');
$rspeclink->setAttribute('client_id', $link->{'name'});
$rspeclink->setAttribute('component_manager_id', $link->{'cm'});
my $cmnode = addNodeRspec($doc, $rspeclink, 'component_manager');
$cmnode->setAttribute('name', $link->{'cm'});
my $linktype = addNodeRspec($doc, $rspeclink, 'link_type');
$linktype->setAttribute('name', $link->{'link_type'});
......@@ -7305,8 +7301,8 @@ sub processLinkRspec ($$$$)
# The forward link
my $property = addNodeRspec($doc, $rspeclink, 'property');
$property->setAttribute('src', $link->{'interface_ref'}->[0]);
$property->setAttribute('dst', $link->{'interface_ref'}->[1]);
$property->setAttribute('source_id', $link->{'interface_ref'}->[0]);
$property->setAttribute('dest_id', $link->{'interface_ref'}->[1]);
$property->setAttribute('capacity', $link->{'capacity'});
$property->setAttribute('latency', $link->{'latency'});
$property->setAttribute('packet_loss', $link->{'packet_loss'});
......@@ -7314,8 +7310,8 @@ sub processLinkRspec ($$$$)
# And now the backward. Assign doesn't know how to deal with
# links with unbalanced properties anyway
$property = addNodeRspec($doc, $rspeclink, 'property');
$property->setAttribute('src', $link->{'interface_ref'}->[1]);
$property->setAttribute('dst', $link->{'interface_ref'}->[0]);
$property->setAttribute('source_id', $link->{'interface_ref'}->[1]);
$property->setAttribute('dest_id', $link->{'interface_ref'}->[0]);
$property->setAttribute('capacity', $link->{'capacity'});
$property->setAttribute('latency', $link->{'latency'});
$property->setAttribute('packet_loss', $link->{'packet_loss'});
......
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