airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: added yam config file and parsers.
Date Sat, 13 Jun 2015 23:23:20 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 78732920e -> 102fb044e


added yam config file and parsers.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/102fb044
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/102fb044
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/102fb044

Branch: refs/heads/master
Commit: 102fb044e5e6d4c318e69cfebdf033ad4c902da1
Parents: 7873292
Author: Shameera Rathanyaka <shameerainfo@gmail.com>
Authored: Sat Jun 13 19:23:17 2015 -0400
Committer: Shameera Rathanyaka <shameerainfo@gmail.com>
Committed: Sat Jun 13 19:23:17 2015 -0400

----------------------------------------------------------------------
 modules/gfac/gfac-core/pom.xml                  |   6 +
 .../core/config/DataTransferTaskConfig.java     |  44 +++++++
 .../gfac/core/config/GFacYamlConfigruation.java | 124 +++++++++++++++++++
 .../core/config/JobSubmitterTaskConfig.java     |  44 +++++++
 .../gfac/core/config/ResourceConfig.java        |  64 ++++++++++
 .../gfac/core/context/ProcessContext.java       |  11 ++
 .../gfac/core/task/JobSubmissionTask.java       |  24 ++++
 .../apache/airavata/gfac/core/task/Task.java    |  24 ++++
 .../src/main/resources/gfac-config.yaml         |  69 +++++++++++
 .../apache/airavata/gfac/impl/GFacEngine.java   |  84 ++++++++++++-
 .../apache/airavata/gfac/impl/GFacWorker.java   |  64 ++++++----
 pom.xml                                         |   1 +
 12 files changed, 529 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/pom.xml b/modules/gfac/gfac-core/pom.xml
index 2b22ac0..4d17e5c 100644
--- a/modules/gfac/gfac-core/pom.xml
+++ b/modules/gfac/gfac-core/pom.xml
@@ -62,6 +62,12 @@
             <version>${project.version}</version>
         </dependency>
 
+        <!-- Configuration file read-->
+        <dependency>
+            <groupId>org.yaml</groupId>
+            <artifactId>snakeyaml</artifactId>
+            <version>${snakeyaml.version}</version>
+        </dependency>
 
         <!-- Test -->
         <dependency>

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/DataTransferTaskConfig.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/DataTransferTaskConfig.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/DataTransferTaskConfig.java
new file mode 100644
index 0000000..a4817fb
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/DataTransferTaskConfig.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.core.config;
+
+import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol;
+
+public class DataTransferTaskConfig {
+	private DataMovementProtocol transferProtocol;
+	private String taskClass;
+
+	public DataMovementProtocol getTransferProtocol() {
+		return transferProtocol;
+	}
+
+	public void setTransferProtocol(DataMovementProtocol transferProtocol) {
+		this.transferProtocol = transferProtocol;
+	}
+
+	public String getTaskClass() {
+		return taskClass;
+	}
+
+	public void setTaskClass(String taskClass) {
+		this.taskClass = taskClass;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/GFacYamlConfigruation.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/GFacYamlConfigruation.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/GFacYamlConfigruation.java
new file mode 100644
index 0000000..8b5aa22
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/GFacYamlConfigruation.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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.core.config;
+
+import org.apache.airavata.gfac.core.GFacException;
+import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol;
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+import org.yaml.snakeyaml.Yaml;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+public class GFacYamlConfigruation {
+
+	private static final String CONFIG = "config";
+	private static final String JOB_SUBMITTERS = "jobSubmitters";
+	private static final String SUBMISSIO_PROTOCOL = "submissionProtocol";
+	private static final String TASK_CLASS = "taskClass";
+	private static final String COMMON_TASKS = "commonTasks";
+	private static final String TYPE = "type";
+	private static final String FILE_TRANSFER_TASKS = "fileTransferTasks";
+	private static final String TRANSFER_PROTOCOL = "transferProtocol";
+	private static final String RESOURCES = "resources";
+	private static final String JOB_MANAGER_TYPE = "jobManagerType";
+	private static final String COMMAND_OUTPUT_PARSER = "commandOutputParser";
+	private static final String EMAIL_PARSER = "emailParser";
+	private static final String RESOURCE_EMAIL_ADDRESS = "resourceEmailAddress";
+
+	private List<JobSubmitterTaskConfig> jobSubmitters;
+	private List<DataTransferTaskConfig> fileTransferTasks;
+	private List<ResourceConfig> resources;
+
+
+	public GFacYamlConfigruation() throws GFacException {
+		InputStream resourceAsStream = GFacYamlConfigruation.class.getClassLoader().
+				getResourceAsStream("gfac-config.yaml");
+		parse(resourceAsStream);
+	}
+
+	private void parse(InputStream resourceAsStream) throws GFacException {
+		if (resourceAsStream == null) {
+			throw new GFacException("Configuration file{gfac-config.yaml} is not fund");
+		}
+		Yaml yaml = new Yaml();
+		Object load = yaml.load(resourceAsStream);
+		if (load == null) {
+			throw new GFacException("Yaml configuration object null");
+		}
+
+		if (load instanceof Map) {
+			Map<String, Object> loadMap = (Map<String, Object>) load;
+			String identifier;
+			List<Map<String, String>> jobSubYamls = (List<Map<String, String>>)
loadMap.get(JOB_SUBMITTERS);
+			JobSubmitterTaskConfig jobSubmitterTaskConfig;
+			for (Map<String, String> jobSub : jobSubYamls) {
+				jobSubmitterTaskConfig = new JobSubmitterTaskConfig();
+				identifier = jobSub.get (SUBMISSIO_PROTOCOL);
+				jobSubmitterTaskConfig.setSubmissionProtocol(JobSubmissionProtocol.valueOf(identifier));
+				jobSubmitterTaskConfig.setTaskClass(jobSub.get(TASK_CLASS));
+				jobSubmitters.add(jobSubmitterTaskConfig);
+			}
+
+			List<Map<String, String>> fileTransYamls = (List<Map<String, String>>)
loadMap.get(FILE_TRANSFER_TASKS);
+			DataTransferTaskConfig dataTransferTaskConfig;
+			for (Map<String, String> fileTransConfig : fileTransYamls) {
+				dataTransferTaskConfig = new DataTransferTaskConfig();
+				identifier = fileTransConfig.get (TRANSFER_PROTOCOL);
+				dataTransferTaskConfig.setTransferProtocol(DataMovementProtocol.valueOf(identifier));
+				dataTransferTaskConfig.setTaskClass(fileTransConfig.get(TASK_CLASS));
+				fileTransferTasks.add(dataTransferTaskConfig);
+			}
+
+			List<Map<String, Object>> resourcesYaml = (List<Map<String, Object>>)
loadMap.get(RESOURCES);
+			ResourceConfig resourceConfig;
+			for (Map<String, Object> resource : resourcesYaml) {
+				resourceConfig = new ResourceConfig();
+				identifier = resource.get(JOB_MANAGER_TYPE).toString();
+				resourceConfig.setJobManagerType(ResourceJobManagerType.valueOf(identifier));
+				resourceConfig.setCommandOutputParser(resource.get(COMMAND_OUTPUT_PARSER).toString());
+				resourceConfig.setEmailParser(resource.get(EMAIL_PARSER).toString());
+				List<String> emailAddressList = (List<String>) resource.get(RESOURCE_EMAIL_ADDRESS);
+				resourceConfig.setResourceEmailAddresses(emailAddressList);
+				resources.add(resourceConfig);
+			}
+
+		}
+
+	}
+
+	public List<JobSubmitterTaskConfig> getJobSbumitters() {
+		return jobSubmitters;
+	}
+
+	public List<DataTransferTaskConfig> getFileTransferTasks() {
+		return fileTransferTasks;
+	}
+
+	public List<ResourceConfig> getResourceConfiguration() {
+		return resources;
+	}
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/JobSubmitterTaskConfig.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/JobSubmitterTaskConfig.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/JobSubmitterTaskConfig.java
new file mode 100644
index 0000000..daea282
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/JobSubmitterTaskConfig.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.core.config;
+
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
+
+public class JobSubmitterTaskConfig {
+	private JobSubmissionProtocol submissionProtocol;
+	private String taskClass;
+
+	public JobSubmissionProtocol getSubmissionProtocol() {
+		return submissionProtocol;
+	}
+
+	public void setSubmissionProtocol(JobSubmissionProtocol submissionProtocol) {
+		this.submissionProtocol = submissionProtocol;
+	}
+
+	public String getTaskClass() {
+		return taskClass;
+	}
+
+	public void setTaskClass(String taskClass) {
+		this.taskClass = taskClass;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/ResourceConfig.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/ResourceConfig.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/ResourceConfig.java
new file mode 100644
index 0000000..d83484e
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/config/ResourceConfig.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.core.config;
+
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+
+import java.util.List;
+
+public class ResourceConfig {
+	private ResourceJobManagerType jobManagerType;
+	private String commandOutputParser;
+	private String emailParser;
+	private List<String> resourceEmailAddresses;
+
+	public ResourceJobManagerType getJobManagerType() {
+		return jobManagerType;
+	}
+
+	public void setJobManagerType(ResourceJobManagerType jobManagerType) {
+		this.jobManagerType = jobManagerType;
+	}
+
+	public String getCommandOutputParser() {
+		return commandOutputParser;
+	}
+
+	public void setCommandOutputParser(String commandOutputParser) {
+		this.commandOutputParser = commandOutputParser;
+	}
+
+	public String getEmailParser() {
+		return emailParser;
+	}
+
+	public void setEmailParser(String emailParser) {
+		this.emailParser = emailParser;
+	}
+
+	public List<String> getResourceEmailAddresses() {
+		return resourceEmailAddresses;
+	}
+
+	public void setResourceEmailAddresses(List<String> resourceEmailAddresses) {
+		this.resourceEmailAddresses = resourceEmailAddresses;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
index 4cab291..7db8a9e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
@@ -22,6 +22,7 @@
 package org.apache.airavata.gfac.core.context;
 
 import org.apache.airavata.common.utils.LocalEventPublisher;
+import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.registry.cpi.AppCatalog;
 import org.apache.airavata.registry.cpi.ExperimentCatalog;
 import org.apache.curator.framework.CuratorFramework;
@@ -35,6 +36,7 @@ public class ProcessContext {
 	private final String processId;
 	private final String gatewayId;
 	private final String tokenId;
+	private ProcessModel processModel;
 
 	public ProcessContext(String processId, String gatewayId, String tokenId) {
 		this.processId = processId;
@@ -42,6 +44,7 @@ public class ProcessContext {
 		this.tokenId = tokenId;
 	}
 
+
 	// Getters and Setters
 	public ExperimentCatalog getExperimentCatalog() {
 		return experimentCatalog;
@@ -86,4 +89,12 @@ public class ProcessContext {
 	public void setLocalEventPublisher(LocalEventPublisher localEventPublisher) {
 		this.localEventPublisher = localEventPublisher;
 	}
+
+	public ProcessModel getProcessModel() {
+		return processModel;
+	}
+
+	public void setProcessModel(ProcessModel processModel) {
+		this.processModel = processModel;
+	}
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/JobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/JobSubmissionTask.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/JobSubmissionTask.java
new file mode 100644
index 0000000..41a540e
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/JobSubmissionTask.java
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.core.task;
+
+public interface JobSubmissionTask{
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/Task.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/Task.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/Task.java
new file mode 100644
index 0000000..7e764d4
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/task/Task.java
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.core.task;
+
+public interface Task {
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-core/src/main/resources/gfac-config.yaml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/gfac-config.yaml b/modules/gfac/gfac-core/src/main/resources/gfac-config.yaml
new file mode 100644
index 0000000..f33ca6e
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/gfac-config.yaml
@@ -0,0 +1,69 @@
+##################################################################
+# 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.
+#
+################################################################
+
+config:
+ jobSubmitters:
+   - submissionProtocol: SSH
+     taskClass: org.apache.airavata.task.adapters.SSHJobSubmissionTask
+
+   - submissionProtocol: GSISSH
+     taskClass: org.apache.airavata.task.adapters.GSISSHJobSubmissionTask
+
+ commonTasks:
+    - type: SETUP
+      taskClass: org.apache.airavata.task.common.SetupTask
+
+    - type: CLEANUP
+      taskClass: org.apache.airavata.task.common.CleanupTask
+
+ fileTransferTasks:
+   - transferProtocol: SCP
+     taskClass: org.apache.airavata.task.adapters.SCPFileTransferTask
+
+   - transferProtocol: HTTP
+     taskClass: org.apache.airavata.task.adapters.HTTPFileTransferTask
+
+   - transferProtocol: GRIDFTP
+     taskClass: org.apache.airavata.task.adapters.GRIDFTPFileTransferTask
+
+ resources:
+   - jobManagerType: PBS
+     commandOutputParser: org.apache.airavata.commmand.PBSOutputParser
+     emailParser: org.apache.airavata.email.parser.PBSEmailParser
+     resourceEmailAddresses:
+       - pbsconsult@sdsc.edu  # gordon
+       - adm@trident.bigred2.uits.iu.edu # Bigred2
+       - root <adm@trident.bigred2.uits.iu.edu> # Bigred2
+       - root <adm@scyld.localdomain> # alamo
+
+   - jobManagerType: SLURM
+     commandOutputParser: org.apache.airavata.commmand.SLURMOutputParser
+     emailParser: org.apache.airavata.email.parser.SLURMEmailParser
+     resourceEmailAddresses:
+       - SDSC Admin <slurm@comet-fe3.sdsc.edu> # comet
+       - slurm@batch1.stampede.tacc.utexas.edu # stampede
+
+   - jobManagerType: UGE
+     commandOutputParser: org.apache.airavata.commmand.UGEOutputParser
+     emailParser: org.apache.airavata.email.parser.UGEEmailParser
+     resourceEmailAddresses:
+       - ls4.tacc.utexas.edu # contain Lonestar
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngine.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngine.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngine.java
index cdb22f6..476da59 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngine.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngine.java
@@ -22,32 +22,104 @@
 package org.apache.airavata.gfac.impl;
 
 import org.apache.airavata.gfac.core.GFacException;
+import org.apache.airavata.gfac.core.config.DataTransferTaskConfig;
+import org.apache.airavata.gfac.core.config.GFacYamlConfigruation;
+import org.apache.airavata.gfac.core.config.JobSubmitterTaskConfig;
+import org.apache.airavata.gfac.core.config.ResourceConfig;
 import org.apache.airavata.gfac.core.context.ProcessContext;
+import org.apache.airavata.gfac.core.task.Task;
+import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol;
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+import org.apache.airavata.model.application.io.DataType;
+import org.apache.airavata.model.application.io.InputDataObjectType;
+import org.apache.airavata.model.process.ProcessModel;
+import org.apache.airavata.model.task.TaskModel;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 public class GFacEngine {
+	private static GFacEngine engine;
+	Map<JobSubmissionProtocol, Task> jobSubmissionTask;
+	Map<DataMovementProtocol, Task> dataMovementTask;
+	Map<ResourceJobManagerType, ResourceConfig> resources;
 
-	public static void createTaskChain(ProcessContext processContext) throws GFacException {
 
+	private GFacEngine() throws GFacException {
+		GFacYamlConfigruation config = new GFacYamlConfigruation();
+		for (JobSubmitterTaskConfig jobSubmitterTaskConfig : config.getJobSbumitters()) {
+			jobSubmissionTask.put(jobSubmitterTaskConfig.getSubmissionProtocol(), null);
+		}
+
+		for (DataTransferTaskConfig dataTransferTaskConfig : config.getFileTransferTasks()) {
+			dataMovementTask.put(dataTransferTaskConfig.getTransferProtocol(), null);
+		}
+
+		for (ResourceConfig resourceConfig : config.getResourceConfiguration()) {
+			resources.put(resourceConfig.getJobManagerType(), resourceConfig);
+		}
+	}
+
+	public static GFacEngine getInstance() throws GFacException {
+		if (engine == null) {
+			synchronized (GFacEngine.class) {
+				if (engine == null) {
+					engine = new GFacEngine();
+				}
+			}
+		}
+		return engine;
+	}
+
+	public ProcessContext populateProcessContext(ProcessContext processContext) {
+		processContext.setProcessModel(new ProcessModel());
+		return processContext;
+	}
+
+	public void createTaskChain(ProcessContext processContext) throws GFacException {
+		List<InputDataObjectType> processInputs = processContext.getProcessModel().getProcessInputs();
+		List<TaskModel> taskChain = new ArrayList<>();
+		if (processInputs != null) {
+			for (InputDataObjectType processInput : processInputs) {
+				DataType type = processInput.getType();
+				switch (type) {
+					case STDERR:
+						//
+						break;
+					case STDOUT:
+						//
+						break;
+					case URI:
+						// add URI type Task
+						break;
+					default:
+						// nothing to do
+						break;
+				}
+			}
+		}
 	}
 
-	public static void executeProcess(ProcessContext processContext) throws GFacException {
+	public void executeProcess(ProcessContext processContext) throws GFacException {
 
 
 	}
 
-	public static void recoverProcess(ProcessContext processContext) throws GFacException {
+	public void recoverProcess(ProcessContext processContext) throws GFacException {
 
 	}
 
-	public static void runProcessOutflow(ProcessContext processContext) throws GFacException
{
+	public void runProcessOutflow(ProcessContext processContext) throws GFacException {
 
 	}
 
-	public static void recoverProcessOutflow(ProcessContext processContext) throws GFacException
{
+	public void recoverProcessOutflow(ProcessContext processContext) throws GFacException {
 
 	}
 
-	public static void cancelProcess() throws GFacException {
+	public void cancelProcess() throws GFacException {
 
 	}
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
index d8aa094..f7616b3 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
@@ -42,33 +42,49 @@ public class GFacWorker implements Runnable {
 
     @Override
     public void run() {
-	    ProcessType type = getProcessType(processContext);
 	    try {
-		    switch (type){
-			    case NEW:
-				    GFacUtils.populateProcessContext(processContext);
-				    GFacEngine.createTaskChain(processContext);
-				    GFacEngine.executeProcess(processContext);
-				    break;
-			    case RECOVER:
-				    // recover the process
-				    GFacEngine.recoverProcess(processContext);
-				    break;
-			    case OUTFLOW:
-				    // run the outflow task
-				    GFacEngine.runProcessOutflow(processContext);
-				    break;
-			    case RECOVER_OUTFLOW:
-				    // recover  outflow task;
-				    GFacEngine.recoverProcessOutflow(processContext);
+		    GFacEngine engine = GFacEngine.getInstance();
+		    ProcessType type = getProcessType(processContext);
+		    try {
+			    switch (type) {
+				    case NEW:
+					    engine.populateProcessContext(processContext);
+					    engine.createTaskChain(processContext);
+					    engine.executeProcess(processContext);
+					    break;
+				    case RECOVER:
+					    // recover the process
+					    engine.populateProcessContext(processContext);
+					    engine.createTaskChain(processContext);
+					    engine.recoverProcess(processContext);
+					    break;
+				    case OUTFLOW:
+					    // run the outflow task
+					    engine.runProcessOutflow(processContext);
+					    break;
+				    case RECOVER_OUTFLOW:
+					    // recover  outflow task;
+					    engine.populateProcessContext(processContext);
+					    engine.recoverProcessOutflow(processContext);
+			    }
+		    } catch (GFacException e) {
+			    switch (type) {
+				    case NEW:
+					    log.error("Process execution error", e);
+					    break;
+				    case RECOVER:
+					    log.error("Process recover error ", e);
+					    break;
+				    case OUTFLOW:
+					    log.error("Process outflow execution error", e);
+					    break;
+				    case RECOVER_OUTFLOW:
+					    log.error("Process outflow recover error", e);
+					    break;
+			    }
 		    }
 	    } catch (GFacException e) {
-		    switch (type) {
-			    case NEW: log.error("Process execution error", e); break;
-			    case RECOVER: log.error("Process recover error ", e); break;
-			    case OUTFLOW: log.error("Process outflow execution error",e); break;
-			    case RECOVER_OUTFLOW: log.error("Process outflow recover error",e); break;
-		    }
+		    log.error("GFac Worker throws an exception", e);
 	    }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/102fb044/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c95d00c..be776ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -98,6 +98,7 @@
         <google.gson.version>2.3</google.gson.version>
 		<zk.version>3.4.0</zk.version>
 		<amqp.client.version>3.5.1</amqp.client.version>
+        <snakeyaml.version>1.15</snakeyaml.version>
 	</properties>
 
 	<developers>


Mime
View raw message