You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/04/23 21:42:31 UTC
[4/8] merging monitoring with gfac-core, later this will be separated
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
index 10287a5..0b6619e 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
@@ -31,12 +31,14 @@ import java.util.Set;
import net.schmizz.sshj.connection.ConnectionException;
import net.schmizz.sshj.transport.TransportException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.security.GSISecurityContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
import org.apache.airavata.gfac.provider.GFacProviderException;
+import org.apache.airavata.gfac.util.GFACSSHUtils;
import org.apache.airavata.gfac.utils.GFacUtils;
import org.apache.airavata.gfac.utils.OutputUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
@@ -54,7 +56,14 @@ public class SCPOutputHandler extends AbstractHandler{
private static final Logger log = LoggerFactory.getLogger(SCPOutputHandler.class);
public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException, GFacException {
-
+ if(jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT) == null){
+ try {
+ GFACSSHUtils.addSecurityContext(jobExecutionContext);
+ } catch (ApplicationSettingsException e) {
+ log.error(e.getMessage());
+ throw new GFacHandlerException("Error while creating SSHSecurityContext", e, e.getLocalizedMessage());
+ }
+ }
super.invoke(jobExecutionContext);
DataTransferDetails detail = new DataTransferDetails();
TransferStatus status = new TransferStatus();
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/provider/impl/SSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/provider/impl/SSHProvider.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/provider/impl/SSHProvider.java
index 12e2ad1..78cf25c 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/provider/impl/SSHProvider.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/provider/impl/SSHProvider.java
@@ -32,6 +32,7 @@ import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.gfac.Constants;
@@ -39,7 +40,9 @@ import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.handler.GFacHandlerException;
import org.apache.airavata.gfac.provider.GFacProviderException;
+import org.apache.airavata.gfac.util.GFACSSHUtils;
import org.apache.airavata.gfac.utils.GFacUtils;
import org.apache.airavata.gsi.ssh.api.Cluster;
import org.apache.airavata.gsi.ssh.api.CommandExecutor;
@@ -70,7 +73,15 @@ public class SSHProvider extends AbstractProvider{
public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
super.initialize(jobExecutionContext);
- taskID = jobExecutionContext.getTaskData().getTaskID();
+ if(jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT) == null){
+ try {
+ GFACSSHUtils.addSecurityContext(jobExecutionContext);
+ } catch (ApplicationSettingsException e) {
+ log.error(e.getMessage());
+ throw new GFacHandlerException("Error while creating SSHSecurityContext", e, e.getLocalizedMessage());
+ }
+ }
+ taskID = jobExecutionContext.getTaskData().getTaskID();
if (!((SSHHostType) jobExecutionContext.getApplicationContext().getHostDescription().getType()).getHpcResource()) {
jobID = "SSH_" + jobExecutionContext.getApplicationContext().getHostDescription().getType().getHostAddress() + "_" + Calendar.getInstance().getTimeInMillis();
cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/util/GFACSSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/util/GFACSSHUtils.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/util/GFACSSHUtils.java
new file mode 100644
index 0000000..29def62
--- /dev/null
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/util/GFACSSHUtils.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.gfac.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gfac.Constants;
+import org.apache.airavata.gfac.GFacException;
+import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gsi.ssh.api.Cluster;
+import org.apache.airavata.gsi.ssh.api.SSHApiException;
+import org.apache.airavata.gsi.ssh.api.ServerInfo;
+import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.PBSCluster;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
+import org.apache.airavata.gsi.ssh.util.CommonUtils;
+import org.apache.airavata.schemas.gfac.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
+
+public class GFACSSHUtils {
+ private final static Logger logger = LoggerFactory.getLogger(GFACSSHUtils.class);
+
+ public static void addSecurityContext(JobExecutionContext jobExecutionContext) throws GFacException, ApplicationSettingsException {
+ HostDescription registeredHost = jobExecutionContext.getApplicationContext().getHostDescription();
+ if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType
+ || registeredHost.getType() instanceof GsisshHostType) {
+ logger.error("This is a wrong method to invoke to non ssh host types,please check your gfac-config.xml");
+ } else if (registeredHost.getType() instanceof SSHHostType) {
+ Properties configurationProperties = ServerSettings.getProperties();
+ String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
+ String sshPrivateKey = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY);
+ String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
+ String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
+ String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
+ SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
+ AuthenticationInfo authenticationInfo = null;
+ // we give higher preference to the password over keypair ssh authentication
+ if (sshPassword != null) {
+ authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
+ } else {
+ authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
+ }
+ ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());
+
+ Cluster pbsCluster = null;
+ try {
+ String installedParentPath = "/";
+ if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
+ installedParentPath = ((HpcApplicationDeploymentType)
+ jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
+ }
+ pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
+ CommonUtils.getPBSJobManager(installedParentPath));
+ } catch (SSHApiException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ sshSecurityContext.setPbsCluster(pbsCluster);
+ sshSecurityContext.setUsername(sshUserName);
+ jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, sshSecurityContext);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/pom.xml b/modules/gfac/pom.xml
index 2d2293b..438623f 100644
--- a/modules/gfac/pom.xml
+++ b/modules/gfac/pom.xml
@@ -33,7 +33,6 @@
<module>gfac-core</module>
<module>gfac-ec2</module>
<module>gfac-ssh</module>
- <module>gfac-monitor</module>
</modules>
</profile>
</profiles>
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/airavata-orchestrator-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/pom.xml b/modules/orchestrator/airavata-orchestrator-service/pom.xml
index 2dcf045..549f707 100644
--- a/modules/orchestrator/airavata-orchestrator-service/pom.xml
+++ b/modules/orchestrator/airavata-orchestrator-service/pom.xml
@@ -41,12 +41,7 @@
<artifactId>airavata-orchestrator-core</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>gfac-monitor</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-model-utils</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 26f447e..c3491be 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -24,25 +24,13 @@ package org.apache.airavata.orchestrator.server;
import java.util.Arrays;
import java.util.List;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.MonitorManager;
-import org.apache.airavata.job.monitor.core.Monitor;
-import org.apache.airavata.job.monitor.core.PullMonitor;
-import org.apache.airavata.job.monitor.core.PushMonitor;
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-import org.apache.airavata.job.monitor.impl.LocalJobMonitor;
-import org.apache.airavata.job.monitor.impl.pull.qstat.QstatMonitor;
-import org.apache.airavata.job.monitor.impl.push.amqp.AMQPMonitor;
+import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.monitor.MonitorManager;
import org.apache.airavata.model.workspace.experiment.Experiment;
import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
-import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
import org.apache.airavata.orchestrator.cpi.OrchestratorService;
import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
@@ -51,7 +39,6 @@ import org.apache.airavata.registry.cpi.DataType;
import org.apache.airavata.registry.cpi.Registry;
import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -79,66 +66,12 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
public OrchestratorServerHandler() {
try {
// first constructing the monitorManager and orchestrator, then fill the required properties
- monitorManager = new MonitorManager();
orchestrator = new SimpleOrchestratorImpl();
registry = RegistryFactory.getDefaultRegistry();
-
- // Filling monitorManager properties
- // we can keep a single user to do all the monitoring authentication for required machine..
- String myProxyUser = ServerSettings.getSetting("myproxy.username");
- String myProxyPass = ServerSettings.getSetting("myproxy.password");
- String certPath = ServerSettings.getSetting("trusted.cert.location");
- String myProxyServer = ServerSettings.getSetting("myproxy.server");
- authenticationInfo = new MyProxyAuthenticationInfo(myProxyUser, myProxyPass, myProxyServer,
- 7512, 17280000, certPath);
-
- // loading Monitor configuration
- String monitors = ServerSettings.getSetting("monitors");
- if(monitors == null) {
- log.error("No Monitor is configured, so job monitoring will not monitor any job");
- return;
- }
- List<String> monitorList = Arrays.asList(monitors.split(","));
- List<String> list = Arrays.asList(ServerSettings.getSetting("amqp.hosts").split(","));
- String proxyPath = ServerSettings.getSetting("proxy.file.path");
- String connectionName = ServerSettings.getSetting("connection.name");
-
- for (String monitorClass : monitorList) {
- Class<? extends Monitor> aClass = Class.forName(monitorClass).asSubclass(Monitor.class);
- Monitor monitor = aClass.newInstance();
- if (monitor instanceof PullMonitor) {
- if (monitor instanceof QstatMonitor) {
- monitorManager.addQstatMonitor((QstatMonitor) monitor);
- }
- } else if (monitor instanceof PushMonitor) {
- if (monitor instanceof AMQPMonitor) {
- ((AMQPMonitor) monitor).initialize(proxyPath, connectionName, list);
- monitorManager.addAMQPMonitor((AMQPMonitor) monitor);
- }
- } else if(monitor instanceof LocalJobMonitor){
- monitorManager.addLocalMonitor((LocalJobMonitor)monitor);
- } else {
- log.error("Wrong class is given to primary Monitor");
- }
- }
-
- monitorManager.registerListener(orchestrator);
- // Now Monitor Manager is properly configured, now we have to start the monitoring system.
- // This will initialize all the required threads and required queues
- monitorManager.launchMonitor();
- } catch (OrchestratorException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
+ orchestrator.initialize();
+ }catch (OrchestratorException e) {
e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (AiravataMonitorException e) {
- e.printStackTrace();
- } catch (ApplicationSettingsException e) {
- e.printStackTrace();
- }
+ }
}
/**
@@ -163,49 +96,20 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
}
List<String> ids = registry.getIds(DataType.WORKFLOW_NODE_DETAIL,WorkflowNodeConstants.EXPERIMENT_ID,experimentId);
for (String workflowNodeId : ids) {
- List<Object> taskDetailList = registry.get(DataType.TASK_DETAIL,TaskDetailConstants.NODE_ID,workflowNodeId);
- for (Object o : taskDetailList) {
- TaskDetails taskID=(TaskDetails)o;
- //iterate through all the generated tasks and performs the job submisssion+monitoring
- String jobID = null;
- Experiment experiment = (Experiment) registry.get(DataType.EXPERIMENT, experimentId);
- if (experiment == null) {
- log.error("Error retrieving the Experiment by the given experimentID: " + experimentId);
- return false;
- }
- String userName = experiment.getUserName();
-
- HostDescription hostDescription = OrchestratorUtils.getHostDescription(orchestrator, taskID);
-
- // creating monitorID to register with monitoring queue
- // this is a special case because amqp has to be in place before submitting the job
- if ((hostDescription instanceof GsisshHostType) &&
- Constants.PUSH.equals(((GsisshHostType) hostDescription).getMonitorMode())) {
- monitorID = new MonitorID(hostDescription, null, taskID.getTaskID(), workflowNodeId, experimentId, userName);
- monitorManager.addAJobToMonitor(monitorID);
- jobID = orchestrator.launchExperiment(experimentId, taskID.getTaskID());
- if("none".equals(jobID)) {
- log.error("Job submission Failed, so we remove the job from monitoring");
-
- }else{
- log.info("Job Launched to the resource by GFAC and jobID returned : " + jobID);
- }
- } else {
- // Launching job for each task
- // if the monitoring is pull mode then we add the monitorID for each task after submitting
- // the job with the jobID, otherwise we don't need the jobID
- jobID = orchestrator.launchExperiment(experimentId, taskID.getTaskID());
- log.info("Job Launched to the resource by GFAC and jobID returned : " + jobID);
- monitorID = new MonitorID(hostDescription, jobID, taskID.getTaskID(), workflowNodeId, experimentId, userName, authenticationInfo);
- if("none".equals(jobID)) {
- log.error("Job submission Failed, so we remove the job from monitoring");
-
- }else{
- monitorManager.addAJobToMonitor(monitorID);
- }
- }
- }
- }
+ WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails)registry.get(DataType.WORKFLOW_NODE_DETAIL, workflowNodeId);
+ List<Object> taskDetailList = registry.get(DataType.TASK_DETAIL, TaskDetailConstants.NODE_ID, workflowNodeId);
+ for (Object o : taskDetailList) {
+ TaskDetails taskID = (TaskDetails) o;
+ //iterate through all the generated tasks and performs the job submisssion+monitoring
+ Experiment experiment = (Experiment) registry.get(DataType.EXPERIMENT, experimentId);
+ if (experiment == null) {
+ log.error("Error retrieving the Experiment by the given experimentID: " + experimentId);
+ return false;
+ }
+ orchestrator.launchExperiment(experiment, workflowNodeDetail, taskID);
+ }
+ }
+
} catch (Exception e) {
throw new TException(e);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
index ee4596e..02ccf24 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
@@ -1,5 +1,5 @@
-primaryMonitor=org.apache.airavata.job.monitor.impl.push.amqp.AMQPMonitor
-secondaryMonitor=org.apache.airavata.job.monitor.impl.pull.qstat.QstatMonitor
+primaryMonitor=org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
+secondaryMonitor=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor
amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
connection.name=xsede_private
trusted.certificate.location=/Users/chathuri/dev/airavata/cert/certificates
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/pom.xml b/modules/orchestrator/orchestrator-core/pom.xml
index e718c93..b228284 100644
--- a/modules/orchestrator/orchestrator-core/pom.xml
+++ b/modules/orchestrator/orchestrator-core/pom.xml
@@ -70,11 +70,6 @@ the License. -->
<artifactId>airavata-model-utils</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>gfac-monitor</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
index e81b76e..fad5e58 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/context/OrchestratorContext.java
@@ -23,7 +23,7 @@ package org.apache.airavata.orchestrator.core.context;
import java.util.ArrayList;
import java.util.List;
-import org.apache.airavata.job.monitor.MonitorManager;
+import org.apache.airavata.gfac.monitor.MonitorManager;
import org.apache.airavata.orchestrator.core.OrchestratorConfiguration;
import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
import org.apache.airavata.registry.api.AiravataRegistry2;
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
index 3fd655f..d02155e 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java
@@ -20,7 +20,9 @@
*/
package org.apache.airavata.orchestrator.cpi;
+import org.apache.airavata.model.workspace.experiment.Experiment;
import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
import java.util.List;
@@ -36,11 +38,12 @@ public interface Orchestrator {
* experimentID as the handler to the experiment, during the launchExperiment
* We just have to give the experimentID
*
- * @param experimentID
+ * @param experiment
* @return jobID
* @throws OrchestratorException
*/
- String launchExperiment(String experimentID, String taskID) throws OrchestratorException;
+ String launchExperiment(Experiment experiment, WorkflowNodeDetails workflowNodeDetail,
+ TaskDetails taskID) throws OrchestratorException;
/**
@@ -64,4 +67,6 @@ public interface Orchestrator {
//todo have to add another method to handle failed or jobs to be recovered by orchestrator
//todo if you don't add these this is not an orchestrator, its just an intemediate component which invoke gfac
+
+ void initialize() throws OrchestratorException;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 463e08e..fa3b5f3 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -21,14 +21,28 @@
package org.apache.airavata.orchestrator.cpi.impl;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
-import org.apache.airavata.job.monitor.AbstractActivityListener;
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.MonitorManager;
-import org.apache.airavata.job.monitor.command.ExperimentCancelRequest;
-import org.apache.airavata.job.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
+import org.apache.airavata.gfac.monitor.AbstractActivityListener;
+import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.monitor.MonitorManager;
+import org.apache.airavata.gfac.monitor.command.ExperimentCancelRequest;
+import org.apache.airavata.gfac.monitor.core.Monitor;
+import org.apache.airavata.gfac.monitor.core.PullMonitor;
+import org.apache.airavata.gfac.monitor.core.PushMonitor;
+import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
+import org.apache.airavata.gfac.monitor.impl.LocalJobMonitor;
+import org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor;
+import org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor;
+import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
import org.apache.airavata.model.util.ExperimentModelUtil;
import org.apache.airavata.model.workspace.experiment.Experiment;
import org.apache.airavata.model.workspace.experiment.JobState;
@@ -36,10 +50,13 @@ import org.apache.airavata.model.workspace.experiment.TaskDetails;
import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
import org.apache.airavata.orchestrator.core.job.JobSubmitter;
+import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
import org.apache.airavata.orchestrator.core.validator.JobMetadataValidator;
+import org.apache.airavata.persistance.registry.jpa.model.WorkflowNodeDetail;
import org.apache.airavata.registry.cpi.ChildDataType;
import org.apache.airavata.registry.cpi.DataType;
import org.apache.airavata.registry.cpi.Registry;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,6 +71,9 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator implements Abst
private JobMetadataValidator jobMetadataValidator = null;
+ private MonitorManager monitorManager = null;
+
+ private AuthenticationInfo authenticationInfo = null;
public SimpleOrchestratorImpl() throws OrchestratorException {
try {
@@ -62,7 +82,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator implements Abst
Class<? extends JobSubmitter> aClass = Class.forName(submitterClass.trim()).asSubclass(JobSubmitter.class);
jobSubmitter = aClass.newInstance();
jobSubmitter.initialize(this.orchestratorContext);
-
+ monitorManager = new MonitorManager();
String validatorClzz = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClass();
if (this.orchestratorConfiguration.isEnableValidation()) {
if (validatorClzz == null) {
@@ -82,19 +102,50 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator implements Abst
}
}
- public String launchExperiment(String experimentID, String taskID) throws OrchestratorException {
+ public String launchExperiment(Experiment experiment, WorkflowNodeDetails workflowNode, TaskDetails task) throws OrchestratorException {
// we give higher priority to userExperimentID
//todo support multiple validators
String jobID = null;
- if (this.orchestratorConfiguration.isEnableValidation()) {
- if (jobMetadataValidator.validate(experimentID)) {
- logger.info("validation Successful for the experiment: " + experimentID);
+ String experimentId = experiment.getExperimentID();
+ String taskId = task.getTaskID();
+ String workflowNodeId = workflowNode.getNodeInstanceId();
+ String userName = experiment.getUserName();
+ // creating monitorID to register with monitoring queue
+ // this is a special case because amqp has to be in place before submitting the job
+ HostDescription hostDescription = OrchestratorUtils.getHostDescription(this, task);
+
+ // creating monitorID to register with monitoring queue
+ // this is a special case because amqp has to be in place before submitting the job
+ try {
+ if ((hostDescription instanceof GsisshHostType) &&
+ Constants.PUSH.equals(((GsisshHostType) hostDescription).getMonitorMode())) {
+ MonitorID monitorID = new MonitorID(hostDescription, null, taskId, workflowNodeId, experimentId, userName);
+ monitorManager.addAJobToMonitor(monitorID);
+ jobSubmitter.submit(experimentId, taskId);
+ if ("none".equals(jobID)) {
+ logger.error("Job submission Failed, so we remove the job from monitoring");
+
+ } else {
+ logger.info("Job Launched to the resource by GFAC and jobID returned : " + jobID);
+ }
} else {
- throw new OrchestratorException("Validation Failed, so Job will not be submitted to GFAC");
+ // Launching job for each task
+ // if the monitoring is pull mode then we add the monitorID for each task after submitting
+ // the job with the jobID, otherwise we don't need the jobID
+ jobSubmitter.submit(experimentId, taskId);
+ logger.info("Job Launched to the resource by GFAC and jobID returned : " + jobID);
+ MonitorID monitorID = new MonitorID(hostDescription, jobID, taskId, workflowNodeId, experimentId, userName, authenticationInfo);
+ if ("none".equals(jobID)) {
+ logger.error("Job submission Failed, so we remove the job from monitoring");
+
+ } else {
+ monitorManager.addAJobToMonitor(monitorID);
+ }
}
+ } catch (Exception e) {
+ throw new OrchestratorException("Error launching the job", e);
}
- jobID = jobSubmitter.submit(experimentID, taskID);
return jobID;
}
@@ -163,7 +214,15 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator implements Abst
this.jobSubmitter = jobSubmitter;
}
- @Override
+ public AuthenticationInfo getAuthenticationInfo() {
+ return authenticationInfo;
+ }
+
+ public void setAuthenticationInfo(AuthenticationInfo authenticationInfo) {
+ this.authenticationInfo = authenticationInfo;
+ }
+
+ @Override
public void setup(Object... configurations) {
for (Object config : configurations) {
if (config instanceof MonitorManager){
@@ -177,4 +236,61 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator implements Abst
}
}
+ public void initialize() throws OrchestratorException {
+ // Filling monitorManager properties
+ // we can keep a single user to do all the monitoring authentication for required machine..
+ try{
+ String myProxyUser = ServerSettings.getSetting("myproxy.username");
+ String myProxyPass = ServerSettings.getSetting("myproxy.password");
+ String certPath = ServerSettings.getSetting("trusted.cert.location");
+ String myProxyServer = ServerSettings.getSetting("myproxy.server");
+ setAuthenticationInfo(new MyProxyAuthenticationInfo(myProxyUser, myProxyPass, myProxyServer,
+ 7512, 17280000, certPath));
+
+ // loading Monitor configuration
+ String monitors = ServerSettings.getSetting("monitors");
+ if(monitors == null) {
+ logger.error("No Monitor is configured, so job monitoring will not monitor any job");
+ return;
+ }
+ List<String> monitorList = Arrays.asList(monitors.split(","));
+ List<String> list = Arrays.asList(ServerSettings.getSetting("amqp.hosts").split(","));
+ String proxyPath = ServerSettings.getSetting("proxy.file.path");
+ String connectionName = ServerSettings.getSetting("connection.name");
+
+ for (String monitorClass : monitorList) {
+ Class<? extends Monitor> aClass = Class.forName(monitorClass).asSubclass(Monitor.class);
+ Monitor monitor = aClass.newInstance();
+ if (monitor instanceof PullMonitor) {
+ if (monitor instanceof QstatMonitor) {
+ monitorManager.addQstatMonitor((QstatMonitor) monitor);
+ }
+ } else if (monitor instanceof PushMonitor) {
+ if (monitor instanceof AMQPMonitor) {
+ ((AMQPMonitor) monitor).initialize(proxyPath, connectionName, list);
+ monitorManager.addAMQPMonitor((AMQPMonitor) monitor);
+ }
+ } else if(monitor instanceof LocalJobMonitor){
+ monitorManager.addLocalMonitor((LocalJobMonitor)monitor);
+ } else {
+ logger.error("Wrong class is given to primary Monitor");
+ }
+ }
+
+ monitorManager.registerListener(this);
+ // Now Monitor Manager is properly configured, now we have to start the monitoring system.
+ // This will initialize all the required threads and required queues
+ monitorManager.launchMonitor();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (AiravataMonitorException e) {
+ e.printStackTrace();
+ } catch (ApplicationSettingsException e) {
+ e.printStackTrace();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
index e161da6..59ff255 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
@@ -51,7 +51,6 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
private Orchestrator orchestrator;
- private String experimentID;
private List<TaskDetails> tasks;
@BeforeTest
@@ -59,7 +58,6 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
AiravataUtils.setExecutionAsServer();
super.setUp();
orchestrator = new SimpleOrchestratorImpl();
- createJobRequestWithDocuments(getAiravataAPI());
// System.setProperty("myproxy.user", "ogce");
// System.setProperty("myproxy.pass", "");
// System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates");
@@ -68,8 +66,11 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
// System.setProperty("trusted.cert.location",System.getProperty("gsi.working.directory"));
}
- private void createJobRequestWithDocuments(AiravataAPI airavataAPI) throws Exception{
- // creating host description
+
+
+ @Test
+ public void localHostTest() throws Exception {
+ // creating host description
List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
DataObjectType input = new DataObjectType();
input.setKey("echo_input");
@@ -88,6 +89,7 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
simpleExperiment.setExperimentOutputs(exOut);
+ WorkflowNodeDetails test = ExperimentModelUtil.createWorkflowNode("test", null);
ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "sds128");
scheduling.setResourceHostId("localhost");
UserConfigurationData userConfigurationData = new UserConfigurationData();
@@ -97,14 +99,10 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
simpleExperiment.setUserConfigurationData(userConfigurationData);
Registry defaultRegistry = RegistryFactory.getDefaultRegistry();
- experimentID = (String)defaultRegistry.add(ParentDataType.EXPERIMENT, simpleExperiment);
- tasks = orchestrator.createTasks(experimentID);
- }
-
- @Test
- public void localHostTest() throws Exception {
+ String experimentId = (String)defaultRegistry.add(ParentDataType.EXPERIMENT, simpleExperiment);
+ tasks = orchestrator.createTasks(experimentId);
for(TaskDetails details:tasks) {
- orchestrator.launchExperiment(experimentID, details.getTaskID());
+ orchestrator.launchExperiment(simpleExperiment,test, details);
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
index 9fafe98..3a3fa04 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithMyProxyAuth.java
@@ -49,65 +49,63 @@ import java.util.List;
public class OrchestratorTestWithMyProxyAuth extends BaseOrchestratorTest {
private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
- private Orchestrator orchestrator;
+ private Orchestrator orchestrator;
- private String experimentID;
+ private String experimentID;
- private List<TaskDetails> tasks;
+ private List<TaskDetails> tasks;
- @BeforeTest
- public void setUp() throws Exception {
- AiravataUtils.setExecutionAsServer();
- super.setUp();
- orchestrator = new SimpleOrchestratorImpl();
- createJobRequestWithDocuments();
+ @BeforeTest
+ public void setUp() throws Exception {
+ AiravataUtils.setExecutionAsServer();
+ super.setUp();
+ orchestrator = new SimpleOrchestratorImpl();
// System.setProperty("myproxy.user", "ogce");
// System.setProperty("myproxy.pass", "");
// System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates");
- // this is the same propertySystem.getProperty("myproxy.user");
+ // this is the same propertySystem.getProperty("myproxy.user");
// System.setProperty("myproxy.pass",System.getProperty("myproxy.password"));
// System.setProperty("trusted.cert.location",System.getProperty("gsi.working.directory"));
- }
-
- private void createJobRequestWithDocuments() throws Exception{
- List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
- DataObjectType input = new DataObjectType();
- input.setKey("echo_input");
- input.setType(DataType.STRING.toString());
- input.setValue("echo_output=Hello World");
- exInputs.add(input);
-
- List<DataObjectType> exOut = new ArrayList<DataObjectType>();
- DataObjectType output = new DataObjectType();
- output.setKey("echo_output");
- output.setType(DataType.STRING.toString());
- output.setValue("");
- exOut.add(output);
-
- Experiment simpleExperiment =
- ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
- simpleExperiment.setExperimentOutputs(exOut);
-
- ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128");
- scheduling.setResourceHostId("gsissh-trestles");
- UserConfigurationData userConfigurationData = new UserConfigurationData();
- userConfigurationData.setAiravataAutoSchedule(false);
- userConfigurationData.setOverrideManualScheduledParams(false);
- userConfigurationData.setComputationalResourceScheduling(scheduling);
- simpleExperiment.setUserConfigurationData(userConfigurationData);
-
- Registry registry = RegistryFactory.getDefaultRegistry();
- experimentID = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment);
- tasks = orchestrator.createTasks(experimentID);
-
- }
-
- @Test
- public void noDescriptorTest() throws Exception {
- for(TaskDetails taskDetail:tasks) {
- orchestrator.launchExperiment(experimentID, taskDetail.getTaskID());
- }
- }
+ }
+
+ @Test
+ public void noDescriptorTest() throws Exception {
+ List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+ DataObjectType input = new DataObjectType();
+ input.setKey("echo_input");
+ input.setType(DataType.STRING.toString());
+ input.setValue("echo_output=Hello World");
+ exInputs.add(input);
+
+ List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+ DataObjectType output = new DataObjectType();
+ output.setKey("echo_output");
+ output.setType(DataType.STRING.toString());
+ output.setValue("");
+ exOut.add(output);
+
+ Experiment simpleExperiment =
+ ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
+ simpleExperiment.setExperimentOutputs(exOut);
+
+ ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+ scheduling.setResourceHostId("gsissh-trestles");
+ UserConfigurationData userConfigurationData = new UserConfigurationData();
+ userConfigurationData.setAiravataAutoSchedule(false);
+ userConfigurationData.setOverrideManualScheduledParams(false);
+ userConfigurationData.setComputationalResourceScheduling(scheduling);
+ simpleExperiment.setUserConfigurationData(userConfigurationData);
+
+ WorkflowNodeDetails test = ExperimentModelUtil.createWorkflowNode("test", null);
+ Registry registry = RegistryFactory.getDefaultRegistry();
+ experimentID = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment);
+ tasks = orchestrator.createTasks(experimentID);
+
+ for (TaskDetails taskDetail: tasks)
+ {
+ orchestrator.launchExperiment(simpleExperiment,test, taskDetail);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/pom.xml
----------------------------------------------------------------------
diff --git a/tools/job-monitor/pom.xml b/tools/job-monitor/pom.xml
deleted file mode 100644
index 4fc6ced..0000000
--- a/tools/job-monitor/pom.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under
- the Apache License, Version 2.0 (theĆ "License"); you may not use this file except in compliance with the License. You may
- obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to
- in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
- ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under
- the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata</artifactId>
- <version>0.12-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>job-monitor-tool</artifactId>
- <name>Airavata Job Monitor</name>
- <description>This component handle the Airavata Job monitoring funcationality</description>
- <url>http://airavata.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.jglobus</groupId>
- <artifactId>gss</artifactId>
- <version>${jglobus.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jglobus</groupId>
- <artifactId>myproxy</artifactId>
- <version>${jglobus.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk16</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!--dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- <version>1.48</version>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk15on</artifactId>
- <version>1.48</version>
- </dependency-->
- <!-- Logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.rabbitmq</groupId>
- <artifactId>amqp-client</artifactId>
- <version>3.2.3</version>
- </dependency>
- <!-- SSH -->
- <dependency>
- <groupId>net.schmizz</groupId>
- <artifactId>sshj</artifactId>
- <version>0.8.0</version>
- </dependency>
-
-
- <!-- Test -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>6.1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
-
-
- <!-- Guava -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>12.0</version>
- </dependency>
-
- <!-- gsi-ssh api and other util dependencies -->
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>gsissh</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-gfac-schema-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-data-models</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.50</version>
- </dependency>
- <dependency>
- <groupId>org.ogce</groupId>
- <artifactId>bcgss</artifactId>
- <version>146</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>${xmlbeans.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.0.0</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-maven-plugin</artifactId>
- <version>0.4.0</version>
- <configuration>
- <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
- <targetPackage>org.apache.airavata</targetPackage>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/ExperimentIdentity.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/ExperimentIdentity.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/ExperimentIdentity.java
deleted file mode 100644
index 652ad1d..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/ExperimentIdentity.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.job.monitor;
-
-public class ExperimentIdentity {
- private String experimentID;
- public ExperimentIdentity(String experimentId) {
- setExperimentID(experimentId);
- }
- public String getExperimentID() {
- return experimentID;
- }
-
- public void setExperimentID(String experimentID) {
- this.experimentID = experimentID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/HostMonitorData.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/HostMonitorData.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/HostMonitorData.java
deleted file mode 100644
index 6e5fde9..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/HostMonitorData.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor;
-
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class HostMonitorData {
- private HostDescription host;
-
- private List<MonitorID> monitorIDs;
-
- public HostMonitorData(HostDescription host) {
- this.host = host;
- monitorIDs = new ArrayList<MonitorID>();
- }
-
- public HostMonitorData(HostDescription host, List<MonitorID> monitorIDs) {
- this.host = host;
- this.monitorIDs = monitorIDs;
- }
-
- public HostDescription getHost() {
- return host;
- }
-
- public void setHost(HostDescription host) {
- this.host = host;
- }
-
- public List<MonitorID> getMonitorIDs() {
- return monitorIDs;
- }
-
- public void setMonitorIDs(List<MonitorID> monitorIDs) {
- this.monitorIDs = monitorIDs;
- }
-
- /**
- * this method get called by CommonUtils and it will check the right place before adding
- * so there will not be a mismatch between this.host and monitorID.host
- * @param monitorID
- * @throws AiravataMonitorException
- */
- public void addMonitorIDForHost(MonitorID monitorID)throws AiravataMonitorException{
- monitorIDs.add(monitorID);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/JobIdentity.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/JobIdentity.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/JobIdentity.java
deleted file mode 100644
index 5753d9d..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/JobIdentity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.job.monitor;
-
-public class JobIdentity extends TaskIdentity {
- private String jobId;
-
- public JobIdentity(String experimentId, String workflowNodeId, String taskId, String jobId) {
- super(experimentId,workflowNodeId,taskId);
- setJobId(jobId);
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public void setJobId(String jobId) {
- this.jobId = jobId;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/TaskIdentity.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/TaskIdentity.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/TaskIdentity.java
deleted file mode 100644
index f7bc785..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/TaskIdentity.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.job.monitor;
-
-public class TaskIdentity extends WorkflowNodeIdentity {
- private String taskId;
-
- public TaskIdentity(String experimentId, String workflowNodeId, String taskId) {
- super(experimentId,workflowNodeId);
- setTaskId(taskId);
- }
- public String getTaskId() {
- return taskId;
- }
-
- public void setTaskId(String taskId) {
- this.taskId = taskId;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/UserMonitorData.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/UserMonitorData.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/UserMonitorData.java
deleted file mode 100644
index 13c177a..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/UserMonitorData.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor;
-
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This is the datastructure to keep the user centric job data, rather keeping
- * the individual jobs we keep the jobs based on the each user
- */
-public class UserMonitorData {
- private final static Logger logger = LoggerFactory.getLogger(UserMonitorData.class);
-
- private String userName;
-
- private List<HostMonitorData> hostMonitorData;
-
-
- public UserMonitorData(String userName) {
- this.userName = userName;
- hostMonitorData = new ArrayList<HostMonitorData>();
- }
-
- public UserMonitorData(String userName, List<HostMonitorData> hostMonitorDataList) {
- this.hostMonitorData = hostMonitorDataList;
- this.userName = userName;
- }
-
- public List<HostMonitorData> getHostMonitorData() {
- return hostMonitorData;
- }
-
- public void setHostMonitorData(List<HostMonitorData> hostMonitorData) {
- this.hostMonitorData = hostMonitorData;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- /*
- This method will add element to the MonitorID list, user should not
- duplicate it, we do not check it because its going to be used by airavata
- so we have to use carefully and this method will add a host if its a new host
- */
- public void addHostMonitorData(HostMonitorData hostMonitorData) throws AiravataMonitorException {
- this.hostMonitorData.add(hostMonitorData);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/WorkflowNodeIdentity.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/WorkflowNodeIdentity.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/WorkflowNodeIdentity.java
deleted file mode 100644
index a8fe09f..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/WorkflowNodeIdentity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.job.monitor;
-
-public class WorkflowNodeIdentity extends ExperimentIdentity {
- private String workflowNodeID;
- public WorkflowNodeIdentity(String experimentId, String workflowNodeId) {
- super(experimentId);
- setWorkflowNodeID(workflowNodeId);
- }
- public String getWorkflowNodeID() {
- return workflowNodeID;
- }
-
- public void setWorkflowNodeID(String workflowNodeID) {
- this.workflowNodeID = workflowNodeID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/AiravataAbstractMonitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/AiravataAbstractMonitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/AiravataAbstractMonitor.java
deleted file mode 100644
index 2e85b32..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/AiravataAbstractMonitor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.core;
-
-import org.apache.airavata.job.monitor.event.MonitorPublisher;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This is the abstract Monitor which needs to be used by
- * any Monitoring implementation which expect to consume
- * to store the status to registry. Because they have to
- * use the MonitorPublisher to publish the monitoring statuses
- * to the Event Bus. All the Monitor statuses publish to the eventbus
- * will be saved to the Registry.
- */
-public abstract class AiravataAbstractMonitor implements Monitor {
- private final static Logger logger = LoggerFactory.getLogger(AiravataAbstractMonitor.class);
- MonitorPublisher publisher;
-
- public MonitorPublisher getPublisher() {
- return publisher;
- }
-
- public void setPublisher(MonitorPublisher publisher) {
- this.publisher = publisher;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/MessageParser.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/MessageParser.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/MessageParser.java
deleted file mode 100644
index b4a06c9..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/MessageParser.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.core;
-
-import org.apache.airavata.job.monitor.HostMonitorData;
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.UserMonitorData;
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-import org.apache.airavata.job.monitor.state.JobStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.JobState;
-
-/**
- * This is an interface to implement messageparser, it could be
- * pull based or push based still monitor has to parse the content of
- * the message it gets from remote monitoring system and finalize
- * them to internal job state, Ex: JSON parser for AMQP and Qstat reader
- * for pull based monitor.
- */
-public interface MessageParser {
- /**
- * This method is to implement how to parse the incoming message
- * and implement a logic to finalize the status of the job,
- * we have to makesure the correct message is given to the messageparser
- * parse method, it will not do any filtering
- * @param message content of the message
- * @return
- */
- JobState parseMessage(String message)throws AiravataMonitorException;
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/Monitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/Monitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/Monitor.java
deleted file mode 100644
index 9627bbc..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/Monitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.core;
-
-
-/**
- * This is the primary interface for Monitors,
- * This can be used to implement different methods of monitoring
- */
-public interface Monitor extends Runnable {
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PullMonitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PullMonitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PullMonitor.java
deleted file mode 100644
index 4b904b1..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PullMonitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.core;
-
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-
-/**
- * PullMonitors can implement this interface
- * Since the pull and push based monitoring required different
- * operations, PullMonitor will be useful.
- * This will allow users to program Pull monitors separately
- */
-public abstract class PullMonitor extends AiravataAbstractMonitor{
-
- private int pollingFrequence;
- /**
- * This method will can invoke when PullMonitor needs to start
- * and it has to invoke in the frequency specified below,
- * @return if the start process is successful return true else false
- */
- public abstract boolean startPulling() throws AiravataMonitorException;
-
- /**
- * This is the method to stop the polling process
- * @return if the stopping process is successful return true else false
- */
- public abstract boolean stopPulling()throws AiravataMonitorException;
-
- /**
- * this method can be used to set the polling frequencey or otherwise
- * can implement a polling mechanism, and implement how to do
- * @param frequence
- */
- public void setPollingFrequence(int frequence){
- this.pollingFrequence = frequence;
- }
-
- /**
- * this method can be used to get the polling frequencey or otherwise
- * can implement a polling mechanism, and implement how to do
- * @return
- */
- public int getPollingFrequence(){
- return this.pollingFrequence;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PushMonitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PushMonitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PushMonitor.java
deleted file mode 100644
index f172ece..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/core/PushMonitor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.core;
-
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.UserMonitorData;
-import org.apache.airavata.job.monitor.exception.AiravataMonitorException;
-
-/**
- * PushMonitors can implement this interface
- * Since the pull and push based monitoring required different
- * operations, PullMonitor will be useful.
- * This interface will allow users to program Push monitors separately
- */
-public abstract class PushMonitor extends AiravataAbstractMonitor {
- /**
- * This method can be invoked to register a listener with the
- * remote monitoring system, ideally inside this method users will be
- * writing some client listener code for the remote monitoring system,
- * this will be a simple wrapper around any client for the remote Monitor.
- * @param monitorID
- * @return
- */
- public abstract boolean registerListener(MonitorID monitorID)throws AiravataMonitorException;
-
- /**
- * This method can be invoked to unregister a listener with the
- * remote monitoring system, ideally inside this method users will be
- * writing some client listener code for the remote monitoring system,
- * this will be a simple wrapper around any client for the remote Monitor.
- * @param monitorID
- * @return
- */
- public abstract boolean unRegisterListener(MonitorID monitorID)throws AiravataMonitorException;
-
- /**
- * This can be used to stop the registration thread
- * @return
- * @throws AiravataMonitorException
- */
- public abstract boolean stopRegister()throws AiravataMonitorException;
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/event/MonitorPublisher.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/event/MonitorPublisher.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/event/MonitorPublisher.java
deleted file mode 100644
index 3064781..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/event/MonitorPublisher.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.event;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.eventbus.EventBus;
-
-public class MonitorPublisher{
- private final static Logger logger = LoggerFactory.getLogger(MonitorPublisher.class);
- private EventBus eventBus;
-
- public MonitorPublisher(EventBus eventBus) {
- this.eventBus = eventBus;
- }
-
- public void registerListener(Object listener) {
- eventBus.register(listener);
- }
-
- public void unregisterListener(Object listener) {
- eventBus.unregister(listener);
- }
-
- public void publish(Object o) {
- eventBus.post(o);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/exception/AiravataMonitorException.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/exception/AiravataMonitorException.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/exception/AiravataMonitorException.java
deleted file mode 100644
index 5a13be2..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/exception/AiravataMonitorException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.exception;
-
-public class AiravataMonitorException extends Exception {
- private static final long serialVersionUID = -2849422320139467602L;
-
- public AiravataMonitorException(Throwable e) {
- super(e);
- }
-
- public AiravataMonitorException(String message) {
- super(message, null);
- }
-
- public AiravataMonitorException(String message, Throwable e) {
- super(message, e);
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/LocalJobMonitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/LocalJobMonitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/LocalJobMonitor.java
deleted file mode 100644
index ec4cb40..0000000
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/LocalJobMonitor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.job.monitor.impl;
-
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.job.monitor.JobIdentity;
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.core.AiravataAbstractMonitor;
-import org.apache.airavata.job.monitor.state.JobStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.JobState;
-
-import java.util.concurrent.BlockingQueue;
-
-/**
- * This monitor can be used to monitor a job which runs locally,
- * Since its a local job job doesn't have states, once it get executed
- * then the job starts running
- */
-public class LocalJobMonitor extends AiravataAbstractMonitor {
- // Though we have a qeuue here, it not going to be used in local jobs
- BlockingQueue<MonitorID> jobQueue;
-
- public void run() {
- do {
- try {
- MonitorID take = jobQueue.take();
- getPublisher().publish(new JobStatusChangeRequest(take, new JobIdentity(take.getExperimentID(), take.getWorkflowNodeID(), take.getTaskID(), take.getJobID()), JobState.COMPLETE));
- } catch (Exception e) {
- e.printStackTrace();
- }
- } while (!ServerSettings.isStopAllThreads());
- }
-
- public BlockingQueue<MonitorID> getJobQueue() {
- return jobQueue;
- }
-
- public void setJobQueue(BlockingQueue<MonitorID> jobQueue) {
- this.jobQueue = jobQueue;
- }
-}