You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/07/11 13:58:06 UTC
git commit: Samples application as discussed in - AIRAVATA-1344
Repository: airavata
Updated Branches:
refs/heads/master 5a4302152 -> b6392ef33
Samples application as discussed in - AIRAVATA-1344
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b6392ef3
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b6392ef3
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b6392ef3
Branch: refs/heads/master
Commit: b6392ef33f780dc53ebe18f2782415820bffc543
Parents: 5a43021
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Jul 11 07:57:55 2014 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Jul 11 07:57:55 2014 -0400
----------------------------------------------------------------------
.../resources/php-cli-samples/getAppModule.php | 68 ----
.../getApplicationDeployment.php | 46 +++
.../php-cli-samples/getApplicationModule.php | 68 ++++
.../updateApplicationInterface.php | 10 +-
.../tools/RegisterSampleApplications.java | 376 +++++++++++++++++++
.../tools/RegisterSampleApplicationsUtils.java | 154 ++++++++
.../applicationDeploymentModel.thrift | 2 +-
7 files changed, 650 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
deleted file mode 100644
index e28dbac..0000000
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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;
-
-
-if (count($argv) < 2) {
- exit("Please provide an appModuleID. \n");
-}
-
-$appModuleId = $argv[1];
-
-$applicationModule = get_appModule($appModuleId);
-
-var_dump($applicationModule);
-
-$transport->close();
-
-/**
- * Get the appModule with the given ID
- * @param $appModuleId
- * @return null
- */
-function get_appModule($appModuleId)
-{
- global $airavataclient;
-
- try
- {
- return $airavataclient->getApplicationModule($appModuleId);
- }
- catch (InvalidRequestException $ire)
- {
- echo 'InvalidRequestException!<br><br>' . $ire->getMessage();
- }
- catch (AiravataClientException $ace)
- {
- echo 'AiravataClientException!<br><br>' . $ace->getMessage();
- }
- catch (AiravataSystemException $ase)
- {
- echo 'AiravataSystemException!<br><br>' . $ase->getMessage();
- }
- catch (TTransportException $tte)
- {
- echo 'TTransportException!<br><br>' . $tte->getMessage();
- }
- catch (\Exception $e)
- {
- echo 'Exception!<br><br>' . $e->getMessage();
- }
-
-}
-
-?>
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployment.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployment.php
new file mode 100644
index 0000000..c59d99c
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployment.php
@@ -0,0 +1,46 @@
+<?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 ($argc < 1) {
+ echo 'php getApplicationDeployment.php <Application Deployment Id>';
+ } else {
+ $appDeploymentId = $argv[1];
+
+ $appDeployment = $airavataclient->getApplicationDeployment($appDeploymentId);
+
+ if ($appDeployment) {
+ var_dump($appDeployment);
+ } else {
+ echo "\n Failed to fetch application deployment description. \n";
+ }
+ }
+
+} catch (InvalidRequestException $ire) {
+ echo 'InvalidRequestException!<br><br>' . $ire->getMessage();
+} catch (AiravataClientException $ace) {
+ echo 'AiravataClientException!<br><br>' . $ace->getMessage();
+} catch (AiravataSystemException $ase) {
+ echo 'AiravataSystemException!<br><br>' . $ase->getMessage();
+} catch (TTransportException $tte) {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+} catch (\Exception $e) {
+ echo 'Exception!<br><br>' . $e->getMessage();
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationModule.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationModule.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationModule.php
new file mode 100644
index 0000000..e28dbac
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationModule.php
@@ -0,0 +1,68 @@
+<?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;
+
+
+if (count($argv) < 2) {
+ exit("Please provide an appModuleID. \n");
+}
+
+$appModuleId = $argv[1];
+
+$applicationModule = get_appModule($appModuleId);
+
+var_dump($applicationModule);
+
+$transport->close();
+
+/**
+ * Get the appModule with the given ID
+ * @param $appModuleId
+ * @return null
+ */
+function get_appModule($appModuleId)
+{
+ global $airavataclient;
+
+ try
+ {
+ return $airavataclient->getApplicationModule($appModuleId);
+ }
+ catch (InvalidRequestException $ire)
+ {
+ echo 'InvalidRequestException!<br><br>' . $ire->getMessage();
+ }
+ catch (AiravataClientException $ace)
+ {
+ echo 'AiravataClientException!<br><br>' . $ace->getMessage();
+ }
+ catch (AiravataSystemException $ase)
+ {
+ echo 'AiravataSystemException!<br><br>' . $ase->getMessage();
+ }
+ catch (TTransportException $tte)
+ {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+ }
+ catch (\Exception $e)
+ {
+ echo 'Exception!<br><br>' . $e->getMessage();
+ }
+
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/updateApplicationInterface.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/updateApplicationInterface.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/updateApplicationInterface.php
index baccbc3..5b96be8 100755
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/updateApplicationInterface.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/updateApplicationInterface.php
@@ -32,12 +32,12 @@ try
$appInput1 = new InputDataObjectType();
$appInput1->name = "Namelist_File";
- $appInput1->userFriendlyDescription = "Namelist file";
+ $appInput1->userFriendlyDescription = "Namelist Configuration File";
$appInput1->type = DataType::URI;
$appInput2 = new InputDataObjectType();
- $appInput2->name = "WRF Boundary File";
- $appInput2->userFriendlyDescription = "Boundary file";
+ $appInput2->name = "WRF_Boundary_File";
+ $appInput2->userFriendlyDescription = "Boundary Conditions File";
$appInput2->type = DataType::URI;
$appInput3 = new InputDataObjectType();
@@ -46,11 +46,11 @@ try
$appInput3->type = DataType::URI;
$appOutput1 = new OutputDataObjectType();
- $appOutput1->name = "WRF Standard Out";
+ $appOutput1->name = "WRF_Standard_Out";
$appOutput1->type = DataType::STRING;
$appOutput2 = new OutputDataObjectType();
- $appOutput2->name = "WRF RSL Out";
+ $appOutput2->name = "WRF_RSL_Out";
$appOutput2->type = DataType::STRING;
$appInterface = $airavataclient->getApplicationInterface($appInterfaceId);
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/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
new file mode 100644
index 0000000..9db25fb
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -0,0 +1,376 @@
+/*
+ *
+ * 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.client.tools;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationParallelismType;
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.computeresource.*;
+import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
+import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.model.error.InvalidRequestException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.thrift.TException;
+
+public class RegisterSampleApplications {
+
+ public static final String THRIFT_SERVER_HOST = "localhost";
+ public static final int THRIFT_SERVER_PORT = 8930;
+ private final static Logger logger = LoggerFactory.getLogger(RegisterSampleApplications.class);
+ private static final String DEFAULT_USER = "default.registry.user";
+ private static final String DEFAULT_GATEWAY = "default.registry.gateway";
+ private static Airavata.Client airavataClient;
+
+ //Host Id's
+ private static String stampedeResourceId;
+ private static String trestlesResourceId;
+ private static String bigredResourceId;
+
+ //App Module Id's
+ private static String echoModuleId;
+ private static String amberModuleId;
+ private static String autoDockModuleId;
+ private static String espressoModuleId;
+ private static String gromacsModuleId;
+ private static String lammpsModuleId;
+ private static String nwChemModuleId;
+ private static String trinityModuleId;
+ private static String wrfModuleId;
+
+ public static void main(String[] args) {
+ try {
+ airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+ System.out.println("API version is " + airavataClient.getAPIVersion());
+
+ //Register all compute hosts
+ registerXSEDEHosts();
+
+ //Register all application modules
+ registerAppModules();
+
+ //Register all application deployments
+ registerAppDeployments();
+
+ } catch (Exception e) {
+ logger.error("Error while connecting with server", e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ public static void registerXSEDEHosts() {
+ try {
+ System.out.println("\n #### Registering XSEDE Computational Resources #### \n");
+
+ //Register Stampede
+ stampedeResourceId = registerComputeHost("stampede.tacc.xsede.org", "TACC Stampede Cluster",
+ ResourceJobManagerType.SLURM, "push", "/usr/bin", SecurityProtocol.GSI, 2222);
+ System.out.println("Stampede Resource Id is " + stampedeResourceId);
+
+ //Register Trestles
+ trestlesResourceId = registerComputeHost("trestles.sdsc.xsede.org", "SDSC Trestles Cluster",
+ ResourceJobManagerType.PBS, "push", "/usr/bin", SecurityProtocol.GSI, 22);
+ System.out.println("Trestles Resource Id is " + trestlesResourceId);
+
+ //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);
+ System.out.println("BigredII Resource Id is " + bigredResourceId);
+
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static void registerAppModules() {
+ try {
+ System.out.println("\n #### Registering Application Modules #### \n");
+
+ //Register Echo
+ echoModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "Echo", "1.0", "A Simple Echo Application"));
+ System.out.println("Echo Module Id " + echoModuleId);
+
+ //Register Amber
+ amberModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "Amber", "12.0", "Amber Molecular Dynamics Package"));
+ System.out.println("Amber Module Id " + amberModuleId);
+
+ //Register AutoDock
+ autoDockModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "AutoDock", "4.2", "AutoDock suite of automated docking tools"));
+ System.out.println("AutoDock Module Id " + autoDockModuleId);
+
+ //Register ESPRESSO
+ espressoModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "ESPRESSO", "5.0.3", "Nanoscale electronic-structure calculations and materials modeling"));
+ System.out.println("ESPRESSO Module Id " + espressoModuleId);
+
+ //Register GROMACS
+ gromacsModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "GROMACS", "4.6.5", "GROMACS Molecular Dynamics Package"));
+ System.out.println("GROMACS Module Id " + gromacsModuleId);
+
+ //Register LAMMPS
+ lammpsModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "LAMMPS", "20Mar14", "Large-scale Atomic/Molecular Massively Parallel Simulator"));
+ System.out.println("LAMMPS Module Id " + lammpsModuleId);
+
+ //Register NWChem
+ nwChemModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "NWChem", "6.3", "Ab initio computational chemistry software package"));
+ System.out.println("NWChem Module Id " + nwChemModuleId);
+
+ //Register Trinity
+ trinityModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "Trinity", "r20130225", "de novo reconstruction of transcriptomes from RNA-seq data"));
+ System.out.println("Trinity Module Id " + trinityModuleId);
+
+ //Register WRF
+ wrfModuleId = airavataClient.registerApplicationModule(
+ RegisterSampleApplicationsUtils.createApplicationModule(
+ "WRF", "3.5.1", "Weather Research and Forecasting"));
+ System.out.println("WRF Module Id " + wrfModuleId);
+
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static void registerAppDeployments() {
+ System.out.println("\n #### Registering Application Deployments #### \n");
+
+ //Registering Stampede Apps
+ registerStampedeApps();
+
+ //Registering Trestles Apps
+ registerTrestlesApps();
+
+ //Registering BigRed II Apps
+ registerBigRedApps();
+ }
+
+ public static void registerStampedeApps() {
+ try {
+ System.out.println("#### Registering Application Deployments on Stampede #### \n");
+
+ //Register Echo
+ String echoAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, stampedeResourceId,
+ "/bin/echo", ApplicationParallelismType.SERIAL, "Echo Testing Application"));
+ System.out.println("Echo on stampede deployment Id " + echoAppDeployId);
+
+ //Register Amber
+ String amberAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "Amber Molecular Dynamics Package"));
+ System.out.println("Amber on stampede deployment Id " + amberAppDeployId);
+
+ //Register ESPRESSO
+ String espressoAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(espressoModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/espresso_wrapper.sh", ApplicationParallelismType.MPI,
+ "Nanoscale electronic-structure calculations and materials modeling"));
+ System.out.println("ESPRESSO on stampede deployment Id " + espressoAppDeployId);
+
+ //Register GROMACS
+ String gromacsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
+ "GROMACS Molecular Dynamics Package"));
+ System.out.println("GROMACS on stampede deployment Id " + gromacsAppDeployId);
+
+ //Register LAMMPS
+ String lammpsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/lammps_wrapper.sh", ApplicationParallelismType.MPI,
+ "Large-scale Atomic/Molecular Massively Parallel Simulator"));
+ System.out.println("LAMMPS on stampede deployment Id " + lammpsAppDeployId);
+
+ //Register NWChem
+ String nwChemAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(nwChemModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/nwchem_wrapper.sh", ApplicationParallelismType.MPI,
+ "Ab initio computational chemistry software package"));
+ System.out.println("NWChem on stampede deployment Id " + nwChemAppDeployId);
+
+ //Register Trinity
+ String trinityAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(trinityModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/trinity_wrapper.sh", ApplicationParallelismType.MPI,
+ "de novo reconstruction of transcriptomes from RNA-seq data"));
+ System.out.println("Trinity on stampede deployment Id " + trinityAppDeployId);
+
+ //Register WRF
+ String wrfAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(wrfModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/wrf_wrapper_3.5.1.sh", ApplicationParallelismType.MPI,
+ "Weather Research and Forecasting"));
+ System.out.println("WRF on stampede deployment Id " + wrfAppDeployId);
+
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void registerTrestlesApps() {
+ try {
+ System.out.println("#### Registering Application Deployments on Trestles #### \n");
+
+ //Register Echo
+ String echoAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, trestlesResourceId,
+ "/bin/echo", ApplicationParallelismType.SERIAL, "Echo Testing Application"));
+ System.out.println("Echo on trestles deployment Id " + echoAppDeployId);
+
+ //Register Amber
+ String amberAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, trestlesResourceId,
+ "/home/ogce/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "Amber Molecular Dynamics Package"));
+ System.out.println("Amber on trestles deployment Id " + amberAppDeployId);
+
+ //Register GROMACS
+ String gromacsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, trestlesResourceId,
+ "/home/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
+ "GROMACS Molecular Dynamics Package"));
+ System.out.println("GROMACS on trestles deployment Id " + gromacsAppDeployId);
+
+ //Register LAMMPS
+ String lammpsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, trestlesResourceId,
+ "/home/ogce/production/app_wrappers/lammps_wrapper.sh", ApplicationParallelismType.MPI,
+ "Large-scale Atomic/Molecular Massively Parallel Simulator"));
+ System.out.println("LAMMPS on trestles deployment Id " + lammpsAppDeployId);
+
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void registerBigRedApps() {
+ try {
+ System.out.println("#### Registering Application Deployments on BigRed II #### \n");
+
+ //Register Echo
+ String echoAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, bigredResourceId,
+ "/bin/echo", ApplicationParallelismType.SERIAL, "Echo Testing Application"));
+ System.out.println("Echo on bigredII deployment Id " + echoAppDeployId);
+
+ //Register Amber
+ String amberAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, bigredResourceId,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/amber_wrapper_simple.sh", ApplicationParallelismType.MPI,
+ "Amber Molecular Dynamics Package"));
+ System.out.println("Amber on bigredII deployment Id " + amberAppDeployId);
+
+ //Register AutoDock
+ String autoDockDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(nwChemModuleId, bigredResourceId,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/auto_dock_wrapper.sh", ApplicationParallelismType.MPI,
+ "AutoDock suite of automated docking tools"));
+ System.out.println("AutoDock on bigredII deployment Id " + autoDockDeployId);
+
+ //Register GROMACS
+ String gromacsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, bigredResourceId,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI,
+ "GROMACS Molecular Dynamics Package"));
+ System.out.println("GROMACS on bigredII deployment Id " + gromacsAppDeployId);
+
+ //Register LAMMPS
+ String lammpsAppDeployId = airavataClient.registerApplicationDeployment(
+ RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, bigredResourceId,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/lammps_wrapper.sh", ApplicationParallelismType.MPI,
+ "Large-scale Atomic/Molecular Massively Parallel Simulator"));
+ System.out.println("LAMMPS on bigredII deployment Id " + lammpsAppDeployId);
+
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static String registerComputeHost(String hostName, String hostDesc,
+ ResourceJobManagerType resourceJobManagerType,
+ String monitoringEndPoint, String jobMangerBinPath,
+ SecurityProtocol securityProtocol, int portNumber) throws TException {
+
+ ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.
+ createComputeResourceDescription(hostName, hostDesc, null, null);
+
+ String computeResourceId = airavataClient.registerComputeResource(computeResourceDescription);
+
+ if (computeResourceId.isEmpty()) throw new AiravataClientException();
+
+ ResourceJobManager resourceJobManager = RegisterSampleApplicationsUtils.
+ createResourceJobManager(resourceJobManagerType, monitoringEndPoint, jobMangerBinPath, null);
+
+ SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
+ sshJobSubmission.setResourceJobManager(resourceJobManager);
+ sshJobSubmission.setSecurityProtocol(securityProtocol);
+ sshJobSubmission.setSshPort(portNumber);
+ boolean sshAddStatus = airavataClient.addSSHJobSubmissionDetails(computeResourceId, 1, sshJobSubmission);
+
+ if (!sshAddStatus) throw new AiravataClientException();
+
+ SCPDataMovement scpDataMovement = new SCPDataMovement();
+ scpDataMovement.setSecurityProtocol(securityProtocol);
+ scpDataMovement.setSshPort(portNumber);
+ boolean scpAddStatus = airavataClient.addSCPDataMovementDetails(computeResourceId, 1, scpDataMovement);
+
+ if (!scpAddStatus) throw new AiravataClientException();
+
+ return computeResourceId;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplicationsUtils.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplicationsUtils.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplicationsUtils.java
new file mode 100644
index 0000000..f47b0aa
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplicationsUtils.java
@@ -0,0 +1,154 @@
+/*
+*
+* 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.client.tools;
+
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationParallelismType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.appcatalog.computeresource.*;
+import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
+
+import java.util.Map;
+import java.util.Set;
+
+public class RegisterSampleApplicationsUtils {
+
+
+ public static ComputeResourcePreference
+ createComputeResourcePreference(String computeResourceId, String allocationProjectNumber,
+ boolean overridebyAiravata, String preferredBatchQueue,
+ String preferredJobSubmissionProtocol,String preferredDataMovementProtocol,
+ String scratchLocation) throws AppCatalogException {
+ ComputeResourcePreference computeResourcePreference = new ComputeResourcePreference();
+ computeResourcePreference.setComputeResourceId(computeResourceId);
+ computeResourcePreference.setOverridebyAiravata(overridebyAiravata);
+ computeResourcePreference.setAllocationProjectNumber(allocationProjectNumber);
+ computeResourcePreference.setPreferredBatchQueue(preferredBatchQueue);
+ computeResourcePreference.setPreferredDataMovementProtocol(preferredDataMovementProtocol);
+ computeResourcePreference.setPreferredJobSubmissionProtocol(preferredJobSubmissionProtocol);
+ computeResourcePreference.setScratchLocation(scratchLocation);
+ return computeResourcePreference;
+ }
+
+ public static ApplicationDeploymentDescription createApplicationDeployment(
+ String appModuleId, String computeResourceId, String executablePath,
+ ApplicationParallelismType parallelism, String appDeploymentDescription) {
+ ApplicationDeploymentDescription deployment = new ApplicationDeploymentDescription();
+// deployment.setIsEmpty(false);
+ deployment.setAppDeploymentDescription(appDeploymentDescription);
+ deployment.setAppModuleId(appModuleId);
+ deployment.setComputeHostId(computeResourceId);
+ deployment.setExecutablePath(executablePath);
+ deployment.setParallelism(parallelism);
+ return deployment;
+ }
+
+ public static ApplicationModule createApplicationModule(String appModuleName,
+ String appModuleVersion, String appModuleDescription) {
+ ApplicationModule module = new ApplicationModule();
+ module.setAppModuleDescription(appModuleDescription);
+ module.setAppModuleName(appModuleName);
+ module.setAppModuleVersion(appModuleVersion);
+ return module;
+ }
+
+ public static DataMovementInterface createDataMovementInterface(
+ String dataMovementInterfaceId,
+ DataMovementProtocol dataMovementProtocolType, int priorityOrder) {
+ DataMovementInterface dataMovementInterface = new DataMovementInterface();
+ dataMovementInterface.setDataMovementInterfaceId(dataMovementInterfaceId);
+ dataMovementInterface.setDataMovementProtocol(dataMovementProtocolType);
+ dataMovementInterface.setPriorityOrder(priorityOrder);
+ return dataMovementInterface;
+ }
+
+ public static JobSubmissionInterface createJobSubmissionInterface(
+ String jobSubmissionInterfaceId,
+ JobSubmissionProtocol jobSubmissionProtocolType, int priorityOrder) {
+ JobSubmissionInterface jobSubmissionInterface = new JobSubmissionInterface();
+ jobSubmissionInterface.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
+ jobSubmissionInterface.setJobSubmissionProtocol(jobSubmissionProtocolType);
+ jobSubmissionInterface.setPriorityOrder(priorityOrder);
+ return jobSubmissionInterface;
+ }
+
+ public static ComputeResourceDescription createComputeResourceDescription(
+ String hostName, String hostDesc, Set<String> hostAliases, Set<String> ipAddresses) {
+ ComputeResourceDescription host = new ComputeResourceDescription();
+ host.setHostName(hostName);
+ host.setResourceDescription(hostDesc);
+ host.setIpAddresses(ipAddresses);
+ host.setHostAliases(hostAliases);
+ return host;
+ }
+
+ public static ResourceJobManager createResourceJobManager(
+ ResourceJobManagerType resourceJobManagerType, String pushMonitoringEndpoint, String jobManagerBinPath,
+ Map<JobManagerCommand, String> jobManagerCommands) {
+ ResourceJobManager resourceJobManager = new ResourceJobManager();
+ resourceJobManager.setResourceJobManagerType(resourceJobManagerType);
+ resourceJobManager.setJobManagerBinPath(jobManagerBinPath);
+ resourceJobManager.setJobManagerCommands(jobManagerCommands);
+ resourceJobManager.setPushMonitoringEndpoint(pushMonitoringEndpoint);
+ return resourceJobManager;
+ }
+
+ public static InputDataObjectType createAppInput(String inputName, String argumentName, String description, String value, org.apache.airavata.model.appcatalog.appinterface.DataType type) {
+ InputDataObjectType input = new InputDataObjectType();
+// input.setIsEmpty(false);
+ if (inputName != null) {
+ input.setName(inputName);
+ }
+ if (value != null) {
+ input.setValue(value);
+ }
+ if (type != null) {
+ input.setType(type);
+ }
+ if (argumentName != null) {
+ input.setApplicationArgument(argumentName);
+ }
+ if (description != null) {
+ input.setUserFriendlyDescription(description);
+ }
+ return input;
+ }
+
+ public static OutputDataObjectType createAppOutput(String inputName, String value, org.apache.airavata.model.appcatalog.appinterface.DataType type) {
+ OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
+// outputDataObjectType.setIsEmpty(false);
+ if (inputName != null) {
+ outputDataObjectType.setName(inputName);
+ }
+ if (value != null) {
+ outputDataObjectType.setValue(value);
+ }
+ if (type != null) {
+ outputDataObjectType.setType(type);
+ }
+ return outputDataObjectType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b6392ef3/airavata-api/thrift-interface-descriptions/applicationDeploymentModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/applicationDeploymentModel.thrift b/airavata-api/thrift-interface-descriptions/applicationDeploymentModel.thrift
index 4ee3978..9df1df3 100644
--- a/airavata-api/thrift-interface-descriptions/applicationDeploymentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/applicationDeploymentModel.thrift
@@ -120,7 +120,7 @@ struct ApplicationDeploymentDescription {
2: required string appModuleId,
3: required string computeHostId,
4: required string executablePath,
- 5: required ApplicationParallelismType parallelism = ApplicationParallelismType.SERIAL ,
+ 5: required ApplicationParallelismType parallelism = ApplicationParallelismType.SERIAL,
6: optional string appDeploymentDescription,
7: optional list<string> moduleLoadCmds,
8: optional list<SetEnvPaths> libPrependPaths,