airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [1/2] Exposing the orchestration validation functions from Airavata API and also validating before launch - AIRAVATA-1200
Date Tue, 13 May 2014 14:45:42 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 6328beae7 -> 3ba8cfa9c


http://git-wip-us.apache.org/repos/asf/airavata/blob/3ba8cfa9/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 42fc7f4..cf3d5ca 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
@@ -29,6 +29,7 @@ interface AiravataIf {
   public function updateExperiment($airavataExperimentId, \Airavata\Model\Workspace\Experiment\Experiment
$experiment);
   public function updateExperimentConfiguration($airavataExperimentId, \Airavata\Model\Workspace\Experiment\UserConfigurationData
$userConfiguration);
   public function updateResourceScheduleing($airavataExperimentId, \Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling
$resourceScheduling);
+  public function validateExperiment($airavataExperimentId);
   public function launchExperiment($airavataExperimentId, $airavataCredStoreToken);
   public function getExperimentStatus($airavataExperimentId);
   public function getExperimentOutputs($airavataExperimentId);
@@ -738,6 +739,69 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     return;
   }
 
+  public function validateExperiment($airavataExperimentId)
+  {
+    $this->send_validateExperiment($airavataExperimentId);
+    return $this->recv_validateExperiment();
+  }
+
+  public function send_validateExperiment($airavataExperimentId)
+  {
+    $args = new \Airavata\API\Airavata_validateExperiment_args();
+    $args->airavataExperimentId = $airavataExperimentId;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'validateExperiment', TMessageType::CALL,
$args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('validateExperiment', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_validateExperiment()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_validateExperiment_result',
$this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\API\Airavata_validateExperiment_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->enf !== null) {
+      throw $result->enf;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    throw new \Exception("validateExperiment failed: unknown result");
+  }
+
   public function launchExperiment($airavataExperimentId, $airavataCredStoreToken)
   {
     $this->send_launchExperiment($airavataExperimentId, $airavataCredStoreToken);
@@ -3556,6 +3620,238 @@ class Airavata_updateResourceScheduleing_result {
 
 }
 
+class Airavata_validateExperiment_args {
+  static $_TSPEC;
+
+  public $airavataExperimentId = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'airavataExperimentId',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['airavataExperimentId'])) {
+        $this->airavataExperimentId = $vals['airavataExperimentId'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_validateExperiment_args';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->airavataExperimentId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('Airavata_validateExperiment_args');
+    if ($this->airavataExperimentId !== null) {
+      $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 1);
+      $xfer += $output->writeString($this->airavataExperimentId);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class Airavata_validateExperiment_result {
+  static $_TSPEC;
+
+  public $success = null;
+  public $ire = null;
+  public $enf = null;
+  public $ace = null;
+  public $ase = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        0 => array(
+          'var' => 'success',
+          'type' => TType::BOOL,
+          ),
+        1 => array(
+          'var' => 'ire',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\InvalidRequestException',
+          ),
+        2 => array(
+          'var' => 'enf',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+          ),
+        3 => array(
+          'var' => 'ace',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataClientException',
+          ),
+        4 => array(
+          'var' => 'ase',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataSystemException',
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['success'])) {
+        $this->success = $vals['success'];
+      }
+      if (isset($vals['ire'])) {
+        $this->ire = $vals['ire'];
+      }
+      if (isset($vals['enf'])) {
+        $this->enf = $vals['enf'];
+      }
+      if (isset($vals['ace'])) {
+        $this->ace = $vals['ace'];
+      }
+      if (isset($vals['ase'])) {
+        $this->ase = $vals['ase'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_validateExperiment_result';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 0:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 1:
+          if ($ftype == TType::STRUCT) {
+            $this->ire = new \Airavata\API\Error\InvalidRequestException();
+            $xfer += $this->ire->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRUCT) {
+            $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+            $xfer += $this->enf->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRUCT) {
+            $this->ace = new \Airavata\API\Error\AiravataClientException();
+            $xfer += $this->ace->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRUCT) {
+            $this->ase = new \Airavata\API\Error\AiravataSystemException();
+            $xfer += $this->ase->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('Airavata_validateExperiment_result');
+    if ($this->success !== null) {
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ire !== null) {
+      $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+      $xfer += $this->ire->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->enf !== null) {
+      $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+      $xfer += $this->enf->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ace !== null) {
+      $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+      $xfer += $this->ace->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ase !== null) {
+      $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+      $xfer += $this->ase->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
 class Airavata_launchExperiment_args {
   static $_TSPEC;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/3ba8cfa9/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
index b8fc000..b498141 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Experiment/Types.php
@@ -202,15 +202,17 @@ final class CorrectiveAction {
 final class DataType {
   const STRING = 0;
   const INTEGER = 1;
-  const URI = 2;
-  const STDOUT = 3;
-  const STDERR = 4;
+  const FLOAT = 2;
+  const URI = 3;
+  const STDOUT = 4;
+  const STDERR = 5;
   static public $__names = array(
     0 => 'STRING',
     1 => 'INTEGER',
-    2 => 'URI',
-    3 => 'STDOUT',
-    4 => 'STDERR',
+    2 => 'FLOAT',
+    3 => 'URI',
+    4 => 'STDOUT',
+    5 => 'STDERR',
   );
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/3ba8cfa9/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/DataType.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/DataType.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/DataType.java
index eceb638..8d7fd67 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/DataType.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/DataType.java
@@ -30,9 +30,10 @@ import org.apache.thrift.TEnum;
 @SuppressWarnings("all") public enum DataType implements org.apache.thrift.TEnum {
   STRING(0),
   INTEGER(1),
-  URI(2),
-  STDOUT(3),
-  STDERR(4);
+  FLOAT(2),
+  URI(3),
+  STDOUT(4),
+  STDERR(5);
 
   private final int value;
 
@@ -58,10 +59,12 @@ import org.apache.thrift.TEnum;
       case 1:
         return INTEGER;
       case 2:
-        return URI;
+        return FLOAT;
       case 3:
-        return STDOUT;
+        return URI;
       case 4:
+        return STDOUT;
+      case 5:
         return STDERR;
       default:
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/3ba8cfa9/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 354bae6..f9feaec 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -247,6 +247,20 @@ service Airavata {
   void updateResourceScheduleing(1: required string airavataExperimentId,
                                  2: required experimentModel.ComputationalResourceScheduling
resourceScheduling)
 
+    /**
+     *
+     * Validate experiment configuration. A true in general indicates, the experiment is
ready to be launched.
+     *
+     * @param experimentID
+     * @return sucess/failure
+     *
+    **/
+  bool validateExperiment(1: required string airavataExperimentId)
+      throws (1: airavataErrors.InvalidRequestException ire,
+              2: airavataErrors.ExperimentNotFoundException enf,
+              3: airavataErrors.AiravataClientException ace,
+              4: airavataErrors.AiravataSystemException ase)
+
   /**
    * Launch a previously created and configured experiment. Airavata Server will then start
processing the request and appropriate
    *   notifications and intermediate and output data will be subsequently available for
this experiment.


Mime
View raw message