You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/07/22 17:05:38 UTC
[13/50] [abbrv] git commit: Updated application samples
Updated application samples
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/e18f5525
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/e18f5525
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/e18f5525
Branch: refs/heads/workflow-support
Commit: e18f5525e36135660b0386d63ba5aa3a7f478bd5
Parents: 731688c
Author: Suresh Marru <sm...@apache.org>
Authored: Sat Jul 12 10:05:28 2014 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Sat Jul 12 10:05:28 2014 -0400
----------------------------------------------------------------------
.../resources/conf/app-catalog-identifiers.ini | 14 ++---
.../php-cli-samples/createExperiment.php | 9 +--
.../deleteGatewayComputeResourcePreference.php | 50 ++++++++++++++++
.../php-cli-samples/getAiravataClient.php | 2 +
.../getGatewayComputeResourcePreference.php | 62 ++++++++++++++++++++
.../tools/RegisterSampleApplications.java | 45 +++++++-------
6 files changed, 151 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini
index 9cd2735..ee2ddd3 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini
@@ -1,8 +1,8 @@
#Apache Airavata Gateway to Airavata Deployment Identifiers
-#Fri Jul 11 16:24:39 EDT 2014
-trestlesResourceId=trestles.sdsc.xsede.org_db29986e-5a27-4949-ae7f-04a6012d0d35
-bigredResourceId=bigred2.uits.iu.edu_fc06d292-8ace-4cdc-b4e3-88ecc6d1c7a5
-stampedeResourceId=stampede.tacc.xsede.org_62af26f4-b96e-48eb-9456-fec236ecdf54
-amberInterfaceId=Amber_0162b092-fe31-42ba-b59f-484e61048912
-wrfInterfaceId=WRF_6ff7a63d-f3ab-472e-919e-3b05a70efada
-echoInterfaceId=Echo_500f90b6-b76d-42a9-b55c-d3b5ca8ecb0c
+#Fri Jul 11 18:09:20 EDT 2014
+trestlesResourceId=trestles.sdsc.xsede.org_be1e9355-467c-4e71-b030-1f0ac76091d5
+bigredResourceId=bigred2.uits.iu.edu_866a6c6a-1387-4f87-b7e3-ba6f95c5c652
+stampedeResourceId=stampede.tacc.xsede.org_4a92a63c-be81-422d-a9be-121d35e04af9
+amberInterfaceId=Amber_26a0dec3-eb94-4f2c-9dfc-8a837bf4fbba
+wrfInterfaceId=WRF_9a1de5fb-8f90-4e32-96cb-c06bc1333274
+echoInterfaceId=Echo_b35ac096-808a-494e-94d1-0d20021c43f9
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php
index 26669e0..e765c91 100755
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php
@@ -24,12 +24,13 @@ use Airavata\Model\Workspace\Experiment\UserConfigurationData;
use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
use Airavata\Model\Workspace\Experiment\DataType;
-include 'getAiravataClient.php';
-global $airavataclient;
-global $transport;
-
$appId = 'SimpleEcho3_ca40f7c6-69ba-4f89-918d-9937cea0ca8f';
$hostID = 'stampede.tacc.xsede.org_8f20b832-c11a-444b-8e73-bf15f4760b9a';
+
+$stampedeResourceId = $appcatalogdocs['stampedeResourceId'];
+
+echo "stampede resource if $stampedeResourceId \n";
+
try
{
if ($argc != 4)
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/deleteGatewayComputeResourcePreference.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/deleteGatewayComputeResourcePreference.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/deleteGatewayComputeResourcePreference.php
new file mode 100644
index 0000000..1d1cb08
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/deleteGatewayComputeResourcePreference.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Bundle all thrift and Airavata stubs into a include file. This is simple but not so elegant way.
+ * Contributions welcome to improve writing PHP Client Samples.
+ *
+ */
+include 'getAiravataClient.php';
+global $airavataclient;
+global $transport;
+
+use Airavata\API\Error\AiravataClientException;
+use Airavata\API\Error\AiravataSystemException;
+use Airavata\API\Error\InvalidRequestException;
+use Thrift\Exception\TTransportException;
+
+use Airavata\Model\AppCatalog\AppDeployment\ApplicationModule;
+
+try {
+
+ if (count($argv) != 3) {
+ exit("\n Incorrect Arguments \n. Usage: deleteGatewayComputeResourcePreference.php <gateway id> <compute resource id>. \n");
+ } else {
+
+ $gatewayId = $argv[1];
+ $computeResourceId = $argv[2];
+
+ $success = $airavataclient->deleteGatewayComputeResourcePreference($gatewayId, $computeResourceId);
+
+ if ($success) {
+ echo "Gateway Profile for $gatewayId for resource $computeResourceId is successfully deleted";
+ } else {
+ echo "\n Failed to delete gateway profile $computeResourceId \n";
+ }
+ }
+} catch (InvalidRequestException $ire) {
+ print 'InvalidRequestException: ' . $ire->getMessage() . "\n";
+} catch (AiravataClientException $ace) {
+ print 'Airavata System Exception: ' . $ace->getMessage() . "\n";
+} catch (AiravataSystemException $ase) {
+ print 'Airavata System Exception: ' . $ase->getMessage() . "\n";
+} catch (TTransportException $tte) {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+} catch (\Exception $e) {
+ echo 'Exception!<br><br>' . $e->getMessage();
+}
+
+$transport->close();
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAiravataClient.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAiravataClient.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAiravataClient.php
index 8a82060..15440ce 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAiravataClient.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAiravataClient.php
@@ -3,6 +3,8 @@ namespace Airavata\Client\Samples;
$airavataconfig = parse_ini_file("../conf/airavata-client-properties.ini");
+$appcatalogdocs = parse_ini_file("../conf/app-catalog-identifiers.ini");
+
$GLOBALS['THRIFT_ROOT'] = $airavataconfig['THRIFT_LIB_DIR'];
require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TSocket.php';
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getGatewayComputeResourcePreference.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getGatewayComputeResourcePreference.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getGatewayComputeResourcePreference.php
new file mode 100755
index 0000000..c26b42d
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getGatewayComputeResourcePreference.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Bundle all thrift and Airavata stubs into a include file. This is simple but not so elegant way.
+ * Contributions welcome to improve writing PHP Client Samples.
+ *
+ */
+include 'getAiravataClient.php';
+global $airavataclient;
+global $transport;
+
+use Airavata\API\Error\AiravataClientException;
+use Airavata\API\Error\AiravataSystemException;
+use Airavata\API\Error\InvalidRequestException;
+use Thrift\Exception\TTransportException;
+use Airavata\Model\AppCatalog\AppInterface\DataType;
+
+try
+{
+
+ if ($argc < 2)
+ {
+ echo 'php getGatewayComputeResourcePreference.php <gateway id> <compute resource id>';
+ }
+ else {
+
+ $gatewayId = $argv[1];
+ $computeResourceId = $argv[2];
+
+ $computeResourcePreferences = $airavataclient->getGatewayComputeResourcePreference($gatewayId, $computeResourceId);
+
+ if ($computeResourcePreferences) {
+ var_dump($computeResourcePreferences);
+ } else {
+ echo "\n Failed to fetch compute resource preference Inputs. \n";
+ }
+}
+}
+catch (InvalidRequestException $ire)
+{
+ print 'InvalidRequestException: ' . $ire->getMessage()."\n";
+}
+catch (AiravataClientException $ace)
+{
+ print 'Airavata System Exception: ' . $ace->getMessage()."\n";
+}
+catch (AiravataSystemException $ase)
+{
+ print 'Airavata System Exception: ' . $ase->getMessage()."\n";
+}
+catch (TTransportException $tte)
+{
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+}
+catch (\Exception $e)
+{
+ echo 'Exception!<br><br>' . $e->getMessage();
+}
+
+$transport->close();
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/e18f5525/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index e991b06..5c2c0c3 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -94,14 +94,14 @@ public class RegisterSampleApplications {
private static String wrfModuleId;
//App Interface Id's
- private static String echoInterfaceId;
- private static String amberInterfaceId;
- private static String autoDockInterfaceId;
- private static String espressoInterfaceId;
- private static String gromacsInterfaceId;
- private static String lammpsInterfaceId;
- private static String nwChemInterfaceId;
- private static String trinityInterfaceId;
+ private static String echoInterfaceId = "";
+ private static String amberInterfaceId = "";
+ private static String autoDockInterfaceId = "";
+ private static String espressoInterfaceId = "";
+ private static String gromacsInterfaceId = "";
+ private static String lammpsInterfaceId = "";
+ private static String nwChemInterfaceId = "";
+ private static String trinityInterfaceId = "";
private static String wrfInterfaceId;
public static void main(String[] args) {
@@ -149,7 +149,7 @@ public class RegisterSampleApplications {
//Register BigRedII
bigredResourceId = registerComputeHost("bigred2.uits.iu.edu", "IU BigRed II Cluster",
- ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/", SecurityProtocol.SSH_KEYS, 22, "aprun -n 4");
+ ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/", SecurityProtocol.SSH_KEYS, 22, "aprun -n");
System.out.println("BigredII Resource Id is " + bigredResourceId);
} catch (TException e) {
@@ -254,7 +254,7 @@ public class RegisterSampleApplications {
// registerGromacsInterface();
//Registering Lammps
-// registerLammpsInterface();
+ registerLammpsInterface();
//Registering NWChem
// registerNWChemInterface();
@@ -317,10 +317,10 @@ public class RegisterSampleApplications {
applicationInputs.add(input2);
applicationInputs.add(input3);
- OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Prod.info",null,DataType.URI);
- OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Prod.info",null,DataType.URI);
- OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Prod.info",null,DataType.URI);
- OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Prod.info",null,DataType.URI);
+ OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Execution_Summary",null,DataType.URI);
+ OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Execution_log",null,DataType.URI);
+ OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Trajectory_file",null,DataType.URI);
+ OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("AMBER_Restart_file",null,DataType.URI);
List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
applicationOutputs.add(output1);
@@ -450,8 +450,7 @@ public class RegisterSampleApplications {
List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
applicationInputs.add(input1);
- OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output",
- "", DataType.STRING);
+ OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("LAMMPS_Simulation_Log",null,DataType.URI);
List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
applicationOutputs.add(output1);
@@ -584,7 +583,7 @@ public class RegisterSampleApplications {
//Register Amber
String amberAppDeployId = airavataClient.registerApplicationDeployment(
RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, stampedeResourceId,
- "/home1/01437/ogce/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "/home1/01437/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
amberDescription));
System.out.println("Amber on stampede deployment Id " + amberAppDeployId);
@@ -626,7 +625,7 @@ public class RegisterSampleApplications {
//Register WRF
String wrfAppDeployId = airavataClient.registerApplicationDeployment(
RegisterSampleApplicationsUtils.createApplicationDeployment(wrfModuleId, stampedeResourceId,
- "/home1/01437/ogce/production/app_wrappers/wrf_wrapper_3.5.1.sh", ApplicationParallelismType.MPI,
+ "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI,
wrfDescription));
System.out.println("WRF on stampede deployment Id " + wrfAppDeployId);
@@ -648,7 +647,7 @@ public class RegisterSampleApplications {
//Register Amber
String amberAppDeployId = airavataClient.registerApplicationDeployment(
RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, trestlesResourceId,
- "/home/ogce/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "/home/ogce/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
amberDescription));
System.out.println("Amber on trestles deployment Id " + amberAppDeployId);
@@ -684,7 +683,7 @@ public class RegisterSampleApplications {
//Register Amber
String amberAppDeployId = airavataClient.registerApplicationDeployment(
RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, bigredResourceId,
- "/N/u/cgateway/BigRed2/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/amber_wrapper.sh", ApplicationParallelismType.MPI,
amberDescription));
System.out.println("Amber on bigredII deployment Id " + amberAppDeployId);
@@ -796,6 +795,12 @@ public class RegisterSampleApplications {
properties.setProperty("echoInterfaceId", echoInterfaceId);
properties.setProperty("amberInterfaceId", amberInterfaceId);
+ properties.setProperty("autoDockInterfaceId", autoDockInterfaceId);
+ properties.setProperty("espressoInterfaceId", espressoInterfaceId);
+ properties.setProperty("gromacsInterfaceId", gromacsInterfaceId);
+ properties.setProperty("lammpsInterfaceId", lammpsInterfaceId);
+ properties.setProperty("nwChemInterfaceId", nwChemInterfaceId);
+ properties.setProperty("trinityInterfaceId", trinityInterfaceId);
properties.setProperty("wrfInterfaceId", wrfInterfaceId);
File file = new File("airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/app-catalog-identifiers.ini");