git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@150848 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
73d4602510
commit
7500d118b1
|
@ -85,7 +85,7 @@ public class RestPoolManager implements PoolManager {
|
|||
// // PropertiesBasedProxySelector("/home/ngalante/.proxy-settings"));
|
||||
//
|
||||
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
|
||||
// SecurityTokenProvider.instance.set("708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548");
|
||||
SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
|
||||
|
||||
// AuthorizationEntry entry = authorizationService().get("708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548");
|
||||
// System.out.println(entry.getContext());
|
||||
|
|
|
@ -2,29 +2,27 @@ package org.gcube.dataanalysis.dataminer.poolmanager.service;
|
|||
|
||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckMethod;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.NotificationHelper;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.SendMail;
|
||||
import org.gcube.dataanalysis.dataminer.poolmanager.util.ServiceConfiguration;
|
||||
|
||||
public class StagingJob extends DMPMJob {
|
||||
|
||||
|
||||
|
||||
private Algorithm algorithm;
|
||||
private Cluster stagingCluster;
|
||||
private Cluster rProtoCluster;
|
||||
private String rProtoVREName;
|
||||
|
||||
public StagingJob(
|
||||
SVNUpdater svnUpdater,
|
||||
Algorithm algorithm,
|
||||
Cluster stagingCluster,
|
||||
Cluster rProtoCluster,
|
||||
public StagingJob(SVNUpdater svnUpdater, Algorithm algorithm, Cluster stagingCluster, Cluster rProtoCluster,
|
||||
String rProtoVREName) {
|
||||
super(svnUpdater);
|
||||
this.algorithm = algorithm;
|
||||
|
@ -38,31 +36,43 @@ public class StagingJob extends DMPMJob {
|
|||
ServiceConfiguration a = new ServiceConfiguration();
|
||||
CheckMethod b = new CheckMethod();
|
||||
SendMail sm = new SendMail();
|
||||
|
||||
NotificationHelper nh = new NotificationHelper();
|
||||
|
||||
try {
|
||||
|
||||
this.svnUpdater.readRPRotoDeps(this.algorithm);
|
||||
int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.stagingCluster, false, "root"));
|
||||
|
||||
if (ret == 0) {
|
||||
Collection<String> undefinedDependencies = this.svnUpdater.getUndefinedDependencies(
|
||||
this.svnUpdater.getRProtoDependencyFile(this.algorithm.getLanguage()), this.algorithm.getDependencies());
|
||||
|
||||
if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get())
|
||||
&& (b.algoExists(this.algorithm))) {
|
||||
if (!undefinedDependencies.isEmpty()) {
|
||||
|
||||
sm.sendNotification("", "");
|
||||
// this.svnUpdater.updateRPRotoDeps(this.algorithm);
|
||||
|
||||
this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName,
|
||||
this.algorithm.getFullname(), "Proto");
|
||||
|
||||
|
||||
// int ret2 = this.executeAnsibleWorker(
|
||||
// createWorker(this.algorithm, this.rProtoCluster,
|
||||
// false, "gcube"));
|
||||
}
|
||||
String message = "Following dependencies are not defined:\n";
|
||||
for (String n : undefinedDependencies) {
|
||||
message += "\n" + n;
|
||||
}
|
||||
else sm.sendNotification("", "");
|
||||
|
||||
sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody(message));
|
||||
return;
|
||||
}
|
||||
|
||||
int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.stagingCluster, false, "root"));
|
||||
|
||||
if (ret == 0) {
|
||||
|
||||
if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get())
|
||||
&& (b.algoExists(this.algorithm))) {
|
||||
|
||||
sm.sendNotification(nh.getSuccessSubject(), nh.getSuccessBody());
|
||||
// this.svnUpdater.updateRPRotoDeps(this.algorithm);
|
||||
|
||||
this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName,
|
||||
this.algorithm.getFullname(), "Proto");
|
||||
|
||||
// int ret2 = this.executeAnsibleWorker(
|
||||
// createWorker(this.algorithm, this.rProtoCluster,
|
||||
// false, "gcube"));
|
||||
}
|
||||
} else
|
||||
sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody("Installation failed. Return code=" + ret));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -8,43 +8,15 @@ import org.apache.commons.lang.StringUtils;
|
|||
import scala.actors.threadpool.Arrays;
|
||||
|
||||
public class NotificationHelper {
|
||||
|
||||
private Calendar startTime;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String scope;
|
||||
|
||||
private Exception executionException;
|
||||
|
||||
public NotificationHelper() {
|
||||
}
|
||||
|
||||
public void setStartTime(Calendar startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
private String getSubjectHeader() {
|
||||
return "[DataMinerGhostInstallationRequestReport]";
|
||||
}
|
||||
|
||||
private String getSpecificVREName() {
|
||||
if(this.scope!=null) {
|
||||
String[] parts = this.scope.split("/");
|
||||
if(parts.length>=3) {
|
||||
return StringUtils.join(Arrays.copyOfRange(parts, 3, parts.length), "/");
|
||||
}
|
||||
}
|
||||
return this.scope;
|
||||
}
|
||||
|
||||
private boolean isError() {
|
||||
return this.executionException!=null;
|
||||
|
@ -54,45 +26,40 @@ public class NotificationHelper {
|
|||
this.executionException = executionException;
|
||||
}
|
||||
|
||||
private String getSuccessSubject() {
|
||||
return String.format("%s Results for your experiment '%s' are ready", this.getSubjectHeader(), this.taskId);
|
||||
public String getSuccessSubject() {
|
||||
return this.getSubjectHeader()+" is SUCCESS";
|
||||
}
|
||||
|
||||
private String getFailedSubject() {
|
||||
return String.format("%s An error occurred while executing your experiment '%s'", this.getSubjectHeader(), this.taskId);
|
||||
public String getFailedSubject() {
|
||||
return String.format(this.getSubjectHeader()+" is FAILED");
|
||||
}
|
||||
|
||||
private String getFormattedStartTime() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
|
||||
return sdf.format(this.startTime.getTime());
|
||||
}
|
||||
|
||||
private String getSuccessBody() {
|
||||
String message = String.format("Your experiment '%s' submitted on %s in the '%s' VRE completed successfully.", this.taskId, this.getFormattedStartTime(), this.getSpecificVREName());
|
||||
|
||||
public String getSuccessBody() {
|
||||
String message = String.format("The installation of the algorithm in the ghost dataminer is completed successfully.");
|
||||
message+="\n\nYou can retrieve experiment results under the '/DataMiner' e-Infrastructure Workspace folder or from the DataMiner interface.";
|
||||
return message;
|
||||
}
|
||||
|
||||
private String getFailedBody() {
|
||||
String message = String.format("An error occurred while executing your experiment '%s' submitted on %s in the '%s' VRE.", this.taskId, this.getFormattedStartTime(), this.getSpecificVREName());
|
||||
message+= "\n\nHere are the error details:\n\n" + this.executionException;
|
||||
return message;
|
||||
public String getFailedBody(String message) {
|
||||
String body = String.format("An error occurred while deploying your algorithm");
|
||||
body+= "\n\nHere are the error details:\n\n" + message;
|
||||
return body;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
if(this.isError()) {
|
||||
return this.getFailedSubject();
|
||||
} else {
|
||||
return this.getSuccessSubject();
|
||||
}
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
if(this.isError()) {
|
||||
return this.getFailedBody();
|
||||
} else {
|
||||
return this.getSuccessBody();
|
||||
}
|
||||
}
|
||||
// public String getSubject() {
|
||||
// if(this.isError()) {
|
||||
// return this.getFailedSubject();
|
||||
// } else {
|
||||
// return this.getSuccessSubject();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public String getBody() {
|
||||
// if(this.isError()) {
|
||||
// return this.getFailedBody();
|
||||
// } else {
|
||||
// return this.getSuccessBody();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -23,190 +23,316 @@ import java.util.*;
|
|||
*/
|
||||
public class SVNUpdater {
|
||||
|
||||
private SVNRepository svnRepository;
|
||||
private ServiceConfiguration configuration;
|
||||
private SVNRepository svnRepository;
|
||||
private ServiceConfiguration configuration;
|
||||
|
||||
public SVNUpdater(ServiceConfiguration configuration) throws SVNException {
|
||||
this.svnRepository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(configuration.getSVNRepository()));
|
||||
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager();
|
||||
this.svnRepository.setAuthenticationManager(authManager);
|
||||
this.configuration = configuration;
|
||||
}
|
||||
public SVNUpdater(ServiceConfiguration configuration) throws SVNException {
|
||||
this.svnRepository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(configuration.getSVNRepository()));
|
||||
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager();
|
||||
this.svnRepository.setAuthenticationManager(authManager);
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public void updateRPRotoDeps(Algorithm algorithm) {
|
||||
this.updateSVN(this.configuration.getSVNRProtoOSDepsList(), algorithm.getOSDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getCranDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProtoGitHubDepsList(), algorithm.getGitHubDependencies());
|
||||
}
|
||||
|
||||
public String getRProtoDependencyFile(String language) {
|
||||
switch (language) {
|
||||
case "R":
|
||||
return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "R-blackbox":
|
||||
// return "";
|
||||
// case "Java":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
case "Knime-Workflow":
|
||||
return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Linux-compiled":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Octave":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Python":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Pre-Installed":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Windows-compiled":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getProdDependencyFile(String language) {
|
||||
switch (language) {
|
||||
case "R":
|
||||
return this.configuration.getSVNRProdCRANDepsList();
|
||||
// case "R-blackbox":
|
||||
// return "";
|
||||
// case "Java":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Knime-Workflow":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Linux-compiled":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Octave":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Python":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Pre-Installed":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
// case "Windows-compiled":
|
||||
// return this.configuration.getSVNRProtoCRANDepsList();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateRPRotoDeps(Algorithm algorithm){
|
||||
this.updateSVN(this.configuration.getSVNRProtoOSDepsList(), algorithm.getOSDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getCranDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProtoGitHubDepsList(), algorithm.getGitHubDependencies());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void readRPRotoDeps(Algorithm algorithm) throws SVNException{
|
||||
if (algorithm.getLanguage().equals("R")){
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("R-blackbox")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Java")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Knime-Workflow")){
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Linux-compiled")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Octave")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Python")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Windows-compiled")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Pre-Installed")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void readProdDeps(Algorithm algorithm) throws SVNException{
|
||||
if (algorithm.getLanguage().equals("R")){
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProdCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("R-blackbox")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Java")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Knime-Workflow")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Linux-compiled")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Octave")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Python")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Windows-compiled")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Pre-Installed")){
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void updateProdDeps(Algorithm algorithm){
|
||||
this.updateSVN(this.configuration.getSVNProdOSDepsList(), algorithm.getOSDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProdCRANDepsList(), algorithm.getCranDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProdGitHubDepsList(), algorithm.getGitHubDependencies());
|
||||
}
|
||||
public void readRPRotoDeps(Algorithm algorithm) throws SVNException {
|
||||
if (algorithm.getLanguage().equals("R")) {
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("R-blackbox")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Java")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Knime-Workflow")) {
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Linux-compiled")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Octave")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Python")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Windows-compiled")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Pre-Installed")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
}
|
||||
|
||||
public void readProdDeps(Algorithm algorithm) throws SVNException {
|
||||
if (algorithm.getLanguage().equals("R")) {
|
||||
this.checkIfAvaialable(this.configuration.getSVNRProdCRANDepsList(), algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("R-blackbox")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Java")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Knime-Workflow")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Linux-compiled")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Octave")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Python")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Windows-compiled")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
if (algorithm.getLanguage().equals("Pre-Installed")) {
|
||||
this.checkIfAvaialable("", algorithm.getDependencies());
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSVNRProtoAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env){
|
||||
this.updateSVNAlgorithmList(this.configuration.getSVNRProtoAlgorithmsList(), algorithm, targetVRE, user, env);
|
||||
}
|
||||
public void updateProdDeps(Algorithm algorithm) {
|
||||
this.updateSVN(this.configuration.getSVNProdOSDepsList(), algorithm.getOSDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProdCRANDepsList(), algorithm.getCranDependencies());
|
||||
this.updateSVN(this.configuration.getSVNRProdGitHubDepsList(), algorithm.getGitHubDependencies());
|
||||
}
|
||||
|
||||
public void updateSVNRProtoAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) {
|
||||
this.updateSVNAlgorithmList(this.configuration.getSVNRProtoAlgorithmsList(), algorithm, targetVRE, user, env);
|
||||
}
|
||||
|
||||
public void updateSVNProdAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env){
|
||||
this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, user, env);
|
||||
}
|
||||
public void updateSVNProdAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) {
|
||||
this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, user, env);
|
||||
}
|
||||
|
||||
public void updateSVNAlgorithmList(String file, Algorithm algorithm, String targetVRE, String user, String env){
|
||||
try {
|
||||
System.out.println("Updating algorithm list: "+ file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
public void updateSVNAlgorithmList(String file, Algorithm algorithm, String targetVRE, String user, String env) {
|
||||
try {
|
||||
System.out.println("Updating algorithm list: " + file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
|
||||
//check if the algorithm is already in the list (match the class name)
|
||||
for(String l: lines){
|
||||
if(l.contains(algorithm.getClazz())){
|
||||
System.out.println("Not updating algorithm list beacuse already present");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// check if the algorithm is already in the list (match the class
|
||||
// name)
|
||||
for (String l : lines) {
|
||||
if (l.contains(algorithm.getClazz())) {
|
||||
System.out.println("Not updating algorithm list beacuse already present");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//the algorithm is not in the list. Add it
|
||||
List<String> newContent = new LinkedList<>(Arrays.asList(lines));
|
||||
newContent.add(this.generateAlgorithmEntry(algorithm, targetVRE, env));
|
||||
//Collections.sort(newContent);
|
||||
// the algorithm is not in the list. Add it
|
||||
List<String> newContent = new LinkedList<>(Arrays.asList(lines));
|
||||
newContent.add(this.generateAlgorithmEntry(algorithm, targetVRE, env));
|
||||
// Collections.sort(newContent);
|
||||
|
||||
final SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
|
||||
|
||||
final SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
|
||||
byte[] originalContents = byteArrayOutputStream.toByteArray();
|
||||
|
||||
byte[] originalContents = byteArrayOutputStream.toByteArray();
|
||||
final ISVNEditor commitEditor = svnRepository.getCommitEditor("update algorithm list", null);
|
||||
commitEditor.openRoot(-1);
|
||||
commitEditor.openFile(file, -1);
|
||||
|
||||
final ISVNEditor commitEditor = svnRepository.getCommitEditor("update algorithm list", null);
|
||||
commitEditor.openRoot(-1);
|
||||
commitEditor.openFile(file, -1);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
for (String line : newContent) {
|
||||
baos.write(line.getBytes());
|
||||
baos.write("\n".getBytes());
|
||||
}
|
||||
byte[] bytes = baos.toByteArray();
|
||||
|
||||
for (String line : newContent) {
|
||||
baos.write(line.getBytes());
|
||||
baos.write("\n".getBytes());
|
||||
}
|
||||
byte[] bytes = baos.toByteArray();
|
||||
commitEditor.applyTextDelta(file, md5(originalContents));
|
||||
|
||||
commitEditor.applyTextDelta(file,md5(originalContents));
|
||||
final String checksum = deltaGenerator.sendDelta(file, new ByteArrayInputStream(originalContents), 0,
|
||||
new ByteArrayInputStream(bytes), commitEditor, true);
|
||||
commitEditor.closeFile(file, checksum);
|
||||
commitEditor.closeEdit();
|
||||
|
||||
final String checksum = deltaGenerator.sendDelta(file, new ByteArrayInputStream(originalContents), 0,
|
||||
new ByteArrayInputStream(bytes), commitEditor, true);
|
||||
commitEditor.closeFile(file, checksum);
|
||||
commitEditor.closeEdit();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
finally {
|
||||
svnRepository.closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String env) {
|
||||
StringBuffer sb = new StringBuffer("| ");
|
||||
sb.append(algorithm.getName() + " | ");
|
||||
sb.append(algorithm.getFullname() + " | ");
|
||||
sb.append(algorithm.getCategory() + " | ");
|
||||
sb.append(env + " | ");
|
||||
sb.append("<notextile>./addAlgorithm.sh " + algorithm.getName() + " " + algorithm.getCategory() + " "
|
||||
+ algorithm.getClazz() + " " + targetVRE + " " + algorithm.getAlgorithmType() + " N "
|
||||
+ algorithm.getPackageURL() + " \"" + algorithm.getDescription() + "\" </notextile> | ");
|
||||
sb.append("none |");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public Collection<String> getUndefinedDependencies(String file, Collection<Dependency> deps) throws SVNException {
|
||||
// SendMail sm = new SendMail();
|
||||
// NotificationHelper nh = new NotificationHelper();
|
||||
|
||||
finally {
|
||||
svnRepository.closeSession();
|
||||
} }
|
||||
|
||||
System.out.println("Checking dependencies list: " + file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
List<String> validDependencies = Arrays.asList(lines);
|
||||
|
||||
|
||||
|
||||
List<String> undefined = new LinkedList<String>();
|
||||
|
||||
|
||||
|
||||
for(Dependency d: deps){
|
||||
String depName = d.getName();
|
||||
if(!validDependencies.contains(depName)){
|
||||
undefined.add(depName);
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
//
|
||||
//
|
||||
// for (String a : lines) {
|
||||
// for (String b : ldep) {
|
||||
// if (b.equals(a)) {
|
||||
// System.out.println("The following dependency is correctly written: " + b);
|
||||
// } else
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// boolean check = false;
|
||||
// try {
|
||||
// System.out.println("Checking dependencies list: " + file);
|
||||
// final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
// svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
// String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
//
|
||||
// // if(deps.isEmpty()){
|
||||
// // sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody());
|
||||
// // Exception e = new Exception("No dependency specified for this
|
||||
// // algorithm");
|
||||
// // throw e;
|
||||
// //
|
||||
// // }
|
||||
//
|
||||
// // else if (!deps.isEmpty()) {
|
||||
// List<String> ldep = new LinkedList<>();
|
||||
// for (Dependency d : deps) {
|
||||
// ldep.add(d.getName());
|
||||
// }
|
||||
// for (String a : lines) {
|
||||
// for (String b : ldep) {
|
||||
// if (b.equals(a)) {
|
||||
// System.out.println("The following dependency is correctly written: " + b);
|
||||
// check = true;
|
||||
// } else
|
||||
// check = false;
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// // }
|
||||
// } catch (Exception a) {
|
||||
// a.getMessage();
|
||||
// }
|
||||
//
|
||||
// return check;
|
||||
|
||||
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String env){
|
||||
StringBuffer sb = new StringBuffer("| ");
|
||||
sb.append(algorithm.getName() +" | ");
|
||||
sb.append(algorithm.getFullname() + " | ");
|
||||
sb.append(algorithm.getCategory() + " | ");
|
||||
sb.append(env + " | ");
|
||||
sb.append("<notextile>./addAlgorithm.sh "+ algorithm.getName()+" " + algorithm.getCategory() + " " + algorithm.getClazz() + " " + targetVRE + " " + algorithm.getAlgorithmType() + " N " + algorithm.getPackageURL() + " \"" + algorithm.getDescription() + "\" </notextile> | ");
|
||||
sb.append("none |");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean checkIfAvaialable(String file, Collection<Dependency> deps) throws SVNException {
|
||||
SendMail sm = new SendMail();
|
||||
NotificationHelper nh = new NotificationHelper();
|
||||
|
||||
boolean check = false;
|
||||
try{
|
||||
System.out.println("Checking dependencies list: " + file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
|
||||
if(deps.isEmpty()){
|
||||
Exception e = new Exception("No dependency specified for this algorithm");
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
else if (!deps.isEmpty()) {
|
||||
try {
|
||||
System.out.println("Checking dependencies list: " + file);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
|
||||
// if(deps.isEmpty()){
|
||||
// sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody());
|
||||
// Exception e = new Exception("No dependency specified for this
|
||||
// algorithm");
|
||||
// throw e;
|
||||
//
|
||||
// }
|
||||
|
||||
// else if (!deps.isEmpty()) {
|
||||
List<String> ldep = new LinkedList<>();
|
||||
for (Dependency d : deps) {
|
||||
ldep.add(d.getName());
|
||||
|
@ -214,101 +340,91 @@ public class SVNUpdater {
|
|||
for (String a : lines) {
|
||||
for (String b : ldep) {
|
||||
if (b.equals(a)) {
|
||||
System.out.println("The following dependency is correctly written: "+b);
|
||||
System.out.println("The following dependency is correctly written: " + b);
|
||||
check = true;
|
||||
} else
|
||||
check = false;
|
||||
Exception e = new Exception("One or more of the following dependencies are not correctly written: "+b);
|
||||
throw e;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception a){
|
||||
// }
|
||||
} catch (Exception a) {
|
||||
a.getMessage();
|
||||
}
|
||||
|
||||
|
||||
return check;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void updateSVN(String file, Collection<Dependency> deps) {
|
||||
try {
|
||||
System.out.println("Updating dependencies list: "+ file);
|
||||
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
public void updateSVN(String file, Collection<Dependency> deps) {
|
||||
try {
|
||||
System.out.println("Updating dependencies list: " + file);
|
||||
|
||||
List<String> ldep = new LinkedList<>();
|
||||
for(Dependency d: deps){
|
||||
ldep.add(d.getName());
|
||||
}
|
||||
List<String> aa = this.checkMatch(lines, ldep);
|
||||
Collections.sort(aa);
|
||||
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream);
|
||||
String lines[] = byteArrayOutputStream.toString().split("\\r?\\n");
|
||||
|
||||
final SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
|
||||
List<String> ldep = new LinkedList<>();
|
||||
for (Dependency d : deps) {
|
||||
ldep.add(d.getName());
|
||||
}
|
||||
List<String> aa = this.checkMatch(lines, ldep);
|
||||
Collections.sort(aa);
|
||||
|
||||
byte[] originalContents = byteArrayOutputStream.toByteArray();
|
||||
final SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
|
||||
|
||||
final ISVNEditor commitEditor = svnRepository.getCommitEditor("update dependencies", null);
|
||||
commitEditor.openRoot(-1);
|
||||
commitEditor.openFile(file, -1);
|
||||
byte[] originalContents = byteArrayOutputStream.toByteArray();
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
final ISVNEditor commitEditor = svnRepository.getCommitEditor("update dependencies", null);
|
||||
commitEditor.openRoot(-1);
|
||||
commitEditor.openFile(file, -1);
|
||||
|
||||
for (String line : aa) {
|
||||
baos.write(line.getBytes());
|
||||
baos.write("\n".getBytes());
|
||||
}
|
||||
byte[] bytes = baos.toByteArray();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
commitEditor.applyTextDelta(file,md5(originalContents));
|
||||
for (String line : aa) {
|
||||
baos.write(line.getBytes());
|
||||
baos.write("\n".getBytes());
|
||||
}
|
||||
byte[] bytes = baos.toByteArray();
|
||||
|
||||
final String checksum = deltaGenerator.sendDelta(file, new ByteArrayInputStream(originalContents), 0,
|
||||
new ByteArrayInputStream(bytes), commitEditor, true);
|
||||
commitEditor.closeFile(file, checksum);
|
||||
commitEditor.closeEdit();
|
||||
|
||||
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
commitEditor.applyTextDelta(file, md5(originalContents));
|
||||
|
||||
finally {
|
||||
svnRepository.closeSession();
|
||||
}
|
||||
}
|
||||
final String checksum = deltaGenerator.sendDelta(file, new ByteArrayInputStream(originalContents), 0,
|
||||
new ByteArrayInputStream(bytes), commitEditor, true);
|
||||
commitEditor.closeFile(file, checksum);
|
||||
commitEditor.closeEdit();
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
finally {
|
||||
svnRepository.closeSession();
|
||||
}
|
||||
}
|
||||
|
||||
public static String md5(byte[] contents) {
|
||||
final byte[] tmp = new byte[1024];
|
||||
final SVNChecksumInputStream checksumStream = new SVNChecksumInputStream(new ByteArrayInputStream(contents),
|
||||
"md5");
|
||||
try {
|
||||
while (checksumStream.read(tmp) > 0) {
|
||||
//
|
||||
}
|
||||
return checksumStream.getDigest();
|
||||
} catch (IOException e) {
|
||||
// never happens
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
SVNFileUtil.closeFile(checksumStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static String md5(byte[] contents) {
|
||||
final byte[] tmp = new byte[1024];
|
||||
final SVNChecksumInputStream checksumStream = new SVNChecksumInputStream(new ByteArrayInputStream(contents), "md5");
|
||||
try {
|
||||
while (checksumStream.read(tmp) > 0) {
|
||||
//
|
||||
}
|
||||
return checksumStream.getDigest();
|
||||
} catch (IOException e) {
|
||||
//never happens
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
SVNFileUtil.closeFile(checksumStream);
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> checkMatch(String[] lines, List<String> ls) {
|
||||
Set<String> ss = new HashSet<String>(ls);
|
||||
ss.addAll(Arrays.asList(lines));
|
||||
return new ArrayList<>(ss);
|
||||
}
|
||||
|
||||
public List<String> checkMatch(String[] lines, List<String> ls) {
|
||||
Set<String> ss = new HashSet<String>(ls);
|
||||
ss.addAll(Arrays.asList(lines));
|
||||
return new ArrayList<>(ss);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,80 +26,69 @@ public class SendMail extends StandardLocalInfraAlgorithm {
|
|||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public void sendNotification(String subject, String body) throws Exception {
|
||||
|
||||
AnalysisLogger.getLogger().debug("Emailing System->Starting request of email in scope "+ScopeProvider.instance.get());
|
||||
|
||||
public void sendNotification(String subject, String body) throws Exception {
|
||||
|
||||
AnalysisLogger.getLogger()
|
||||
.debug("Emailing System->Starting request of email in scope " + ScopeProvider.instance.get());
|
||||
|
||||
String serviceAddress = InfraRetrieval.findEmailingSystemAddress(ScopeProvider.instance.get());
|
||||
|
||||
|
||||
if (!serviceAddress.endsWith("/"))
|
||||
serviceAddress = serviceAddress+"/";
|
||||
|
||||
String requestForMessage = serviceAddress + "messages/writeMessageToUsers" + "?gcube-token=" + SecurityTokenProvider.instance.get();
|
||||
requestForMessage = requestForMessage.replace("http://", "https://").replace(":80", ""); // remove the port (or set it to 443) otherwise you get an SSL error
|
||||
serviceAddress = serviceAddress + "/";
|
||||
|
||||
String requestForMessage = serviceAddress + "messages/writeMessageToUsers" + "?gcube-token="
|
||||
+ SecurityTokenProvider.instance.get();
|
||||
requestForMessage = requestForMessage.replace("http://", "https://").replace(":80", "");
|
||||
|
||||
AnalysisLogger.getLogger().debug("Emailing System->Request url is going to be " + requestForMessage);
|
||||
|
||||
|
||||
// put the sender, the recipients, subject and body of the mail here
|
||||
subject=URLEncoder.encode(subject,"UTF-8");
|
||||
body=URLEncoder.encode(body,"UTF-8");
|
||||
String requestParameters = "&sender=dataminer&recipients="+this.getAdmins()+"&subject="+subject+"&body="+body;
|
||||
|
||||
|
||||
subject = URLEncoder.encode(subject, "UTF-8");
|
||||
body = URLEncoder.encode(body, "UTF-8");
|
||||
String requestParameters = "&sender=dataminer&recipients=" + /*this.getAdmins()*/this.username(SecurityTokenProvider.instance.get()) + "&subject=" + subject + "&body="
|
||||
+ body;
|
||||
|
||||
String response = HttpRequest.sendPostRequest(requestForMessage, requestParameters);
|
||||
AnalysisLogger.getLogger().debug("Emailing System->Emailing response OK ");
|
||||
|
||||
if (response==null){
|
||||
|
||||
if (response == null) {
|
||||
Exception e = new Exception("Error in email sending response");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// public void notifySubmitter(String a, String b) throws Exception {
|
||||
// NotificationHelper nh = new NotificationHelper();
|
||||
// super.sendNotification(nh.getSubject(),
|
||||
// nh.getBody());
|
||||
// }
|
||||
}
|
||||
|
||||
// public void notifySubmitter(String a, String b) throws Exception {
|
||||
// NotificationHelper nh = new NotificationHelper();
|
||||
// super.sendNotification(nh.getSubject(),
|
||||
// nh.getBody());
|
||||
// }
|
||||
|
||||
|
||||
public String username(String token) throws ObjectNotFound, Exception{
|
||||
public String username(String token) throws ObjectNotFound, Exception {
|
||||
AuthorizationEntry entry = authorizationService().get(token);
|
||||
System.out.println(entry.getClientInfo().getId());
|
||||
return entry.getClientInfo().getId();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String retrieveAdminRole() throws Exception{
|
||||
public String retrieveAdminRole() throws Exception {
|
||||
String serviceAddress = InfraRetrieval.findEmailingSystemAddress(ScopeProvider.instance.get());
|
||||
|
||||
if (!serviceAddress.endsWith("/"))
|
||||
serviceAddress = serviceAddress+"/";
|
||||
|
||||
String requestForMessage = serviceAddress + "2/users/get-usernames-by-global-role";
|
||||
requestForMessage = requestForMessage.replace("https://", "http://").replace(":80", ""); // remove the port (or set it to 443) otherwise you get an SSL error
|
||||
String requestParameters = "role-name=Administrator"+"&gcube-token=" + SecurityTokenProvider.instance.get();
|
||||
|
||||
String response = HttpRequest.sendGetRequest(requestForMessage,requestParameters);
|
||||
if (!serviceAddress.endsWith("/"))
|
||||
serviceAddress = serviceAddress + "/";
|
||||
|
||||
String requestForMessage = serviceAddress + "2/users/get-usernames-by-global-role";
|
||||
requestForMessage = requestForMessage.replace("https://", "http://").replace(":80", "");
|
||||
String requestParameters = "role-name=Administrator" + "&gcube-token=" + SecurityTokenProvider.instance.get();
|
||||
|
||||
String response = HttpRequest.sendGetRequest(requestForMessage, requestParameters);
|
||||
System.out.println(response.toString());
|
||||
|
||||
if (response==null){
|
||||
|
||||
if (response == null) {
|
||||
Exception e = new Exception("Error in querying the recipient");
|
||||
throw e;
|
||||
}
|
||||
return response;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getAdmins() throws Exception {
|
||||
List<String> s = new LinkedList<String>();
|
||||
|
@ -113,67 +102,54 @@ public void sendNotification(String subject, String body) throws Exception {
|
|||
}
|
||||
s.add(this.username(SecurityTokenProvider.instance.get()));
|
||||
}
|
||||
|
||||
System.out.println(s);
|
||||
return s.toString();
|
||||
|
||||
return s.toString().replace("[", "").replace("]", "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void process() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void setInputParameters() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
|
||||
// SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
|
||||
|
||||
ScopeProvider.instance.set("/gcube/devNext");
|
||||
SecurityTokenProvider.instance.set("708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
|
||||
SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
|
||||
|
||||
//ScopeProvider.instance.set("/gcube/devNext");
|
||||
//SecurityTokenProvider.instance.set("708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548");
|
||||
|
||||
NotificationHelper nh = new NotificationHelper();
|
||||
|
||||
|
||||
SendMail sm = new SendMail();
|
||||
//sm.username(SecurityTokenProvider.instance.get());
|
||||
//sm.retrieveAdminRole();
|
||||
sm.getAdmins();
|
||||
//sm.sendNotification("test", "test");
|
||||
sm.sendNotification(nh.getFailedSubject(), nh.getFailedBody("test failed"));
|
||||
// sm.username(SecurityTokenProvider.instance.get());
|
||||
// sm.retrieveAdminRole();
|
||||
//System.out.println(sm.getAdmins());
|
||||
// sm.sendNotification("test", "test");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class SVNTests {
|
|||
|
||||
SVNUpdater svnUpdater = new SVNUpdater(new ServiceConfiguration("/home/ngalante/workspace/dataminer-pool-manager/src/main/resources/service.properties"));
|
||||
|
||||
Algorithm algo = AlgorithmBuilder.create("http://data.d4science.org/cnFLNHYxR1ZDa1VNdEhrTUQyQlZjaWRBVVZlUHloUitHbWJQNStIS0N6Yz0");
|
||||
Algorithm algo = AlgorithmBuilder.create("http://data.d4science.org/R0ExYjFPVFBrOUlNdEhrTUQyQlZjbUJuQ20rbGFrZ0pHbWJQNStIS0N6Yz0");
|
||||
//algo.setClazz(algo.getClazz() + "TEST");
|
||||
|
||||
//svnUpdater.updateSVNRProtoAlgorithmList(algo, "/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab", "Dataminer Pool Manager", "Proto");
|
||||
|
|
Loading…
Reference in New Issue