Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

157 multipoint different resource type #159

Merged
merged 3 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ private void populateResourceMap() {
resource.put("site.vm", 36);
resource.put("site.vlan", 9);
resource.put("site.lun", 100);
resource.put("site.baremetalce", 2);
resourceMap.put(domain, resource);

domain = new Domain("orca/ndl/substrate/pscvmsite.rdf");
resource = new HashMap<>();
resource.put("site.vm", 150);
resource.put("site.vlan", 8);
resource.put("site.baremetalce", 2);
resourceMap.put(domain, resource);

domain = new Domain("orca/ndl/substrate/rcivmsite.rdf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public static Collection<Object[]> data() {
//{ "../../embed/src/test/resources/orca/embed/TS7/TS7-1.rdf", true, 14-1+11}, // Deprecated. OSG site no longer exists
{ "../../embed/src/test/resources/orca/embed/request-stitchport-URLcham-TAG3291-3292.rdf", true, 3-2+4},
{ "../../embed/src/test/resources/orca/embed/request-stitchport-URLcham-URLncbi.rdf", true, 3-2+4},
{ "src/test/resources/146_create_node_with_two_interfaces_interdomain_request.rdf", true, 5+8}
{ "src/test/resources/146_create_node_with_two_interfaces_interdomain_request.rdf", true, 5+8},
{ "../../embed/src/test/resources/orca/embed/157_mp_diff_resource_type_request.rdf", true, 4+6}
// TS8 really only tests Post-boot Scripts. Not useful in Unit tests
/*
{ "../../embed/src/test/resources/orca/embed/TS8/TS8-1.rdf", true, 12},
Expand Down Expand Up @@ -125,6 +126,8 @@ public void testOrcaRegressionTests() throws Exception {

if (requestFilename.contains("106_mp")){
assertEc2InstanceTypePresent(computedReservations);
} else if (requestFilename.contains("157_mp_diff_resource_type_request")){
assertManifestHasNumberOfComputeElements(slice.workflow.getManifestModel(), 6);
}

assertManifestWillProcess(slice);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package orca.controllers.xmlrpc;

import com.hp.hpl.jena.ontology.Individual;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntResource;
import orca.embed.workflow.ManifestParserListener;
Expand All @@ -9,6 +10,7 @@
import orca.manage.beans.PropertyMng;
import orca.manage.beans.ReservationMng;
import orca.manage.beans.TicketReservationMng;
import orca.ndl.NdlCommons;
import orca.ndl.NdlException;
import orca.ndl.NdlManifestParser;
import orca.ndl.elements.Interface;
Expand Down Expand Up @@ -334,4 +336,19 @@ protected static void assertReservationsHaveResourceConstraints(List<TicketReser
}

}

/**
* The list of NdlCommons.computeElementClass includes both the actual node elements,
* and each unique domain for those node elements.
* In #157, a domain with both VM and BareMetal node elements would "lose" track of one of those type of elements,
* which was exhibited in the domain for the "missing" one to not be present in this list.
*
* @param manifestModel
* @param expectedComputeElements
*/
protected static void assertManifestHasNumberOfComputeElements(OntModel manifestModel, int expectedComputeElements) {
final List<Individual> individuals = manifestModel.listIndividuals(NdlCommons.computeElementClass).toList();

assertEquals("List of Compute Elements did not match expected size.", expectedComputeElements, individuals.size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,29 +325,25 @@ public HashMap <String, LinkedList <NetworkElement>> ifMPConnection(NetworkConne
LinkedList <NetworkElement> con_elements = (LinkedList<NetworkElement>) rc.getConnection();
String e_domain=null;
LinkedList <NetworkElement> elements = null;
ComputeElement c_e = null;
HashMap <String, LinkedList <NetworkElement>> domainCount = new HashMap <String, LinkedList <NetworkElement>>();
if(con_elements.size()>0){
for(NetworkElement e:con_elements){
e_domain = e.getInDomain();
c_e= (ComputeElement) e;
if(e_domain==null){
domainCount = new HashMap <String, LinkedList <NetworkElement>>();
break;
}
if(domainCount.containsKey(e_domain)){
domainCount.get(e_domain).add(e);
//if(c_e.getGroup()==null)
// c_e.setGroup(c_e.getName());
}else{
elements = new LinkedList <NetworkElement>();
elements.add(e);
//if(c_e.getGroup()==null)
// c_e.setGroup(c_e.getName());
domainCount.put(e_domain, elements);
}

for (NetworkElement e : con_elements) {
// #157 - baremetal and VM in same domain must be treated separately
e_domain = e.getInDomain() + "/" + e.getResourceType().getResourceType();

if (e.getInDomain() == null) {
domainCount = new HashMap<String, LinkedList<NetworkElement>>();
break;
}
if (domainCount.containsKey(e_domain)) {
domainCount.get(e_domain).add(e);
} else {
elements = new LinkedList<NetworkElement>();
elements.add(e);
domainCount.put(e_domain, elements);
}
}

return domainCount;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<rdf:RDF
xmlns:ec2="http://geni-orca.renci.org/owl/ec2.owl#"
xmlns:kansei="http://geni-orca.renci.org/owl/kansei.owl#"
xmlns:app-color="http://geni-orca.renci.org/owl/app-color.owl#"
xmlns:geni="http://geni-orca.renci.org/owl/geni.owl#"
xmlns:domain="http://geni-orca.renci.org/owl/domain.owl#"
xmlns:eucalyptus="http://geni-orca.renci.org/owl/eucalyptus.owl#"
xmlns:collections="http://geni-orca.renci.org/owl/collections.owl#"
xmlns:openflow="http://geni-orca.renci.org/owl/openflow.owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:exogeni="http://geni-orca.renci.org/owl/exogeni.owl#"
xmlns:layer="http://geni-orca.renci.org/owl/layer.owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:request-schema="http://geni-orca.renci.org/owl/request.owl#"
xmlns:request="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#"
xmlns:ip4="http://geni-orca.renci.org/owl/ip4.owl#"
xmlns:planetlab="http://geni-orca.renci.org/owl/planetlab.owl#"
xmlns:ethernet="http://geni-orca.renci.org/owl/ethernet.owl#"
xmlns:dtn="http://geni-orca.renci.org/owl/dtn.owl#"
xmlns:time="http://www.w3.org/2006/time#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:modify-schema="http://geni-orca.renci.org/owl/modify.owl#"
xmlns:compute="http://geni-orca.renci.org/owl/compute.owl#"
xmlns:topology="http://geni-orca.renci.org/owl/topology.owl#"
xmlns:orca="http://geni-orca.renci.org/owl/orca.rdf#" >
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/pscvmsite.rdf#pscvmsite/Domain">
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#NetworkDomain"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-vm">
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#Interface"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s2-bm">
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#Interface"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#Term">
<time:hasDurationDescription rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#TermDuration"/>
<rdf:type rdf:resource="http://www.w3.org/2006/time#Interval"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0">
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-vm"/>
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s2-bm"/>
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-bm"/>
<layer:atLayer rdf:resource="http://geni-orca.renci.org/owl/ethernet.owl#EthernetNetworkElement"/>
<layer:bandwidth rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">10000000</layer:bandwidth>
<topology:hasGUID>94492850-cf25-4cad-8b18-7bd5379d3bb3</topology:hasGUID>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#BroadcastConnection"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#Centos+7.3+v1.0.3">
<topology:hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Centos 7.3 v1.0.3</topology:hasName>
<topology:hasURL>http://geni-images.renci.org/images/standard/centos/centos7.3-v1.0.3/centos7.3-v1.0.3.xml</topology:hasURL>
<topology:hasGUID>c3e80c29d021c800dcc122070e5ecbffc417c657</topology:hasGUID>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/compute.owl#DiskImage"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#">
<collections:element rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0"/>
<collections:element rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s1-vm"/>
<collections:element rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s2-bm"/>
<collections:element rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s1-bm"/>
<request-schema:hasTerm rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#Term"/>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/request.owl#Reservation"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s1-bm">
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-bm"/>
<topology:hasGUID>e57f32cb-7ed8-4c1a-a6a0-1c5ca117740b</topology:hasGUID>
<request-schema:inDomain rdf:resource="http://geni-orca.renci.org/owl/pscvmsite.rdf#pscvmsite/Domain"/>
<compute:specificCE rdf:resource="http://geni-orca.renci.org/owl/exogeni.owl#ExoGENI-M4"/>
<domain:hasResourceType rdf:resource="http://geni-orca.renci.org/owl/compute.owl#BareMetalCE"/>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/compute.owl#ComputeElement"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/fiuvmsite.rdf#fiuvmsite/Domain">
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#NetworkDomain"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s1-vm">
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-vm"/>
<topology:hasGUID>e1aa2304-459c-418c-97c1-9565565e784f</topology:hasGUID>
<request-schema:inDomain rdf:resource="http://geni-orca.renci.org/owl/pscvmsite.rdf#pscvmsite/Domain"/>
<compute:diskImage rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#Centos+7.3+v1.0.3"/>
<compute:specificCE rdf:resource="http://geni-orca.renci.org/owl/exogeni.owl#XOXlarge"/>
<domain:hasResourceType rdf:resource="http://geni-orca.renci.org/owl/compute.owl#VM"/>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/compute.owl#ComputeElement"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#TermDuration">
<time:days rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">1</time:days>
<rdf:type rdf:resource="http://www.w3.org/2006/time#DurationDescription"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#s2-bm">
<topology:hasInterface rdf:resource="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s2-bm"/>
<topology:hasGUID>53ccce9f-32ff-4485-87fd-006a9c348316</topology:hasGUID>
<request-schema:inDomain rdf:resource="http://geni-orca.renci.org/owl/fiuvmsite.rdf#fiuvmsite/Domain"/>
<compute:specificCE rdf:resource="http://geni-orca.renci.org/owl/exogeni.owl#ExoGENI-M4"/>
<domain:hasResourceType rdf:resource="http://geni-orca.renci.org/owl/compute.owl#BareMetalCE"/>
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/compute.owl#ComputeElement"/>
</rdf:Description>
<rdf:Description rdf:about="http://geni-orca.renci.org/owl/8a84f3aa-6222-4609-9e2b-fbc95eac9bf9#VLAN0-s1-bm">
<rdf:type rdf:resource="http://geni-orca.renci.org/owl/topology.owl#Interface"/>
</rdf:Description>
</rdf:RDF>