airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [1/2] airavata git commit: Added new Cloud resource job manager type and Renamed AuroraJobSubmission -> AuroraJobSubmissionTask
Date Wed, 09 Nov 2016 20:21:16 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 3660cd8ff -> c0665f1aa


Added new Cloud resource job manager type and Renamed AuroraJobSubmission -> AuroraJobSubmissionTask


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

Branch: refs/heads/develop
Commit: b2bded2c00de11678895e97e7125dc9a2dfeb915
Parents: 3660cd8
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Wed Nov 9 15:20:20 2016 -0500
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Wed Nov 9 15:20:20 2016 -0500

----------------------------------------------------------------------
 .../airavata/compute_resource_model_types.cpp   |   8 +-
 .../lib/airavata/compute_resource_model_types.h |   3 +-
 .../resources/lib/Airavata/API/Airavata.php     |  82 +++++-----
 .../Model/AppCatalog/ComputeResource/Types.php  |   2 +
 .../model/appcatalog/computeresource/ttypes.py  |   3 +
 .../computeresource/ResourceJobManagerType.java |   5 +-
 .../src/main/resources/CLOUD_Groovy.template    |   7 +
 .../server/src/main/resources/gfac-config.yaml  |   2 +
 .../apache/airavata/gfac/core/GFacUtils.java    |  63 +++++---
 .../apache/airavata/gfac/core/GroovyMap.java    |  12 ++
 .../gfac/core/context/ProcessContext.java       |   1 -
 .../airavata/gfac/core/GFacUtilsTest.java       |   9 ++
 .../org/apache/airavata/gfac/impl/Factory.java  |  12 +-
 .../gfac/impl/task/AuroraJobSubmission.java     | 148 ------------------
 .../gfac/impl/task/AuroraJobSubmissionTask.java | 151 +++++++++++++++++++
 .../impl/task/DefaultJobSubmissionTask.java     |  15 +-
 .../compute_resource_model.thrift               |   3 +-
 17 files changed, 303 insertions(+), 223 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp
index a744a1f..8f88e12 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp
@@ -35,16 +35,18 @@ int _kResourceJobManagerTypeValues[] = {
   ResourceJobManagerType::PBS,
   ResourceJobManagerType::SLURM,
   ResourceJobManagerType::LSF,
-  ResourceJobManagerType::UGE
+  ResourceJobManagerType::UGE,
+  ResourceJobManagerType::CLOUD
 };
 const char* _kResourceJobManagerTypeNames[] = {
   "FORK",
   "PBS",
   "SLURM",
   "LSF",
-  "UGE"
+  "UGE",
+  "CLOUD"
 };
-const std::map<int, const char*> _ResourceJobManagerType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kResourceJobManagerTypeValues, _kResourceJobManagerTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+const std::map<int, const char*> _ResourceJobManagerType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kResourceJobManagerTypeValues, _kResourceJobManagerTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
 int _kJobManagerCommandValues[] = {
   JobManagerCommand::SUBMISSION,

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h
index 89566a0..95ab605 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h
@@ -45,7 +45,8 @@ struct ResourceJobManagerType {
     PBS = 1,
     SLURM = 2,
     LSF = 3,
-    UGE = 4
+    UGE = 4,
+    CLOUD = 5
   };
 };
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index d75e594..0cea7e2 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -3027,7 +3027,7 @@ interface AiravataIf {
    * @param computeResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @param gatewayComputeResourcePreference
+   * @param computeResourcePreference
    *   The ComputeResourcePreference object to be added to the resource profile.
    * 
    * @return status
@@ -3038,14 +3038,14 @@ interface AiravataIf {
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $gatewayID
    * @param string $computeResourceId
-   * @param \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference
+   * @param \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference
    * @return bool
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference);
+  public function addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference);
   /**
    * Add a Storage Resource Preference to a registered gateway profile.
    * 
@@ -3055,7 +3055,7 @@ interface AiravataIf {
    * @param storageResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @param gatewayComputeResourcePreference
+   * @param computeResourcePreference
    *   The ComputeResourcePreference object to be added to the resource profile.
    * 
    * @return status
@@ -3084,7 +3084,7 @@ interface AiravataIf {
    * @param computeResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @return gatewayComputeResourcePreference
+   * @return computeResourcePreference
    *   Returns the ComputeResourcePreference object.
    * 
    * 
@@ -3161,7 +3161,7 @@ interface AiravataIf {
    * @param gatewayID
    *   The identifier for the gateway profile to be requested
    * 
-   * @return gatewayComputeResourcePreference
+   * @return computeResourcePreference
    *   Returns the ComputeResourcePreference object.
    * 
    * 
@@ -3219,7 +3219,7 @@ interface AiravataIf {
    * @param computeResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @param gatewayComputeResourcePreference
+   * @param computeResourcePreference
    *   The ComputeResourcePreference object to be updated to the resource profile.
    * 
    * @return status
@@ -3229,14 +3229,14 @@ interface AiravataIf {
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $gatewayID
    * @param string $computeResourceId
-   * @param \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference
+   * @param \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference
    * @return bool
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference);
+  public function updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference);
   /**
    * Update a Storage Resource Preference of a registered gateway profile.
    * 
@@ -3437,7 +3437,7 @@ interface AiravataIf {
    * @param computeResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @param gatewayComputeResourcePreference
+   * @param computeResourcePreference
    *   The ComputeResourcePreference object to be added to the resource profile.
    * 
    * @return status
@@ -3469,7 +3469,7 @@ interface AiravataIf {
    * @param storageResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @param gatewayComputeResourcePreference
+   * @param computeResourcePreference
    *   The ComputeResourcePreference object to be added to the resource profile.
    * 
    * @return status
@@ -3502,7 +3502,7 @@ interface AiravataIf {
    * @param userComputeResourceId
    *   Preferences related to a particular compute resource
    * 
-   * @return gatewayComputeResourcePreference
+   * @return computeResourcePreference
    *   Returns the ComputeResourcePreference object.
    * 
    * 
@@ -3580,7 +3580,7 @@ interface AiravataIf {
    * @param gatewayID
    *   The identifier for the gateway profile to be requested
    * 
-   * @return gatewayComputeResourcePreference
+   * @return computeResourcePreference
    *   Returns the ComputeResourcePreference object.
    * 
    * 
@@ -11807,19 +11807,19 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("deleteGatewayResourceProfile failed: unknown result");
   }
 
-  public function addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference)
+  public function addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference)
   {
-    $this->send_addGatewayComputeResourcePreference($authzToken, $gatewayID, $computeResourceId, $gatewayComputeResourcePreference);
+    $this->send_addGatewayComputeResourcePreference($authzToken, $gatewayID, $computeResourceId, $computeResourcePreference);
     return $this->recv_addGatewayComputeResourcePreference();
   }
 
-  public function send_addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference)
+  public function send_addGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference)
   {
     $args = new \Airavata\API\Airavata_addGatewayComputeResourcePreference_args();
     $args->authzToken = $authzToken;
     $args->gatewayID = $gatewayID;
     $args->computeResourceId = $computeResourceId;
-    $args->gatewayComputeResourcePreference = $gatewayComputeResourcePreference;
+    $args->computeResourcePreference = $computeResourcePreference;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -12260,19 +12260,19 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("getAllGatewayResourceProfiles failed: unknown result");
   }
 
-  public function updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference)
+  public function updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference)
   {
-    $this->send_updateGatewayComputeResourcePreference($authzToken, $gatewayID, $computeResourceId, $gatewayComputeResourcePreference);
+    $this->send_updateGatewayComputeResourcePreference($authzToken, $gatewayID, $computeResourceId, $computeResourcePreference);
     return $this->recv_updateGatewayComputeResourcePreference();
   }
 
-  public function send_updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $gatewayComputeResourcePreference)
+  public function send_updateGatewayComputeResourcePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $computeResourceId, \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference $computeResourcePreference)
   {
     $args = new \Airavata\API\Airavata_updateGatewayComputeResourcePreference_args();
     $args->authzToken = $authzToken;
     $args->gatewayID = $gatewayID;
     $args->computeResourceId = $computeResourceId;
-    $args->gatewayComputeResourcePreference = $gatewayComputeResourcePreference;
+    $args->computeResourcePreference = $computeResourcePreference;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -51622,7 +51622,7 @@ class Airavata_addGatewayComputeResourcePreference_args {
   /**
    * @var \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference
    */
-  public $gatewayComputeResourcePreference = null;
+  public $computeResourcePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -51641,7 +51641,7 @@ class Airavata_addGatewayComputeResourcePreference_args {
           'type' => TType::STRING,
           ),
         4 => array(
-          'var' => 'gatewayComputeResourcePreference',
+          'var' => 'computeResourcePreference',
           'type' => TType::STRUCT,
           'class' => '\Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference',
           ),
@@ -51657,8 +51657,8 @@ class Airavata_addGatewayComputeResourcePreference_args {
       if (isset($vals['computeResourceId'])) {
         $this->computeResourceId = $vals['computeResourceId'];
       }
-      if (isset($vals['gatewayComputeResourcePreference'])) {
-        $this->gatewayComputeResourcePreference = $vals['gatewayComputeResourcePreference'];
+      if (isset($vals['computeResourcePreference'])) {
+        $this->computeResourcePreference = $vals['computeResourcePreference'];
       }
     }
   }
@@ -51706,8 +51706,8 @@ class Airavata_addGatewayComputeResourcePreference_args {
           break;
         case 4:
           if ($ftype == TType::STRUCT) {
-            $this->gatewayComputeResourcePreference = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
-            $xfer += $this->gatewayComputeResourcePreference->read($input);
+            $this->computeResourcePreference = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
+            $xfer += $this->computeResourcePreference->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -51743,12 +51743,12 @@ class Airavata_addGatewayComputeResourcePreference_args {
       $xfer += $output->writeString($this->computeResourceId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->gatewayComputeResourcePreference !== null) {
-      if (!is_object($this->gatewayComputeResourcePreference)) {
+    if ($this->computeResourcePreference !== null) {
+      if (!is_object($this->computeResourcePreference)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('gatewayComputeResourcePreference', TType::STRUCT, 4);
-      $xfer += $this->gatewayComputeResourcePreference->write($output);
+      $xfer += $output->writeFieldBegin('computeResourcePreference', TType::STRUCT, 4);
+      $xfer += $this->computeResourcePreference->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -53787,7 +53787,7 @@ class Airavata_updateGatewayComputeResourcePreference_args {
   /**
    * @var \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference
    */
-  public $gatewayComputeResourcePreference = null;
+  public $computeResourcePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -53806,7 +53806,7 @@ class Airavata_updateGatewayComputeResourcePreference_args {
           'type' => TType::STRING,
           ),
         4 => array(
-          'var' => 'gatewayComputeResourcePreference',
+          'var' => 'computeResourcePreference',
           'type' => TType::STRUCT,
           'class' => '\Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference',
           ),
@@ -53822,8 +53822,8 @@ class Airavata_updateGatewayComputeResourcePreference_args {
       if (isset($vals['computeResourceId'])) {
         $this->computeResourceId = $vals['computeResourceId'];
       }
-      if (isset($vals['gatewayComputeResourcePreference'])) {
-        $this->gatewayComputeResourcePreference = $vals['gatewayComputeResourcePreference'];
+      if (isset($vals['computeResourcePreference'])) {
+        $this->computeResourcePreference = $vals['computeResourcePreference'];
       }
     }
   }
@@ -53871,8 +53871,8 @@ class Airavata_updateGatewayComputeResourcePreference_args {
           break;
         case 4:
           if ($ftype == TType::STRUCT) {
-            $this->gatewayComputeResourcePreference = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
-            $xfer += $this->gatewayComputeResourcePreference->read($input);
+            $this->computeResourcePreference = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
+            $xfer += $this->computeResourcePreference->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -53908,12 +53908,12 @@ class Airavata_updateGatewayComputeResourcePreference_args {
       $xfer += $output->writeString($this->computeResourceId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->gatewayComputeResourcePreference !== null) {
-      if (!is_object($this->gatewayComputeResourcePreference)) {
+    if ($this->computeResourcePreference !== null) {
+      if (!is_object($this->computeResourcePreference)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('gatewayComputeResourcePreference', TType::STRUCT, 4);
-      $xfer += $this->gatewayComputeResourcePreference->write($output);
+      $xfer += $output->writeFieldBegin('computeResourcePreference', TType::STRUCT, 4);
+      $xfer += $this->computeResourcePreference->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
index 39acd3c..696b064 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/ComputeResource/Types.php
@@ -42,12 +42,14 @@ final class ResourceJobManagerType {
   const SLURM = 2;
   const LSF = 3;
   const UGE = 4;
+  const CLOUD = 5;
   static public $__names = array(
     0 => 'FORK',
     1 => 'PBS',
     2 => 'SLURM',
     3 => 'LSF',
     4 => 'UGE',
+    5 => 'CLOUD',
   );
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py
index 174d3b8..300ba5b 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py
@@ -45,6 +45,7 @@ class ResourceJobManagerType:
   SLURM = 2
   LSF = 3
   UGE = 4
+  CLOUD = 5
 
   _VALUES_TO_NAMES = {
     0: "FORK",
@@ -52,6 +53,7 @@ class ResourceJobManagerType:
     2: "SLURM",
     3: "LSF",
     4: "UGE",
+    5: "CLOUD",
   }
 
   _NAMES_TO_VALUES = {
@@ -60,6 +62,7 @@ class ResourceJobManagerType:
     "SLURM": 2,
     "LSF": 3,
     "UGE": 4,
+    "CLOUD": 5,
   }
 
 class JobManagerCommand:

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ResourceJobManagerType.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ResourceJobManagerType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ResourceJobManagerType.java
index 2fc5c0b..2bc79c5 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ResourceJobManagerType.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ResourceJobManagerType.java
@@ -52,7 +52,8 @@ public enum ResourceJobManagerType implements org.apache.thrift.TEnum {
   PBS(1),
   SLURM(2),
   LSF(3),
-  UGE(4);
+  UGE(4),
+  CLOUD(5);
 
   private final int value;
 
@@ -83,6 +84,8 @@ public enum ResourceJobManagerType implements org.apache.thrift.TEnum {
         return LSF;
       case 4:
         return UGE;
+      case 5:
+        return CLOUD;
       default:
         return null;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/configuration/server/src/main/resources/CLOUD_Groovy.template
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/CLOUD_Groovy.template b/modules/configuration/server/src/main/resources/CLOUD_Groovy.template
new file mode 100644
index 0000000..b16beb7
--- /dev/null
+++ b/modules/configuration/server/src/main/resources/CLOUD_Groovy.template
@@ -0,0 +1,7 @@
+<%
+   if (workingDirectory != null)  out.print 'cd ' + workingDirectory +' && '
+   if (jobSubmitterCommand != null)  out.print jobSubmitterCommand + ' '
+   if (executablePath != null)  out.print  executablePath + ' '
+   if (inputs != null) for(input in inputs)  out.print input + ' '
+   out.print '\n'
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/configuration/server/src/main/resources/gfac-config.yaml
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/gfac-config.yaml b/modules/configuration/server/src/main/resources/gfac-config.yaml
index 802d1e5..7d580ab 100644
--- a/modules/configuration/server/src/main/resources/gfac-config.yaml
+++ b/modules/configuration/server/src/main/resources/gfac-config.yaml
@@ -34,6 +34,8 @@ jobSubmitters:
   - submissionProtocol: LOCAL
     taskClass: org.apache.airavata.gfac.impl.task.LocalJobSubmissionTask
 
+  - submissionProtocol: CLOUD
+    taskClass: org.apache.airavata.gfac.impl.task.AuroraJobSubmissionTask
 
 # Following job subbmitters are not yet implemented.
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index bef7bfb..dcbe683 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -529,6 +529,11 @@ public class GFacUtils {
         }
 
         // NOTE: Give precedence to data comes with experiment
+        // qos per queue
+        String qoS = getQoS(processContext.getQualityOfService(), processContext.getQueueName());
+        if (qoS != null) {
+            groovyMap.add(Script.QUALITY_OF_SERVICE, qoS);
+        }
         ComputationalResourceSchedulingModel scheduling = processModel.getProcessResourceSchedule();
         if (scheduling != null) {
             int totalNodeCount = scheduling.getNodeCount();
@@ -540,11 +545,6 @@ public class GFacUtils {
             if (totalNodeCount > 0) {
                 groovyMap.add(Script.NODES, totalNodeCount);
             }
-            // qos per queue
-            String qoS = getQoS(processContext.getQualityOfService(), processContext.getQueueName());
-            if (qoS != null) {
-                groovyMap.add(Script.QUALITY_OF_SERVICE, qoS);
-            }
             if (totalCPUCount > 0) {
                 int ppn = totalCPUCount / totalNodeCount;
                 groovyMap.add(Script.PROCESS_PER_NODE, ppn);
@@ -867,26 +867,51 @@ public class GFacUtils {
     }
 
     public static File createJobFile(GroovyMap groovyMap, TaskContext tc, JobManagerConfiguration jMC)
-            throws GFacException{
+            throws GFacException {
+        try {
+            int number = new SecureRandom().nextInt();
+            number = (number < 0 ? -number : number);
+            File tempJobFile = new File(GFacUtils.getLocalDataDir(tc), "job_" + Integer.toString(number) + jMC.getScriptExtension());
+            FileUtils.writeStringToFile(tempJobFile, generateScript(groovyMap, jMC.getJobDescriptionTemplateName()));
+            return tempJobFile;
+        } catch (IOException e) {
+            throw new GFacException("Error while writing script content to temp file");
+        }
+    }
 
-        URL templateUrl = ApplicationSettings.loadFile(jMC.getJobDescriptionTemplateName());
+    public static String generateScript(GroovyMap groovyMap, String templateName) throws GFacException {
+        URL templateUrl = ApplicationSettings.loadFile(templateName);
         if (templateUrl == null) {
-            String error = "System configuration file '" + jMC.getJobDescriptionTemplateName()
-                    + "' not found in the classpath";
+            String error = "Template file '" + templateName + "' not found";
             throw new GFacException(error);
         }
+        File template = new File(templateUrl.getPath());
+        TemplateEngine engine = new GStringTemplateEngine();
+        Writable make;
         try {
-            File template = new File(templateUrl.getPath());
-            TemplateEngine engine = new GStringTemplateEngine();
-            Writable make = engine.createTemplate(template).make(groovyMap);
+            make = engine.createTemplate(template).make(groovyMap);
+        } catch (Exception e) {
+            throw new GFacException("Error while generating script using groovy map");
+        }
+        return make.toString();
+    }
 
-            int number = new SecureRandom().nextInt();
-            number = (number < 0 ? -number : number);
-            File tempJobFile = new File(GFacUtils.getLocalDataDir(tc), "job_" + Integer.toString(number) + jMC.getScriptExtension());
-            FileUtils.writeStringToFile(tempJobFile, make.toString());
-            return tempJobFile;
-        } catch (ClassNotFoundException | IOException e) {
-            throw new GFacException("Error while parsing template and generating script file");
+    public static String getTemplateFileName(ResourceJobManagerType resourceJobManagerType) {
+        switch (resourceJobManagerType) {
+            case FORK:
+                return "UGE_Groovy.template";
+            case PBS:
+                return "PBS_Groovy.template";
+            case SLURM:
+                return "SLURM_Groovy.template";
+            case UGE:
+                return "UGE_Groovy.template";
+            case LSF:
+                return "LSF_Groovy.template";
+            case CLOUD:
+                return "CLOUD_Groovy.template";
+            default:
+                return null;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
index 1abc878..a376fed 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
@@ -39,6 +39,7 @@ package org.apache.airavata.gfac.core;/*
  */
 
 import java.util.HashMap;
+import java.util.Optional;
 
 public class GroovyMap extends HashMap<String, Object> {
 
@@ -63,6 +64,17 @@ public class GroovyMap extends HashMap<String, Object> {
         return get(script.name);
     }
 
+    public Optional<String> getStringValue(Script script) {
+        Object obj = get(script);
+        if (obj instanceof String) {
+            return Optional.of((String) obj);
+        } else if (obj == null) {
+            return Optional.empty();
+        } else {
+            throw new IllegalArgumentException("Value is not String type");
+        }
+    }
+
     private void addDefaultValues() {
         this.add(Script.SHELL_NAME, null)
                 .add(Script.QUEUE_NAME, null)

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/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 1b2fb22..00598f2 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
@@ -115,7 +115,6 @@ public class ProcessContext {
 		this.tokenId = tokenId;
 	}
 
-
 	public ExperimentCatalog getExperimentCatalog() {
 		return experimentCatalog;
 	}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/core/GFacUtilsTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/core/GFacUtilsTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/core/GFacUtilsTest.java
index cf56780..4c405ab 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/core/GFacUtilsTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/gfac/core/GFacUtilsTest.java
@@ -59,4 +59,13 @@ public class GFacUtilsTest {
         Assert.assertNotNull(value);
         Assert.assertEquals("mkdir -p /my/scratch/seagrid/John/gaussian", value);
     }
+
+    @Test
+    public void parserCommandTestWithEscapeChar() throws Exception {
+        String command = "abq_job=\\${baseinp%.*}";
+        GroovyMap groovyMap = new GroovyMap();
+        String value = GFacUtils.parseCommands(command, groovyMap);
+        Assert.assertNotNull(value);
+        Assert.assertEquals("abq_job=${baseinp%.*}", value);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
index ac40c80..21327fd 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
@@ -199,22 +199,24 @@ public abstract class Factory {
 					.getResourceJobManagerType().name());
 		}
 
+		String templateFileName = GFacUtils.getTemplateFileName(resourceJobManager.getResourceJobManagerType());
 		switch (resourceJobManager.getResourceJobManagerType()) {
 			case PBS:
-				return new PBSJobConfiguration("PBS_Groovy.template", ".pbs", resourceJobManager.getJobManagerBinPath(),
+				return new PBSJobConfiguration(templateFileName, ".pbs", resourceJobManager.getJobManagerBinPath(),
 						resourceJobManager.getJobManagerCommands(), outputParser);
 			case SLURM:
-				return new SlurmJobConfiguration("SLURM_Groovy.template", ".slurm", resourceJobManager
+				return new SlurmJobConfiguration(templateFileName, ".slurm", resourceJobManager
 						.getJobManagerBinPath(), resourceJobManager.getJobManagerCommands(), outputParser);
 			case LSF:
-				return new LSFJobConfiguration("LSF_Groovy.template", ".lsf", resourceJobManager.getJobManagerBinPath(),
+				return new LSFJobConfiguration(templateFileName, ".lsf", resourceJobManager.getJobManagerBinPath(),
 						resourceJobManager.getJobManagerCommands(), outputParser);
 			case UGE:
-				return new UGEJobConfiguration("UGE_Groovy.template", ".pbs", resourceJobManager.getJobManagerBinPath(),
+				return new UGEJobConfiguration(templateFileName, ".pbs", resourceJobManager.getJobManagerBinPath(),
 						resourceJobManager.getJobManagerCommands(), outputParser);
 			case FORK:
-				return new ForkJobConfiguration("FORK_Groovy.template", ".sh", resourceJobManager.getJobManagerBinPath(),
+				return new ForkJobConfiguration(templateFileName, ".sh", resourceJobManager.getJobManagerBinPath(),
 						resourceJobManager.getJobManagerCommands(), outputParser);
+			// We don't have a job configuration manager for CLOUD type
 			default:
 				return null;
 		}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmission.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmission.java
deleted file mode 100644
index 0941c85..0000000
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmission.java
+++ /dev/null
@@ -1,148 +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.gfac.impl.task;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.airavata.cloud.aurora.client.AuroraThriftClient;
-import org.apache.airavata.cloud.aurora.client.bean.IdentityBean;
-import org.apache.airavata.cloud.aurora.client.bean.JobConfigBean;
-import org.apache.airavata.cloud.aurora.client.bean.JobKeyBean;
-import org.apache.airavata.cloud.aurora.client.bean.ProcessBean;
-import org.apache.airavata.cloud.aurora.client.bean.ResourceBean;
-import org.apache.airavata.cloud.aurora.client.bean.ResponseBean;
-import org.apache.airavata.cloud.aurora.client.bean.TaskConfigBean;
-import org.apache.airavata.cloud.aurora.util.AuroraThriftClientUtil;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.gfac.core.GFacException;
-import org.apache.airavata.gfac.core.GFacUtils;
-import org.apache.airavata.gfac.core.context.ProcessContext;
-import org.apache.airavata.gfac.core.context.TaskContext;
-import org.apache.airavata.gfac.core.task.JobSubmissionTask;
-import org.apache.airavata.gfac.core.task.TaskException;
-import org.apache.airavata.gfac.impl.AuroraUtils;
-import org.apache.airavata.model.commons.ErrorModel;
-import org.apache.airavata.model.job.JobModel;
-import org.apache.airavata.model.status.JobState;
-import org.apache.airavata.model.status.JobStatus;
-import org.apache.airavata.model.status.TaskState;
-import org.apache.airavata.model.status.TaskStatus;
-import org.apache.airavata.model.task.TaskTypes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AuroraJobSubmission implements JobSubmissionTask{
-
-    private static final Logger log = LoggerFactory.getLogger(AuroraJobSubmission.class);
-
-    @Override
-    public JobStatus cancel(TaskContext taskcontext) throws TaskException {
-        JobStatus jobStatus = new JobStatus();
-        jobStatus.setJobState(JobState.ACTIVE);
-        return jobStatus;
-    }
-
-    @Override
-    public void init(Map<String, String> propertyMap) throws TaskException {
-
-    }
-
-    @Override
-    public TaskStatus execute(TaskContext taskContext) {
-        TaskStatus taskStatus = new TaskStatus(TaskState.COMPLETED); // set to completed.
-        ProcessContext processContext = taskContext.getParentProcessContext();
-        JobModel jobModel = processContext.getJobModel();
-        jobModel.setTaskId(taskContext.getTaskId());
-        String jobIdAndName = "A" + GFacUtils.generateJobName();
-        jobModel.setJobName(jobIdAndName);
-        JobStatus jobStatus = new JobStatus();
-        jobStatus.setJobState(JobState.SUBMITTED);
-
-        try {
-            JobKeyBean jobKey = new JobKeyBean(AuroraUtils.ENVIRONMENT, AuroraUtils.ROLE, jobIdAndName);
-            IdentityBean owner = new IdentityBean(AuroraUtils.ROLE);
-            // only autodoc vina
-            String workingDir = taskContext.getWorkingDir();
-//            ProcessBean proc1 = new ProcessBean("process_1", "mkdir -p " + workingDir, false);
-//            ProcessBean proc2 = new ProcessBean("process_2", "cp -rf /home/centos/efs-mount-point/autodock-vina/* " + workingDir , false);
-            String executablePath = processContext.getApplicationDeploymentDescription().getExecutablePath();
-            ProcessBean proc3 = new ProcessBean("process_3", "cd " + workingDir + " && sh " + executablePath, false);
-            Set<ProcessBean> processes = new LinkedHashSet<>();
-//            processes.add(proc1);
-//            processes.add(proc2);
-            processes.add(proc3);
-
-            ResourceBean resources = new ResourceBean(1.5, 512, 512);
-
-            TaskConfigBean taskConfig = new TaskConfigBean("Airavata-Aurora-" + jobIdAndName, processes, resources);
-            JobConfigBean jobConfig = new JobConfigBean(jobKey, owner, taskConfig, AuroraUtils.CLUSTER);
-
-            String executorConfigJson = AuroraThriftClientUtil.getExecutorConfigJson(jobConfig);
-            log.info("Executor Config for Job {} , {}", jobIdAndName, executorConfigJson);
-
-            AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient();
-            ResponseBean response = client.createJob(jobConfig);
-            log.info("Response for job {}, {}", jobIdAndName, response);
-            jobModel.setJobDescription(resources.toString());
-
-            jobModel.setJobId(jobIdAndName);
-            jobStatus.setReason("Successfully Submitted");
-            jobModel.setJobStatuses(Arrays.asList(jobStatus ));
-            jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-            taskContext.getParentProcessContext().setJobModel(jobModel);
-
-            GFacUtils.saveJobModel(processContext, jobModel);
-            GFacUtils.saveJobStatus(processContext, jobModel);
-            taskStatus.setReason("Successfully submitted job to Aurora");
-        } catch (Exception e) {
-            String msg = "Error occurred while submitting the job";
-            log.error(msg, e);
-            taskStatus.setState(TaskState.FAILED);
-            taskStatus.setReason(msg);
-            taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-            ErrorModel errorModel = new ErrorModel();
-            errorModel.setActualErrorMessage(e.getMessage());
-            errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
-        }
-
-        taskContext.setTaskStatus(taskStatus);
-        try {
-            GFacUtils.saveAndPublishTaskStatus(taskContext);
-        } catch (GFacException e) {
-            log.error("Error while saving task status", e);
-        }
-        return taskStatus;
-    }
-
-    @Override
-    public TaskStatus recover(TaskContext taskContext) {
-        return execute(taskContext);
-    }
-
-    @Override
-    public TaskTypes getType() {
-        return TaskTypes.JOB_SUBMISSION;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmissionTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmissionTask.java
new file mode 100644
index 0000000..96b8187
--- /dev/null
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AuroraJobSubmissionTask.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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.impl.task;
+
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.airavata.cloud.aurora.client.AuroraThriftClient;
+import org.apache.airavata.cloud.aurora.client.bean.IdentityBean;
+import org.apache.airavata.cloud.aurora.client.bean.JobConfigBean;
+import org.apache.airavata.cloud.aurora.client.bean.JobKeyBean;
+import org.apache.airavata.cloud.aurora.client.bean.ProcessBean;
+import org.apache.airavata.cloud.aurora.client.bean.ResourceBean;
+import org.apache.airavata.cloud.aurora.client.bean.ResponseBean;
+import org.apache.airavata.cloud.aurora.client.bean.TaskConfigBean;
+import org.apache.airavata.cloud.aurora.util.AuroraThriftClientUtil;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.gfac.core.GFacException;
+import org.apache.airavata.gfac.core.GFacUtils;
+import org.apache.airavata.gfac.core.GroovyMap;
+import org.apache.airavata.gfac.core.Script;
+import org.apache.airavata.gfac.core.context.ProcessContext;
+import org.apache.airavata.gfac.core.context.TaskContext;
+import org.apache.airavata.gfac.core.task.JobSubmissionTask;
+import org.apache.airavata.gfac.core.task.TaskException;
+import org.apache.airavata.gfac.impl.AuroraUtils;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+import org.apache.airavata.model.commons.ErrorModel;
+import org.apache.airavata.model.job.JobModel;
+import org.apache.airavata.model.status.JobState;
+import org.apache.airavata.model.status.JobStatus;
+import org.apache.airavata.model.status.TaskState;
+import org.apache.airavata.model.status.TaskStatus;
+import org.apache.airavata.model.task.TaskTypes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AuroraJobSubmissionTask implements JobSubmissionTask{
+
+    private static final Logger log = LoggerFactory.getLogger(AuroraJobSubmissionTask.class);
+
+    @Override
+    public JobStatus cancel(TaskContext taskcontext) throws TaskException {
+        JobStatus jobStatus = new JobStatus();
+        jobStatus.setJobState(JobState.ACTIVE);
+        return jobStatus;
+    }
+
+    @Override
+    public void init(Map<String, String> propertyMap) throws TaskException {
+
+    }
+
+    @Override
+    public TaskStatus execute(TaskContext taskContext) {
+        TaskStatus taskStatus = new TaskStatus(TaskState.COMPLETED); // set to completed.
+        ProcessContext processContext = taskContext.getParentProcessContext();
+        JobModel jobModel = processContext.getJobModel();
+        jobModel.setTaskId(taskContext.getTaskId());
+        String jobIdAndName = "A" + GFacUtils.generateJobName();
+        jobModel.setJobName(jobIdAndName);
+        JobStatus jobStatus = new JobStatus();
+        jobStatus.setJobState(JobState.SUBMITTED);
+
+        try {
+            JobKeyBean jobKey = new JobKeyBean(AuroraUtils.ENVIRONMENT, AuroraUtils.ROLE, jobIdAndName);
+            IdentityBean owner = new IdentityBean(AuroraUtils.ROLE);
+            GroovyMap groovyMap = GFacUtils.createGroovyMap(processContext, taskContext);
+            groovyMap.add(Script.JOB_SUBMITTER_COMMAND, "sh");
+            String templateFileName = GFacUtils.getTemplateFileName(ResourceJobManagerType.CLOUD);
+            String script = GFacUtils.generateScript(groovyMap, templateFileName);
+            Set<ProcessBean> processes = new LinkedHashSet<>();
+            ProcessBean process_1 = new ProcessBean("process_1", script, false);
+            processes.add(process_1);
+
+            ProcessBean stdOutProcess = new ProcessBean("stdout_copy_process", "pwd", false);
+            processes.add(stdOutProcess);
+
+            ResourceBean resources = new ResourceBean(1.5, 512, 512);
+
+            TaskConfigBean taskConfig = new TaskConfigBean("Airavata-Aurora-" + jobIdAndName, processes, resources);
+            JobConfigBean jobConfig = new JobConfigBean(jobKey, owner, taskConfig, AuroraUtils.CLUSTER);
+
+            String executorConfigJson = AuroraThriftClientUtil.getExecutorConfigJson(jobConfig);
+            log.info("Executor Config for Job {} , {}", jobIdAndName, executorConfigJson);
+
+            AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient();
+            ResponseBean response = client.createJob(jobConfig);
+            log.info("Response for job {}, {}", jobIdAndName, response);
+            jobModel.setJobDescription(resources.toString());
+
+            jobModel.setJobId(jobIdAndName);
+            jobStatus.setReason("Successfully Submitted");
+            jobModel.setJobStatuses(Arrays.asList(jobStatus ));
+            jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+            taskContext.getParentProcessContext().setJobModel(jobModel);
+
+            GFacUtils.saveJobModel(processContext, jobModel);
+            GFacUtils.saveJobStatus(processContext, jobModel);
+            taskStatus.setReason("Successfully submitted job to Aurora");
+        } catch (Throwable e) {
+            String msg = "Error occurred while submitting Aurora job";
+            log.error(msg, e);
+            taskStatus.setState(TaskState.FAILED);
+            taskStatus.setReason(msg);
+            taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+            ErrorModel errorModel = new ErrorModel();
+            errorModel.setActualErrorMessage(e.getMessage());
+            errorModel.setUserFriendlyMessage(msg);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
+        }
+
+        taskContext.setTaskStatus(taskStatus);
+        try {
+            GFacUtils.saveAndPublishTaskStatus(taskContext);
+        } catch (GFacException e) {
+            log.error("Error while saving task status", e);
+        }
+        return taskStatus;
+    }
+
+    @Override
+    public TaskStatus recover(TaskContext taskContext) {
+        return execute(taskContext);
+    }
+
+    @Override
+    public TaskTypes getType() {
+        return TaskTypes.JOB_SUBMISSION;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
index 97956bd..ddb3297 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
@@ -73,7 +73,8 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    jobModel.setTaskId(taskContext.getTaskId());
 		    RemoteCluster remoteCluster = processContext.getJobSubmissionRemoteCluster();
 			GroovyMap groovyMap = GFacUtils.createGroovyMap(processContext, taskContext);
-			jobModel.setJobName(groovyMap.get(Script.JOB_NAME).toString());
+			groovyMap.getStringValue(Script.JOB_NAME).
+					ifPresent(jobName -> jobModel.setJobName(jobName));
 			ResourceJobManager resourceJobManager = GFacUtils.getResourceJobManager(processContext);
 		    JobManagerConfiguration jConfig = null;
 		    if (resourceJobManager != null) {
@@ -278,8 +279,16 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
 		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
-	    } catch (RegistryException e) {
-            e.printStackTrace();
+		} catch (Throwable e) {
+			String msg = "JobSubmission failed";
+			log.error(msg, e);
+			taskStatus.setState(TaskState.FAILED);
+			taskStatus.setReason(msg);
+			taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+			ErrorModel errorModel = new ErrorModel();
+			errorModel.setActualErrorMessage(e.getMessage());
+			errorModel.setUserFriendlyMessage(msg);
+			taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         }
 
         taskContext.setTaskStatus(taskStatus);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b2bded2c/thrift-interface-descriptions/data-models/resource-catalog-models/compute_resource_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/compute_resource_model.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/compute_resource_model.thrift
index 5ca2728..7da3fce 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/compute_resource_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/compute_resource_model.thrift
@@ -52,7 +52,8 @@ enum ResourceJobManagerType {
     PBS,
     SLURM,
     LSF,
-    UGE
+    UGE,
+    CLOUD
 }
 
 /**


Mime
View raw message