You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/12/06 22:47:11 UTC
svn commit: r1418098 - in /airavata/trunk/samples/airavata-client:
create-application/README.txt workflow-run/README.txt
workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java
Author: lahiru
Date: Thu Dec 6 21:47:10 2012
New Revision: 1418098
URL: http://svn.apache.org/viewvc?rev=1418098&view=rev
Log:
more changes to newly added samples.
Modified:
airavata/trunk/samples/airavata-client/create-application/README.txt
airavata/trunk/samples/airavata-client/workflow-run/README.txt
airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java
Modified: airavata/trunk/samples/airavata-client/create-application/README.txt
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/create-application/README.txt?rev=1418098&r1=1418097&r2=1418098&view=diff
==============================================================================
--- airavata/trunk/samples/airavata-client/create-application/README.txt (original)
+++ airavata/trunk/samples/airavata-client/create-application/README.txt Thu Dec 6 21:47:10 2012
@@ -1 +1,24 @@
+Creating an application using Airavata API
+==========================================
+
+This sample demonstrate how to create an Application to run in your localhost. This simply create an echo application to run in your machine with /bin/echo executable.
+
+Pre Requirements
+----------------
+
+1. You need to have executable /bin/echo which echo what is given as the argument (Linux or Mac system do have this executable by default)
+
+2. You have to have registry service running on http://localhost:8080/airavata-registry/api (If you start airavata server distribution without changing any configuration this service will start).
+
+
+Steps to Run
+------------
+
+1. Unpack Airavata server distribution and start with AIRAVATA_SERVER_HOME/bin/airavata-servers.sh.
+
+2. go to create-application folder in the airavata-client distribution and run following command.
+
+ ant run
+
+3. After successful run you can see your application has been created by starting xbaya using airavata xbaya distribution. Connect to the registry service using http://localhost:8080/airavata-registry/api, which is the default setting and you will see the Echo application has registered.
Modified: airavata/trunk/samples/airavata-client/workflow-run/README.txt
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/README.txt?rev=1418098&r1=1418097&r2=1418098&view=diff
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/README.txt (original)
+++ airavata/trunk/samples/airavata-client/workflow-run/README.txt Thu Dec 6 21:47:10 2012
@@ -1 +1,24 @@
+Creating an application using Airavata API
+==========================================
+This sample demonstrate how to save a given workflow in to registry and run a workflow using airavata API
+
+Pre Requirements
+----------------
+
+1. You should have successfully run the create-application sample.
+
+
+2. You have to have registry service running on http://localhost:8080/airavata-registry/api (If you start airavata server distribution without changing any configuration this service will start).
+
+
+Steps to Run
+------------
+
+1. Follow the instructions in create-application sample. Now you have an application created in your registry. Do not shut down the airavata server you have started in previous sample.
+
+2. go to workflow-run folder in the airavata-client distribution and run following command.
+
+ ant run
+
+3. After successful run you can see the experiment ID has printed in to the screen.
Modified: airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java
URL: http://svn.apache.org/viewvc/airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java?rev=1418098&r1=1418097&r2=1418098&view=diff
==============================================================================
--- airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java (original)
+++ airavata/trunk/samples/airavata-client/workflow-run/src/main/java/org/apache/airavata/client/samples/RunWorkflow.java Thu Dec 6 21:47:10 2012
@@ -30,6 +30,9 @@ import org.apache.airavata.workflow.mode
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -69,8 +72,9 @@ public class RunWorkflow {
PasswordCallback passwordCallback = new PasswordCallbackImpl(getUserName(), getPassword());
airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()),
getGatewayName(), getUserName(), passwordCallback);
-
- String workflowName = "Echo";
+ System.out.println((new File("")).getAbsolutePath());
+ String workflowName = "Workflow1";
+ airavataAPI.getWorkflowManager().saveWorkflow(getWorkflowComposeContent());
List<WorkflowInput> workflowInputs = new ArrayList<WorkflowInput>();
String name = "echo_input";
String type = "String";
@@ -83,7 +87,7 @@ public class RunWorkflow {
workflowName);
System.out.println("Workflow Experiment ID Returned : " + result);
List<ExperimentData> experimentDataList = airavataAPI.getProvenanceManager().getExperimentDataList(result);
- for (ExperimentData data: experimentDataList){
+ for (ExperimentData data : experimentDataList) {
System.out.println(data.getExperimentName() + ": " + data.getTopic());
}
}
@@ -115,4 +119,15 @@ public class RunWorkflow {
public static String getPassword() {
return password;
}
+
+ protected static String getWorkflowComposeContent() throws IOException {
+
+ BufferedReader reader = new BufferedReader(new FileReader("src/main/resources/EchoWorkflow.xwf"));
+ String line = null;
+ StringBuffer buffer = new StringBuffer();
+ while ((line = reader.readLine()) != null) {
+ buffer.append(line);
+ }
+ return buffer.toString();
+ }
}