Skip to content
Snippets Groups Projects
Commit e8b43908 authored by erbel's avatar erbel
Browse files

Removed Example project

parent dcd2f6e1
No related branches found
No related tags found
No related merge requests found
Pipeline #85241 passed
Showing
with 1 addition and 1221 deletions
......@@ -110,7 +110,7 @@ project(':de.ugoe.cs.rwm.mocci.connector') {
project(':de.ugoe.cs.rwm.mocci.examples') {
dependencies {
//compile project(':de.ugoe.cs.rwm.mocci.model')
compile project(':de.ugoe.cs.rwm.mocci.model')
}
}
......
/de/
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>
# Created by https://www.gitignore.io/api/java,gradle
### Java ###
*.class
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle ###
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# End of https://www.gitignore.io/api/java,gradle
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>de.ugoe.cs.rwm.mocci.examples</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.sirius.nature.modelingproject</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=..
eclipse.preferences.version=1
#
#Fri Nov 09 16:28:19 CET 2018
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
apply plugin : 'eclipse'
apply plugin: 'java'
//apply plugin: 'osgi'
apply plugin: 'maven'
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
//mavenLocal()
mavenCentral()
// jcenter()
maven {
url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/"
}
maven {
url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/"
}
}
dependencies {
//Nexus
compile "org.eclipse.uml2:org.eclipse.uml2.uml:4.1.2"
//runtime?
compile "org.eclipse.uml2:org.eclipse.uml2.types:1.1.0"
compile "org.eclipse.uml2:org.eclipse.uml2.common:1.8.2"
compile group: 'org.eclipse.ocl', name: 'pivot', version: '1.3.0'
//occiware
compile group: 'org.eclipse.cmf.occi', name: 'core', version: '1.0.0'
compile group: 'org.eclipse.cmf.occi', name: 'infrastructure', version: '1.0.0'
compile group: 'org.eclipse.cmf.occi', name: 'crtp', version: '1.0.0'
//own
compile group: 'de.ugoe.cs.rwm', name: 'tocci', version: '1.0.0'
compile group: 'de.ugoe.cs.rwm', name: 'docci', version: '1.0.0'
compile group: 'de.ugoe.cs.rwm.wocci', name: 'model', version: '1.0.0'
//modmacao
compile group: 'org.modmacao', name: 'core', version: '1.0.0'
compile group: 'org.modmacao', name: 'placement', version: '1.0.0'
compile group: 'org.modmacao.occi', name: 'platform', version: '1.0.0'
compile group: 'org.modmacao.openstack', name: 'runtime', version: '1.0.0'
compile group: 'org.modmacao.openstack.swe', name: 'runtime', version: '1.0.0'
compile group: 'org.modmacao', name: 'ansible', version:'1.0.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
test {
testLogging.showStandardStreams = true
testLogging {
exceptionFormat = 'full'
}
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xmi:id="_W3jdEPb4EeiCiOA5ZDMQdg" version="12.1.0.201708031200">
<semanticResources>src/hadoopClusterOldExt.occic</semanticResources>
<semanticResources>http://schemas.ogf.org/occi/core</semanticResources>
<semanticResources>http://schemas.ogf.org/occi/infrastructure</semanticResources>
<semanticResources>http://schemas.modmacao.org/occi/platform</semanticResources>
<semanticResources>http://schemas.ogf.org/occi/infrastructure/compute/template/1.1</semanticResources>
<semanticResources>http://schemas.modmacao.org/placement</semanticResources>
<semanticResources>http://schemas.modmacao.org/openstack/runtime</semanticResources>
<semanticResources>http://schemas.modmacao.org/modmacao</semanticResources>
<semanticResources>http://schemas.modmacao.org/openstack/swe</semanticResources>
<semanticResources>http://schemas.ogf.org/occi/monitoring</semanticResources>
<semanticResources>src/hadoopClusterWithoutMonitoring.occic</semanticResources>
<semanticResources>src/test/resources/occi/Empty.occic</semanticResources>
<semanticResources>build/resources/test/occi/Empty.occic</semanticResources>
</viewpoint:DAnalysis>
/*
* This settings file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* In a single project build this file can be empty or even removed.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.3/userguide/multi_project_builds.html
*/
/*
// To declare projects as part of a multi-project build use the 'include' method
include 'shared'
include 'api'
include 'services:webservice'
*/
rootProject.name = 'de.ugoe.cs.rwm.mocci.examples'
This diff is collapsed.
This diff is collapsed.
de.ugoe.cs.rwm.mocci.examples/src/hadoopNewExt.jpg

694 KiB

de.ugoe.cs.rwm.mocci.examples/src/hadoopOldMonitoring.jpg

705 KiB

package de.ugoe.cs.rwm.mocci.examples;
/**Making javadoc happy.
* @author erbel
*
*/
public class ExampleClass {
/**Making javadoc happy.
* @param args Making javadoc happy.
*/
public static void main(String[] args) {
System.out.println("Hello world");
}
}
/**
*
*/
/**
* Main package that includes util classes as well as the monitoring interface.
*
* @author erbel
*
*/
package de.ugoe.cs.rwm.mocci.examples;
package de.ugoe.cs.rwm.mocci.examples;
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.EPackage;
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.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.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 monitoring.MonitoringPackage;
public class DeployHadoopMonitoringTest {
@BeforeClass
public static void OCCIRegistrySetup() {
TestUtility.loggerSetup();
TestUtility.extensionRegistrySetup();
}
//@Before
public void deprovisionEverything() {
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);
}
@Ignore
@Test
public void deployHadoopWithNewMonitoring() {
CachedResourceSet.getCache().clear();
System.out.println(OcciRegistry.getInstance().getRegisteredExtensions());
Logger.getRootLogger().setLevel(Level.FATAL);
Path occiPath = Paths.get(ModelUtility.getPathToResource("occi/hadoopClusterNewExt.occic"));
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
trans.transform(occiPath, occiPath);
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
assertTrue(TestUtility.equalsRuntime(occiPath, conn));
}
@Test
public void resolveProxies() {
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());
}
}
}
}
package de.ugoe.cs.rwm.mocci.examples;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.log4j.Level;
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.infrastructure.InfrastructurePackage;
import org.eclipse.emf.ecore.EObject;
import org.modmacao.ansibleconfiguration.AnsibleconfigurationPackage;
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 modmacao.ModmacaoPackage;
import monitoring.MonitoringPackage;
import openstackruntime.OpenstackruntimePackage;
import ossweruntime.OssweruntimePackage;
import workflow.WorkflowPackage;
public class TestUtility {
public static void extensionRegistrySetup() {
InfrastructurePackage.eINSTANCE.eClass();
OCCIPackage.eINSTANCE.eClass();
ModmacaoPackage.eINSTANCE.eClass();
OpenstackruntimePackage.eINSTANCE.eClass();
PlacementPackage.eINSTANCE.eClass();
WorkflowPackage.eINSTANCE.eClass();
OssweruntimePackage.eINSTANCE.eClass();
AnsibleconfigurationPackage.eINSTANCE.eClass();
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/modmacao#",
ModmacaoPackage.class.getClassLoader().getResource("model/modmacao.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/openstack/runtime#",
OpenstackruntimePackage.class.getClassLoader().getResource("model/openstackruntime.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/openstack/swe#",
OssweruntimePackage.class.getClassLoader().getResource("model/openstackruntime.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.modmacao.org/placement#",
PlacementPackage.class.getClassLoader().getResource("model/placement.occie").toString());
OcciRegistry.getInstance().registerExtension("http://schemas.ogf.org/occi/infrastructure#",
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());
}
public static void loggerSetup() {
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.FATAL);
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);
}
public static boolean equalsRuntime(Path desiredModelPath, Connector conn) {
Path deployedOCCI = Paths.get(System.getProperty("user.home") + "/.rwm/runtime.occic");
conn.loadRuntimeModel(deployedOCCI);
org.eclipse.emf.ecore.resource.Resource desiredModel = ModelUtility.loadOCCIintoEMFResource(desiredModelPath);
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;
}
}
# Use an official openjdk base image
FROM ubuntu:latest
# Set the working directory to /app
WORKDIR /mart
# Get all required packages and install the project
RUN apt-get update \
&& apt-get install -y git openjdk-8-jdk openjdk-8-jre wget openssh*
COPY /authorized_keys /root/.ssh/authorized_keys
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
# Copy the application and its configuration files
COPY /org.occiware.mart.jetty.jar /mart
COPY /startLocal.sh /mart
# Copy Mart-Plugins
COPY /martserver-plugins/ /root/martserver-plugins/
# Copy roles
COPY /roles/ /root/roles/
# Make ports 8080 available to the world outside this container
EXPOSE 8080
EXPOSE 22
# Start SSH and bash
ENTRYPOINT service ssh start && ./startLocal.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment