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 2014/02/28 19:22:25 UTC
[1/2] git commit: fixing build error
Repository: airavata
Updated Branches:
refs/heads/master 66c88f6d2 -> 99297f91c
fixing build error
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/6228daa4
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/6228daa4
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/6228daa4
Branch: refs/heads/master
Commit: 6228daa4dd8f270bc223804a012ee6d772796430
Parents: 93545e1
Author: lahiru <la...@apache.org>
Authored: Fri Feb 28 13:22:06 2014 -0500
Committer: lahiru <la...@apache.org>
Committed: Fri Feb 28 13:22:06 2014 -0500
----------------------------------------------------------------------
.../orchestrator/client/DocumentCreator.java | 315 +++++++++++++++++++
.../client/OrchestratorClientFactoryTest.java | 1 -
2 files changed, 315 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/6228daa4/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/DocumentCreator.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/DocumentCreator.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/DocumentCreator.java
new file mode 100644
index 0000000..97c516c
--- /dev/null
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/DocumentCreator.java
@@ -0,0 +1,315 @@
+/*
+ *
+ * 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.orchestrator.client;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.schemas.gfac.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+public class DocumentCreator {
+
+ private AiravataAPI airavataAPI = null;
+ private String hpcHostAddress = "trestles.sdsc.edu";
+ private String gramHostName = "gram-trestles";
+ private String gsiSshHostName = "gsissh-trestles";
+ private String gridftpAddress = "gsiftp://trestles-dm1.sdsc.edu:2811";
+ private String gramAddress = "trestles-login1.sdsc.edu:2119/jobmanager-pbstest2";
+
+
+ public DocumentCreator(AiravataAPI airavataAPI) {
+ this.airavataAPI = airavataAPI;
+ }
+
+ public void createLocalHostDocs() {
+ HostDescription descriptor = new HostDescription();
+ descriptor.getType().setHostName("localhost");
+ descriptor.getType().setHostAddress("127.0.0.1");
+ try {
+ airavataAPI.getApplicationManager().saveHostDescription(descriptor);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ ServiceDescription serviceDescription = new ServiceDescription();
+ List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
+ List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
+ serviceDescription.getType().setName("Echo");
+ serviceDescription.getType().setDescription("Echo service");
+ // Creating input parameters
+ InputParameterType parameter = InputParameterType.Factory.newInstance();
+ parameter.setParameterName("echo_input");
+ parameter.setParameterDescription("echo input");
+ ParameterType parameterType = parameter.addNewParameterType();
+ parameterType.setType(DataType.STRING);
+ parameterType.setName("String");
+ inputParameters.add(parameter);
+
+ // Creating output parameters
+ OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
+ outputParameter.setParameterName("echo_output");
+ outputParameter.setParameterDescription("Echo output");
+ ParameterType outputParaType = outputParameter.addNewParameterType();
+ outputParaType.setType(DataType.STRING);
+ outputParaType.setName("String");
+ outputParameters.add(outputParameter);
+
+ // Setting input and output parameters to serviceDescriptor
+ serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
+ serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
+
+ try {
+ airavataAPI.getApplicationManager().saveServiceDescription(serviceDescription);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ ApplicationDescription applicationDeploymentDescription = new ApplicationDescription();
+ ApplicationDeploymentDescriptionType applicationDeploymentDescriptionType = applicationDeploymentDescription
+ .getType();
+ applicationDeploymentDescriptionType.addNewApplicationName().setStringValue("EchoApplication");
+ applicationDeploymentDescriptionType.setExecutableLocation("/bin/echo");
+ applicationDeploymentDescriptionType.setScratchWorkingDirectory("/tmp");
+
+ try {
+ airavataAPI.getApplicationManager().saveApplicationDescription("Echo", "localhost", applicationDeploymentDescription);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ }
+
+ public void createGramDocs() {
+ /*
+ creating host descriptor for gram
+ */
+ HostDescription host = new HostDescription(GlobusHostType.type);
+ host.getType().setHostAddress(hpcHostAddress);
+ host.getType().setHostName(gramHostName);
+ ((GlobusHostType) host.getType()).setGlobusGateKeeperEndPointArray(new String[]{gramAddress});
+ ((GlobusHostType) host.getType()).setGridFTPEndPointArray(new String[]{gridftpAddress});
+ try {
+ airavataAPI.getApplicationManager().saveHostDescription(host);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+
+ /*
+ * Service Description creation and saving
+ */
+ String serviceName = "SimpleEcho1";
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName(serviceName);
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ ParameterType parameterType = input.addNewParameterType();
+ parameterType.setType(DataType.STRING);
+ parameterType.setName("String");
+
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ ParameterType parameterType1 = output.addNewParameterType();
+ parameterType1.setType(DataType.STRING);
+ parameterType1.setName("String");
+
+ inputList.add(input);
+ outputList.add(output);
+
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
+ OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+ try {
+ airavataAPI.getApplicationManager().saveServiceDescription(serv);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace();
+ }
+
+ /*
+ Application descriptor creation and saving
+ */
+ ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
+ HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocal");
+ app.setApplicationName(name);
+ ProjectAccountType projectAccountType = app.addNewProjectAccount();
+ projectAccountType.setProjectAccountNumber("sds128");
+
+ QueueType queueType = app.addNewQueue();
+ queueType.setQueueName("development");
+
+ app.setCpuCount(1);
+ app.setJobType(JobTypeType.SERIAL);
+ app.setNodeCount(1);
+ app.setProcessorsPerNode(1);
+
+ /*
+ * Use bat file if it is compiled on Windows
+ */
+ app.setExecutableLocation("/bin/echo");
+
+ /*
+ * Default tmp location
+ */
+ String tempDir = "/home/ogce/scratch";
+ String date = (new Date()).toString();
+ date = date.replaceAll(" ", "_");
+ date = date.replaceAll(":", "_");
+
+ tempDir = tempDir + File.separator
+ + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
+
+ app.setScratchWorkingDirectory(tempDir);
+ app.setStaticWorkingDirectory(tempDir);
+ app.setInputDataDirectory(tempDir + File.separator + "inputData");
+ app.setOutputDataDirectory(tempDir + File.separator + "outputData");
+ app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
+ app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");
+
+
+ try {
+ airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, gramHostName, appDesc);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+
+ public void createGSISSHDocs() {
+ HostDescription host = new HostDescription(GsisshHostType.type);
+ host.getType().setHostAddress(hpcHostAddress);
+ host.getType().setHostName(gsiSshHostName);
+
+ try {
+ airavataAPI.getApplicationManager().saveHostDescription(host);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ /*
+ * Service Description creation and saving
+ */
+ String serviceName = "SimpleEcho2";
+ ServiceDescription serv = new ServiceDescription();
+ serv.getType().setName(serviceName);
+
+ List<InputParameterType> inputList = new ArrayList<InputParameterType>();
+ List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
+
+
+ InputParameterType input = InputParameterType.Factory.newInstance();
+ input.setParameterName("echo_input");
+ ParameterType parameterType = input.addNewParameterType();
+ parameterType.setType(DataType.STRING);
+ parameterType.setName("String");
+
+ OutputParameterType output = OutputParameterType.Factory.newInstance();
+ output.setParameterName("echo_output");
+ ParameterType parameterType1 = output.addNewParameterType();
+ parameterType1.setType(DataType.STRING);
+ parameterType1.setName("String");
+
+ inputList.add(input);
+ outputList.add(output);
+
+ InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
+ OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
+
+ serv.getType().setInputParametersArray(inputParamList);
+ serv.getType().setOutputParametersArray(outputParamList);
+ try {
+ airavataAPI.getApplicationManager().saveServiceDescription(serv);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ /*
+ Application descriptor creation and saving
+ */
+ ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
+ HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
+ ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+ name.setStringValue("EchoLocal");
+ app.setApplicationName(name);
+ ProjectAccountType projectAccountType = app.addNewProjectAccount();
+ projectAccountType.setProjectAccountNumber("sds128");
+
+ QueueType queueType = app.addNewQueue();
+ queueType.setQueueName("development");
+
+ app.setCpuCount(1);
+ app.setJobType(JobTypeType.SERIAL);
+ app.setNodeCount(1);
+ app.setProcessorsPerNode(1);
+
+ /*
+ * Use bat file if it is compiled on Windows
+ */
+ app.setExecutableLocation("/bin/echo");
+
+ /*
+ * Default tmp location
+ */
+ String tempDir = "/home/ogce/scratch";
+ String date = (new Date()).toString();
+ date = date.replaceAll(" ", "_");
+ date = date.replaceAll(":", "_");
+
+ tempDir = tempDir + File.separator
+ + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
+
+ app.setScratchWorkingDirectory(tempDir);
+ app.setStaticWorkingDirectory(tempDir);
+ app.setInputDataDirectory(tempDir + File.separator + "inputData");
+ app.setOutputDataDirectory(tempDir + File.separator + "outputData");
+ app.setStandardOutput(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stdout");
+ app.setStandardError(tempDir + File.separator + app.getApplicationName().getStringValue() + ".stderr");
+ app.setInstalledParentPath("/opt/torque/bin/");
+
+ try {
+ airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, gsiSshHostName, appDesc);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ }
+
+ public AiravataAPI getAiravataAPI() {
+ return airavataAPI;
+ }
+
+ public void setAiravataAPI(AiravataAPI airavataAPI) {
+ this.airavataAPI = airavataAPI;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/6228daa4/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
index 0b6e8b2..15f4dac 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
@@ -31,7 +31,6 @@ import org.apache.airavata.model.util.ExperimentModelUtil;
import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.orchestrator.core.DocumentCreator;
import org.apache.airavata.orchestrator.cpi.OrchestratorService;
import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.ChildDataType;
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/airavata
Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/99297f91
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/99297f91
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/99297f91
Branch: refs/heads/master
Commit: 99297f91cc01771e7679d35eeff3dc64f6918c83
Parents: 6228daa 66c88f6
Author: lahiru <la...@apache.org>
Authored: Fri Feb 28 13:22:17 2014 -0500
Committer: lahiru <la...@apache.org>
Committed: Fri Feb 28 13:22:17 2014 -0500
----------------------------------------------------------------------
.../registry/jpa/resources/Utils.java | 506 +++++++++++--------
.../jpa/utils/ThriftDataModelConversion.java | 473 +++++++++--------
2 files changed, 559 insertions(+), 420 deletions(-)
----------------------------------------------------------------------