75 lines
2.1 KiB
Java
75 lines
2.1 KiB
Java
package org.gcube.dataanalysis.dataminer.poolmanager.service;
|
|
|
|
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
|
|
|
import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
***REMOVED***
|
|
***REMOVED***
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm;
|
|
***REMOVED***
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.CheckMethod;
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater;
|
|
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,
|
|
String rProtoVREName) {
|
|
super(svnUpdater);
|
|
this.algorithm = algorithm;
|
|
this.stagingCluster = stagingCluster;
|
|
this.rProtoCluster = rProtoCluster;
|
|
this.rProtoVREName = rProtoVREName;
|
|
***REMOVED***
|
|
|
|
@Override
|
|
protected void execute() {
|
|
ServiceConfiguration a = new ServiceConfiguration();
|
|
CheckMethod b = new CheckMethod();
|
|
|
|
try {
|
|
|
|
if (this.svnUpdater.checkIfAvaialable(this.algorithm.getLanguage(), this.algorithm.getDependencies())) {
|
|
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))) {
|
|
|
|
***REMOVED*** this.svnUpdater.updateRPRotoDeps(this.algorithm);
|
|
|
|
this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName,
|
|
this.algorithm.getFullname(), "Proto");
|
|
|
|
|
|
|
|
|
|
|
|
***REMOVED*** int ret2 = this.executeAnsibleWorker(
|
|
***REMOVED*** createWorker(this.algorithm, this.rProtoCluster,
|
|
***REMOVED*** false, "gcube"));
|
|
***REMOVED***
|
|
***REMOVED***
|
|
***REMOVED***
|
|
|
|
***REMOVED*** catch (Exception e) {
|
|
e.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|