git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@160699 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
961a980369
commit
987afa2f0e
|
@ -10,13 +10,19 @@ import java.util.Vector;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
public class AlgorithmPackage ***REMOVED***
|
public class AlgorithmPackage ***REMOVED***
|
||||||
|
|
||||||
private Algorithm algorithm;
|
private Algorithm algorithm;
|
||||||
private boolean includeAlgorithmDependencies;
|
private boolean includeAlgorithmDependencies;
|
||||||
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies) ***REMOVED***
|
private Logger logger;
|
||||||
this.algorithm = a;
|
|
||||||
|
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies)
|
||||||
|
***REMOVED***
|
||||||
|
this.logger = LoggerFactory.getLogger(AlgorithmPackage.class);
|
||||||
|
this.algorithm = a;
|
||||||
this.includeAlgorithmDependencies = includeAlgorithmDependencies;
|
this.includeAlgorithmDependencies = includeAlgorithmDependencies;
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
@ -61,12 +67,13 @@ public class AlgorithmPackage ***REMOVED***
|
||||||
Role r = tm.fillRoleTemplate(template, dictionary);
|
Role r = tm.fillRoleTemplate(template, dictionary);
|
||||||
r.setName(roleName);
|
r.setName(roleName);
|
||||||
out.add(r);
|
out.add(r);
|
||||||
***REMOVED*** else ***REMOVED***
|
***REMOVED*** else
|
||||||
System.out.println("WARNING: template is null");
|
***REMOVED***
|
||||||
|
this.logger.warn("WARNING: template is null");
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||||
***REMOVED*** e.printStackTrace();
|
***REMOVED*** e.printStackTrace();
|
||||||
System.out.println("WARNING: no template found for " + roleName);
|
this.logger.warn("WARNING: no template found for " + roleName);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -6,16 +6,20 @@ import java.util.Vector;
|
||||||
|
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
public class CustomDependencyPackage extends DependencyPackage ***REMOVED***
|
public class CustomDependencyPackage extends DependencyPackage ***REMOVED***
|
||||||
|
|
||||||
public CustomDependencyPackage(Dependency d) ***REMOVED***
|
private Logger logger;
|
||||||
super(d);
|
|
||||||
|
public CustomDependencyPackage(Dependency dependency)
|
||||||
|
***REMOVED***
|
||||||
|
super(dependency);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
private String getCustomRepositoryLocation(String ansibleRoot) ***REMOVED***
|
***REMOVED*** private String getCustomRepositoryLocation(String ansibleRoot) ***REMOVED***
|
||||||
return ansibleRoot+"/custom";
|
***REMOVED*** return ansibleRoot+"/custom";
|
||||||
***REMOVED***
|
***REMOVED*** ***REMOVED***
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public void serializeTo(String ansibleRoot) ***REMOVED***
|
public void serializeTo(String ansibleRoot) ***REMOVED***
|
||||||
|
@ -54,7 +58,7 @@ public class CustomDependencyPackage extends DependencyPackage ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||||
***REMOVED*** e.printStackTrace();
|
***REMOVED*** e.printStackTrace();
|
||||||
System.out.println("WARNING: no custom role found for " + roleName);
|
this.logger.warn("WARNING: no custom role found for " + roleName);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -10,11 +10,7 @@ import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSeriali
|
||||||
|
|
||||||
public class CustomRoleManager ***REMOVED***
|
public class CustomRoleManager ***REMOVED***
|
||||||
|
|
||||||
private String root;
|
|
||||||
|
|
||||||
public CustomRoleManager() ***REMOVED***
|
|
||||||
|
|
||||||
***REMOVED***
|
|
||||||
|
|
||||||
public String getRoot() ***REMOVED***
|
public String getRoot() ***REMOVED***
|
||||||
String input = AnsibleBridge.class.getClassLoader().getResource("custom").getPath();
|
String input = AnsibleBridge.class.getClassLoader().getResource("custom").getPath();
|
||||||
|
|
|
@ -8,13 +8,18 @@ import java.util.Vector;
|
||||||
|
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
public class DependencyPackage ***REMOVED***
|
public class DependencyPackage ***REMOVED***
|
||||||
|
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
private Dependency dependency;
|
private Dependency dependency;
|
||||||
|
|
||||||
public DependencyPackage(Dependency d) ***REMOVED***
|
public DependencyPackage(Dependency dependency) ***REMOVED***
|
||||||
this.dependency = d;
|
this.dependency = dependency;
|
||||||
|
this.logger = LoggerFactory.getLogger(DependencyPackage.class);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
protected Map<String, String> getDictionary(Dependency d) ***REMOVED***
|
protected Map<String, String> getDictionary(Dependency d) ***REMOVED***
|
||||||
|
@ -42,11 +47,11 @@ public class DependencyPackage ***REMOVED***
|
||||||
r.setName(roleName);
|
r.setName(roleName);
|
||||||
out.add(r);
|
out.add(r);
|
||||||
***REMOVED*** else ***REMOVED***
|
***REMOVED*** else ***REMOVED***
|
||||||
System.out.println("WARNING: template is null");
|
this.logger.warn("WARNING: template is null");
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||||
***REMOVED*** e.printStackTrace();
|
***REMOVED*** e.printStackTrace();
|
||||||
System.out.println("WARNING: no template found for " + roleName);
|
this.logger.warn("WARNING: no template found for " + roleName);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -4,8 +4,8 @@ import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||||
|
|
||||||
public class OSDependencyPackage extends DependencyPackage ***REMOVED***
|
public class OSDependencyPackage extends DependencyPackage ***REMOVED***
|
||||||
|
|
||||||
public OSDependencyPackage(Dependency d) ***REMOVED***
|
public OSDependencyPackage(Dependency dependency) ***REMOVED***
|
||||||
super(d);
|
super(dependency);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -2,7 +2,6 @@ package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,20 @@ import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckPermission;
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckPermission;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
import au.com.bytecode.opencsv.CSVReader;
|
import au.com.bytecode.opencsv.CSVReader;
|
||||||
|
|
||||||
public class HAProxy ***REMOVED***
|
public class HAProxy ***REMOVED***
|
||||||
|
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
private CSVReader reader;
|
private CSVReader reader;
|
||||||
|
|
||||||
|
public HAProxy() ***REMOVED***
|
||||||
|
this.logger = LoggerFactory.getLogger(HAProxy.class);
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED*** public Cluster getClusterByHProxy() throws IOException ***REMOVED***
|
***REMOVED*** public Cluster getClusterByHProxy() throws IOException ***REMOVED***
|
||||||
***REMOVED*** Cluster cl = new Cluster();
|
***REMOVED*** Cluster cl = new Cluster();
|
||||||
***REMOVED*** String HProxy = ISClient.getHProxy();
|
***REMOVED*** String HProxy = ISClient.getHProxy();
|
||||||
|
@ -121,11 +129,11 @@ public class HAProxy ***REMOVED***
|
||||||
Host b = new Host();
|
Host b = new Host();
|
||||||
b.setName(nextLine[1]);
|
b.setName(nextLine[1]);
|
||||||
out.add(b);
|
out.add(b);
|
||||||
System.out.println(b.getFullyQualifiedName());
|
this.logger.info(b.getFullyQualifiedName());
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
System.out.println(out);
|
this.logger.info(out.toString());
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -3,29 +3,11 @@ package org.gcube.dataanalysis.dataminer.poolmanager.clients;
|
||||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Scanner;
|
|
||||||
***REMOVED***
|
|
||||||
import java.util.TreeMap;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
@ -34,12 +16,7 @@ import org.gcube.common.resources.gcore.Resources;
|
||||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Domain;
|
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.comparator.HostComparator;
|
|
||||||
***REMOVED***
|
|
||||||
import org.gcube.informationsystem.publisher.AdvancedScopedPublisher;
|
import org.gcube.informationsystem.publisher.AdvancedScopedPublisher;
|
||||||
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
|
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
|
||||||
import org.gcube.informationsystem.publisher.ScopedPublisher;
|
import org.gcube.informationsystem.publisher.ScopedPublisher;
|
||||||
|
@ -48,24 +25,15 @@ import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.tmatesoft.svn.core.SVNDepth;
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.tmatesoft.svn.core.SVNURL;
|
|
||||||
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
|
|
||||||
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
|
|
||||||
import org.tmatesoft.svn.core.io.SVNRepository;
|
|
||||||
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
|
|
||||||
import org.tmatesoft.svn.core.wc.ISVNOptions;
|
|
||||||
import org.tmatesoft.svn.core.wc.SVNClientManager;
|
|
||||||
import org.tmatesoft.svn.core.wc.SVNRevision;
|
|
||||||
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
|
|
||||||
import org.tmatesoft.svn.core.wc.SVNWCUtil;
|
|
||||||
|
|
||||||
import au.com.bytecode.opencsv.CSVReader;
|
|
||||||
|
|
||||||
public class ISClient ***REMOVED***
|
public class ISClient ***REMOVED***
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ISClient.class);
|
private Logger logger;
|
||||||
|
|
||||||
|
public ISClient() ***REMOVED***
|
||||||
|
this.logger = LoggerFactory.getLogger(ISClient.class);
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public Host getDataminer(String hostname) ***REMOVED***
|
public Host getDataminer(String hostname) ***REMOVED***
|
||||||
Host h = new Host();
|
Host h = new Host();
|
||||||
|
@ -196,11 +164,11 @@ public class ISClient ***REMOVED***
|
||||||
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
||||||
AdvancedScopedPublisher advancedScopedPublisher = new AdvancedScopedPublisher(scopedPublisher);
|
AdvancedScopedPublisher advancedScopedPublisher = new AdvancedScopedPublisher(scopedPublisher);
|
||||||
String id = resource.id();
|
String id = resource.id();
|
||||||
LOGGER.debug("Trying to remove ***REMOVED******REMOVED*** with ID ***REMOVED******REMOVED*** from ***REMOVED******REMOVED***", resource.getClass().getSimpleName(), id,
|
this.logger.info("Trying to remove ***REMOVED******REMOVED*** with ID ***REMOVED******REMOVED*** from ***REMOVED******REMOVED***", resource.getClass().getSimpleName(), id,
|
||||||
ScopeProvider.instance.get());
|
ScopeProvider.instance.get());
|
||||||
***REMOVED*** scopedPublisher.remove(resource, scopes);
|
***REMOVED*** scopedPublisher.remove(resource, scopes);
|
||||||
advancedScopedPublisher.forceRemove(resource);
|
advancedScopedPublisher.forceRemove(resource);
|
||||||
LOGGER.debug("***REMOVED******REMOVED*** with ID ***REMOVED******REMOVED*** removed successfully", resource.getClass().getSimpleName(), id);
|
this.logger.info("***REMOVED******REMOVED*** with ID ***REMOVED******REMOVED*** removed successfully", resource.getClass().getSimpleName(), id);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void publishScopedResource(GenericResource a, List<String> scopes)
|
public void publishScopedResource(GenericResource a, List<String> scopes)
|
||||||
|
@ -210,11 +178,11 @@ public class ISClient ***REMOVED***
|
||||||
|
|
||||||
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
System.out.println(scopes);
|
this.logger.debug(scopes.toString());
|
||||||
System.out.println(stringWriter);
|
this.logger.debug(stringWriter.toString());
|
||||||
scopedPublisher.create(a, scopes);
|
scopedPublisher.create(a, scopes);
|
||||||
***REMOVED*** catch (RegistryNotFoundException e) ***REMOVED***
|
***REMOVED*** catch (RegistryNotFoundException e) ***REMOVED***
|
||||||
System.out.println(e);
|
this.logger.error("Registry not found",e);
|
||||||
throw e;
|
throw e;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -11,7 +11,8 @@ import org.gcube.dataanalysis.dataminer.poolmanager.clients.configuration.Config
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public class DMPMClientConfiguratorManager***REMOVED***
|
public class DMPMClientConfiguratorManager
|
||||||
|
***REMOVED***
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
private Properties defaultAdmins;
|
private Properties defaultAdmins;
|
||||||
private String admins;
|
private String admins;
|
||||||
|
|
|
@ -3,36 +3,21 @@ package org.gcube.dataanalysis.dataminer.poolmanager.clients.configurations;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
|
|
||||||
public abstract class AbstractConfiguration ***REMOVED***
|
public abstract class AbstractConfiguration
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String host;
|
private String host;
|
||||||
|
|
||||||
private String algorithmsList;
|
private String algorithmsList;
|
||||||
|
|
||||||
private String softwareRepo;
|
private String softwareRepo;
|
||||||
|
|
||||||
private String ghostRepo;
|
private String ghostRepo;
|
||||||
|
|
||||||
private String depsLinuxCompiled;
|
private String depsLinuxCompiled;
|
||||||
|
|
||||||
private String depsPreInstalled;
|
private String depsPreInstalled;
|
||||||
|
|
||||||
private String depsRBlackbox;
|
private String depsRBlackbox;
|
||||||
|
|
||||||
private String depsR;
|
private String depsR;
|
||||||
|
|
||||||
private String depsJava;
|
private String depsJava;
|
||||||
|
|
||||||
private String depsKnimeWorkflow;
|
private String depsKnimeWorkflow;
|
||||||
|
|
||||||
private String depsOctave;
|
private String depsOctave;
|
||||||
|
|
||||||
private String depsPython;
|
private String depsPython;
|
||||||
|
|
||||||
private String depsWindowsCompiled;
|
private String depsWindowsCompiled;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@ package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
|
||||||
public class Action ***REMOVED***
|
public class Action ***REMOVED***
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String script;
|
private String script;
|
||||||
|
|
||||||
public String getName() ***REMOVED***
|
public String getName() ***REMOVED***
|
||||||
|
|
|
@ -9,36 +9,24 @@ import java.util.Vector;
|
||||||
public class Algorithm ***REMOVED***
|
public class Algorithm ***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
private String fullname;
|
private String fullname;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String language;
|
private String language;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String clazz;
|
private String clazz;
|
||||||
|
|
||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
private String algorithmType;
|
private String algorithmType;
|
||||||
|
|
||||||
private String skipJava;
|
private String skipJava;
|
||||||
|
|
||||||
private String packageURL;
|
private String packageURL;
|
||||||
|
|
||||||
private Collection<Action> actions;
|
private Collection<Action> actions;
|
||||||
|
|
||||||
private Collection<Dependency> dependencies;
|
private Collection<Dependency> dependencies;
|
||||||
|
|
||||||
public Algorithm() ***REMOVED***
|
public Algorithm() ***REMOVED***
|
||||||
this.actions = new Vector<>();
|
this.actions = new Vector<>();
|
||||||
this.dependencies = new Vector<>();
|
this.dependencies = new Vector<>();
|
||||||
Dependency p = new Dependency();
|
***REMOVED*** Dependency p = new Dependency();
|
||||||
|
|
||||||
***REMOVED***init with default values
|
***REMOVED***init with default values
|
||||||
this.skipJava = "N";
|
this.skipJava = "N";
|
||||||
|
|
|
@ -6,39 +6,46 @@ import java.util.Vector;
|
||||||
public class AlgorithmSet ***REMOVED***
|
public class AlgorithmSet ***REMOVED***
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private Collection<Algorithm> algorithms;
|
private Collection<Algorithm> algorithms;
|
||||||
|
|
||||||
public AlgorithmSet() ***REMOVED***
|
public AlgorithmSet()
|
||||||
|
***REMOVED***
|
||||||
this.algorithms = new Vector<>();
|
this.algorithms = new Vector<>();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getName() ***REMOVED***
|
public String getName()
|
||||||
|
***REMOVED***
|
||||||
return name;
|
return name;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void setName(String name) ***REMOVED***
|
public void setName(String name)
|
||||||
|
***REMOVED***
|
||||||
this.name = name;
|
this.name = name;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public Collection<Algorithm> getAlgorithms() ***REMOVED***
|
public Collection<Algorithm> getAlgorithms()
|
||||||
|
***REMOVED***
|
||||||
return new Vector<>(algorithms);
|
return new Vector<>(algorithms);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void addAlgorithm(Algorithm algoritm) ***REMOVED***
|
public void addAlgorithm(Algorithm algoritm)
|
||||||
|
***REMOVED***
|
||||||
this.algorithms.add(algoritm);
|
this.algorithms.add(algoritm);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public Boolean hasAlgorithm(Algorithm algorithm) ***REMOVED***
|
public Boolean hasAlgorithm(Algorithm algorithm)
|
||||||
|
***REMOVED***
|
||||||
for (Algorithm a : this.algorithms) ***REMOVED***
|
for (Algorithm a : this.algorithms) ***REMOVED***
|
||||||
if (a.getName().equals(algorithm.getName())) ***REMOVED***
|
if (a.getName().equals(algorithm.getName()))
|
||||||
|
***REMOVED***
|
||||||
return true;
|
return true;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return false;
|
return false;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String toString() ***REMOVED***
|
public String toString()
|
||||||
|
***REMOVED***
|
||||||
String out = "ALGOSET: " + this.name + "\n";
|
String out = "ALGOSET: " + this.name + "\n";
|
||||||
for(Algorithm a:this.algorithms) ***REMOVED***
|
for(Algorithm a:this.algorithms) ***REMOVED***
|
||||||
out+=a+"\n";
|
out+=a+"\n";
|
||||||
|
|
|
@ -25,40 +25,49 @@ public class Cluster ***REMOVED***
|
||||||
*/
|
*/
|
||||||
private Collection<AlgorithmSet> algoSets;
|
private Collection<AlgorithmSet> algoSets;
|
||||||
|
|
||||||
public Cluster() ***REMOVED***
|
public Cluster()
|
||||||
|
***REMOVED***
|
||||||
this.hosts = new Vector<>();
|
this.hosts = new Vector<>();
|
||||||
this.algoSets = new Vector<>();
|
this.algoSets = new Vector<>();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void addAlgorithmSet(AlgorithmSet set) ***REMOVED***
|
public void addAlgorithmSet(AlgorithmSet set)
|
||||||
|
***REMOVED***
|
||||||
this.algoSets.add(set);
|
this.algoSets.add(set);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void addHost(Host host) ***REMOVED***
|
public void addHost(Host host)
|
||||||
|
***REMOVED***
|
||||||
this.hosts.add(host);
|
this.hosts.add(host);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public Collection<Host> getHosts() ***REMOVED***
|
public Collection<Host> getHosts()
|
||||||
|
***REMOVED***
|
||||||
return hosts;
|
return hosts;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getName() ***REMOVED***
|
public String getName()
|
||||||
|
***REMOVED***
|
||||||
return name;
|
return name;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void setName(String name) ***REMOVED***
|
public void setName(String name)
|
||||||
|
***REMOVED***
|
||||||
this.name = name;
|
this.name = name;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getDescription() ***REMOVED***
|
public String getDescription()
|
||||||
|
***REMOVED***
|
||||||
return description;
|
return description;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public void setDescription(String description) ***REMOVED***
|
public void setDescription(String description)
|
||||||
|
***REMOVED***
|
||||||
this.description = description;
|
this.description = description;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public Collection<AlgorithmSet> getAlgorithmSets() ***REMOVED***
|
public Collection<AlgorithmSet> getAlgorithmSets()
|
||||||
|
***REMOVED***
|
||||||
return algoSets;
|
return algoSets;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,10 @@ package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
|
||||||
public class Dependency ***REMOVED***
|
public class Dependency ***REMOVED***
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
public String getName() ***REMOVED***
|
public String getName()
|
||||||
|
***REMOVED***
|
||||||
return name;
|
return name;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ public class Host ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public Host() ***REMOVED***
|
public Host() ***REMOVED***
|
||||||
***REMOVED*** TODO Auto-generated constructor stub
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getFullyQualifiedName() ***REMOVED***
|
public String getFullyQualifiedName() ***REMOVED***
|
||||||
|
|
|
@ -10,9 +10,10 @@ import java.util.Vector;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
public class AlgorithmPackageParser ***REMOVED***
|
public class AlgorithmPackageParser ***REMOVED***
|
||||||
|
|
||||||
|
@ -20,35 +21,32 @@ public class AlgorithmPackageParser ***REMOVED***
|
||||||
* The name of the file containing algorithm metadata. Expected in the root
|
* The name of the file containing algorithm metadata. Expected in the root
|
||||||
* directory of the package.
|
* directory of the package.
|
||||||
*/
|
*/
|
||||||
private static final String METADATA_FILE_NAME = "Info.txt";
|
private final String METADATA_FILE_NAME = "Info.txt",
|
||||||
|
METADATA_USERNAME = "Username",
|
||||||
|
METADATA_FULLNAME = "Full Name",
|
||||||
|
METADATA_EMAIL = "Email",
|
||||||
|
METADATA_LANGUAGE = "Language",
|
||||||
|
METADATA_CATEGORY = "Algorithm Category",
|
||||||
|
METADATA_ALGORITHM_NAME = "Algorithm Name",
|
||||||
|
METADATA_ALGORITHM_DESCRIPTION = "Algorithm Description",
|
||||||
|
METADATA_CLASS_NAME = "Class Name",
|
||||||
|
|
||||||
private static final String METADATA_USERNAME = "Username";
|
***REMOVED*** private static final String METADATA_PACKAGES = "Packages";
|
||||||
|
|
||||||
private static final String METADATA_FULLNAME = "Full Name";
|
METADATA_KEY_VALUE_SEPARATOR = ":";
|
||||||
|
|
||||||
private static final String METADATA_EMAIL = "Email";
|
private final int BUFFER_SIZE = 4096;
|
||||||
|
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
private static final String METADATA_LANGUAGE = "Language";
|
public AlgorithmPackageParser() ***REMOVED***
|
||||||
|
this.logger = LoggerFactory.getLogger(AlgorithmPackageParser.class);
|
||||||
private static final String METADATA_CATEGORY = "Algorithm Category";
|
***REMOVED***
|
||||||
|
|
||||||
private static final String METADATA_ALGORITHM_NAME = "Algorithm Name";
|
|
||||||
|
|
||||||
private static final String METADATA_ALGORITHM_DESCRIPTION = "Algorithm Description";
|
|
||||||
|
|
||||||
private static final String METADATA_CLASS_NAME = "Class Name";
|
|
||||||
|
|
||||||
private static final String METADATA_PACKAGES = "Packages";
|
|
||||||
|
|
||||||
private static final String METADATA_KEY_VALUE_SEPARATOR = ":";
|
|
||||||
|
|
||||||
private static final int BUFFER_SIZE = 4096;
|
|
||||||
|
|
||||||
|
|
||||||
public Algorithm parsePackage(String url) throws IOException ***REMOVED***
|
public Algorithm parsePackage(String url) throws IOException ***REMOVED***
|
||||||
String packageMetadata = this.getPackageMetadata(url);
|
String packageMetadata = this.getPackageMetadata(url);
|
||||||
if (packageMetadata == null) ***REMOVED***
|
if (packageMetadata == null) ***REMOVED***
|
||||||
System.out.println("WARNING: No metadata found for " + url);
|
this.logger.warn("WARNING: No metadata found for " + url);
|
||||||
return null;
|
return null;
|
||||||
***REMOVED*** else ***REMOVED***
|
***REMOVED*** else ***REMOVED***
|
||||||
Map<String, List<String>> parsedMetadata = this.parseMetadata(packageMetadata);
|
Map<String, List<String>> parsedMetadata = this.parseMetadata(packageMetadata);
|
||||||
|
@ -125,7 +123,7 @@ public class AlgorithmPackageParser ***REMOVED***
|
||||||
out.put(key, values);
|
out.put(key, values);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
values.add(value);
|
values.add(value);
|
||||||
System.out.println(key + METADATA_KEY_VALUE_SEPARATOR + " " + values);
|
this.logger.debug(key + METADATA_KEY_VALUE_SEPARATOR + " " + values);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -35,18 +35,17 @@
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet;
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public interface PoolManager ***REMOVED***
|
public interface PoolManager
|
||||||
|
***REMOVED***
|
||||||
String addAlgorithmToVRE(Algorithm algo, String vre, boolean test ) throws IOException, InterruptedException;
|
String addAlgorithmToVRE(Algorithm algo, String vre, boolean test ) throws IOException, InterruptedException;
|
||||||
String addAlgorithmToHost(Algorithm algo, String host,boolean test) throws IOException, InterruptedException;
|
|
||||||
|
|
||||||
|
String addAlgorithmToHost(Algorithm algo, String host,boolean test) throws IOException, InterruptedException;
|
||||||
|
|
||||||
String stageAlgorithm(String algorithmPackageURL) throws IOException, InterruptedException;
|
String stageAlgorithm(String algorithmPackageURL) throws IOException, InterruptedException;
|
||||||
String publishAlgorithm(String algorithmPackageURL, String targetVREToken, String targetVRE) throws IOException, InterruptedException;
|
|
||||||
|
|
||||||
|
String publishAlgorithm(String algorithmPackageURL, String targetVREToken, String targetVRE) throws IOException, InterruptedException;
|
||||||
|
|
||||||
Algorithm extractAlgorithm(String url) throws IOException;
|
Algorithm extractAlgorithm(String url) throws IOException;
|
||||||
|
|
||||||
|
@ -61,6 +60,7 @@ public interface PoolManager ***REMOVED***
|
||||||
void addAlgToIs(Algorithm algo);
|
void addAlgToIs(Algorithm algo);
|
||||||
|
|
||||||
Set<Algorithm> getAlgoFromIs();
|
Set<Algorithm> getAlgoFromIs();
|
||||||
|
|
||||||
List<String> updateSVN(String file, List<String> ldep) throws SVNException, IOException;
|
List<String> updateSVN(String file, List<String> ldep) throws SVNException, IOException;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class DataminerPoolManager ***REMOVED***
|
||||||
this.svnUpdaterStaging = new SVNUpdaterStaging();
|
this.svnUpdaterStaging = new SVNUpdaterStaging();
|
||||||
this.svnUpdaterProduction = new SVNUpdaterProduction();
|
this.svnUpdaterProduction = new SVNUpdaterProduction();
|
||||||
***REMOVED*** catch (SVNException e) ***REMOVED***
|
***REMOVED*** catch (SVNException e) ***REMOVED***
|
||||||
e.printStackTrace();
|
this.logger.error("SVN Exception",e);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ public abstract class CheckMethod ***REMOVED***
|
||||||
String operatorName = line.substring(line.indexOf(">") + 1);
|
String operatorName = line.substring(line.indexOf(">") + 1);
|
||||||
operatorName = operatorName.substring(0, operatorName.indexOf("<"));
|
operatorName = operatorName.substring(0, operatorName.indexOf("<"));
|
||||||
this.logger.debug("Operator "+operatorName);
|
this.logger.debug("Operator "+operatorName);
|
||||||
System.out.println(" " + operatorName);
|
|
||||||
URL innerRequestURL = new URL(baseDescriptionRequest + operatorName);
|
URL innerRequestURL = new URL(baseDescriptionRequest + operatorName);
|
||||||
BufferedReader innerBufferedReader = new BufferedReader(
|
BufferedReader innerBufferedReader = new BufferedReader(
|
||||||
new InputStreamReader(innerRequestURL.openStream()));
|
new InputStreamReader(innerRequestURL.openStream()));
|
||||||
|
@ -225,12 +224,9 @@ public abstract class CheckMethod ***REMOVED***
|
||||||
session.connect();
|
session.connect();
|
||||||
Channel channel = session.openChannel(SFTP_PROTOCOL);
|
Channel channel = session.openChannel(SFTP_PROTOCOL);
|
||||||
channel.connect();
|
channel.connect();
|
||||||
System.out.println("shell channel connected....");
|
this.logger.debug("shell channel connected....");
|
||||||
|
|
||||||
ChannelSftp c = (ChannelSftp) channel;
|
ChannelSftp c = (ChannelSftp) channel;
|
||||||
|
this.logger.debug(path);
|
||||||
|
|
||||||
System.out.println(path);
|
|
||||||
|
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
c.lstat(path);
|
c.lstat(path);
|
||||||
|
|
|
@ -4,21 +4,24 @@ import static org.gcube.common.authorization.client.Constants.authorizationServi
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public class CheckPermission ***REMOVED***
|
public class CheckPermission ***REMOVED***
|
||||||
|
|
||||||
public CheckPermission() ***REMOVED***
|
private static final Logger logger = LoggerFactory.getLogger(CheckPermission.class);
|
||||||
***REMOVED***
|
|
||||||
|
|
||||||
public static boolean apply(String VREToken, String vre) throws ObjectNotFound, Exception ***REMOVED***
|
|
||||||
|
public static boolean apply(String VREToken, String vre) throws ObjectNotFound, Exception
|
||||||
|
***REMOVED***
|
||||||
AuthorizationEntry entry = authorizationService().get(VREToken);
|
AuthorizationEntry entry = authorizationService().get(VREToken);
|
||||||
if (entry.getContext().equals(vre)) ***REMOVED***
|
if (entry.getContext().equals(vre)) ***REMOVED***
|
||||||
System.out.println("Authorization OK!");
|
logger.info("Authorization OK!");
|
||||||
return true;
|
return true;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
System.out.println("Not a valid token recognized for the VRE: "+vre);
|
logger.info("Not a valid token recognized for the VRE: "+vre);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -310,7 +310,7 @@ public abstract class SVNUpdater ***REMOVED***
|
||||||
sb.append("none | ");
|
sb.append("none | ");
|
||||||
sb.append(this.getTimeZone() + " | ");
|
sb.append(this.getTimeZone() + " | ");
|
||||||
|
|
||||||
System.out.println("Algo details: "+sb.toString());
|
this.logger.info("Algo details: "+sb.toString());
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
@ -419,7 +419,7 @@ public abstract class SVNUpdater ***REMOVED***
|
||||||
|
|
||||||
boolean check = false;
|
boolean check = false;
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
System.out.println("Checking dependencies list: " + file);
|
this.logger.info("Checking dependencies list: " + file);
|
||||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||||
|
@ -448,8 +448,10 @@ public abstract class SVNUpdater ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** ***REMOVED***
|
***REMOVED*** ***REMOVED***
|
||||||
***REMOVED*** catch (Exception a) ***REMOVED***
|
***REMOVED*** catch (Exception a)
|
||||||
a.getMessage();
|
***REMOVED***
|
||||||
|
this.logger.error(a.getMessage(),a);
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
return check;
|
return check;
|
||||||
|
@ -458,7 +460,7 @@ public abstract class SVNUpdater ***REMOVED***
|
||||||
|
|
||||||
public void updateSVN(String file, Collection<Dependency> deps) ***REMOVED***
|
public void updateSVN(String file, Collection<Dependency> deps) ***REMOVED***
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
System.out.println("Updating dependencies list: " + file);
|
this.logger.info("Updating dependencies list: " + file);
|
||||||
|
|
||||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||||
|
@ -537,7 +539,7 @@ public abstract class SVNUpdater ***REMOVED***
|
||||||
Date fromDate = formatter.parse(cal.getTime().toString());
|
Date fromDate = formatter.parse(cal.getTime().toString());
|
||||||
TimeZone central = TimeZone.getTimeZone("UTC");
|
TimeZone central = TimeZone.getTimeZone("UTC");
|
||||||
formatter.setTimeZone(central);
|
formatter.setTimeZone(central);
|
||||||
System.out.println(formatter.format(fromDate));
|
this.logger.info(formatter.format(fromDate));
|
||||||
return formatter.format(fromDate);
|
return formatter.format(fromDate);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class SendMail ***REMOVED***
|
||||||
HttpGet getReq = new HttpGet(serviceAddress);
|
HttpGet getReq = new HttpGet(serviceAddress);
|
||||||
getReq.setHeader("accept", JSON_MIME_TYPE);
|
getReq.setHeader("accept", JSON_MIME_TYPE);
|
||||||
getReq.setHeader("content-type", JSON_MIME_TYPE);
|
getReq.setHeader("content-type", JSON_MIME_TYPE);
|
||||||
System.out.println(EntityUtils.toString(client.execute(getReq).getEntity()));
|
this.logger.info(EntityUtils.toString(client.execute(getReq).getEntity()));
|
||||||
|
|
||||||
return EntityUtils.toString(client.execute(getReq).getEntity());
|
return EntityUtils.toString(client.execute(getReq).getEntity());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue