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;
|
||||
***REMOVED***
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public class AlgorithmPackage ***REMOVED***
|
||||
|
||||
private Algorithm algorithm;
|
||||
private boolean includeAlgorithmDependencies;
|
||||
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies) ***REMOVED***
|
||||
this.algorithm = a;
|
||||
private Logger logger;
|
||||
|
||||
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies)
|
||||
***REMOVED***
|
||||
this.logger = LoggerFactory.getLogger(AlgorithmPackage.class);
|
||||
this.algorithm = a;
|
||||
this.includeAlgorithmDependencies = includeAlgorithmDependencies;
|
||||
|
||||
***REMOVED***
|
||||
|
@ -61,12 +67,13 @@ public class AlgorithmPackage ***REMOVED***
|
|||
Role r = tm.fillRoleTemplate(template, dictionary);
|
||||
r.setName(roleName);
|
||||
out.add(r);
|
||||
***REMOVED*** else ***REMOVED***
|
||||
System.out.println("WARNING: template is null");
|
||||
***REMOVED*** else
|
||||
***REMOVED***
|
||||
this.logger.warn("WARNING: template is null");
|
||||
***REMOVED***
|
||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||
***REMOVED*** e.printStackTrace();
|
||||
System.out.println("WARNING: no template found for " + roleName);
|
||||
this.logger.warn("WARNING: no template found for " + roleName);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
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.datamodel.Dependency;
|
||||
***REMOVED***
|
||||
|
||||
public class CustomDependencyPackage extends DependencyPackage ***REMOVED***
|
||||
|
||||
public CustomDependencyPackage(Dependency d) ***REMOVED***
|
||||
super(d);
|
||||
private Logger logger;
|
||||
|
||||
public CustomDependencyPackage(Dependency dependency)
|
||||
***REMOVED***
|
||||
super(dependency);
|
||||
***REMOVED***
|
||||
|
||||
private String getCustomRepositoryLocation(String ansibleRoot) ***REMOVED***
|
||||
return ansibleRoot+"/custom";
|
||||
***REMOVED***
|
||||
***REMOVED*** private String getCustomRepositoryLocation(String ansibleRoot) ***REMOVED***
|
||||
***REMOVED*** return ansibleRoot+"/custom";
|
||||
***REMOVED*** ***REMOVED***
|
||||
|
||||
/*
|
||||
public void serializeTo(String ansibleRoot) ***REMOVED***
|
||||
|
@ -54,7 +58,7 @@ public class CustomDependencyPackage extends DependencyPackage ***REMOVED***
|
|||
***REMOVED***
|
||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||
***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***
|
||||
return out;
|
||||
|
|
|
@ -10,11 +10,7 @@ import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSeriali
|
|||
|
||||
public class CustomRoleManager ***REMOVED***
|
||||
|
||||
private String root;
|
||||
|
||||
public CustomRoleManager() ***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public String getRoot() ***REMOVED***
|
||||
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.datamodel.Dependency;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public class DependencyPackage ***REMOVED***
|
||||
|
||||
private Logger logger;
|
||||
|
||||
private Dependency dependency;
|
||||
|
||||
public DependencyPackage(Dependency d) ***REMOVED***
|
||||
this.dependency = d;
|
||||
public DependencyPackage(Dependency dependency) ***REMOVED***
|
||||
this.dependency = dependency;
|
||||
this.logger = LoggerFactory.getLogger(DependencyPackage.class);
|
||||
***REMOVED***
|
||||
|
||||
protected Map<String, String> getDictionary(Dependency d) ***REMOVED***
|
||||
|
@ -42,11 +47,11 @@ public class DependencyPackage ***REMOVED***
|
|||
r.setName(roleName);
|
||||
out.add(r);
|
||||
***REMOVED*** else ***REMOVED***
|
||||
System.out.println("WARNING: template is null");
|
||||
this.logger.warn("WARNING: template is null");
|
||||
***REMOVED***
|
||||
***REMOVED*** catch (NoSuchElementException e) ***REMOVED***
|
||||
***REMOVED*** e.printStackTrace();
|
||||
System.out.println("WARNING: no template found for " + roleName);
|
||||
this.logger.warn("WARNING: no template found for " + roleName);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return out;
|
||||
|
|
|
@ -4,8 +4,8 @@ import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
|||
|
||||
public class OSDependencyPackage extends DependencyPackage ***REMOVED***
|
||||
|
||||
public OSDependencyPackage(Dependency d) ***REMOVED***
|
||||
super(d);
|
||||
public OSDependencyPackage(Dependency dependency) ***REMOVED***
|
||||
super(dependency);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template;
|
|||
|
||||
import java.io.File;
|
||||
***REMOVED***
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
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.util.CheckPermission;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
import au.com.bytecode.opencsv.CSVReader;
|
||||
|
||||
public class HAProxy ***REMOVED***
|
||||
|
||||
private Logger logger;
|
||||
|
||||
private CSVReader reader;
|
||||
|
||||
public HAProxy() ***REMOVED***
|
||||
this.logger = LoggerFactory.getLogger(HAProxy.class);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** public Cluster getClusterByHProxy() throws IOException ***REMOVED***
|
||||
***REMOVED*** Cluster cl = new Cluster();
|
||||
***REMOVED*** String HProxy = ISClient.getHProxy();
|
||||
|
@ -121,11 +129,11 @@ public class HAProxy ***REMOVED***
|
|||
Host b = new Host();
|
||||
b.setName(nextLine[1]);
|
||||
out.add(b);
|
||||
System.out.println(b.getFullyQualifiedName());
|
||||
this.logger.info(b.getFullyQualifiedName());
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
System.out.println(out);
|
||||
this.logger.info(out.toString());
|
||||
return out;
|
||||
|
||||
***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.queryFor;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
***REMOVED***
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.io.StringWriter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
***REMOVED***
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
***REMOVED***
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import java.util.Vector;
|
||||
|
||||
***REMOVED***
|
||||
|
@ -34,12 +16,7 @@ import org.gcube.common.resources.gcore.Resources;
|
|||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
***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.comparator.HostComparator;
|
||||
***REMOVED***
|
||||
import org.gcube.informationsystem.publisher.AdvancedScopedPublisher;
|
||||
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
|
||||
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;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.tmatesoft.svn.core.SVNDepth;
|
||||
***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***
|
||||
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***
|
||||
Host h = new Host();
|
||||
|
@ -196,11 +164,11 @@ public class ISClient ***REMOVED***
|
|||
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
||||
AdvancedScopedPublisher advancedScopedPublisher = new AdvancedScopedPublisher(scopedPublisher);
|
||||
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());
|
||||
***REMOVED*** scopedPublisher.remove(resource, scopes);
|
||||
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***
|
||||
|
||||
public void publishScopedResource(GenericResource a, List<String> scopes)
|
||||
|
@ -210,11 +178,11 @@ public class ISClient ***REMOVED***
|
|||
|
||||
ScopedPublisher scopedPublisher = RegistryPublisherFactory.scopedPublisher();
|
||||
try ***REMOVED***
|
||||
System.out.println(scopes);
|
||||
System.out.println(stringWriter);
|
||||
this.logger.debug(scopes.toString());
|
||||
this.logger.debug(stringWriter.toString());
|
||||
scopedPublisher.create(a, scopes);
|
||||
***REMOVED*** catch (RegistryNotFoundException e) ***REMOVED***
|
||||
System.out.println(e);
|
||||
this.logger.error("Registry not found",e);
|
||||
throw e;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
|
|
@ -11,7 +11,8 @@ import org.gcube.dataanalysis.dataminer.poolmanager.clients.configuration.Config
|
|||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public class DMPMClientConfiguratorManager***REMOVED***
|
||||
public class DMPMClientConfiguratorManager
|
||||
***REMOVED***
|
||||
private final Logger logger;
|
||||
private Properties defaultAdmins;
|
||||
private String admins;
|
||||
|
|
|
@ -3,36 +3,21 @@ package org.gcube.dataanalysis.dataminer.poolmanager.clients.configurations;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
|
||||
public abstract class AbstractConfiguration ***REMOVED***
|
||||
|
||||
|
||||
|
||||
|
||||
public abstract class AbstractConfiguration
|
||||
***REMOVED***
|
||||
|
||||
private String host;
|
||||
|
||||
private String algorithmsList;
|
||||
|
||||
private String softwareRepo;
|
||||
|
||||
private String ghostRepo;
|
||||
|
||||
private String depsLinuxCompiled;
|
||||
|
||||
private String depsPreInstalled;
|
||||
|
||||
private String depsRBlackbox;
|
||||
|
||||
private String depsR;
|
||||
|
||||
private String depsJava;
|
||||
|
||||
private String depsKnimeWorkflow;
|
||||
|
||||
private String depsOctave;
|
||||
|
||||
private String depsPython;
|
||||
|
||||
private String depsWindowsCompiled;
|
||||
|
||||
|
||||
|
|
|
@ -3,9 +3,7 @@ package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
|
|||
public class Action ***REMOVED***
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private String script;
|
||||
|
||||
public String getName() ***REMOVED***
|
||||
|
|
|
@ -9,36 +9,24 @@ import java.util.Vector;
|
|||
public class Algorithm ***REMOVED***
|
||||
|
||||
|
||||
private String username;
|
||||
|
||||
private String username;
|
||||
private String fullname;
|
||||
|
||||
private String email;
|
||||
|
||||
private String language;
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private String clazz;
|
||||
|
||||
private String category;
|
||||
|
||||
private String algorithmType;
|
||||
|
||||
private String skipJava;
|
||||
|
||||
private String packageURL;
|
||||
|
||||
private Collection<Action> actions;
|
||||
|
||||
private Collection<Dependency> dependencies;
|
||||
|
||||
public Algorithm() ***REMOVED***
|
||||
this.actions = new Vector<>();
|
||||
this.dependencies = new Vector<>();
|
||||
Dependency p = new Dependency();
|
||||
***REMOVED*** Dependency p = new Dependency();
|
||||
|
||||
***REMOVED***init with default values
|
||||
this.skipJava = "N";
|
||||
|
|
|
@ -6,39 +6,46 @@ import java.util.Vector;
|
|||
public class AlgorithmSet ***REMOVED***
|
||||
|
||||
private String name;
|
||||
|
||||
private Collection<Algorithm> algorithms;
|
||||
|
||||
public AlgorithmSet() ***REMOVED***
|
||||
public AlgorithmSet()
|
||||
***REMOVED***
|
||||
this.algorithms = new Vector<>();
|
||||
***REMOVED***
|
||||
|
||||
public String getName() ***REMOVED***
|
||||
public String getName()
|
||||
***REMOVED***
|
||||
return name;
|
||||
***REMOVED***
|
||||
|
||||
public void setName(String name) ***REMOVED***
|
||||
public void setName(String name)
|
||||
***REMOVED***
|
||||
this.name = name;
|
||||
***REMOVED***
|
||||
|
||||
public Collection<Algorithm> getAlgorithms() ***REMOVED***
|
||||
public Collection<Algorithm> getAlgorithms()
|
||||
***REMOVED***
|
||||
return new Vector<>(algorithms);
|
||||
***REMOVED***
|
||||
|
||||
public void addAlgorithm(Algorithm algoritm) ***REMOVED***
|
||||
public void addAlgorithm(Algorithm algoritm)
|
||||
***REMOVED***
|
||||
this.algorithms.add(algoritm);
|
||||
***REMOVED***
|
||||
|
||||
public Boolean hasAlgorithm(Algorithm algorithm) ***REMOVED***
|
||||
public Boolean hasAlgorithm(Algorithm algorithm)
|
||||
***REMOVED***
|
||||
for (Algorithm a : this.algorithms) ***REMOVED***
|
||||
if (a.getName().equals(algorithm.getName())) ***REMOVED***
|
||||
if (a.getName().equals(algorithm.getName()))
|
||||
***REMOVED***
|
||||
return true;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return false;
|
||||
***REMOVED***
|
||||
|
||||
public String toString() ***REMOVED***
|
||||
public String toString()
|
||||
***REMOVED***
|
||||
String out = "ALGOSET: " + this.name + "\n";
|
||||
for(Algorithm a:this.algorithms) ***REMOVED***
|
||||
out+=a+"\n";
|
||||
|
|
|
@ -25,40 +25,49 @@ public class Cluster ***REMOVED***
|
|||
*/
|
||||
private Collection<AlgorithmSet> algoSets;
|
||||
|
||||
public Cluster() ***REMOVED***
|
||||
public Cluster()
|
||||
***REMOVED***
|
||||
this.hosts = new Vector<>();
|
||||
this.algoSets = new Vector<>();
|
||||
***REMOVED***
|
||||
|
||||
public void addAlgorithmSet(AlgorithmSet set) ***REMOVED***
|
||||
public void addAlgorithmSet(AlgorithmSet set)
|
||||
***REMOVED***
|
||||
this.algoSets.add(set);
|
||||
***REMOVED***
|
||||
|
||||
public void addHost(Host host) ***REMOVED***
|
||||
public void addHost(Host host)
|
||||
***REMOVED***
|
||||
this.hosts.add(host);
|
||||
***REMOVED***
|
||||
|
||||
public Collection<Host> getHosts() ***REMOVED***
|
||||
public Collection<Host> getHosts()
|
||||
***REMOVED***
|
||||
return hosts;
|
||||
***REMOVED***
|
||||
|
||||
public String getName() ***REMOVED***
|
||||
public String getName()
|
||||
***REMOVED***
|
||||
return name;
|
||||
***REMOVED***
|
||||
|
||||
public void setName(String name) ***REMOVED***
|
||||
public void setName(String name)
|
||||
***REMOVED***
|
||||
this.name = name;
|
||||
***REMOVED***
|
||||
|
||||
public String getDescription() ***REMOVED***
|
||||
public String getDescription()
|
||||
***REMOVED***
|
||||
return description;
|
||||
***REMOVED***
|
||||
|
||||
public void setDescription(String description) ***REMOVED***
|
||||
public void setDescription(String description)
|
||||
***REMOVED***
|
||||
this.description = description;
|
||||
***REMOVED***
|
||||
|
||||
public Collection<AlgorithmSet> getAlgorithmSets() ***REMOVED***
|
||||
public Collection<AlgorithmSet> getAlgorithmSets()
|
||||
***REMOVED***
|
||||
return algoSets;
|
||||
***REMOVED***
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
|
|||
public class Dependency ***REMOVED***
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
public String getName() ***REMOVED***
|
||||
public String getName()
|
||||
***REMOVED***
|
||||
return name;
|
||||
***REMOVED***
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ public class Host ***REMOVED***
|
|||
***REMOVED***
|
||||
|
||||
public Host() ***REMOVED***
|
||||
***REMOVED*** TODO Auto-generated constructor stub
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public String getFullyQualifiedName() ***REMOVED***
|
||||
|
|
|
@ -10,9 +10,10 @@ import java.util.Vector;
|
|||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
***REMOVED***
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
|
||||
***REMOVED***
|
||||
***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
|
||||
* 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";
|
||||
|
||||
private static final String METADATA_CATEGORY = "Algorithm Category";
|
||||
|
||||
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 AlgorithmPackageParser() ***REMOVED***
|
||||
this.logger = LoggerFactory.getLogger(AlgorithmPackageParser.class);
|
||||
***REMOVED***
|
||||
|
||||
public Algorithm parsePackage(String url) throws IOException ***REMOVED***
|
||||
String packageMetadata = this.getPackageMetadata(url);
|
||||
if (packageMetadata == null) ***REMOVED***
|
||||
System.out.println("WARNING: No metadata found for " + url);
|
||||
this.logger.warn("WARNING: No metadata found for " + url);
|
||||
return null;
|
||||
***REMOVED*** else ***REMOVED***
|
||||
Map<String, List<String>> parsedMetadata = this.parseMetadata(packageMetadata);
|
||||
|
@ -125,7 +123,7 @@ public class AlgorithmPackageParser ***REMOVED***
|
|||
out.put(key, values);
|
||||
***REMOVED***
|
||||
values.add(value);
|
||||
System.out.println(key + METADATA_KEY_VALUE_SEPARATOR + " " + values);
|
||||
this.logger.debug(key + METADATA_KEY_VALUE_SEPARATOR + " " + values);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return out;
|
||||
|
|
|
@ -35,18 +35,17 @@
|
|||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.AlgorithmSet;
|
||||
***REMOVED***
|
||||
|
||||
public interface PoolManager ***REMOVED***
|
||||
|
||||
String addAlgorithmToVRE(Algorithm algo, String vre, boolean test ) throws IOException, InterruptedException;
|
||||
String addAlgorithmToHost(Algorithm algo, String host,boolean test) throws IOException, InterruptedException;
|
||||
public interface PoolManager
|
||||
***REMOVED***
|
||||
String addAlgorithmToVRE(Algorithm algo, String vre, boolean test ) throws IOException, InterruptedException;
|
||||
|
||||
String addAlgorithmToHost(Algorithm algo, String host,boolean test) 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;
|
||||
|
||||
|
@ -61,6 +60,7 @@ public interface PoolManager ***REMOVED***
|
|||
void addAlgToIs(Algorithm algo);
|
||||
|
||||
Set<Algorithm> getAlgoFromIs();
|
||||
|
||||
List<String> updateSVN(String file, List<String> ldep) throws SVNException, IOException;
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class DataminerPoolManager ***REMOVED***
|
|||
this.svnUpdaterStaging = new SVNUpdaterStaging();
|
||||
this.svnUpdaterProduction = new SVNUpdaterProduction();
|
||||
***REMOVED*** catch (SVNException e) ***REMOVED***
|
||||
e.printStackTrace();
|
||||
this.logger.error("SVN Exception",e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ public abstract class CheckMethod ***REMOVED***
|
|||
String operatorName = line.substring(line.indexOf(">") + 1);
|
||||
operatorName = operatorName.substring(0, operatorName.indexOf("<"));
|
||||
this.logger.debug("Operator "+operatorName);
|
||||
System.out.println(" " + operatorName);
|
||||
URL innerRequestURL = new URL(baseDescriptionRequest + operatorName);
|
||||
BufferedReader innerBufferedReader = new BufferedReader(
|
||||
new InputStreamReader(innerRequestURL.openStream()));
|
||||
|
@ -225,12 +224,9 @@ public abstract class CheckMethod ***REMOVED***
|
|||
session.connect();
|
||||
Channel channel = session.openChannel(SFTP_PROTOCOL);
|
||||
channel.connect();
|
||||
System.out.println("shell channel connected....");
|
||||
|
||||
this.logger.debug("shell channel connected....");
|
||||
ChannelSftp c = (ChannelSftp) channel;
|
||||
|
||||
|
||||
System.out.println(path);
|
||||
this.logger.debug(path);
|
||||
|
||||
try ***REMOVED***
|
||||
c.lstat(path);
|
||||
|
|
|
@ -4,21 +4,24 @@ import static org.gcube.common.authorization.client.Constants.authorizationServi
|
|||
|
||||
***REMOVED***
|
||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
|
||||
public class CheckPermission ***REMOVED***
|
||||
|
||||
public CheckPermission() ***REMOVED***
|
||||
***REMOVED***
|
||||
private static final Logger logger = LoggerFactory.getLogger(CheckPermission.class);
|
||||
|
||||
|
||||
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);
|
||||
if (entry.getContext().equals(vre)) ***REMOVED***
|
||||
System.out.println("Authorization OK!");
|
||||
logger.info("Authorization OK!");
|
||||
return true;
|
||||
***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;
|
||||
|
||||
***REMOVED***
|
||||
|
|
|
@ -310,7 +310,7 @@ public abstract class SVNUpdater ***REMOVED***
|
|||
sb.append("none | ");
|
||||
sb.append(this.getTimeZone() + " | ");
|
||||
|
||||
System.out.println("Algo details: "+sb.toString());
|
||||
this.logger.info("Algo details: "+sb.toString());
|
||||
|
||||
return sb.toString();
|
||||
***REMOVED***
|
||||
|
@ -419,7 +419,7 @@ public abstract class SVNUpdater ***REMOVED***
|
|||
|
||||
boolean check = false;
|
||||
try ***REMOVED***
|
||||
System.out.println("Checking dependencies list: " + file);
|
||||
this.logger.info("Checking dependencies list: " + file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
|
@ -448,8 +448,10 @@ public abstract class SVNUpdater ***REMOVED***
|
|||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED*** ***REMOVED***
|
||||
***REMOVED*** catch (Exception a) ***REMOVED***
|
||||
a.getMessage();
|
||||
***REMOVED*** catch (Exception a)
|
||||
***REMOVED***
|
||||
this.logger.error(a.getMessage(),a);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
return check;
|
||||
|
@ -458,7 +460,7 @@ public abstract class SVNUpdater ***REMOVED***
|
|||
|
||||
public void updateSVN(String file, Collection<Dependency> deps) ***REMOVED***
|
||||
try ***REMOVED***
|
||||
System.out.println("Updating dependencies list: " + file);
|
||||
this.logger.info("Updating dependencies list: " + file);
|
||||
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new 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());
|
||||
TimeZone central = TimeZone.getTimeZone("UTC");
|
||||
formatter.setTimeZone(central);
|
||||
System.out.println(formatter.format(fromDate));
|
||||
this.logger.info(formatter.format(fromDate));
|
||||
return formatter.format(fromDate);
|
||||
***REMOVED***
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ public class SendMail ***REMOVED***
|
|||
HttpGet getReq = new HttpGet(serviceAddress);
|
||||
getReq.setHeader("accept", 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());
|
||||
|
||||
|
|
Loading…
Reference in New Issue