git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@157787 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
80884db7c5
commit
f00127bc61
|
@ -8,4 +8,7 @@
|
||||||
<Changeset component="dataminer-pool-manager.2-1-0" date="$***REMOVED***buildDate***REMOVED***">
|
<Changeset component="dataminer-pool-manager.2-1-0" date="$***REMOVED***buildDate***REMOVED***">
|
||||||
<Change>New configuration file added</Change>
|
<Change>New configuration file added</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
|
<Changeset component="dataminer-pool-manager.2-1-1" date="$***REMOVED***buildDate***REMOVED***">
|
||||||
|
<Change>Improvements and bugs fixed/SVN-UTF8 compliant/Installation in Production ghost added</Change>
|
||||||
|
</Changeset>
|
||||||
</ReleaseNotes>
|
</ReleaseNotes>
|
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<groupId>org.gcube.dataAnalysis</groupId>
|
<groupId>org.gcube.dataAnalysis</groupId>
|
||||||
<artifactId>dataminer-pool-manager</artifactId>
|
<artifactId>dataminer-pool-manager</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>2.1.0-SNAPSHOT</version>
|
<version>2.1.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>dataminer-pool-manager</name>
|
<name>dataminer-pool-manager</name>
|
||||||
<description>
|
<description>
|
||||||
|
|
|
@ -42,9 +42,9 @@ public class DataminerPoolManager ***REMOVED***
|
||||||
|
|
||||||
***REMOVED***Algorithm algo, String targetVRE, String category, String algorithm_type/*, String env*/) throws IOException, InterruptedException ***REMOVED***
|
***REMOVED***Algorithm algo, String targetVRE, String category, String algorithm_type/*, String env*/) throws IOException, InterruptedException ***REMOVED***
|
||||||
|
|
||||||
***REMOVED***Cluster prodCluster = ClusterBuilder.getVRECluster(targetVREToken, targetVRE);
|
Cluster prodCluster = ClusterBuilder.getProdDataminerCluster();
|
||||||
|
|
||||||
DMPMJob job = new ProductionPublishingJob(this.svnUpdater, algo, /*prodCluster,*/ targetVRE, category, algorithm_type/*,env*/);
|
DMPMJob job = new ProductionPublishingJob(this.svnUpdater, algo, prodCluster, targetVRE, category, algorithm_type/*,env*/);
|
||||||
String id = job.start();
|
String id = job.start();
|
||||||
return id;
|
return id;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -4,20 +4,23 @@ import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
||||||
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckMethod;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckPermission;
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckPermission;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.NotificationHelper;
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.NotificationHelper;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater;
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater;
|
||||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.SendMail;
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.SendMail;
|
||||||
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.ServiceConfiguration;
|
||||||
|
|
||||||
public class ProductionPublishingJob extends DMPMJob ***REMOVED***
|
public class ProductionPublishingJob extends DMPMJob ***REMOVED***
|
||||||
|
|
||||||
private Algorithm algorithm;
|
private Algorithm algorithm;
|
||||||
***REMOVED***private Cluster prodCluster;
|
private Cluster prodCluster;
|
||||||
private String targetVREName;
|
private String targetVREName;
|
||||||
private String category;
|
private String category;
|
||||||
private String algorithm_type;
|
private String algorithm_type;
|
||||||
|
@ -26,41 +29,81 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public ProductionPublishingJob(SVNUpdater svnUpdater, Algorithm algorithm,
|
public ProductionPublishingJob(SVNUpdater svnUpdater, Algorithm algorithm,
|
||||||
***REMOVED***Cluster prodCluster,*/ String targetVREName, String category,String algorithm_type/*, String env*/) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED***
|
Cluster prodCluster, String targetVREName, String category,String algorithm_type/*, String env*/) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED***
|
||||||
super(svnUpdater);
|
super(svnUpdater);
|
||||||
|
this.jobLogs = new File(
|
||||||
|
System.getProperty("user.home") + File.separator + "dataminer-pool-manager" + File.separator + "jobs");
|
||||||
|
this.jobLogs.mkdirs();
|
||||||
this.algorithm = algorithm;
|
this.algorithm = algorithm;
|
||||||
***REMOVED***this.prodCluster = prodCluster;
|
this.prodCluster = prodCluster;
|
||||||
this.targetVREName = targetVREName;
|
this.targetVREName = targetVREName;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.algorithm_type = algorithm_type;
|
this.algorithm_type = algorithm_type;
|
||||||
***REMOVED***this.targetVREToken = targetVREToken;
|
***REMOVED***this.targetVREToken = targetVREToken;
|
||||||
***REMOVED***this.env= env;
|
***REMOVED***this.env= env;
|
||||||
|
this.getStatus(0);
|
||||||
|
|
||||||
this.jobLogs = new File(System.getProperty("user.home") + File.separator + "dataminer-pool-manager" + File.separator + "jobs");
|
|
||||||
this.jobLogs.mkdirs();
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
protected void execute() ***REMOVED***
|
protected void execute() ***REMOVED***
|
||||||
SendMail sm = new SendMail();
|
SendMail sm = new SendMail();
|
||||||
NotificationHelper nh = new NotificationHelper();
|
NotificationHelper nh = new NotificationHelper();
|
||||||
|
ServiceConfiguration a = new ServiceConfiguration();
|
||||||
|
CheckMethod b = new CheckMethod();
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
|
|
||||||
***REMOVED***if (CheckPermission.apply(targetVREToken,targetVREName))***REMOVED***
|
Collection<String> undefinedDependencies = this.svnUpdater.getUndefinedDependencies(
|
||||||
|
this.svnUpdater.getDependencyFileProd(this.algorithm.getLanguage()/*,env*/),
|
||||||
***REMOVED***this.svnUpdater.updateProdDeps(this.algorithm);
|
this.algorithm.getDependencies());
|
||||||
this.svnUpdater.updateSVNProdAlgorithmList(this.algorithm, this.targetVREName, this.category,this.algorithm_type, this.algorithm.getFullname()/*, env*/);
|
|
||||||
this.getStatus(9);
|
if (!undefinedDependencies.isEmpty()) ***REMOVED***
|
||||||
sm.sendNotification(nh.getSuccessSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBodyRelease("\n\n"+this.buildInfo()));
|
|
||||||
|
String message = "Following dependencies are not defined:\n";
|
||||||
|
for (String n : undefinedDependencies) ***REMOVED***
|
||||||
|
message += "\n" + n +"\n";
|
||||||
|
***REMOVED***
|
||||||
|
this.getStatus(2);
|
||||||
|
|
||||||
|
sm.sendNotification(nh.getFailedSubjectRelease() +" for "+this.algorithm.getName()+ " algorithm", nh.getFailedBody(message+"\n\n"+this.buildInfo()));
|
||||||
return;
|
return;
|
||||||
***REMOVED******REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***else this.getStatus(0);
|
b.deleteFilesProd(this.algorithm);
|
||||||
***REMOVED***sm.sendNotification(nh.getFailedSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getFailedBodyRelease(" The user "+this.algorithm.getFullname()+ " is not authorized to access to the "+ targetVREName+ " VRE"+"\n\n"+this.buildInfo()));
|
|
||||||
***REMOVED***return;
|
int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.prodCluster, false, "root"));
|
||||||
***REMOVED*** int ret = this.executeAnsibleWorker(
|
|
||||||
***REMOVED*** createWorker(this.algorithm, this.prodCluster, false, "gcube"));
|
if (ret != 0) ***REMOVED***
|
||||||
|
this.getStatus(2);
|
||||||
|
sm.sendNotification(nh.getFailedSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getFailedBody("Installation failed. Return code=" + ret)+"\n\n"+this.buildInfo());
|
||||||
|
return;
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
if (ret == 0) ***REMOVED***
|
||||||
|
this.getStatus(0);
|
||||||
|
|
||||||
|
if (b.checkMethod(a.getProdHost(), SecurityTokenProvider.instance.get())&&(b.algoExistsProd(this.algorithm/*, env*/))) ***REMOVED***
|
||||||
|
|
||||||
|
System.out.println("Interface check ok!");
|
||||||
|
System.out.println("Both the files exist at the correct path!");
|
||||||
|
|
||||||
|
this.svnUpdater.updateSVNProdAlgorithmList(this.algorithm, this.targetVREName,this.category, this.algorithm_type,
|
||||||
|
this.algorithm.getFullname()/*, env*/);
|
||||||
|
|
||||||
|
this.getStatus(9);
|
||||||
|
sm.sendNotification(nh.getSuccessSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBody("\n\n"+this.buildInfo()));
|
||||||
|
return;
|
||||||
|
***REMOVED*** else
|
||||||
|
this.getStatus(2);
|
||||||
|
sm.sendNotification(nh.getFailedSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm",
|
||||||
|
nh.getFailedBody(
|
||||||
|
"\n"+
|
||||||
|
"Installation completed but DataMiner Interface not working correctly or files "
|
||||||
|
+ this.algorithm.getName() + ".jar and " + this.algorithm.getName()
|
||||||
|
+ "_interface.jar not availables at the expected path")+"\n\n"+this.buildInfo());
|
||||||
|
return;
|
||||||
|
|
||||||
|
***REMOVED***
|
||||||
***REMOVED*** catch (Exception e) ***REMOVED***
|
***REMOVED*** catch (Exception e) ***REMOVED***
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
this.getStatus(0);
|
this.getStatus(0);
|
||||||
|
@ -75,42 +118,51 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getStatus(int exitstatus) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED***
|
public String getStatus(int exitstatus) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED***
|
||||||
|
|
||||||
File m = new File(this.jobLogs + File.separator + this.id+"_exitStatus");
|
File m = new File(this.jobLogs + File.separator + this.id + "_exitStatus");
|
||||||
PrintWriter writer = new PrintWriter(m, "UTF-8");
|
PrintWriter writer = new PrintWriter(m, "UTF-8");
|
||||||
|
|
||||||
String response = "";
|
String response = "";
|
||||||
|
|
||||||
|
if (exitstatus == 0) ***REMOVED***
|
||||||
|
response = "IN PROGRESS";
|
||||||
|
writer.println(response);
|
||||||
|
***REMOVED***writer.close();
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
if (exitstatus == 9) ***REMOVED***
|
if (exitstatus == 9) ***REMOVED***
|
||||||
response = "COMPLETED";
|
response = "COMPLETED";
|
||||||
writer.println(response);
|
writer.println(response);
|
||||||
|
***REMOVED***writer.close();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
if (exitstatus == 0) ***REMOVED***
|
if (exitstatus == 2) ***REMOVED***
|
||||||
response = "FAILED";
|
response = "FAILED";
|
||||||
writer.println(response);
|
writer.println(response);
|
||||||
***REMOVED***writer.close();
|
***REMOVED***writer.close();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
writer.close();
|
writer.close();
|
||||||
return response;
|
return response;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public String buildInfo() throws UnsupportedEncodingException***REMOVED***
|
||||||
public String buildInfo()***REMOVED***
|
ServiceConfiguration a = new ServiceConfiguration();
|
||||||
|
|
||||||
return
|
return
|
||||||
"\n"+
|
"\n"+
|
||||||
"Algorithm details:\n"+"\n"+
|
"Algorithm details:\n"+"\n"+
|
||||||
"User: "+this.algorithm.getFullname()+"\n"+
|
"User: "+this.algorithm.getFullname()+"\n"+
|
||||||
"Algorithm name: "+this.algorithm.getName()+"\n"+
|
"Algorithm name: "+this.algorithm.getName()+"\n"+
|
||||||
|
"Staging DataMiner Host: "+ a.getProdHost()+"\n"+
|
||||||
"Caller VRE: "+ScopeProvider.instance.get()+"\n"+
|
"Caller VRE: "+ScopeProvider.instance.get()+"\n"+
|
||||||
"Target VRE: "+targetVREName+"\n";
|
"Target VRE: "+this.targetVREName+"\n";
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
|
@ -87,7 +87,6 @@ public class CheckMethod ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean algoExists(Algorithm a/*, String env*/) throws Exception***REMOVED***
|
public boolean algoExists(Algorithm a/*, String env*/) throws Exception***REMOVED***
|
||||||
ServiceConfiguration p = new ServiceConfiguration();
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
|
||||||
|
@ -112,6 +111,30 @@ public class CheckMethod ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public boolean algoExistsProd(Algorithm a/*, String env*/) throws Exception***REMOVED***
|
||||||
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
|
||||||
|
File file = new File(p.getProdGhostAlgoDirectory()+"/"+a.getName()+".jar");
|
||||||
|
File file2 = new File(p.getProdGhostAlgoDirectory()+"/"+a.getName()+"_interface.jar");
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("First file is located to: "+file.getPath());
|
||||||
|
System.out.println("Second file is located to: "+file2.getPath());
|
||||||
|
|
||||||
|
|
||||||
|
if ((this.doesExistProd(file.getPath()/*,env*/)) && (this.doesExistProd(file2.getPath()/*,env*/)))***REMOVED***
|
||||||
|
this.copyFromDmToSVNProd(file/*,env*/);
|
||||||
|
this.copyFromDmToSVNProd(file2/*,env*/);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
***REMOVED***
|
||||||
|
else
|
||||||
|
System.out.println("Algorithm "+a.getName()+".jar"+ " and "+a.getName()+"_interface.jar files are not present at the expected path");
|
||||||
|
return false;
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public void deleteFiles(Algorithm a/*,String env*/) throws Exception***REMOVED***
|
public void deleteFiles(Algorithm a/*,String env*/) throws Exception***REMOVED***
|
||||||
JSch jsch = new JSch();
|
JSch jsch = new JSch();
|
||||||
Session session = null;
|
Session session = null;
|
||||||
|
@ -163,7 +186,55 @@ public class CheckMethod ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public void deleteFilesProd(Algorithm a/*,String env*/) throws Exception***REMOVED***
|
||||||
|
JSch jsch = new JSch();
|
||||||
|
Session session = null;
|
||||||
|
Channel channel = null;
|
||||||
|
ChannelSftp c = null;
|
||||||
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
System.out.println("checking existing in env: " + p.getProdHost());
|
||||||
|
|
||||||
|
File file = new File(p.getProdGhostAlgoDirectory()+"/"+a.getName()+".jar");
|
||||||
|
File file2 = new File(p.getProdGhostAlgoDirectory()+"/"+a.getName()+"_interface.jar");
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("First file is located to: "+file.getPath());
|
||||||
|
System.out.println("Second file is located to: "+file2.getPath());
|
||||||
|
|
||||||
|
|
||||||
|
jsch.setKnownHosts("~/.ssh/known_hosts");
|
||||||
|
String privateKey = "~/.ssh/id_rsa";
|
||||||
|
|
||||||
|
jsch.addIdentity(privateKey);
|
||||||
|
System.out.println("Private Key Added.");
|
||||||
|
|
||||||
|
session = jsch.getSession("root", p.getProdHost());
|
||||||
|
System.out.println("session created.");
|
||||||
|
|
||||||
|
java.util.Properties config = new java.util.Properties();
|
||||||
|
config.put("StrictHostKeyChecking", "no");
|
||||||
|
|
||||||
|
session.setConfig(config);
|
||||||
|
session.connect();
|
||||||
|
|
||||||
|
channel = session.openChannel("sftp");
|
||||||
|
channel.connect();
|
||||||
|
System.out.println("shell channel connected....");
|
||||||
|
|
||||||
|
c = (ChannelSftp) channel;
|
||||||
|
|
||||||
|
if(doesExistProd(file.getPath()/*,env*/)&&(doesExistProd(file2.getPath()/*,env*/)))***REMOVED***
|
||||||
|
|
||||||
|
c.rm(file.getPath());
|
||||||
|
c.rm(file2.getPath());
|
||||||
|
System.out.println("Both the files have been deleted");
|
||||||
|
***REMOVED***
|
||||||
|
else System.out.println("Files not found");
|
||||||
|
channel.disconnect();
|
||||||
|
c.disconnect();
|
||||||
|
session.disconnect();
|
||||||
|
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,6 +290,55 @@ public class CheckMethod ***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean doesExistProd(String path/*, String env*/) throws Exception ***REMOVED***
|
||||||
|
JSch jsch = new JSch();
|
||||||
|
Session session = null;
|
||||||
|
Channel channel = null;
|
||||||
|
ChannelSftp c = null;
|
||||||
|
boolean success = false;
|
||||||
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
|
||||||
|
|
||||||
|
jsch.setKnownHosts("~/.ssh/known_hosts");
|
||||||
|
String privateKey = "~/.ssh/id_rsa";
|
||||||
|
|
||||||
|
jsch.addIdentity(privateKey);
|
||||||
|
System.out.println("Private Key Added.");
|
||||||
|
|
||||||
|
session = jsch.getSession("root", p.getProdHost());
|
||||||
|
System.out.println("session created.");
|
||||||
|
|
||||||
|
java.util.Properties config = new java.util.Properties();
|
||||||
|
config.put("StrictHostKeyChecking", "no");
|
||||||
|
|
||||||
|
session.setConfig(config);
|
||||||
|
session.connect();
|
||||||
|
|
||||||
|
channel = session.openChannel("sftp");
|
||||||
|
channel.connect();
|
||||||
|
System.out.println("shell channel connected....");
|
||||||
|
|
||||||
|
c = (ChannelSftp) channel;
|
||||||
|
|
||||||
|
SftpATTRS is = null;
|
||||||
|
System.out.println(path);
|
||||||
|
|
||||||
|
try ***REMOVED***
|
||||||
|
is = c.lstat(path);
|
||||||
|
success = true;
|
||||||
|
***REMOVED*** catch (SftpException e) ***REMOVED***
|
||||||
|
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) ***REMOVED***
|
||||||
|
***REMOVED*** file doesn't exist
|
||||||
|
success = false;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED***success = true; ***REMOVED*** something else went wrong
|
||||||
|
***REMOVED***
|
||||||
|
channel.disconnect();
|
||||||
|
c.disconnect();
|
||||||
|
session.disconnect();
|
||||||
|
return success;
|
||||||
|
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public void copyFromDmToSVN(File a/*,String env*/) throws Exception ***REMOVED***
|
public void copyFromDmToSVN(File a/*,String env*/) throws Exception ***REMOVED***
|
||||||
|
@ -264,9 +384,50 @@ public class CheckMethod ***REMOVED***
|
||||||
f.delete();
|
f.delete();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void copyFromDmToSVNProd(File a/*,String env*/) throws Exception ***REMOVED***
|
||||||
|
JSch jsch = new JSch();
|
||||||
|
Session session = null;
|
||||||
|
ServiceConfiguration sc = new ServiceConfiguration();
|
||||||
|
SVNUpdater svnUpdater = new SVNUpdater(sc);
|
||||||
|
|
||||||
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
|
||||||
|
jsch.setKnownHosts("~/.ssh/known_hosts");
|
||||||
|
String privateKey = "~/.ssh/id_rsa";
|
||||||
|
|
||||||
|
jsch.addIdentity(privateKey);
|
||||||
|
System.out.println("Private Key Added.");
|
||||||
|
|
||||||
|
session = jsch.getSession("root", p.getProdHost());
|
||||||
|
System.out.println("session created.");
|
||||||
|
|
||||||
|
java.util.Properties config = new java.util.Properties();
|
||||||
|
config.put("StrictHostKeyChecking", "no");
|
||||||
|
|
||||||
|
session.setConfig(config);
|
||||||
|
session.connect();
|
||||||
|
|
||||||
|
Channel channel = session.openChannel("sftp");
|
||||||
|
channel.connect();
|
||||||
|
|
||||||
|
ChannelSftp sftp = (ChannelSftp) channel;
|
||||||
|
|
||||||
|
sftp.cd(p.getProdGhostAlgoDirectory());
|
||||||
|
|
||||||
|
System.out.println("REMOTE : "+p.getProdGhostAlgoDirectory()+"/"+a.getName());
|
||||||
|
System.out.println("LOCAL : /tmp/"+a.getName());
|
||||||
|
|
||||||
|
sftp.get(p.getProdGhostAlgoDirectory()+"/"+a.getName(),"/tmp/"+a.getName());
|
||||||
|
|
||||||
|
channel.disconnect();
|
||||||
|
session.disconnect();
|
||||||
|
|
||||||
|
File f = new File("/tmp/"+a.getName());
|
||||||
|
svnUpdater.updateAlgorithmFilesProd(f);
|
||||||
|
f.delete();
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
public List<String> getFiles(String a)***REMOVED***
|
public List<String> getFiles(String a)***REMOVED***
|
||||||
|
|
||||||
|
@ -281,13 +442,6 @@ public class CheckMethod ***REMOVED***
|
||||||
return ls;
|
return ls;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception ***REMOVED***
|
public static void main(String[] args) throws Exception ***REMOVED***
|
||||||
***REMOVED*** ServiceConfiguration a = new ServiceConfiguration();
|
***REMOVED*** ServiceConfiguration a = new ServiceConfiguration();
|
||||||
|
@ -295,7 +449,7 @@ public class CheckMethod ***REMOVED***
|
||||||
|
|
||||||
CheckMethod a = new CheckMethod();
|
CheckMethod a = new CheckMethod();
|
||||||
|
|
||||||
a.getFiles("/trunk/data-analysis/RConfiguration/RPackagesManagement/r_deb_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_cran_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_github_pkgs.txt");
|
***REMOVED***a.getFiles("/trunk/data-analysis/RConfiguration/RPackagesManagement/r_deb_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_cran_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_github_pkgs.txt");
|
||||||
|
|
||||||
***REMOVED*** File aa = new File("OCTAVEBLACKBOX.jar");
|
***REMOVED*** File aa = new File("OCTAVEBLACKBOX.jar");
|
||||||
***REMOVED*** System.out.println(aa.getName());
|
***REMOVED*** System.out.println(aa.getName());
|
||||||
|
@ -321,8 +475,8 @@ public class CheckMethod ***REMOVED***
|
||||||
***REMOVED*** a.copyFromDmToSVN(aa, "Dev");
|
***REMOVED*** a.copyFromDmToSVN(aa, "Dev");
|
||||||
|
|
||||||
|
|
||||||
***REMOVED***a.checkMethod("dataminer-ghost-d.dev.d4science.org",
|
System.out.println(a.checkMethod("dm-pool-manager-proto.d4science.org",
|
||||||
***REMOVED*** "***REMOVED***");
|
"2eceaf27-0e22-4dbe-8075-e09eff199bf9-98187548"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,29 @@ public class ClusterBuilder ***REMOVED***
|
||||||
return cluster;
|
return cluster;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public static Cluster getProdDataminerCluster() throws FileNotFoundException***REMOVED***
|
||||||
|
Cluster cluster = new Cluster();
|
||||||
|
ServiceConfiguration p = new ServiceConfiguration();
|
||||||
|
Host h = new Host();
|
||||||
|
h.setName(p.getProdHost());
|
||||||
|
cluster.addHost(h);
|
||||||
|
|
||||||
|
***REMOVED*** if (env.equals("Dev"))***REMOVED***
|
||||||
|
***REMOVED*** h.setName(p.getDevStagingHost());
|
||||||
|
***REMOVED*** cluster.addHost(h);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** if ((env.equals("Prod")||(env.equals("Proto"))))***REMOVED***
|
||||||
|
***REMOVED*** h.setName(p.getProtoProdStagingHost());
|
||||||
|
***REMOVED*** cluster.addHost(h);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
|
||||||
|
return cluster;
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Cluster getVRECluster(String targetVREToken, String targetVRE) throws IOException***REMOVED***
|
public static Cluster getVRECluster(String targetVREToken, String targetVRE) throws IOException***REMOVED***
|
||||||
Cluster cluster = new Cluster();
|
Cluster cluster = new Cluster();
|
||||||
for (Host h : new HAProxy().listDataMinersByCluster(targetVREToken,targetVRE)) ***REMOVED***
|
for (Host h : new HAProxy().listDataMinersByCluster(targetVREToken,targetVRE)) ***REMOVED***
|
||||||
|
|
|
@ -15,11 +15,11 @@ public class NotificationHelper ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
private String getSubjectHeader() ***REMOVED***
|
private String getSubjectHeader() ***REMOVED***
|
||||||
return "[DataMinerGhostInstallationRequestReport]";
|
return "[DataMinerGhostStagingInstallationRequestReport]";
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
private String getSubjectHeaderRelease() ***REMOVED***
|
private String getSubjectHeaderRelease() ***REMOVED***
|
||||||
return "[DataMinerReleaseInstallationRequestReport]";
|
return "[DataMinerGhostProductionInstallationRequestReport]";
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
private boolean isError() ***REMOVED***
|
private boolean isError() ***REMOVED***
|
||||||
|
@ -49,7 +49,7 @@ public class NotificationHelper ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getSuccessBody(String info) ***REMOVED***
|
public String getSuccessBody(String info) ***REMOVED***
|
||||||
String message = String.format("The installation of the algorithm in the ghost dataminer is completed successfully.");
|
String message = String.format("The installation of the algorithm is completed successfully.");
|
||||||
message+="\n\nYou can retrieve experiment results under the '/DataMiner' e-Infrastructure Workspace folder or from the DataMiner interface.\n\n"+ info;
|
message+="\n\nYou can retrieve experiment results under the '/DataMiner' e-Infrastructure Workspace folder or from the DataMiner interface.\n\n"+ info;
|
||||||
return message;
|
return message;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
@ -60,17 +60,17 @@ public class NotificationHelper ***REMOVED***
|
||||||
return body;
|
return body;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public String getSuccessBodyRelease(String info) ***REMOVED***
|
***REMOVED*** public String getSuccessBodyRelease(String info) ***REMOVED***
|
||||||
String message = String.format("SVN REPOSITORY CORRECTLY UPDATED.");
|
***REMOVED*** String message = String.format("SVN REPOSITORY CORRECTLY UPDATED.");
|
||||||
message+="\n\n The CRON job will install the algorithm in the target VRE \n\n"+ info;
|
***REMOVED*** message+="\n\n The CRON job will install the algorithm in the target VRE \n\n"+ info;
|
||||||
return message;
|
***REMOVED*** return message;
|
||||||
***REMOVED***
|
***REMOVED*** ***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
public String getFailedBodyRelease(String info) ***REMOVED***
|
***REMOVED*** public String getFailedBodyRelease(String info) ***REMOVED***
|
||||||
String message = String.format("SVN REPOSITORY UPDATE FAILED.");
|
***REMOVED*** String message = String.format("SVN REPOSITORY UPDATE FAILED.");
|
||||||
message+="\n\n The CRON job will NOT be able to install the algorithm in the target VRE \n\n"+ info;
|
***REMOVED*** message+="\n\n The CRON job will NOT be able to install the algorithm in the target VRE \n\n"+ info;
|
||||||
return message;
|
***REMOVED*** return message;
|
||||||
***REMOVED***
|
***REMOVED*** ***REMOVED***
|
||||||
|
|
||||||
***REMOVED*** public String getSubject() ***REMOVED***
|
***REMOVED*** public String getSubject() ***REMOVED***
|
||||||
***REMOVED*** if(this.isError()) ***REMOVED***
|
***REMOVED*** if(this.isError()) ***REMOVED***
|
||||||
|
|
|
@ -19,14 +19,12 @@ import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
import java.sql.Timestamp;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.ws.rs.core.NewCookie;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ggiammat on 5/9/17.
|
* Created by ggiammat on 5/9/17.
|
||||||
*/
|
*/
|
||||||
|
@ -72,116 +70,32 @@ public class SVNUpdater ***REMOVED***
|
||||||
return a;
|
return a;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDependencyFileProd(String language/*, String env*/)***REMOVED***
|
||||||
|
|
||||||
|
String a = "";
|
||||||
|
***REMOVED*** if (env.equals("Dev"))***REMOVED***
|
||||||
|
***REMOVED*** a= this.getDevDependencyFile(language);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** if (env.equals("Prod"))***REMOVED***
|
||||||
|
***REMOVED*** a= this.getProdDependencyFile(language);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** if (env.equals("Proto"))***REMOVED***
|
||||||
|
***REMOVED*** a= this.getRProtoDependencyFile(language);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** if (env.equals("Preprod"))***REMOVED***
|
||||||
|
***REMOVED*** a= this.getPreProdDependencyFile(language);
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
a = this.getProdDependencyFile(language);
|
||||||
|
return a;
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
***REMOVED*** public String getRProtoDependencyFile(String language) ***REMOVED***
|
|
||||||
***REMOVED*** switch (language) ***REMOVED***
|
|
||||||
***REMOVED*** case "R":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoCRANDepsList();
|
|
||||||
***REMOVED*** case "R-blackbox":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoRBDepsList();
|
|
||||||
***REMOVED*** case "Java":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoJavaDepsList();
|
|
||||||
***REMOVED*** case "Knime-Workflow":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoKWDepsList();
|
|
||||||
***REMOVED*** case "Linux-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoLinuxCompiledDepsList();
|
|
||||||
***REMOVED*** case "Octave":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoOctaveDepsList();
|
|
||||||
***REMOVED*** case "Python":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoPythonDepsList();
|
|
||||||
***REMOVED*** case "Pre-Installed":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoPreInstalledDepsList();
|
|
||||||
***REMOVED*** case "Windows-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNRProtoWCDepsList();
|
|
||||||
***REMOVED*** default:
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***REMOVED*** public String getPreProdDependencyFile(String language) ***REMOVED***
|
|
||||||
***REMOVED*** switch (language) ***REMOVED***
|
|
||||||
***REMOVED*** case "R":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdCRANDepsList();
|
|
||||||
***REMOVED*** case "R-blackbox":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdRBDepsList();
|
|
||||||
***REMOVED*** case "Java":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdJavaDepsList();
|
|
||||||
***REMOVED*** case "Knime-Workflow":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdKWDepsList();
|
|
||||||
***REMOVED*** case "Linux-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdLinuxCompiledDepsList();
|
|
||||||
***REMOVED*** case "Octave":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdOctaveDepsList();
|
|
||||||
***REMOVED*** case "Python":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdPythonDepsList();
|
|
||||||
***REMOVED*** case "Pre-Installed":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdPreInstalledDepsList();
|
|
||||||
***REMOVED*** case "Windows-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNPreProdWCDepsList();
|
|
||||||
***REMOVED*** default:
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***REMOVED*** public String getProdDependencyFile(String language) ***REMOVED***
|
|
||||||
***REMOVED*** switch (language) ***REMOVED***
|
|
||||||
***REMOVED*** case "R":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdCRANDepsList();
|
|
||||||
***REMOVED*** case "R-blackbox":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdRBDepsList();
|
|
||||||
***REMOVED*** case "Java":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdJavaDepsList();
|
|
||||||
***REMOVED*** case "Knime-Workflow":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdKWDepsList();
|
|
||||||
***REMOVED*** case "Linux-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdLinuxCompiledDepsList();
|
|
||||||
***REMOVED*** case "Octave":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdOctaveDepsList();
|
|
||||||
***REMOVED*** case "Python":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdPythonDepsList();
|
|
||||||
***REMOVED*** case "Pre-Installed":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdPreInstalledDepsList();
|
|
||||||
***REMOVED*** case "Windows-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNProdWCDepsList();
|
|
||||||
***REMOVED*** default:
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
|
|
||||||
***REMOVED*** public String getDevDependencyFile(String language) ***REMOVED***
|
|
||||||
***REMOVED*** switch (language) ***REMOVED***
|
|
||||||
***REMOVED*** case "R":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevCRANDepsList();
|
|
||||||
***REMOVED*** case "R-blackbox":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevRBDepsList();
|
|
||||||
***REMOVED*** case "Java":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevJavaDepsList();
|
|
||||||
***REMOVED*** case "Knime-Workflow":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevKWDepsList();
|
|
||||||
***REMOVED*** case "Linux-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevLinuxCompiledDepsList();
|
|
||||||
***REMOVED*** case "Octave":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevOctaveDepsList();
|
|
||||||
***REMOVED*** case "Python":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevPythonDepsList();
|
|
||||||
***REMOVED*** case "Pre-Installed":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevPreInstalledDepsList();
|
|
||||||
***REMOVED*** case "Windows-compiled":
|
|
||||||
***REMOVED*** return this.configuration.getSVNDevWCDepsList();
|
|
||||||
***REMOVED*** default:
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
|
|
||||||
|
|
||||||
public String getStagingDependencyFile(String language) ***REMOVED***
|
public String getStagingDependencyFile(String language) ***REMOVED***
|
||||||
switch (language) ***REMOVED***
|
switch (language) ***REMOVED***
|
||||||
|
@ -209,162 +123,32 @@ public class SVNUpdater ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public String getProdDependencyFile(String language) ***REMOVED***
|
||||||
|
switch (language) ***REMOVED***
|
||||||
|
case "R":
|
||||||
***REMOVED*** public void readPreProdDeps(Algorithm algorithm) throws SVNException ***REMOVED***
|
return this.configuration.getSVNProdCRANDepsList();
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R")) ***REMOVED***
|
case "R-blackbox":
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
return this.configuration.getSVNProdRBDepsList();
|
||||||
***REMOVED*** ***REMOVED***
|
case "Java":
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R-blackbox")) ***REMOVED***
|
return this.configuration.getSVNProdJavaDepsList();
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
case "Knime-Workflow":
|
||||||
***REMOVED*** ***REMOVED***
|
return this.configuration.getSVNProdKWDepsList();
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Java")) ***REMOVED***
|
case "Linux-compiled":
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
return this.configuration.getSVNProdLinuxCompiledDepsList();
|
||||||
***REMOVED*** ***REMOVED***
|
case "Octave":
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Knime-Workflow")) ***REMOVED***
|
return this.configuration.getSVNProdOctaveDepsList();
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
case "Python":
|
||||||
***REMOVED*** ***REMOVED***
|
return this.configuration.getSVNProdPythonDepsList();
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Linux-compiled")) ***REMOVED***
|
case "Pre-Installed":
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
return this.configuration.getSVNProdPreInstalledDepsList();
|
||||||
***REMOVED*** ***REMOVED***
|
case "Windows-compiled":
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Octave")) ***REMOVED***
|
return this.configuration.getSVNProdWCDepsList();
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
default:
|
||||||
***REMOVED*** ***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Python")) ***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Windows-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Pre-Installed")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** public void readRPRotoDeps(Algorithm algorithm) throws SVNException ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R-blackbox")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Java")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Knime-Workflow")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Linux-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Octave")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Python")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Windows-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Pre-Installed")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** public void readProdDeps(Algorithm algorithm) throws SVNException ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNProdCRANDepsList(), algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R-blackbox")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Java")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Knime-Workflow")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Linux-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Octave")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Python")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Windows-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Pre-Installed")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** public void readRDevDeps(Algorithm algorithm) throws SVNException ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("R-blackbox")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Java")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Knime-Workflow")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Linux-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Octave")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Python")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Windows-compiled")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** if (algorithm.getLanguage().equals("Pre-Installed")) ***REMOVED***
|
|
||||||
***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies());
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
***REMOVED*** public void updateProdDeps(Algorithm algorithm) ***REMOVED***
|
|
||||||
***REMOVED*** this.updateSVN(this.configuration.getSVNProdOSDepsList(), algorithm.getOSDependencies());
|
|
||||||
***REMOVED*** this.updateSVN(this.configuration.getSVNRProdCRANDepsList(), algorithm.getCranDependencies());
|
|
||||||
***REMOVED*** this.updateSVN(this.configuration.getSVNRProdGitHubDepsList(), algorithm.getGitHubDependencies());
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
***REMOVED*** public void updateSVNAlgorithmList(Algorithm algorithm, String targetVRE, String category, String algorithm_type, String user/*, String env*/) ***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** if (env.equals("Dev"))***REMOVED***
|
|
||||||
***REMOVED*** this.updateSVNAlgorithmList(this.configuration.getSVNDevAlgorithmsList(), algorithm, targetVRE, category,algorithm_type, user, env);
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** if (env.equals("Prod"))***REMOVED***
|
|
||||||
***REMOVED*** this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user, env);
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** if (env.equals("Proto"))***REMOVED***
|
|
||||||
***REMOVED*** this.updateSVNAlgorithmList(this.configuration.getSVNRProtoAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user, env);
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** if (env.equals("Preprod"))***REMOVED***
|
|
||||||
***REMOVED*** this.updateSVNAlgorithmList(this.configuration.getSVNPreProdAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user, env);
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
|
|
||||||
public void updateSVNStagingAlgorithmList(Algorithm algorithm, String targetVRE, String category, String algorithm_type, String user/*, String env*/) ***REMOVED***
|
public void updateSVNStagingAlgorithmList(Algorithm algorithm, String targetVRE, String category, String algorithm_type, String user/*, String env*/) ***REMOVED***
|
||||||
this.updateSVNAlgorithmList(this.configuration.getSVNStagingAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user);
|
this.updateSVNAlgorithmList(this.configuration.getSVNStagingAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user);
|
||||||
|
@ -381,6 +165,13 @@ public class SVNUpdater ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
public void updateAlgorithmFilesProd(File a) throws SVNException***REMOVED***
|
||||||
|
***REMOVED***this.updateAlgorithmList(this.configuration.getSVNMainAlgoRepo(), a);
|
||||||
|
this.updateAlgorithmList(this.configuration.getProdRepository(), a);
|
||||||
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void updateAlgorithmList(String svnMainAlgoRepo, File a) throws SVNException ***REMOVED***
|
public void updateAlgorithmList(String svnMainAlgoRepo, File a) throws SVNException ***REMOVED***
|
||||||
try ***REMOVED***
|
try ***REMOVED***
|
||||||
System.out.println("Adding .jar file: " + a + " to repository " + svnMainAlgoRepo);
|
System.out.println("Adding .jar file: " + a + " to repository " + svnMainAlgoRepo);
|
||||||
|
@ -533,6 +324,7 @@ public class SVNUpdater ***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String category, String algorithm_type/*,String env*/) throws ParseException ***REMOVED***
|
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String category, String algorithm_type/*,String env*/) throws ParseException ***REMOVED***
|
||||||
***REMOVED***Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
***REMOVED***Timestamp timestamp = new Timestamp(System.currentTimeMillis());
|
||||||
***REMOVED***long unixTime = System.currentTimeMillis() / 1000L;
|
***REMOVED***long unixTime = System.currentTimeMillis() / 1000L;
|
||||||
|
@ -547,6 +339,9 @@ public class SVNUpdater ***REMOVED***
|
||||||
+ algorithm.getPackageURL() + " \"" + algorithm.getDescription() + "\" </notextile> | ");
|
+ algorithm.getPackageURL() + " \"" + algorithm.getDescription() + "\" </notextile> | ");
|
||||||
sb.append("none | ");
|
sb.append("none | ");
|
||||||
sb.append(this.getTimeZone() + " | ");
|
sb.append(this.getTimeZone() + " | ");
|
||||||
|
|
||||||
|
System.out.println("Algo details: "+sb.toString());
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
@ -746,7 +541,6 @@ public class SVNUpdater ***REMOVED***
|
||||||
SVNFileUtil.closeFile(checksumStream);
|
SVNFileUtil.closeFile(checksumStream);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public List<String> checkMatch(String[] lines, List<String> ls) ***REMOVED***
|
public List<String> checkMatch(String[] lines, List<String> ls) ***REMOVED***
|
||||||
Set<String> ss = new HashSet<String>(ls);
|
Set<String> ss = new HashSet<String>(ls);
|
||||||
ss.addAll(Arrays.asList(lines));
|
ss.addAll(Arrays.asList(lines));
|
||||||
|
@ -758,7 +552,7 @@ public class SVNUpdater ***REMOVED***
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.getTime();
|
cal.getTime();
|
||||||
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
|
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
|
||||||
Date fromDate = (Date)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));
|
System.out.println(formatter.format(fromDate));
|
||||||
|
@ -782,7 +576,7 @@ public class SVNUpdater ***REMOVED***
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.getTime();
|
cal.getTime();
|
||||||
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
|
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
|
||||||
Date fromDate = (Date)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));
|
System.out.println(formatter.format(fromDate));
|
||||||
|
|
|
@ -114,6 +114,9 @@ public class AlgorithmPackageParserTest ***REMOVED***
|
||||||
***REMOVED*** "/home/ngalante/.proxy-settings"));
|
***REMOVED*** "/home/ngalante/.proxy-settings"));
|
||||||
|
|
||||||
new AlgorithmPackageParserTest().extractAllAlgorithms();
|
new AlgorithmPackageParserTest().extractAllAlgorithms();
|
||||||
|
***REMOVED*** AlgorithmPackageParserTest at = new AlgorithmPackageParserTest();
|
||||||
|
***REMOVED*** Algorithm a = at.extractAlgorithm("http:***REMOVED***data.d4science.org/YjJ3TmJab1dqYzVoTmppdjlsK0l0b1ZXWGtzWlQ1NHNHbWJQNStIS0N6Yz0");
|
||||||
|
***REMOVED*** System.out.println(a.getFullname());
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
Loading…
Reference in New Issue