Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lennart.thiesen/de.ugoe.cs.rwm.mocci
  • rwm/de.ugoe.cs.rwm.mocci
2 results
Show changes
Showing
with 599 additions and 236 deletions
......@@ -9,7 +9,7 @@
<use href="http://schemas.modmacao.org/modmacao#/"/>
<use href="http://schemas.modmacao.org/openstack/swe#/"/>
<use href="http://schemas.ugoe.cs.rwm/monitoring#/"/>
<resources xsi:type="infrastructure:Compute" id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce" title="hadoop-master" location="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/" rlinks="//@resources.2/@links.0 //@resources.1/@links.0" occiComputeCores="2" occiComputeHostname="vm2" occiComputeMemory="4096.0" occiComputeState="active">
<resources xsi:type="infrastructure:Compute" id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce" title="Hadoop-master" location="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/" rlinks="//@resources.2/@links.0 //@resources.1/@links.0" occiComputeCores="2" occiComputeHostname="vm2" occiComputeMemory="4096.0" occiComputeState="active">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='compute']"/>
<attributes name="occi.core.id" value="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce"/>
<attributes name="occi.core.title" value="hadoop-master"/>
......@@ -38,40 +38,15 @@
<attributes name="occi.core.id" value="urn:uuid:ea482951-5c26-471d-aa1b-8e03b1e6096c"/>
<attributes name="occi.core.title" value="link3"/>
<attributes name="occi.networkinterface.address" value="10.254.1.5"/>
<attributes name="occi.core.source" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/"/>
<attributes name="occi.core.target" value="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/"/>
<parts xsi:type="infrastructure:Ipnetworkinterface" occiNetworkinterfaceAddress="10.254.1.5" occiNetworkinterfaceGateway="10.254.1.254">
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
</links>
<links xsi:type="infrastructure:Networkinterface" id="urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d" title="monNwLink" target="//@resources.12" occiNetworkinterfaceInterface="100.254.1.35" occiNetworkinterfaceMac="">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='networkinterface']"/>
<attributes name="occi.core.id" value="urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d"/>
<attributes name="occi.core.title" value="monNwLink"/>
<attributes name="occi.networkinterface.address" value="100.254.1.35"/>
<attributes name="occi.core.source" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/"/>
<attributes name="occi.core.target" value=""/>
<parts xsi:type="infrastructure:Ipnetworkinterface" occiNetworkinterfaceAddress="100.254.1.35">
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
</links>
<links id="urn:uuid:ae43c9ca-149f-48f8-84d6-24b6b369d0a0" title="hadoop-master -> Management Network" target="//@resources.13">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='networkinterface']"/>
<attributes name="occi.core.id" value="urn:uuid:ae43c9ca-149f-48f8-84d6-24b6b369d0a0"/>
<attributes name="occi.core.title" value="hadoop-master -> Management Network"/>
<attributes name="occi.networkinterface.address" value="10.0.0.55"/>
<parts>
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
<parts>
<mixin href="http://schemas.modmacao.org/occi/ansible#//@mixins[term='ansibleendpoint']"/>
</parts>
</links>
</resources>
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896" title="Wordcount" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896/" occiComponentStateMessage="">
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896" title="HJob" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896/" occiComponentStateMessage="">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='component']"/>
<attributes name="occi.core.id" value="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896"/>
<attributes name="occi.core.title" value="Wordcount"/>
<attributes name="occi.core.title" value="HJob"/>
<attributes name="occi.core.summary" value=""/>
<attributes name="occi.component.state" value="undeployed"/>
<attributes name="occi.component.state.message" value=""/>
......@@ -80,11 +55,9 @@
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:ff292f08-d263-41b6-88c8-84d33783b929"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255896/"/>
<attributes name="occi.core.target" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/"/>
</links>
</resources>
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897" title="hMaster" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/" rlinks="//@resources.3/@links.0 //@resources.8/@links.0" occiComponentStateMessage="">
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897" title="HMaster" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/" rlinks="//@resources.3/@links.0" occiComponentStateMessage="">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='component']"/>
<attributes name="occi.core.id" value="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897"/>
<attributes name="occi.core.title" value="hMaster"/>
......@@ -100,7 +73,7 @@
<attributes name="occi.core.target" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/"/>
</links>
</resources>
<resources xsi:type="platform:Application" id="urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d" title="hadoopcluster" location="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d" occiAppName="" occiAppState="deployed">
<resources xsi:type="platform:Application" id="urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d" title="Hadoopcluster" location="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d" occiAppName="" occiAppState="undeployed">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='application']"/>
<attributes name="occi.core.id" value="urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d"/>
<attributes name="occi.core.title" value="hadoopcluster"/>
......@@ -108,21 +81,17 @@
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:9aa31c50-c605-4370-aa60-2c7c461051ef"/>
<attributes name="occi.core.title" value="ComponentLink"/>
<attributes name="occi.core.source" value="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d"/>
<attributes name="occi.core.target" value="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/"/>
</links>
<links xsi:type="platform:Componentlink" id="urn:uuid:7890f02b-6f56-4809-865f-d8c686fd9da1" title="link4" location="/componentlink/urn:uuid:7890f02b-6f56-4809-865f-d8c686fd9da1" target="//@resources.5">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:7890f02b-6f56-4809-865f-d8c686fd9da1"/>
<attributes name="occi.core.title" value="link4"/>
<attributes name="occi.core.source" value="/application/urn:uuid:a4888ba9-a0ea-48f2-a29e-901c876ab42d"/>
<attributes name="occi.core.target" value="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/"/>
</links>
</resources>
<resources xsi:type="infrastructure:Compute" id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf" title="hadoop-worker-1" location="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/" rlinks="//@resources.5/@links.0" occiComputeCores="2" occiComputeHostname="vm2" occiComputeMemory="4096.0" occiComputeState="active">
<resources xsi:type="infrastructure:Compute" id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf" title="Hadoop-worker-1" location="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/" rlinks="//@resources.5/@links.0 //@resources.8/@links.0 //@resources.7/@links.3 //@resources.15/@links.3" occiComputeCores="2" occiComputeHostname="vm2" occiComputeMemory="4096.0" occiComputeState="active">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='compute']"/>
<attributes name="occi.core.id" value="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf"/>
<attributes name="occi.core.title" value="hadoop-worker-1"/>
<attributes name="occi.core.title" value="Hadoop-worker-1"/>
<attributes name="occi.core.summary" value=""/>
<attributes name="occi.compute.architecture" value="x86"/>
<attributes name="occi.compute.cores" value="2"/>
......@@ -148,26 +117,21 @@
<attributes name="occi.core.id" value="urn:uuid:c8c49905-3d5e-43b2-8d09-fabf92d29722"/>
<attributes name="occi.core.title" value="link2"/>
<attributes name="occi.networkinterface.address" value="10.254.1.8"/>
<attributes name="occi.core.source" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/"/>
<attributes name="occi.core.target" value="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/"/>
<parts xsi:type="infrastructure:Ipnetworkinterface" occiNetworkinterfaceAddress="10.254.1.8" occiNetworkinterfaceGateway="10.254.1.254">
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
</links>
<links id="urn:uuid:5eef5126-582f-43a2-af2f-dab60ce30e1f" title="hadoop-worker-1 -> Management Network" target="//@resources.13">
<links xsi:type="infrastructure:Networkinterface" id="urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d" title="monNwLink" target="//@resources.12" occiNetworkinterfaceInterface="100.254.1.35" occiNetworkinterfaceMac="">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='networkinterface']"/>
<attributes name="occi.core.id" value="urn:uuid:5eef5126-582f-43a2-af2f-dab60ce30e1f"/>
<attributes name="occi.core.title" value="hadoop-worker-1 -> Management Network"/>
<attributes name="occi.networkinterface.address" value="10.0.0.65"/>
<parts>
<attributes name="occi.core.id" value="urn:uuid:03f91178-136f-4023-876e-84509f8a5a2d"/>
<attributes name="occi.core.title" value="monNwLink"/>
<attributes name="occi.networkinterface.address" value="100.254.1.35"/>
<parts xsi:type="infrastructure:Ipnetworkinterface" occiNetworkinterfaceAddress="100.254.1.35" occiNetworkinterfaceGateway="">
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
<parts>
<mixin href="http://schemas.modmacao.org/occi/ansible#//@mixins[term='ansibleendpoint']"/>
</parts>
</links>
</resources>
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898" title="Worker" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/" rlinks="//@resources.3/@links.1" occiComponentStateMessage="">
<resources xsi:type="platform:Component" id="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898" title="HWorker" location="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/" rlinks="//@resources.3/@links.1" occiComponentStateMessage="">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='component']"/>
<attributes name="occi.core.id" value="urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898"/>
<attributes name="occi.core.title" value="Worker"/>
......@@ -179,14 +143,13 @@
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:ff292f08-d263-41b6-88c8-84d33783b917"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.target" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/"/>
<attributes name="occi.core.source" value="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255898/"/>
<attributes name="occi.core.target" value="/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166ce/"/>
</links>
</resources>
<resources xsi:type="infrastructure:Network" id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591" title="hNetwork" location="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/" rlinks="//@resources.0/@links.0 //@resources.4/@links.0" occiNetworkState="active">
<resources xsi:type="infrastructure:Network" id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591" title="HNetwork" location="/network/urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591/" rlinks="//@resources.0/@links.0 //@resources.4/@links.0" occiNetworkState="active">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='network']"/>
<attributes name="occi.core.id" value="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339591"/>
<attributes name="occi.core.title" value="hNetwork"/>
<attributes name="occi.core.title" value="HNetwork"/>
<attributes name="occi.core.summary" value=""/>
<attributes name="occi.network.vlan" value="0"/>
<attributes name="occi.network.label" value=""/>
......@@ -197,136 +160,108 @@
<attributes name="occi.network.address" value="10.254.1.1/24"/>
</parts>
</resources>
<resources xsi:type="monitoring:Sensor" id="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb" title="Sensor">
<resources xsi:type="monitoring:Sensor" id="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb" title="CPUSensor">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='sensor']"/>
<attributes name="occi.core.id" value="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbb"/>
<attributes name="occi.core.title" value="Sensor"/>
<attributes name="occi.core.title" value="CPUSensor"/>
<attributes name="occi.core.summary" value=""/>
<attributes name="occi.sensor.timebase" value=""/>
<attributes name="occi.sensor.timestart" value=""/>
<attributes name="occi.sensor.timestop" value=""/>
<attributes name="occi.sensor.period" value=""/>
<attributes name="occi.sensor.granularity" value=""/>
<attributes name="occi.sensor.accuracy" value=""/>
<attributes name="occi.app.state" value="undeployed"/>
<attributes name="occi.app.state.message" value=""/>
<links xsi:type="platform:Componentlink" id="urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52a" title="link1" target="//@resources.8">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52a"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
<links xsi:type="platform:Componentlink" id="urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5a" title="link2" target="//@resources.9">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5a"/>
<attributes name="occi.core.title" value="link2"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
<links xsi:type="platform:Componentlink" id="urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e3" title="link3" target="//@resources.10">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e3"/>
<attributes name="occi.core.title" value="link3"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
<links xsi:type="monitoring:Monitorableproperty" id="urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72" title="CPU" location="" target="//@resources.4" monitoringProperty="CPU" monitoringResult="">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='monitorableproperty']"/>
<attributes name="occi.core.id" value="urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed72"/>
<attributes name="occi.core.title" value="CPU"/>
<attributes name="monitoring.property" value="CPU"/>
</links>
</resources>
<resources xsi:type="monitoring:Datagatherer" id="urn:uuid:051affdc-d686-48f8-884c-83fe81718a48" title="DataGatherer" rlinks="//@resources.7/@links.0 //@resources.9/@links.0">
<resources xsi:type="monitoring:Datagatherer" id="urn:uuid:051affdc-d686-48f8-884c-83fe81718a48" title="Glances" rlinks="//@resources.7/@links.0 //@resources.9/@links.0 //@resources.13/@links.0 //@resources.15/@links.0">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='datagatherer']"/>
<attributes name="occi.core.id" value="urn:uuid:051affdc-d686-48f8-884c-83fe81718a48"/>
<attributes name="occi.core.title" value="DataGatherer"/>
<links xsi:type="placement:Placementlink" id="urn:uuid:60cc05ca-4fd7-465b-8fd0-945dcbf8867f" title="link1" target="//@resources.2">
<attributes name="occi.core.title" value="Glances"/>
<parts mixin="//@mixins.3"/>
<links xsi:type="placement:Placementlink" id="urn:uuid:60cc05ca-4fd7-465b-8fd0-945dcbf8867f" title="link1" target="//@resources.4">
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:60cc05ca-4fd7-465b-8fd0-945dcbf8867f"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value="/component/urn:uuid:f934d445-d0c8-4f2f-8086-d9f1a8255897/"/>
</links>
</resources>
<resources xsi:type="monitoring:Processor" id="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc" title="Processor" rlinks="//@resources.10/@links.0 //@resources.7/@links.1">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='processor']"/>
<resources xsi:type="monitoring:Dataprocessor" id="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc" title="CPUAggregator" rlinks="//@resources.10/@links.0 //@resources.7/@links.1">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='dataprocessor']"/>
<attributes name="occi.core.id" value="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdc"/>
<attributes name="occi.core.title" value="Processor"/>
<attributes name="occi.core.title" value="CPUAggregator"/>
<parts mixin="//@mixins.4"/>
<links xsi:type="platform:Componentlink" id="urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf40" title="link1" target="//@resources.8">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf40"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
<links xsi:type="placement:Placementlink" id="urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f4" title="link2" target="//@resources.11">
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f4"/>
<attributes name="occi.core.title" value="link2"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
</resources>
<resources xsi:type="monitoring:Publisher" id="urn:uuid:588f705e-5279-4847-9337-846af2c86972" title="Publisher" rlinks="//@resources.7/@links.2">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='publisher']"/>
<resources xsi:type="monitoring:Resultprovider" id="urn:uuid:588f705e-5279-4847-9337-846af2c86972" title="CPUProvider" rlinks="//@resources.7/@links.2">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='resultprovider']"/>
<attributes name="occi.core.id" value="urn:uuid:588f705e-5279-4847-9337-846af2c86972"/>
<attributes name="occi.core.title" value="Publisher"/>
<attributes name="occi.core.title" value="CPUProvider"/>
<parts mixin="//@mixins.5"/>
<parts xsi:type="monitoring:Occiresultprovider">
<mixin href="http://schemas.ugoe.cs.rwm/monitoring#//@mixins[term='occiresultprovider']"/>
<attributes name="result.provider.endpoint" value="192.168.35.45:8080"/>
</parts>
<links xsi:type="platform:Componentlink" id="urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b80" title="link1" target="//@resources.9">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b80"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
<links xsi:type="placement:Placementlink" id="urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3616" title="link2" target="//@resources.11">
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3616"/>
<attributes name="occi.core.title" value="link2"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
</links>
</resources>
<resources xsi:type="infrastructure:Compute" id="urn:uuid:37829092-c690-494a-98fa-335b2fd660ea" title="MonVm" rlinks="//@resources.9/@links.1 //@resources.10/@links.1">
<resources xsi:type="infrastructure:Compute" id="urn:uuid:37829092-c690-494a-98fa-335b2fd660ea" title="MonVm" rlinks="//@resources.9/@links.1 //@resources.10/@links.1 //@resources.13/@links.1 //@resources.14/@links.1" occiComputeHostname="monVM" occiComputeState="active">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='compute']"/>
<attributes name="occi.core.id" value="urn:uuid:37829092-c690-494a-98fa-335b2fd660ea"/>
<attributes name="occi.core.title" value="MonVm"/>
<attributes name="occi.core.summary" value=""/>
<attributes name="occi.compute.architecture" value="x86"/>
<attributes name="occi.compute.cores" value="2"/>
<attributes name="occi.compute.hostname" value="hadoop-worker-1"/>
<attributes name="occi.compute.hostname" value="monVM"/>
<attributes name="occi.compute.share" value="0"/>
<attributes name="occi.compute.speed" value="0"/>
<attributes name="occi.compute.memory" value="4096"/>
<attributes name="occi.compute.state" value="active"/>
<attributes name="occi.compute.state.message" value=""/>
<parts>
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ssh_key']"/>
<attributes name="occi.credentials.ssh.publickey" value="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova"/>
</parts>
<parts>
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='user_data']"/>
<attributes name="occi.compute.userdata" value="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"/>
<mixin href="http://schemas.modmacao.org/openstack/swe#//@mixins[term='ubuntu_xenialxerus']"/>
</parts>
<links xsi:type="infrastructure:Networkinterface" id="urn:uuid:00d6889d-b644-44bf-af13-3fe350e926ed" title="link1" target="//@resources.12">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='networkinterface']"/>
<attributes name="occi.core.id" value="urn:uuid:00d6889d-b644-44bf-af13-3fe350e926ed"/>
<attributes name="occi.core.title" value="link1"/>
<attributes name="occi.core.source" value=""/>
<attributes name="occi.core.target" value=""/>
<parts xsi:type="infrastructure:Ipnetworkinterface" occiNetworkinterfaceAddress="100.254.1.25">
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
</links>
<links id="urn:uuid:04d1f2b2-59af-41d1-948c-e6bd96305aa8" title="MonVm -> Management Network" target="//@resources.13">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='networkinterface']"/>
<attributes name="occi.core.id" value="urn:uuid:04d1f2b2-59af-41d1-948c-e6bd96305aa8"/>
<attributes name="occi.core.title" value="MonVM -> Management Network"/>
<attributes name="occi.networkinterface.address" value="10.0.0.75"/>
<parts>
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetworkinterface']"/>
</parts>
<parts>
<mixin href="http://schemas.modmacao.org/occi/ansible#//@mixins[term='ansibleendpoint']"/>
</parts>
</links>
</resources>
<resources xsi:type="infrastructure:Network" id="urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a" title="MonitoringNetwork" rlinks="//@resources.11/@links.0 //@resources.0/@links.1">
<resources xsi:type="infrastructure:Network" id="urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a" title="MonitoringNetwork" rlinks="//@resources.11/@links.0 //@resources.4/@links.1" occiNetworkState="active">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='network']"/>
<attributes name="occi.core.id" value="urn:uuid:7a9fca2c-24fb-473c-aa9c-8dc9e68a432a"/>
<attributes name="occi.core.title" value="MonitoringNetwork"/>
......@@ -340,20 +275,76 @@
<attributes name="occi.network.address" value="100.254.1.1/24"/>
</parts>
</resources>
<resources id="urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590" title="Management Network" rlinks="//@resources.0/@links.2 //@resources.4/@links.1 //@resources.11/@links.1">
<kind href="http://schemas.ogf.org/occi/infrastructure#//@kinds[term='network']"/>
<parts>
<mixin href="http://schemas.modmacao.org/openstack/runtime#//@mixins[term='runtimeid']"/>
<attributes name="openstack.runtime.id" value="75a4639e-9ce7-4058-b859-8a711b0e2e7b"/>
</parts>
<parts>
<mixin href="http://schemas.ogf.org/occi/infrastructure#//@mixins[term='ipnetwork']"/>
<attributes name="occi.network.address" value="10.0.0.1/24"/>
<resources xsi:type="monitoring:Dataprocessor" id="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdd" title="Processor" rlinks="//@resources.14/@links.0 //@resources.15/@links.2">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='dataprocessor']"/>
<attributes name="occi.core.title" value="Processor"/>
<attributes name="occi.core.id" value="urn:uuid:1bda25ab-723b-47e7-9704-5134db26ebdd"/>
<parts mixin="//@mixins.6"/>
<links xsi:type="platform:Componentlink" id="urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf41" title="link1" target="//@resources.8">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:1a821776-7886-4cb4-8b80-46a8403acf41"/>
<attributes name="occi.core.title" value="link1"/>
</links>
<links xsi:type="placement:Placementlink" id="urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f5" title="link2" target="//@resources.11">
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:ff7019e4-a9dc-48dc-83c3-ab77714a25f5"/>
<attributes name="occi.core.title" value="link2"/>
</links>
</resources>
<resources xsi:type="monitoring:Resultprovider" id="urn:uuid:588f705e-5279-4847-9337-846af2c86973" title="Resultprovider" rlinks="//@resources.15/@links.1">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='resultprovider']"/>
<attributes name="occi.core.id" value="urn:uuid:588f705e-5279-4847-9337-846af2c86973"/>
<attributes name="occi.core.title" value="Resultprovider"/>
<parts mixin="//@mixins.7"/>
<parts xsi:type="monitoring:Occiresultprovider">
<mixin href="http://schemas.ugoe.cs.rwm/monitoring#//@mixins[term='occiresultprovider']"/>
<attributes name="result.provider.endpoint" value="192.168.35.45:8080"/>
</parts>
<links xsi:type="platform:Componentlink" id="urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b83" title="link1" target="//@resources.13">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:9551c357-59f8-4ac1-8c85-0e886e206b83"/>
<attributes name="occi.core.title" value="link1"/>
</links>
<links xsi:type="placement:Placementlink" id="urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3618" title="link2" target="//@resources.11">
<kind href="http://schemas.modmacao.org/placement#//@kinds[term='placementlink']"/>
<attributes name="occi.core.id" value="urn:uuid:275b5bce-084c-46f0-88bc-1f6f31bf3618"/>
<attributes name="occi.core.title" value="link2"/>
</links>
</resources>
<resources xsi:type="monitoring:Sensor" id="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbc" title="Sensor" occiAppStateMessage="">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='sensor']"/>
<attributes name="occi.core.title" value="Sensor"/>
<attributes name="occi.core.id" value="urn:uuid:efb0f50a-7a7c-4153-b939-4846d6554dbc"/>
<attributes name="occi.app.state.message" value=""/>
<links xsi:type="platform:Componentlink" id="urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52b" title="link1" target="//@resources.8">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:04cf6483-706d-4a2a-9114-9918ab2bb52b"/>
<attributes name="occi.core.title" value="link1"/>
</links>
<links xsi:type="platform:Componentlink" id="urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5b" title="link2" target="//@resources.14">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:9c604867-3135-4fa1-af9e-2bb11018ff5b"/>
<attributes name="occi.core.title" value="link2"/>
</links>
<links xsi:type="platform:Componentlink" id="urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e4" title="link3" target="//@resources.13">
<kind href="http://schemas.modmacao.org/occi/platform#//@kinds[term='componentlink']"/>
<attributes name="occi.core.id" value="urn:uuid:93f08e31-f350-42b7-a73b-c139eba4a8e4"/>
<attributes name="occi.core.title" value="link3"/>
</links>
<links xsi:type="monitoring:Monitorableproperty" id="urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed73" title="MEM Monitoring" location="" target="//@resources.4" monitoringProperty="Mem" monitoringResult="">
<kind href="http://schemas.ugoe.cs.rwm/monitoring#//@kinds[term='monitorableproperty']"/>
<attributes name="occi.core.title" value="MEM Monitoring"/>
<attributes name="occi.core.id" value="urn:uuid:ba16f4ee-1601-4192-a259-eae4274aed73"/>
<attributes name="monitoring.property" value="Mem"/>
</links>
</resources>
<mixins name="hJob" scheme="http://schemas.modmacao.org/usermixins#" title="Hjob"/>
<mixins name="hMaster" scheme="http://schemas.modmacao.org/usermixins#" title="HMaster"/>
<mixins name="hWorker" scheme="http://schemas.modmacao.org/usermixins#" title="HWorker"/>
<mixins name="hJobMonitoring" scheme="http://schemas.modmacao.org/usermixins#" title="HJobMonitoring"/>
<mixins name="hJobMonitoring2" scheme="http://schemas.modmacao.org/usermixins#" title="HJobMonitoring2"/>
<mixins name="CPUGatherer" scheme="http://schemas.modmacao.org/usermixins#" title="CPUGatherer"/>
<mixins name="CPUProcessor" scheme="http://schemas.modmacao.org/usermixins#" title="CPUProcessor"/>
<mixins name="CPUPublisher" scheme="http://schemas.modmacao.org/usermixins#" title="CPUPublisher"/>
<mixins name="MemProcessor" scheme="http://schemas.modmacao.org/usermixins#" title="MemProcessor"/>
<mixins name="MemPublisher" scheme="http://schemas.modmacao.org/usermixins#" title="MemPublisher"/>
<mixins name="CPUProcessorLocal" scheme="http://schemas.modmacao.org/usermixins#" title="CPUProcessorLocal"/>
</occi:Configuration>
src/main/resources/de/ugoe/cs/rwm/mocci/occi/initial.jpg

130 KiB

#! /bin/bash
state=DownScaled
sequence=3
url='http://localhost:8080/monitorableproperty?attribute=monitoring.result&value=Critical'
echo "Starting MAPE script"
echo "Requesting $url every $sequence seconds!"
while true; do
echo "Monitor"
m=$(curl -s $url)
echo "$m"
echo "Analyze"
if echo $m | grep -q /compute/ ; then
echo "Critical Compute Detected"
echo "Plan: Scale up VM"
if [ "$state" == DownScaled ]; then
state=UpScaled
echo "State: $state"
echo "Execute"
curl -v -X PUT http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf", occi.core.title="hadoop-worker-1", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="8", occi.compute.hostname="hadoop-worker-1", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="8192", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
fi
else
echo "No Crtical Compute Detected"
echo "Plan: Scale down VM"
if [ "$state" == UpScaled ]; then
state=DownScaled
echo "State: $state"
curl -v -X PUT http://localhost:8080/compute/urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf/ -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", ssh_key; scheme="http://schemas.ogf.org/occi/infrastructure/credentials#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", ubuntu_xenialxerus; scheme="http://schemas.modmacao.org/openstack/swe#"; class="mixin"' -H 'X-OCCI-Attribute:occi.core.id="urn:uuid:2e6a73d0-faaa-476a-bd25-ca461dd166cf", occi.core.title="hadoop-worker-1", occi.core.summary="", occi.compute.architecture="x86", occi.compute.cores="2", occi.compute.hostname="hadoop-worker-1", occi.compute.share="0", occi.compute.speed="0", occi.compute.memory="4096", occi.compute.state="active", occi.compute.state.message="", occi.credentials.ssh.publickey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova", occi.compute.userdata="I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj"'
fi
fi
sleep $sequence
done
package de.ugoe.cs.rwm.mocci;
import static org.junit.Assert.assertTrue;
import org.eclipse.cmf.occi.core.Configuration;
import org.eclipse.cmf.occi.core.Link;
import org.eclipse.cmf.occi.core.OCCIFactory;
import org.eclipse.cmf.occi.core.impl.OCCIFactoryImpl;
import org.eclipse.cmf.occi.infrastructure.Compute;
import org.eclipse.cmf.occi.infrastructure.InfrastructureFactory;
import org.eclipse.cmf.occi.infrastructure.impl.InfrastructureFactoryImpl;
import org.junit.BeforeClass;
import org.junit.Test;
import org.modmacao.occi.platform.Componentlink;
import org.modmacao.occi.platform.PlatformFactory;
import org.modmacao.occi.platform.impl.PlatformFactoryImpl;
import monitoring.Datagatherer;
import monitoring.Dataprocessor;
import monitoring.Monitorableproperty;
import monitoring.MonitoringFactory;
import monitoring.Resultprovider;
import monitoring.Sensor;
import monitoring.impl.MonitoringFactoryImpl;
public class CreateMonitoringElementsTest {
@BeforeClass
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Test
public void createMonitoringElements() {
// Factories to create OCCI elements
OCCIFactory cFact = new OCCIFactoryImpl();
InfrastructureFactory iFact = new InfrastructureFactoryImpl();
MonitoringFactory mFact = new MonitoringFactoryImpl();
PlatformFactory pFact = new PlatformFactoryImpl();
// Top level element
Configuration config = cFact.createConfiguration();
Compute comp = iFact.createCompute();
// Resources
Sensor sensor = mFact.createSensor();
config.getResources().add(sensor);
config.getResources().add(comp);
Monitorableproperty mp = mFact.createMonitorableproperty();
mp.setSource(sensor);
mp.setTarget(comp);
Datagatherer dg = mFact.createDatagatherer();
Componentlink cl = pFact.createComponentlink();
cl.setSource(sensor);
cl.setTarget(dg);
Dataprocessor dp = mFact.createDataprocessor();
Componentlink cl1 = pFact.createComponentlink();
cl1.setSource(sensor);
cl1.setTarget(dp);
Resultprovider rp = mFact.createResultprovider();
Componentlink cl2 = pFact.createComponentlink();
cl2.setSource(sensor);
cl2.setTarget(rp);
System.out.println("Checking configuration: " + config.getResources());
assertTrue(checkSensor(config));
}
public boolean checkSensor(Configuration conf) {
for (org.eclipse.cmf.occi.core.Resource res : conf.getResources()) {
if (res instanceof Sensor) {
Sensor sens = (Sensor) res;
if (containsDevices(sens)) {
return true;
}
}
}
return false;
}
private boolean containsDevices(Sensor sens) {
int count = 0;
for (Link link : sens.getLinks()) {
if (link instanceof Componentlink) {
count++;
}
}
if (count == 3) {
return true;
}
return false;
}
}
......@@ -5,47 +5,34 @@ import static org.junit.Assert.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.cmf.occi.core.Configuration;
import org.eclipse.cmf.occi.core.Link;
import org.eclipse.cmf.occi.core.Mixin;
import org.eclipse.cmf.occi.core.OCCIPackage;
import org.eclipse.cmf.occi.core.util.OcciRegistry;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.epsilon.emc.emf.CachedResourceSet;
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.mocci.TestUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.LocalhostConnector;
import de.ugoe.cs.rwm.tocci.Transformator;
import de.ugoe.cs.rwm.tocci.TransformatorFactory;
import de.ugoe.cs.rwm.tocci.occi2openstack.OCCI2OPENSTACKTransformator;
import monitoring.MonitoringPackage;
public class DeployHadoopMonitoringTest {
String manNWid = "urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590";
String manNWRuntimeId = "75a4639e-9ce7-4058-b859-8a711b0e2e7b";
String sshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova";
String userData = "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj";
private static String manNWid = "urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590";
private static String manNWRuntimeId = "75a4639e-9ce7-4058-b859-8a711b0e2e7b";
private static String sshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova";
private static String userData = "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj";
@BeforeClass
public static void OCCIRegistrySetup() {
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Before
public void deprovisionEverything() {
CachedResourceSet.getCache().clear();
......@@ -56,55 +43,80 @@ public class DeployHadoopMonitoringTest {
}
@Test
public void deployHadoopWithNewMonitoring() {
public void deployHadoopWithCPUMonitoring() {
CachedResourceSet.getCache().clear();
System.out.println(OcciRegistry.getInstance().getRegisteredExtensions());
//Logger.getRootLogger().setLevel(Level.FATAL);
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterNewExt.occic"));
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterCPU.occic"));
Resource model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
trans.transform(occiPath, occiPath);
OCCI2OPENSTACKTransformator trans2 = OCCI2OPENSTACKTransformator.getInstance();
try {
trans.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
OCCI2OPENSTACKTransformator trans2 = new OCCI2OPENSTACKTransformator();
trans2.setTransformationProperties(manNWRuntimeId, sshKey, userData, manNWid);
trans2.transform(occiPath, occiPath);
try {
trans2.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
assertTrue(TestUtility.equalsRuntime(occiPath, conn));
deployer.deploy(model);
assertTrue(TestUtility.equalsRuntime(model, conn));
}
@Test
public void resolveProxies() {
MonitoringPackage.eINSTANCE.eClass();
OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/monitoring#",
MonitoringPackage.class.getClassLoader().getResource("model/monitoring.occie").toString());
Path newOCCI = Paths.get(de.ugoe.cs.rwm.docci.ModelUtility.getPathToResource("occi/hadoopClusterNewExt.occic"));
Resource ress = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCIintoEMFResource(newOCCI);
ResourceSet resSet = ress.getResourceSet();
EList<EObject> newModel = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCI(newOCCI);
for (org.eclipse.cmf.occi.core.Resource res : de.ugoe.cs.rwm.docci.ModelUtility.getResources(newModel)) {
System.out.println("Resource Title: " + res.getTitle());
System.out.println(" Kind: " + res.getKind());
for (Link link : res.getLinks()) {
System.out.println(" Link: " + link.getTitle());
System.out.println(" " + " Kind:" + link.getKind());
System.out.println(" " + " Target:" + link.getTarget());
}
for (Mixin mix : res.getMixins()) {
System.out.println(" " + mix);
System.out.println(" " + mix.getScheme());
}
public void deployHadoopWithCPUAndMemMonitoring() {
CachedResourceSet.getCache().clear();
System.out.println(OcciRegistry.getInstance().getRegisteredExtensions());
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterNewExtWithMem.occic"));
Resource model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
try {
trans.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
OCCI2OPENSTACKTransformator trans2 = new OCCI2OPENSTACKTransformator();
trans2.setTransformationProperties(manNWRuntimeId, sshKey, userData, manNWid);
try {
trans2.transform(model, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(model);
assertTrue(TestUtility.equalsRuntime(model, conn));
}
}
package de.ugoe.cs.rwm.mocci;
import static org.junit.Assert.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.eclipse.cmf.occi.core.Configuration;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.epsilon.emc.emf.CachedResourceSet;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.LocalhostConnector;
public class MapeTest {
@BeforeClass
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Before
public void resetEverything() {
CachedResourceSet.getCache().clear();
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/Empty.occic"));
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
InitialDeployment.main(new String[0]);
}
@Test
public void Monitor() {
Monitor monitor = MAPE.monitor();
assertTrue(monitor.getAllCPUs() == 1);
}
@Test
public void Analyze() {
Monitor monitor = MAPE.monitor();
String analysis = MAPE.analyze(monitor);
if (monitor.getCritCPUs() == 1) {
assertTrue(analysis.equals("upScale"));
}
if (monitor.getNoneCPUs() == 1) {
assertTrue(analysis.equals("downScale"));
}
}
@Test
public void Plan() {
Monitor monitor = MAPE.monitor();
String analysis = MAPE.analyze(monitor);
Resource res = MAPE.plan(analysis);
if (analysis.equals("upScale")) {
Configuration pre = (Configuration) MAPE.runtimeModel.getContents().get(0);
Configuration post = (Configuration) res.getContents().get(0);
assertTrue(pre.getResources().size() < post.getResources().size());
}
}
@Test
public void Execute() {
Monitor monitor = MAPE.monitor();
String analysis = MAPE.analyze(monitor);
MAPE.runtimeModel = MAPE.plan(analysis);
MAPE.execute(MAPE.runtimeModel);
assertTrue(TestUtility.equalsRuntime(MAPE.runtimeModel, MAPE.conn));
}
@Test
public void Iterations() {
int iterations = 20;
int count = 0;
int interval = 1000;
while (count < iterations) {
try {
System.out.println("\n--------------------Waiting for new MAPE-K Cycle: Sleeping " + interval
+ "--------------------");
Thread.sleep(interval);
Monitor monitor = MAPE.monitor();
String analysis = MAPE.analyze(monitor);
MAPE.runtimeModel = MAPE.plan(analysis);
MAPE.execute(MAPE.runtimeModel);
count++;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
package de.ugoe.cs.rwm.mocci;
import static org.junit.Assert.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.eclipse.cmf.occi.core.Link;
import org.eclipse.cmf.occi.core.Mixin;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.junit.BeforeClass;
import org.junit.Test;
public class ResolveProxyTest {
@BeforeClass
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Test
public void resolveProxies() {
Path newOCCI = Paths
.get(de.ugoe.cs.rwm.docci.ModelUtility.getPathToResource("occi/hadoopClusterNewExtWithMem.occic"));
Resource ress = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCIintoEMFResource(newOCCI);
@SuppressWarnings("unused")
ResourceSet resSet = ress.getResourceSet();
EList<EObject> newModel = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCI(newOCCI);
for (org.eclipse.cmf.occi.core.Resource res : de.ugoe.cs.rwm.docci.ModelUtility.getResources(newModel)) {
System.out.println("Resource Title: " + res.getTitle());
System.out.println(" Kind: " + res.getKind());
assertTrue(!(res.getKind().eIsProxy()));
for (Link link : res.getLinks()) {
System.out.println(" Link: " + link.getTitle());
System.out.println(" " + " Kind:" + link.getKind());
System.out.println(" " + " Target:" + link.getTarget());
assertTrue(!(link.getKind().eIsProxy()));
}
for (Mixin mix : res.getMixins()) {
System.out.println(" " + mix);
System.out.println(" " + mix.getScheme());
assertTrue(!(mix.eIsProxy()));
}
}
}
}
package de.ugoe.cs.rwm.mocci;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -10,29 +9,26 @@ import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.eclipse.cmf.occi.core.OCCIPackage;
import org.eclipse.cmf.occi.core.util.OcciRegistry;
import org.eclipse.cmf.occi.crtp.CrtpPackage;
import org.eclipse.cmf.occi.docker.DockerPackage;
import org.eclipse.cmf.occi.infrastructure.InfrastructurePackage;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.modmacao.ansibleconfiguration.AnsibleconfigurationPackage;
import org.modmacao.occi.platform.PlatformPackage;
import org.modmacao.placement.PlacementPackage;
import de.ugoe.cs.rwm.cocci.Comparator;
import de.ugoe.cs.rwm.cocci.ComparatorFactory;
import de.ugoe.cs.rwm.docci.Deployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.appdeployer.MartAppDeployerMaster;
import de.ugoe.cs.rwm.docci.appdeployer.MartAppDeployerSlave;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.deprovisioner.Deprovisioner;
import de.ugoe.cs.rwm.docci.executor.Executor;
import de.ugoe.cs.rwm.docci.extractor.Extractor;
import de.ugoe.cs.rwm.docci.provisioner.Provisioner;
import de.ugoe.cs.rwm.docci.updater.ElementAdapter;
import de.ugoe.cs.rwm.tocci.Transformator;
import de.ugoe.cs.rwm.domain.workload.WorkloadPackage;
import modmacao.ModmacaoPackage;
import monitoring.MonitoringPackage;
import openstackruntime.OpenstackruntimePackage;
import ossweruntime.OssweruntimePackage;
import workflow.WorkflowPackage;
public class TestUtility {
public static void extensionRegistrySetup() {
......@@ -40,19 +36,22 @@ public class TestUtility {
OCCIPackage.eINSTANCE.eClass();
ModmacaoPackage.eINSTANCE.eClass();
OpenstackruntimePackage.eINSTANCE.eClass();
PlacementPackage.eINSTANCE.eClass();
WorkflowPackage.eINSTANCE.eClass();
OssweruntimePackage.eINSTANCE.eClass();
AnsibleconfigurationPackage.eINSTANCE.eClass();
MonitoringPackage.eINSTANCE.eClass();
CrtpPackage.eINSTANCE.eClass();
PlatformPackage.eINSTANCE.eClass();
WorkloadPackage.eINSTANCE.eClass();
DockerPackage.eINSTANCE.eClass();
OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/monitoring#",
MonitoringPackage.class.getClassLoader().getResource("model/monitoring.occie").toString());
//OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/monitoring#",
// MonitoringPackage.class.getClassLoader().getResource("model/monitoring.occie").toString());
OcciRegistry.getInstance().registerExtension("http://occiware.org/occi/docker#",
OCCIPackage.class.getClassLoader().getResource("model/docker.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/domain/workload#",
OCCIPackage.class.getClassLoader().getResource("model/workload.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/occi/platform#",
PlatformPackage.class.getClassLoader().getResource("model/platform.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/modmacao#",
ModmacaoPackage.class.getClassLoader().getResource("model/modmacao.occie").toString());
......@@ -66,29 +65,31 @@ public class TestUtility {
InfrastructurePackage.class.getClassLoader().getResource("model/Infrastructure.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.ogf.org/occi/core#",
OCCIPackage.class.getClassLoader().getResource("model/Core.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/workflow#",
OCCIPackage.class.getClassLoader().getResource("model/workflow.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/openstack/swe#",
OCCIPackage.class.getClassLoader().getResource("model/ossweruntime.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/occi/ansible#",
OCCIPackage.class.getClassLoader().getResource("model/ansibleconfiguration.occie").toString());
}
OcciRegistry.getInstance().registerExtension("http://schemas.ugoe.cs.rwm/monitoring#",
MonitoringPackage.class.getClassLoader().getResource("model/monitoring.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.ogf.org/occi/infrastructure/compute/template/1.1#",
OCCIPackage.class.getClassLoader().getResource("model/crtp.occie").toString());
}
public static void loggerSetup() {
File log4jfile = new File(ModelUtility.getPathToResource("log4j.properties"));
PropertyConfigurator.configure(log4jfile.getAbsolutePath());
Logger.getLogger(Executor.class.getName()).setLevel(Level.DEBUG);
//Logger.getLogger(Extractor.class.getName()).setLevel(Level.DEBUG);
//Logger.getLogger(Provisioner.class.getName()).setLevel(Level.DEBUG);
Logger.getLogger(Comparator.class.getName()).setLevel(Level.DEBUG);
Logger.getLogger(Deprovisioner.class.getName()).setLevel(Level.INFO);
//Logger.getLogger(Connector.class.getName()).setLevel(Level.DEBUG);
//Logger.getLogger(ElementAdapter.class.getName()).setLevel(Level.INFO);
// Logger.getLogger(Extractor.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(Provisioner.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(Comparator.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(Deprovisioner.class.getName()).setLevel(Level.INFO);
// Logger.getLogger(Connector.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(ElementAdapter.class.getName()).setLevel(Level.INFO);
Logger.getLogger(Deployer.class.getName()).setLevel(Level.INFO);
Logger.getLogger(MartAppDeployerMaster.class.getName()).setLevel(Level.DEBUG);
Logger.getLogger(MartAppDeployerSlave.class.getName()).setLevel(Level.DEBUG);
//Logger.getLogger(Transformator.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(MartAppDeployerMaster.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(MartAppDeployerSlave.class.getName()).setLevel(Level.DEBUG);
// Logger.getLogger(Transformator.class.getName()).setLevel(Level.DEBUG);
}
public static boolean equalsRuntime(Path desiredModelPath, Connector conn) {
......@@ -121,5 +122,34 @@ public class TestUtility {
}
return assertion;
}
public static boolean equalsRuntime(Resource desiredModel, Connector conn) {
Path deployedOCCI = Paths.get(System.getProperty("user.home") + "/.rwm/runtime.occic");
conn.loadRuntimeModel(deployedOCCI);
org.eclipse.emf.ecore.resource.Resource runtimeModel = ModelUtility.loadOCCIintoEMFResource(deployedOCCI);
Comparator comp = ComparatorFactory.getComparator("Simple", desiredModel, runtimeModel);
boolean assertion = true;
System.out.println("MISSING ELEMENTS:");
for (EObject obj : comp.getMissingElements()) {
// Network check due to provider network
if (obj.eClass().getName().equals("Network") == false) {
System.out.println(obj);
assertion = false;
}
}
System.out.println("NEW ELEMENTS:");
for (EObject obj : comp.getNewElements()) {
// Network check due to provider network
if (obj.eClass().getName().equals("Network") == false) {
System.out.println(obj);
assertion = false;
}
}
return assertion;
}
}
......@@ -5,34 +5,19 @@ import static org.junit.Assert.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.cmf.occi.core.Configuration;
import org.eclipse.cmf.occi.core.Link;
import org.eclipse.cmf.occi.core.Mixin;
import org.eclipse.cmf.occi.core.OCCIPackage;
import org.eclipse.cmf.occi.core.util.OcciRegistry;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.epsilon.emc.emf.CachedResourceSet;
import org.junit.Before;
import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.mocci.TestUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.LocalhostConnector;
import de.ugoe.cs.rwm.docci.connector.MartConnector;
import de.ugoe.cs.rwm.mocci.TestUtility;
import de.ugoe.cs.rwm.tocci.Transformator;
import de.ugoe.cs.rwm.tocci.TransformatorFactory;
import de.ugoe.cs.rwm.tocci.occi2openstack.OCCI2OPENSTACKTransformator;
import monitoring.MonitoringPackage;
public class DeployHadoopMonitoringTestLive {
String manNWid = "urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590";
......@@ -40,14 +25,12 @@ public class DeployHadoopMonitoringTestLive {
String sshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova";
String userData = "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj";
@BeforeClass
public static void OCCIRegistrySetup() {
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Before
public void deprovisionEverything() {
CachedResourceSet.getCache().clear();
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/Empty.occic"));
......@@ -59,22 +42,31 @@ public class DeployHadoopMonitoringTestLive {
@Test
public void deployHadoopWithNewMonitoring() {
CachedResourceSet.getCache().clear();
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterNewExt.occic"));
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterNewExtWithMem.occic"));
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
trans.transform(occiPath, occiPath);
OCCI2OPENSTACKTransformator trans2 = OCCI2OPENSTACKTransformator.getInstance();
try {
trans.transform(occiPath, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
OCCI2OPENSTACKTransformator trans2 = new OCCI2OPENSTACKTransformator();
trans2.setTransformationProperties(manNWRuntimeId, sshKey, userData, manNWid);
trans2.transform(occiPath, occiPath);
try {
trans2.transform(occiPath, occiPath);
} catch (EolRuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Connector conn = new MartConnector("192.168.35.45", 8080, "ubuntu", "~/key.pem");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
assertTrue(TestUtility.equalsRuntime(occiPath, conn));
}
......
package de.ugoe.cs.rwm.mocci.live;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.eclipse.epsilon.emc.emf.CachedResourceSet;
import org.junit.BeforeClass;
import org.junit.Test;
import de.ugoe.cs.rwm.docci.MartDeployer;
import de.ugoe.cs.rwm.docci.ModelUtility;
import de.ugoe.cs.rwm.docci.connector.Connector;
import de.ugoe.cs.rwm.docci.connector.MartConnector;
import de.ugoe.cs.rwm.mocci.TestUtility;
public class EmptyTestLive {
String manNWid = "urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590";
String manNWRuntimeId = "75a4639e-9ce7-4058-b859-8a711b0e2e7b";
String sshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova";
String userData = "I2Nsb3VkLWNvbmZpZwoKIyBVcGdyYWRlIHRoZSBpbnN0YW5jZSBvbiBmaXJzdCBib290CiMgKGllIHJ1biBhcHQtZ2V0IHVwZ3JhZGUpCiMKIyBEZWZhdWx0OiBmYWxzZQojIEFsaWFzZXM6IGFwdF91cGdyYWRlCnBhY2thZ2VfdXBncmFkZTogdHJ1ZQoKcGFja2FnZXM6CiAtIHB5dGhvbgoKd3JpdGVfZmlsZXM6CiAgLSBwYXRoOiAvZXRjL25ldHdvcmsvaW50ZXJmYWNlcy5kLzUwLWNsb3VkLWluaXQuY2ZnCiAgICBjb250ZW50OiB8CiAgICAgIGF1dG8gbG8KICAgICAgaWZhY2UgbG8gaW5ldCBsb29wYmFjawogICAgICAKICAgICAgYXV0byBlbnMwCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMAogICAgICBpZmFjZSBlbnMwIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMQogICAgICBpZmFjZSBlbnMxIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMyCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMgogICAgICBpZmFjZSBlbnMyIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMzCiAgICAgIGFsbG93LWhvdHBsdWcgZW5zMwogICAgICBpZmFjZSBlbnMzIGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM0CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNAogICAgICBpZmFjZSBlbnM0IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM1CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNQogICAgICBpZmFjZSBlbnM1IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM2CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNgogICAgICBpZmFjZSBlbnM2IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM3CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zNwogICAgICBpZmFjZSBlbnM3IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM4CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOAogICAgICBpZmFjZSBlbnM4IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnM5CiAgICAgIGFsbG93LWhvdHBsdWcgZW5zOQogICAgICBpZmFjZSBlbnM5IGluZXQgZGhjcAogICAgICAKICAgICAgYXV0byBlbnMxMAogICAgICBhbGxvdy1ob3RwbHVnIGVuczEwCiAgICAgIGlmYWNlIGVuczEwIGluZXQgZGhjcAoKIyMj";
@BeforeClass
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
@Test
public void deprovisionEverything() {
CachedResourceSet.getCache().clear();
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/Empty.occic"));
Connector conn = new MartConnector("192.168.35.45", 8080, "ubuntu", "~/key.pem");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
}
}
/**
*
*/
/**
* Main package that includes MOCCI live tests.
*
* @author erbel
*
*/
package de.ugoe.cs.rwm.mocci.live;
No preview for this file type
File deleted
File added