diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..70eaec6 --- /dev/null +++ b/.classpath @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..367d621 --- /dev/null +++ b/.project @@ -0,0 +1,42 @@ + + + dataminer-pool-manager + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..fcdc9dc --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..839d647 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..443e085 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..c53dd14 --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..cc81385 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..2afeca5 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 0000000..04cad8c --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/0e558010-c4af-458a-b6ba-532f200d9db8 b/0e558010-c4af-458a-b6ba-532f200d9db8 new file mode 100644 index 0000000..1100bf3 --- /dev/null +++ b/0e558010-c4af-458a-b6ba-532f200d9db8 @@ -0,0 +1,4 @@ + + + + diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/distro/descriptor.xml b/distro/descriptor.xml index acb4e40..7e10090 100644 --- a/distro/descriptor.xml +++ b/distro/descriptor.xml @@ -28,7 +28,7 @@ - target/${build.finalName}.jar + target/${build.finalName}.war /${artifactId} diff --git a/f7ba9c3a-6e2c-4d90-8136-959d71b5b4d1 b/f7ba9c3a-6e2c-4d90-8136-959d71b5b4d1 new file mode 100644 index 0000000..1100bf3 --- /dev/null +++ b/f7ba9c3a-6e2c-4d90-8136-959d71b5b4d1 @@ -0,0 +1,4 @@ + + + + diff --git a/log b/log new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml index 7016e33..37fe797 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.dataanalysis dataminer-pool-manager 1.0.0-SNAPSHOT - jar + war dataminer-pool-manager @@ -44,6 +44,36 @@ ic-client provided + + org.yaml + snakeyaml + 1.16 + + + org.glassfish.jersey.media + jersey-media-json-jackson + 2.23.1 + + + org.glassfish.jersey.core + jersey-client + 2.22.1 + + + + org.glassfish.jersey.containers + jersey-container-servlet + 2.22.1 + + + + org.slf4j + slf4j-api + provided + + + + diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/AnsibleWorker.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/AnsibleWorker.java similarity index 78% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/AnsibleWorker.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/AnsibleWorker.java index 3ac51ca..ac4448d 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/AnsibleWorker.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/AnsibleWorker.java @@ -1,14 +1,12 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible; import java.io.File; import java.io.IOException; -import java.util.UUID; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Inventory; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Playbook; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleSerializeHelper; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Inventory; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Playbook; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper; /** * This class is responsible for the interface with ansible, retrieving log, @@ -45,11 +43,11 @@ public class AnsibleWorker { this.ensureWorkStructure(); } - private File getWorkdir() { + public File getWorkdir() { return this.workerRoot; } - private File getRolesDir() { + public File getRolesDir() { return new File(this.getWorkdir(), ROLES_DIR); } @@ -57,12 +55,12 @@ public class AnsibleWorker { return this.workerRoot.getName(); } - private void ensureWorkStructure() { + public void ensureWorkStructure() { // generate root this.getWorkdir().mkdirs(); } - private void removeWorkStructure() { + public void removeWorkStructure() { // remove the working dir // this.getWorkdir().delete(); } @@ -91,6 +89,8 @@ public class AnsibleWorker { AnsibleSerializeHelper.serializeRole(r, this.getRolesDir()); } + + public void apply() { // TODO execute the playbook and return output System.out.println("TODO: execute: ansible-playbook -v -i " + this.getInventoryFile().getName() + " " + this.getPlaybookFile().getName()); diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/AnsibleHost.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/AnsibleHost.java similarity index 77% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/AnsibleHost.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/AnsibleHost.java index b6003c2..9ed34b3 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/AnsibleHost.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/AnsibleHost.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; public class AnsibleHost { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/HostGroup.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/HostGroup.java similarity index 86% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/HostGroup.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/HostGroup.java index c3dd3c9..077e1a1 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/HostGroup.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/HostGroup.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Inventory.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Inventory.java similarity index 91% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Inventory.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Inventory.java index 51b835d..4d6400d 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Inventory.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Inventory.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Playbook.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Playbook.java similarity index 88% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Playbook.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Playbook.java index 9e045dd..ca5ca47 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Playbook.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Playbook.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; import java.util.List; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Role.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Role.java similarity index 92% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Role.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Role.java index b62a697..3f3aa33 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/Role.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/Role.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/RoleFile.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/RoleFile.java similarity index 92% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/RoleFile.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/RoleFile.java index ca67396..3cff918 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansible/model/RoleFile.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansible/model/RoleFile.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansible.model; +package org.gcube.dataanalysis.dataminer.poolmanager.ansible.model; public class RoleFile { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleBridge.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleBridge.java similarity index 68% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleBridge.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleBridge.java index 0ad1019..29ad20c 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleBridge.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleBridge.java @@ -1,7 +1,9 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.PrintStream; import java.util.Collection; import java.util.List; import java.util.Map; @@ -11,38 +13,37 @@ import java.util.TreeSet; import java.util.UUID; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.AnsibleWorker; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.AnsibleHost; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Inventory; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Playbook; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.AlgorithmPackage; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.CranDependencyPackage; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.CustomDependencyPackage; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.CustomRoleManager; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.DependencyPackage; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.OSDependencyPackage; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.StaticRoleManager; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template.TemplateManager; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.AlgorithmSet; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Cluster; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Host; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator.AlgorithmComparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator.DependencyComparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator.HostComparator; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.AnsibleWorker; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.AnsibleHost; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Inventory; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Playbook; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.AlgorithmPackage; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.CranDependencyPackage; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.CustomDependencyPackage; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.CustomRoleManager; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.OSDependencyPackage; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.StaticRoleManager; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template.TemplateManager; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.comparator.HostComparator; +import org.slf4j.LoggerFactory; public class AnsibleBridge { + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(AnsibleBridge.class); + /** * The workdir for this service */ private String dpmRoot; public AnsibleBridge() { - this("/home/paolo/tmp/dataminer-pool-manager"); + this("/tmp/dataminer-pool-manager"); } public AnsibleBridge(String root) { @@ -142,9 +143,16 @@ public class AnsibleBridge { } } - public void applyAlgorithmSetToCluster(AlgorithmSet as, Cluster cluster) throws IOException { - AnsibleWorker worker = new AnsibleWorker(new File(this.getWorkDir(), UUID.randomUUID().toString())); + public AnsibleWorker applyAlgorithmSetToCluster(AlgorithmSet as, Cluster cluster) throws IOException { + + + return applyAlgorithmSetToCluster (as,cluster,UUID.randomUUID().toString()); + } + + public AnsibleWorker applyAlgorithmSetToCluster(AlgorithmSet as, Cluster cluster,String uuid) throws IOException { + AnsibleWorker worker = new AnsibleWorker(new File(this.getWorkDir(), uuid)); + List algoRoles = new Vector<>(); // add algorithms and dependencies to the worker @@ -186,14 +194,26 @@ public class AnsibleBridge { worker.setPlaybook(playbook); - // execute - worker.apply(); - + // execute and save log locally + PrintStream console = System.out; + File path = new File(worker.getWorkdir() + File.separator + "logs"); + path.mkdirs(); + File n = new File(path + File.separator + worker.getWorkerId()); + FileOutputStream fos = new FileOutputStream(n); + PrintStream ps = new PrintStream(fos); + System.setOut(ps); + worker.apply(); + System.setOut(console); + worker.apply(); + System.out.println("Log stored to to " + n.getAbsolutePath()); + // destroy the worker worker.destroy(); - + return worker; } + + private TemplateManager getTemplateManager() { return new TemplateManager(this.dpmRoot+"/templates"); } diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleSerializeHelper.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleSerializeHelper.java similarity index 85% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleSerializeHelper.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleSerializeHelper.java index ff432b3..4a8b697 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/AnsibleSerializeHelper.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/AnsibleSerializeHelper.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge; import java.io.File; import java.io.FileInputStream; @@ -7,12 +7,12 @@ import java.io.IOException; import java.io.PrintWriter; import org.apache.commons.io.IOUtils; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.AnsibleHost; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.HostGroup; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Inventory; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Playbook; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.AnsibleHost; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.HostGroup; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Inventory; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Playbook; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.RoleFile; public class AnsibleSerializeHelper { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/AlgorithmPackage.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/AlgorithmPackage.java similarity index 84% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/AlgorithmPackage.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/AlgorithmPackage.java index b6c9153..f4ac0bd 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/AlgorithmPackage.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/AlgorithmPackage.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.util.Collection; import java.util.HashMap; @@ -6,10 +6,9 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; public class AlgorithmPackage { diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CranDependencyPackage.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CranDependencyPackage.java new file mode 100644 index 0000000..baa4910 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CranDependencyPackage.java @@ -0,0 +1,11 @@ +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; + +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; + +public class CranDependencyPackage extends DependencyPackage { + + public CranDependencyPackage(Dependency d) { + super(d); + } + +} diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomDependencyPackage.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomDependencyPackage.java similarity index 89% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomDependencyPackage.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomDependencyPackage.java index a316326..a00d08a 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomDependencyPackage.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomDependencyPackage.java @@ -1,11 +1,11 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.util.Collection; import java.util.NoSuchElementException; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; public class CustomDependencyPackage extends DependencyPackage { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomRoleManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomRoleManager.java similarity index 58% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomRoleManager.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomRoleManager.java index d06bdd5..e33d6e8 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CustomRoleManager.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/CustomRoleManager.java @@ -1,16 +1,11 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; -import java.util.Collection; import java.util.NoSuchElementException; -import java.util.Vector; -import org.apache.commons.io.IOUtils; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleSerializeHelper; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper; public class CustomRoleManager { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/DependencyPackage.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/DependencyPackage.java similarity index 83% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/DependencyPackage.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/DependencyPackage.java index c370eb4..909038e 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/DependencyPackage.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/DependencyPackage.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.util.Collection; import java.util.HashMap; @@ -6,9 +6,8 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; public class DependencyPackage { diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/OSDependencyPackage.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/OSDependencyPackage.java new file mode 100644 index 0000000..02fb3d2 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/OSDependencyPackage.java @@ -0,0 +1,11 @@ +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; + +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; + +public class OSDependencyPackage extends DependencyPackage { + + public OSDependencyPackage(Dependency d) { + super(d); + } + +} diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/StaticRoleManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/StaticRoleManager.java similarity index 73% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/StaticRoleManager.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/StaticRoleManager.java index 437a324..3c4607f 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/StaticRoleManager.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/StaticRoleManager.java @@ -1,12 +1,12 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleSerializeHelper; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper; public class StaticRoleManager { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/TemplateManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/TemplateManager.java similarity index 84% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/TemplateManager.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/TemplateManager.java index 556b9e2..73fbf2c 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/TemplateManager.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/ansiblebridge/template/TemplateManager.java @@ -1,17 +1,13 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; +package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; -import java.util.HashMap; import java.util.Map; import java.util.NoSuchElementException; -import org.apache.commons.io.IOUtils; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleSerializeHelper; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.RoleFile; +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper; import org.stringtemplate.v4.ST; public class TemplateManager { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/clients/ISClient.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/clients/ISClient.java similarity index 85% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/clients/ISClient.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/clients/ISClient.java index 217a00a..6fc598e 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/clients/ISClient.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/clients/ISClient.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.clients; +package org.gcube.dataanalysis.dataminer.poolmanager.clients; import static org.gcube.resources.discovery.icclient.ICFactory.clientFor; import static org.gcube.resources.discovery.icclient.ICFactory.queryFor; @@ -8,9 +8,7 @@ import java.util.List; import java.util.Vector; import org.gcube.common.resources.gcore.ServiceEndpoint; -import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Cluster; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Host; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host; import org.gcube.resources.discovery.client.api.DiscoveryClient; import org.gcube.resources.discovery.client.queries.api.SimpleQuery; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Action.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Action.java similarity index 88% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Action.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Action.java index 29dfa35..cbccd2c 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Action.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Action.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; public class Action { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Algorithm.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Algorithm.java similarity index 97% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Algorithm.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Algorithm.java index 90953e2..20d4d1b 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Algorithm.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Algorithm.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/AlgorithmSet.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/AlgorithmSet.java similarity index 93% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/AlgorithmSet.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/AlgorithmSet.java index 7f9a5ee..f85572a 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/AlgorithmSet.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/AlgorithmSet.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Cluster.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Cluster.java similarity index 95% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Cluster.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Cluster.java index 0b33f29..8409b40 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Cluster.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Cluster.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; import java.util.Collection; import java.util.Vector; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Dependency.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Dependency.java similarity index 85% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Dependency.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Dependency.java index ef6b1ce..7f9616e 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Dependency.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Dependency.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; public class Dependency { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Domain.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Domain.java similarity index 72% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Domain.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Domain.java index 73caed7..49f463b 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Domain.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Domain.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; public class Domain { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Host.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Host.java similarity index 90% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Host.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Host.java index 081cfe9..50eec21 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/Host.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Host.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; public class Host { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/AlgorithmComparator.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/AlgorithmComparator.java similarity index 60% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/AlgorithmComparator.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/AlgorithmComparator.java index 69eeef3..024c2d5 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/AlgorithmComparator.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/AlgorithmComparator.java @@ -1,8 +1,8 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel.comparator; import java.util.Comparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; public class AlgorithmComparator implements Comparator { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/DependencyComparator.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/DependencyComparator.java similarity index 58% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/DependencyComparator.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/DependencyComparator.java index b570313..abbfbbd 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/DependencyComparator.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/DependencyComparator.java @@ -1,9 +1,8 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel.comparator; import java.util.Comparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; public class DependencyComparator implements Comparator { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/HostComparator.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/HostComparator.java similarity index 68% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/HostComparator.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/HostComparator.java index ffbd4d8..1e159b8 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/datamodel/comparator/HostComparator.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/comparator/HostComparator.java @@ -1,8 +1,8 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator; +package org.gcube.dataanalysis.dataminer.poolmanager.datamodel.comparator; import java.util.Comparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Host; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host; public class HostComparator implements Comparator { diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AddAlgorithmCommand.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AddAlgorithmCommand.java similarity index 97% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AddAlgorithmCommand.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AddAlgorithmCommand.java index 7edd1de..b6b3c27 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AddAlgorithmCommand.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AddAlgorithmCommand.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.process; +package org.gcube.dataanalysis.dataminer.poolmanager.process; import java.util.StringTokenizer; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AlgorithmPackageParser.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java similarity index 96% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AlgorithmPackageParser.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java index cb6cd50..b71af41 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/process/AlgorithmPackageParser.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.process; +package org.gcube.dataanalysis.dataminer.poolmanager.process; import java.io.IOException; import java.io.InputStream; @@ -10,8 +10,8 @@ import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; public class AlgorithmPackageParser { diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/PoolManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/PoolManager.java new file mode 100644 index 0000000..600c188 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/PoolManager.java @@ -0,0 +1,24 @@ +package org.gcube.dataanalysis.dataminer.poolmanager.rest; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.UnknownHostException; + +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; + +public interface PoolManager { + + String addAlgorithmToVRE(Algorithm algo, String vre) throws IOException, InterruptedException; + + Algorithm extractAlgorithm(String url) throws IOException; + + String getLogById(String logId) throws IOException; + + void getLogId(Algorithm algo, String vre); + + String getScriptFromURL(URL logId) throws IOException; + + URL getURLfromWorkerLog(String logUrl) throws MalformedURLException, UnknownHostException; + +} diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java new file mode 100644 index 0000000..fd13218 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java @@ -0,0 +1,101 @@ +package org.gcube.dataanalysis.dataminer.poolmanager.rest; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.UnknownHostException; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; + +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.service.DataminerPoolManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +@Path("/") +public class RestPoolManager implements PoolManager { + + private static final Logger LOGGER = LoggerFactory.getLogger(RestPoolManager.class); + + private PoolManager service = new DataminerPoolManager(); + + + @GET + @Path("/add") + @Produces("text/plain") + public String addAlgorithmToVRE(@QueryParam("algorithm") String algorithm, @QueryParam("vre") String vre) throws IOException, InterruptedException { + // TODO Auto-generated method stub + LOGGER.debug("Adding algorithm =" + algorithm + " to VRE =" + vre); + Algorithm algo = service.extractAlgorithm(algorithm); + return service.addAlgorithmToVRE(algo, vre); + } + + + @GET + @Path("/log") + @Produces("text/plain") + public String getLogById(@QueryParam("logUrl") String logUrl) throws IOException { + // TODO Auto-generated method stub + LOGGER.debug("Returning Log =" + logUrl); + return service.getScriptFromURL(service.getURLfromWorkerLog(logUrl)); + } + + + + + + @Override + public Algorithm extractAlgorithm(String url) throws IOException { + // TODO Auto-generated method stub + return null; + } + + + public static void main(String[] args) throws IOException, InterruptedException { + RestPoolManager a = new RestPoolManager(); + a.addAlgorithmToVRE("http://data.d4science.org/R0FqV2lNOW1jMkxuUEIrWXY4aUhvSENHSmVMQks4NjdHbWJQNStIS0N6Yz0", "/gcube/devNext/NextNext"); + //System.out.println(a.getLogById("dadcb059-69e5-48c3-aa58-3b290ae0419d")); + } + + + @Override + public void getLogId(Algorithm algo, String vre) { + // TODO Auto-generated method stub + + } + + + @Override + public String getScriptFromURL(URL logId) throws IOException { + // TODO Auto-generated method stub + return null; + } + + + @Override + public String addAlgorithmToVRE(Algorithm algo, String vre) throws IOException, InterruptedException { + // TODO Auto-generated method stub + return null; + } + + + @Override + public URL getURLfromWorkerLog(String logUrl) throws MalformedURLException, UnknownHostException { + // TODO Auto-generated method stub + return null; + } + + + + + + + + + + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java new file mode 100644 index 0000000..0a7f87c --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java @@ -0,0 +1,265 @@ +package org.gcube.dataanalysis.dataminer.poolmanager.service; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.UnknownHostException; +import java.util.UUID; + +import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleBridge; +import org.gcube.dataanalysis.dataminer.poolmanager.clients.ISClient; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host; +import org.gcube.dataanalysis.dataminer.poolmanager.process.AlgorithmPackageParser; +import org.gcube.dataanalysis.dataminer.poolmanager.rest.PoolManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataminerPoolManager implements PoolManager { + + + private static final Logger LOGGER = LoggerFactory.getLogger(DataminerPoolManager.class); + + +// static Collection algorithms; +// +// static Collection sets; +// +// static { +// algorithms = new Vector<>(); +// } +// +// public DataminerPoolManager() { +// } +// +// /** +// * Add a new algorithm to the set of known ones. No further action is expected +// * on the pool. +// */ +// public void publishAlgorithm(Algorithm algorithm) { +// algorithms.add(algorithm); +// } +// +// /** +// * Re-deploy the given algorithm wherever it's installed +// * +// * @param algorithm +// */ +// /* +// * public void updateAlgorithm(Algorithm algorithm) { // TODO implement this } +// */ +// +// /** +// * Add the give algorithm to the given set +// * +// * @param algorithmId +// * @param setId +// */ +// public void addAlgorithmToSet(String algorithmName, String setName) { +// AlgorithmSet set = this.getAlgorithmSet(setName); +// Algorithm algorithm = this.getAlgorithm(algorithmName); +// if (set != null && algorithm != null) { +// set.addAlgorithm(algorithm); +// this.updateClusters(); +// } +// } +// +// /** +// * Apply the given set of algorithms to the given cluster +// * +// * @param setId +// * @param clusterId +// */ +// public void applyAlgorithmSetToCluster(String setName, String clusterName) { +// AlgorithmSet set = this.getAlgorithmSet(setName); +// Cluster cluster = new ISClient().getCluster(clusterName); +// if (set != null && cluster != null) { +// cluster.addAlgorithmSet(set); +// this.updateClusters(); +// } +// } +// +// private AlgorithmSet getAlgorithmSet(String name) { +// for (AlgorithmSet set : sets) { +// if (name.equals(set.getName())) { +// return set; +// } +// } +// return null; +// } +// +// private Algorithm getAlgorithm(String name) { +// for (Algorithm a : algorithms) { +// if (name.equals(a.getName())) { +// return a; +// } +// } +// return null; +// } + + + + +// +// public void getLogId(final Algorithm algorithm, final String vre) { +// new Thread() { +// public void run() { +// while (true) { +// try { +// addAlgorithmToVRE(algorithm, vre); +// } catch (Exception e) { +// //log here +// } +// } +// } +// }.start(); +// } +// +// + +// public String getLogId(){ +// PrintStream console = System.out; +// File path = new File(worker.getWorkdir() + File.separator + "logs"); +// path.mkdirs(); +// File n = new File(path + File.separator + worker.getWorkerId()); +// FileOutputStream fos = new FileOutputStream(n); +// PrintStream ps = new PrintStream(fos); +// System.setOut(ps); +// worker.apply(); +// System.setOut(console); +// worker.apply(); +// System.out.println("Log stored to to " + n.getAbsolutePath()); +// } + + + + +// public String getLogById(String id) throws IOException { +// String strLine = null; +// try{ +// FileInputStream fstream = new FileInputStream("/tmp/dataminer-pool-manager/work/"+id+"/logs/"+id); +// BufferedReader br = new BufferedReader(new InputStreamReader(fstream)); +// /* read log line by line */ +// while ((strLine = br.readLine()) != null) { +// /* parse strLine to obtain what you want */ +// System.out.println (strLine); +// } +// br.close(); +// } catch (Exception e) { +// System.err.println("Error: " + e.getMessage()); +// } +// return strLine; +// } + + + public String getScriptFromURL(URL url) throws IOException { + if (url == null) { + return null; + } + URLConnection yc = url.openConnection(); + BufferedReader input = new BufferedReader(new InputStreamReader( + yc.getInputStream())); + String line; + StringBuffer buffer = new StringBuffer(); + while ((line = input.readLine()) != null) { + buffer.append(line + "\n"); + } + String bufferScript = buffer.substring(0, buffer.length()); + input.close(); + return bufferScript; + } + + + + + + /** + * Publish the given algorithm in the given VRE + * + * @param algorithmName + * @param vre + * + */ + public String addAlgorithmToVRE(Algorithm algorithm, final String vre) throws IOException { + // create a fake algorithm set + final AlgorithmSet algoSet = new AlgorithmSet(); + algoSet.setName("fake"); + algoSet.addAlgorithm(algorithm); + final String uuid = UUID.randomUUID().toString(); + + Runnable r = new Runnable() { + @Override + public void run() { + // TODO Auto-generated method stub + try { + addAlgorithmsToVRE(algoSet, vre, uuid); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }; + new Thread(r).start(); + //this line will execute immediately, not waiting for your task to complete + System.out.println(uuid); + return uuid; + } + + + + public URL getURLfromWorkerLog(String a) throws MalformedURLException, UnknownHostException{ + + File path = new File("/tmp/dataminer-pool-manager/work/" + File.separator + a+File.separator +"logs"); + path.mkdirs(); + File n = new File(path + File.separator +a); + + //String addr = InetAddress.getLocalHost().getHostAddress(); + + return new File(n.getPath()).toURI().toURL(); + } + + + public String addAlgorithmsToVRE(AlgorithmSet algorithms, String vre, String uuid) throws IOException { + + // create the cluster (dataminers in the vre) + Cluster cluster = new Cluster(); + for(Host h:new ISClient().listDataminersInVRE()) { + cluster.addHost(h); + } + + // apply the changes + AnsibleBridge a = new AnsibleBridge(); + + return a.applyAlgorithmSetToCluster(algorithms, cluster,uuid).getWorkerId(); + + } + + public Algorithm extractAlgorithm(String url) throws IOException { + return new AlgorithmPackageParser().parsePackage(url); + } + + +@Override +public void getLogId(Algorithm algo, String vre) { + // TODO Auto-generated method stub + +} + + +@Override +public String getLogById(String logId) throws IOException { + // TODO Auto-generated method stub + return null; +} + + + + + +} diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/util/PropertiesBasedProxySelector.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/PropertiesBasedProxySelector.java similarity index 98% rename from src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/util/PropertiesBasedProxySelector.java rename to src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/PropertiesBasedProxySelector.java index 3f47f74..924a995 100644 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/util/PropertiesBasedProxySelector.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/PropertiesBasedProxySelector.java @@ -1,4 +1,4 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.util; +package org.gcube.dataanalysis.dataminer.poolmanager.util; import java.io.IOException; import java.net.Authenticator; diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CranDependencyPackage.java b/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CranDependencyPackage.java deleted file mode 100644 index 8c38dfb..0000000 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/CranDependencyPackage.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; - -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; - -public class CranDependencyPackage extends DependencyPackage { - - public CranDependencyPackage(Dependency d) { - super(d); - } - -} diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/OSDependencyPackage.java b/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/OSDependencyPackage.java deleted file mode 100644 index dbf0af5..0000000 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/ansiblebridge/template/OSDependencyPackage.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.template; - -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; - -public class OSDependencyPackage extends DependencyPackage { - - public OSDependencyPackage(Dependency d) { - super(d); - } - -} diff --git a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/service/DataminerPoolManager.java b/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/service/DataminerPoolManager.java deleted file mode 100644 index f3f5fb8..0000000 --- a/src/main/java/org/gcube/dataanalysys/dataminerpoolmanager/service/DataminerPoolManager.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.gcube.dataanalysys.dataminerpoolmanager.service; - -import java.io.IOException; -import java.util.Collection; -import java.util.Vector; - -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleBridge; -import org.gcube.dataanalysys.dataminerpoolmanager.clients.ISClient; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.AlgorithmSet; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Cluster; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Host; - -public class DataminerPoolManager { - -// static Collection algorithms; -// -// static Collection sets; -// -// static { -// algorithms = new Vector<>(); -// } -// -// public DataminerPoolManager() { -// } -// -// /** -// * Add a new algorithm to the set of known ones. No further action is expected -// * on the pool. -// */ -// public void publishAlgorithm(Algorithm algorithm) { -// algorithms.add(algorithm); -// } -// -// /** -// * Re-deploy the given algorithm wherever it's installed -// * -// * @param algorithm -// */ -// /* -// * public void updateAlgorithm(Algorithm algorithm) { // TODO implement this } -// */ -// -// /** -// * Add the give algorithm to the given set -// * -// * @param algorithmId -// * @param setId -// */ -// public void addAlgorithmToSet(String algorithmName, String setName) { -// AlgorithmSet set = this.getAlgorithmSet(setName); -// Algorithm algorithm = this.getAlgorithm(algorithmName); -// if (set != null && algorithm != null) { -// set.addAlgorithm(algorithm); -// this.updateClusters(); -// } -// } -// -// /** -// * Apply the given set of algorithms to the given cluster -// * -// * @param setId -// * @param clusterId -// */ -// public void applyAlgorithmSetToCluster(String setName, String clusterName) { -// AlgorithmSet set = this.getAlgorithmSet(setName); -// Cluster cluster = new ISClient().getCluster(clusterName); -// if (set != null && cluster != null) { -// cluster.addAlgorithmSet(set); -// this.updateClusters(); -// } -// } -// -// private AlgorithmSet getAlgorithmSet(String name) { -// for (AlgorithmSet set : sets) { -// if (name.equals(set.getName())) { -// return set; -// } -// } -// return null; -// } -// -// private Algorithm getAlgorithm(String name) { -// for (Algorithm a : algorithms) { -// if (name.equals(a.getName())) { -// return a; -// } -// } -// return null; -// } - - /** - * Publish the given algorithm in the given VRE - * - * @param algorithmName - * @param vre - */ - public void addAlgorithmToVRE(Algorithm algorithm, String vre) throws IOException { - - // create a fake algorithm set - AlgorithmSet algoSet = new AlgorithmSet(); - algoSet.setName("fake"); - algoSet.addAlgorithm(algorithm); - - this.addAlgorithmsToVRE(algoSet, vre); - } - - public void addAlgorithmsToVRE(AlgorithmSet algorithms, String vre) throws IOException { - - // create the cluster (dataminers in the vre) - Cluster cluster = new Cluster(); - for(Host h:new ISClient().listDataminersInVRE()) { - cluster.addHost(h); - } - - // apply the changes - new AnsibleBridge().applyAlgorithmSetToCluster(algorithms, cluster); - - } - -} diff --git a/src/main/webapp/WEB-INF/gcube-app.xml b/src/main/webapp/WEB-INF/gcube-app.xml new file mode 100644 index 0000000..15f231c --- /dev/null +++ b/src/main/webapp/WEB-INF/gcube-app.xml @@ -0,0 +1,13 @@ + + + dataminer-pool-manager + dataanalysis + 0.0.1 + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/gcube-handlers.xml b/src/main/webapp/WEB-INF/gcube-handlers.xml new file mode 100644 index 0000000..c294252 --- /dev/null +++ b/src/main/webapp/WEB-INF/gcube-handlers.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..4c42390 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + Archetype Created Web Application + + + + REST-API + org.glassfish.jersey.servlet.ServletContainer + + jersey.config.server.provider.packages + org.gcube.dataanalysis.dataminer.poolmanager.rest + + 1 + + + + REST-API + /rest/* + + + diff --git a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AlgorithmPackageParserTest.java b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AlgorithmPackageParserTest.java index b9dda4d..29a5eab 100644 --- a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AlgorithmPackageParserTest.java +++ b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AlgorithmPackageParserTest.java @@ -7,12 +7,11 @@ import java.net.URL; import java.util.List; import java.util.Vector; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.AlgorithmSet; -import org.gcube.dataanalysys.dataminerpoolmanager.process.AddAlgorithmCommand; -import org.gcube.dataanalysys.dataminerpoolmanager.process.AlgorithmPackageParser; -import org.gcube.dataanalysys.dataminerpoolmanager.service.DataminerPoolManager; -import org.gcube.dataanalysys.dataminerpoolmanager.util.PropertiesBasedProxySelector; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet; +import org.gcube.dataanalysis.dataminer.poolmanager.process.AddAlgorithmCommand; +import org.gcube.dataanalysis.dataminer.poolmanager.process.AlgorithmPackageParser; +import org.gcube.dataanalysis.dataminer.poolmanager.util.PropertiesBasedProxySelector; public class AlgorithmPackageParserTest { @@ -48,8 +47,9 @@ public class AlgorithmPackageParserTest { algorithms.addAlgorithm(algo); break; } - new DataminerPoolManager().addAlgorithmsToVRE(algorithms, - "/gcube/devNext/NextNext"); + //to uncomment + // new DataminerPoolManager().addAlgorithmsToVRE(algorithms, + // "/gcube/devNext/NextNext"); } /** @@ -111,7 +111,7 @@ public class AlgorithmPackageParserTest { public static void main(String[] args) throws Exception { ProxySelector.setDefault(new PropertiesBasedProxySelector( - "/home/paolo/.proxy-settings")); + "/home/ngalante/.proxy-settings")); new AlgorithmPackageParserTest().extractAllAlgorithms(); } diff --git a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AnsibleWorkerTest.java b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AnsibleWorkerTest.java index 83a84c6..5bd76d9 100644 --- a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AnsibleWorkerTest.java +++ b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/AnsibleWorkerTest.java @@ -4,11 +4,11 @@ import java.io.File; import java.io.IOException; import java.util.UUID; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.AnsibleWorker; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Inventory; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Playbook; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.RoleFile; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.AnsibleWorker; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Inventory; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Playbook; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role; +import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.RoleFile; public class AnsibleWorkerTest { diff --git a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/DataminerPoolManagerTest.java b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/DataminerPoolManagerTest.java index fe6b19f..e9a7f5c 100644 --- a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/DataminerPoolManagerTest.java +++ b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/DataminerPoolManagerTest.java @@ -1,26 +1,12 @@ package org.gcube.dataanalysis.dataminerpoolmanager; import java.net.ProxySelector; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeSet; -import java.util.Vector; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.AnsibleWorker; -import org.gcube.dataanalysys.dataminerpoolmanager.ansible.model.Role; -import org.gcube.dataanalysys.dataminerpoolmanager.ansiblebridge.AnsibleBridge; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Algorithm; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.AlgorithmSet; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Cluster; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Dependency; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Domain; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.Host; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator.AlgorithmComparator; -import org.gcube.dataanalysys.dataminerpoolmanager.datamodel.comparator.DependencyComparator; -import org.gcube.dataanalysys.dataminerpoolmanager.service.DataminerPoolManager; -import org.gcube.dataanalysys.dataminerpoolmanager.util.PropertiesBasedProxySelector; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet; +import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency; +import org.gcube.dataanalysis.dataminer.poolmanager.util.PropertiesBasedProxySelector; public class DataminerPoolManagerTest { @@ -173,7 +159,7 @@ public class DataminerPoolManagerTest { ScopeProvider.instance.set("/gcube/devNext/NextNext"); - ProxySelector.setDefault(new PropertiesBasedProxySelector("/home/paolo/.proxy-settings")); + ProxySelector.setDefault(new PropertiesBasedProxySelector("/home/ngalante/.proxy-settings")); // create the algorithm (download it, etc etc) Algorithm algorithm = new Algorithm(); @@ -225,7 +211,7 @@ public class DataminerPoolManagerTest { ensemble.addDependency(d); algorithms.addAlgorithm(ensemble); - new DataminerPoolManager().addAlgorithmsToVRE(algorithms, "/gcube/devNext/NextNext"); + //new DataminerPoolManager().addAlgorithmsToVRE(algorithms, "/gcube/devNext/NextNext"); } diff --git a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/ISClientTest.java b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/ISClientTest.java index 1fa39ae..211fd04 100644 --- a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/ISClientTest.java +++ b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/ISClientTest.java @@ -3,13 +3,13 @@ package org.gcube.dataanalysis.dataminerpoolmanager; import java.net.ProxySelector; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.dataanalysys.dataminerpoolmanager.clients.ISClient; -import org.gcube.dataanalysys.dataminerpoolmanager.util.PropertiesBasedProxySelector; +import org.gcube.dataanalysis.dataminer.poolmanager.clients.ISClient; +import org.gcube.dataanalysis.dataminer.poolmanager.util.PropertiesBasedProxySelector; public class ISClientTest { public static void main(String[] args) { - ProxySelector.setDefault(new PropertiesBasedProxySelector("/home/paolo/.proxy-settings")); + ProxySelector.setDefault(new PropertiesBasedProxySelector("/home/ngalante/.proxy-settings")); ScopeProvider.instance.set("/gcube/devNext/NextNext"); System.out.println(new ISClient().listDataminersInVRE()); }