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/03/31 15:54:37 UTC
[1/3] git commit: fixng AIRAVATA-942,
no scheduling activity is there in gfac at this point
Repository: airavata
Updated Branches:
refs/heads/master 192cd28de -> 80cbc3e88
fixng AIRAVATA-942, no scheduling activity is there in gfac at this point
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/460da0ef
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/460da0ef
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/460da0ef
Branch: refs/heads/master
Commit: 460da0ef39ebf3a4b62f32148a7c4990d7d8214b
Parents: 52e0fd3
Author: lahiru <la...@apache.org>
Authored: Fri Mar 28 10:31:28 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Fri Mar 28 10:31:28 2014 -0400
----------------------------------------------------------------------
.../core/gfac/services/impl/SchedulerTest.java | 149 -------------------
1 file changed, 149 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/460da0ef/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SchedulerTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SchedulerTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SchedulerTest.java
deleted file mode 100644
index 6ff1f4d..0000000
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SchedulerTest.java
+++ /dev/null
@@ -1,149 +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.core.gfac.services.impl;
-
-import static org.junit.Assert.fail;
-
-public class SchedulerTest {
-// private AiravataRegistry2 jcrRegistry;
-// @Before
-// public void setUp() throws Exception {
-// /*
-// * Create database
-// */
-// Map<String,String> config = new HashMap<String,String>();
-// config.put("org.apache.jackrabbit.repository.home","target");
-// jcrRegistry = RegistryUtils.getRegistryFromConfig(new URL("test.properties"));
-//
-// /*
-// * Host
-// */
-// HostDescription host = new HostDescription();
-// host.getType().setHostName("localhost");
-// host.getType().setHostAddress("10.11.111.1");
-//
-//
-//
-//
-//
-// /*
-// * App
-// */
-// ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
-// ApplicationDeploymentDescriptionType app = appDesc.getType();
-// ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
-// name.setStringValue("EchoLocal");
-// app.setApplicationName(name);
-// app.setExecutableLocation("/bin/echo");
-// app.setScratchWorkingDirectory("/tmp");
-// app.setStaticWorkingDirectory("/tmp");
-// app.setInputDataDirectory("/tmp/input");
-// app.setOutputDataDirectory("/tmp/output");
-// app.setStandardOutput("/tmp/echo.stdout");
-// app.setStandardError("/tmp/echo.stdout");
-//
-//
-//
-// /*
-// * Service
-// */
-// ServiceDescription serv = new ServiceDescription();
-// serv.getType().setName("SimpleEcho");
-//
-//
-//
-// List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-// InputParameterType input = InputParameterType.Factory.newInstance();
-// input.setParameterName("echo_input");
-// input.setParameterType(StringParameterType.Factory.newInstance());
-// inputList.add(input);
-// InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
-// .size()]);
-//
-// List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
-// OutputParameterType output = OutputParameterType.Factory.newInstance();
-// output.setParameterName("echo_output");
-// output.setParameterType(StringParameterType.Factory.newInstance());
-// outputList.add(output);
-// OutputParameterType[] outputParamList = outputList
-// .toArray(new OutputParameterType[outputList.size()]);
-//
-// serv.getType().setInputParametersArray(inputParamList);
-// serv.getType().setOutputParametersArray(outputParamList);
-//
-// /*
-// * Save to registry
-// */
-// jcrRegistry.addHostDescriptor(host);
-// jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host
-// .getType().getHostName(), appDesc);
-// jcrRegistry.addServiceDescriptor(serv);
-//// jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host
-//// .getType().getHostName());
-// }
-//
-// @Test
-// public void testExecute() {
-// try {
-//
-// DefaultInvocationContext ct = new DefaultInvocationContext();
-// DefaultExecutionContext ec = new DefaultExecutionContext();
-// ec.addNotifiable(new LoggingNotification());
-// ct.setExecutionContext(ec);
-//
-// ct.setServiceName("SimpleEcho");
-//
-// /*
-// * Input
-// */
-// ParameterContextImpl input = new ParameterContextImpl();
-// ActualParameter echo_input = new ActualParameter();
-// ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
-// input.add("echo_input", echo_input);
-//
-// /*
-// * Output
-// */
-// ParameterContextImpl output = new ParameterContextImpl();
-// ActualParameter echo_output = new ActualParameter();
-// output.add("echo_output", echo_output);
-//
-// // parameter
-// ct.setInput(input);
-// ct.setOutput(output);
-// ct.getExecutionContext().setRegistryService(jcrRegistry);
-// Scheduler scheduler = new SchedulerImpl();
-// Provider provider = scheduler.schedule(ct);
-//
-//
-// if(provider instanceof GramProvider){
-// junit.framework.Assert.assertTrue(true);
-// }else {
-// junit.framework.Assert.assertTrue(false);
-// }
-// IOUtil.deleteDirectory(new File((new File(".")).getAbsolutePath() + File.separator + "target"));
-//
-// } catch (Exception e) {
-// e.printStackTrace();
-// fail("ERROR");
-// }
-// }
-}
[2/3] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/airavata
Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d68afe9b
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d68afe9b
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d68afe9b
Branch: refs/heads/master
Commit: d68afe9b29a0ad968be6f8902a52e62d3dcfadd5
Parents: 460da0e 192cd28
Author: lahiru <la...@apache.org>
Authored: Mon Mar 31 09:17:27 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Mon Mar 31 09:17:27 2014 -0400
----------------------------------------------------------------------
.../lib/AiravataClientFactory.php | 6 +--
.../airavata/job/monitor/AMQPMonitorTest.java | 41 +++++++++++---------
.../airavata/job/monitor/QstatMonitorTest.java | 27 +++++++------
3 files changed, 42 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
[3/3] git commit: Fixing a NPE during error scenario and fixing the
code to show proper error message
Posted by la...@apache.org.
Fixing a NPE during error scenario and fixing the code to show proper error message
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/80cbc3e8
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/80cbc3e8
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/80cbc3e8
Branch: refs/heads/master
Commit: 80cbc3e884cbc4f0609d5ff216b59430fee0abaf
Parents: d68afe9
Author: lahiru <la...@apache.org>
Authored: Mon Mar 31 09:54:30 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Mon Mar 31 09:54:30 2014 -0400
----------------------------------------------------------------------
.../monitor/impl/pull/qstat/QstatMonitor.java | 26 +++++++++++++-------
1 file changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/80cbc3e8/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
index 1a098da..59de0f4 100644
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
+++ b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
@@ -21,6 +21,7 @@
package org.apache.airavata.job.monitor.impl.pull.qstat;
import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.gsi.ssh.api.SSHApiException;
import org.apache.airavata.job.monitor.HostMonitorData;
import org.apache.airavata.job.monitor.MonitorID;
@@ -109,12 +110,14 @@ public class QstatMonitor extends PullMonitor {
UserMonitorData take = null;
JobStatus jobStatus = new JobStatus();
MonitorID currentMonitorID = null;
+ HostDescription currentHostDescription = null;
try {
take = this.queue.take();
List<MonitorID> completedJobs = new ArrayList<MonitorID>();
List<HostMonitorData> hostMonitorData = take.getHostMonitorData();
for (HostMonitorData iHostMonitorData : hostMonitorData) {
if (iHostMonitorData.getHost().getType() instanceof GsisshHostType) {
+ currentHostDescription = iHostMonitorData.getHost();
GsisshHostType gsisshHostType = (GsisshHostType) iHostMonitorData.getHost().getType();
String hostName = gsisshHostType.getHostAddress();
ResourceConnection connection = null;
@@ -183,16 +186,21 @@ public class QstatMonitor extends PullMonitor {
} else if (e.getMessage().contains("illegally formed job identifier")) {
logger.error("Wrong job ID is given so dropping the job from monitoring system");
} else if (!this.queue.contains(take)) { // we put the job back to the queue only if its state is not unknown
- if (currentMonitorID.getFailedCount() < 2) {
- try {
- currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
- this.queue.put(take);
- } catch (InterruptedException e1) {
- e1.printStackTrace();
- }
+ if (currentMonitorID == null) {
+ logger.error("Monitoring the jobs failed, for user: " + take.getUserName()
+ + " in Host: " + currentHostDescription.getType().getHostAddress());
} else {
- logger.error(e.getMessage());
- logger.error("Tried to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
+ if (currentMonitorID.getFailedCount() < 2) {
+ try {
+ currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
+ this.queue.put(take);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ } else {
+ logger.error(e.getMessage());
+ logger.error("Tried to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
+ }
}
}
throw new AiravataMonitorException("Error retrieving the job status", e);