Repository: airavata Updated Branches: refs/heads/master 7d5d10273 -> cb3a8a55f
adding more test cases with gram and gsissh Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/ce902646 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/ce902646 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/ce902646 Branch: refs/heads/master Commit: ce902646a9bbf47ef32483b223a4097cdb55764c Parents: f52dc3b Author: lahiru <[email protected]> Authored: Mon Feb 17 12:24:17 2014 -0500 Committer: lahiru <[email protected]> Committed: Mon Feb 17 12:24:17 2014 -0500 ---------------------------------------------------------------------- .../core/impl/EmbeddedGFACJobSubmitter.java | 3 +- .../orchestrator/core/DocumentCreator.java | 69 +++++++++----------- .../core/OrchestratorTestWithGRAM.java | 27 ++++---- .../core/OrchestratorTestWithGSISSH.java | 21 +++--- .../test/resources/airavata-server.properties | 24 +++++-- .../src/test/resources/gsissh.properties | 26 ++++++++ .../src/test/resources/orchestrator.properties | 2 +- 7 files changed, 100 insertions(+), 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java index 63bef69..c324e8b 100644 --- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java +++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java @@ -68,7 +68,8 @@ public class EmbeddedGFACJobSubmitter implements JobSubmitter { } //FIXME: (MEP) This method is pretty gruesome. If we really expect multiple implementations of the JobSubmitter - // interface and at least some of them will need to do the stuff in this method, then we need a parent class GenericJobSubmitterImpl.java (maybe abstract) that includes launchGfacWithExperimentID() so that subclasses can inherit it. + // interface and at least some of them will need to do the stuff in this method, then we need a parent class + // GenericJobSubmitterImpl.java (maybe abstract) that includes launchGfacWithExperimentID() so that subclasses can inherit it. private void launchGfacWithExperimentID(String experimentID) throws OrchestratorException { Registry newRegistry = orchestratorContext.getNewRegistry(); try { http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/DocumentCreator.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/DocumentCreator.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/DocumentCreator.java index 037b1e8..93bab0e 100644 --- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/DocumentCreator.java +++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/DocumentCreator.java @@ -39,8 +39,8 @@ public class DocumentCreator { private String hpcHostAddress = "trestles.sdsc.edu"; private String gramHostName = "gram-trestles"; private String gsiSshHostName = "gsissh-trestles"; - private String gridftpAddress = "gsiftp://trestles.sdsc.edu:2811/"; - private String gramAddress = "trestles-login2.sdsc.edu:2119/jobmanager-pbstest2"; + private String gridftpAddress = "gsiftp://trestles-dm1.sdsc.edu:2811"; + private String gramAddress = "trestles-login1.sdsc.edu:2119/jobmanager-pbstest2"; public DocumentCreator(AiravataAPI airavataAPI) { @@ -129,36 +129,32 @@ public class DocumentCreator { 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"); - input.setParameterType(StringParameterType.Factory.newInstance()); - inputList.add(input); - - InputParameterType input1 = InputParameterType.Factory.newInstance(); - input.setParameterName("myinput"); - URIParameterType uriType = URIParameterType.Factory.newInstance(); - uriType.setValue("gsiftp://gridftp1.ls4.tacc.utexas.edu:2811//home1/01437/ogce/gram_20130215.log"); - input.setParameterType(uriType); - inputList.add(input1); - + ParameterType parameterType = input.addNewParameterType(); + parameterType.setType(DataType.STRING); + parameterType.setName("String"); - InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]); - List<OutputParameterType> outputList = new ArrayList<OutputParameterType>(); OutputParameterType output = OutputParameterType.Factory.newInstance(); output.setParameterName("echo_output"); - output.setParameterType(StringParameterType.Factory.newInstance()); + ParameterType parameterType1 = output.addNewParameterType(); + parameterType1.setType(DataType.STRING); + parameterType1.setName("String"); + + inputList.add(input); outputList.add(output); - OutputParameterType[] outputParamList = outputList - .toArray(new OutputParameterType[outputList.size()]); + 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. + e.printStackTrace(); } /* @@ -188,7 +184,7 @@ public class DocumentCreator { /* * Default tmp location */ - String tempDir = "/scratch/01437/ogce/test/"; + String tempDir = "/home/ogce/scratch"; String date = (new Date()).toString(); date = date.replaceAll(" ", "_"); date = date.replaceAll(":", "_"); @@ -196,7 +192,6 @@ public class DocumentCreator { tempDir = tempDir + File.separator + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID(); - System.out.println(tempDir); app.setScratchWorkingDirectory(tempDir); app.setStaticWorkingDirectory(tempDir); app.setInputDataDirectory(tempDir + File.separator + "inputData"); @@ -230,29 +225,26 @@ public class DocumentCreator { 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"); - input.setParameterType(StringParameterType.Factory.newInstance()); - inputList.add(input); - - InputParameterType input1 = InputParameterType.Factory.newInstance(); - input.setParameterName("myinput"); - URIParameterType uriType = URIParameterType.Factory.newInstance(); - uriType.setValue("gsiftp://gridftp1.ls4.tacc.utexas.edu:2811//home1/01437/ogce/gram_20130215.log"); - input.setParameterType(uriType); - inputList.add(input1); - + ParameterType parameterType = input.addNewParameterType(); + parameterType.setType(DataType.STRING); + parameterType.setName("String"); - InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]); - List<OutputParameterType> outputList = new ArrayList<OutputParameterType>(); OutputParameterType output = OutputParameterType.Factory.newInstance(); output.setParameterName("echo_output"); - output.setParameterType(StringParameterType.Factory.newInstance()); + ParameterType parameterType1 = output.addNewParameterType(); + parameterType1.setType(DataType.STRING); + parameterType1.setName("String"); + + inputList.add(input); outputList.add(output); - OutputParameterType[] outputParamList = outputList - .toArray(new OutputParameterType[outputList.size()]); + InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]); + OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]); serv.getType().setInputParametersArray(inputParamList); serv.getType().setOutputParametersArray(outputParamList); @@ -289,7 +281,7 @@ public class DocumentCreator { /* * Default tmp location */ - String tempDir = "/scratch/01437/ogce/test/"; + String tempDir = "/home/ogce/scratch"; String date = (new Date()).toString(); date = date.replaceAll(" ", "_"); date = date.replaceAll(":", "_"); @@ -297,17 +289,16 @@ public class DocumentCreator { tempDir = tempDir + File.separator + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID(); - System.out.println(tempDir); 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, gramHostName, appDesc); + airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, gsiSshHostName, appDesc); } catch (AiravataAPIInvocationException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java index 7147cab..bd1cf8a 100644 --- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java +++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java @@ -20,7 +20,6 @@ */ package org.apache.airavata.orchestrator.core; -import org.apache.airavata.client.api.AiravataAPI; import org.apache.airavata.common.utils.AiravataUtils; import org.apache.airavata.model.experiment.*; import org.apache.airavata.orchestrator.cpi.Orchestrator; @@ -29,6 +28,7 @@ import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl; import org.apache.airavata.registry.cpi.ChildDataType; import org.apache.airavata.registry.cpi.ParentDataType; import org.apache.airavata.registry.cpi.Registry; +import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.BeforeTest; @@ -37,9 +37,10 @@ import org.testng.annotations.Test; import java.util.*; public class OrchestratorTestWithGRAM extends BaseOrchestratorTest { - private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class); + private static final Logger log = LoggerFactory.getLogger(OrchestratorTestWithGRAM.class); private Orchestrator orchestrator; + private String experimentID; @BeforeTest @@ -47,12 +48,10 @@ public class OrchestratorTestWithGRAM extends BaseOrchestratorTest { AiravataUtils.setExecutionAsServer(); super.setUp(); orchestrator = new SimpleOrchestratorImpl(); - createJobRequestWithDocuments(super.getDocumentCreator().getAiravataAPI()); + createJobRequestWithDocuments(); } - private void createJobRequestWithDocuments(AiravataAPI airavataAPI) { - - + private void createJobRequestWithDocuments() { //Using new airavata-api methods to store experiment metadata BasicMetadata basicMetadata = new BasicMetadata(); basicMetadata.setExperimentName("test-trestles"); @@ -68,8 +67,6 @@ public class OrchestratorTestWithGRAM extends BaseOrchestratorTest { HashMap<String, String> exInputs = new HashMap<String, String>(); exInputs.put("echo_input", "echo_output=hello"); - exInputs.put("copy_input", "file:///tmp/tmpstrace"); - exInputs.put("outputlocation", "./outputData/."); configurationData.setExperimentInputs(exInputs); configurationData.setAdvanceInputDataHandling(advancedInputDataHandling); @@ -86,14 +83,14 @@ public class OrchestratorTestWithGRAM extends BaseOrchestratorTest { @Test public void noDescriptorTest() throws Exception { -// boolean b = orchestrator.launchExperiment(experimentID); + boolean b = orchestrator.launchExperiment(experimentID); -// if (b) { -// This means orchestrator successfully accepted the job -// Assert.assertTrue(true); -// } else { -// Assert.assertFalse(true); -// } + Thread.sleep(100000); + if (b) { + Assert.assertTrue(true); + } else { + Assert.assertFalse(true); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java index ae91978..38a6689 100644 --- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java +++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java @@ -20,6 +20,7 @@ */ package org.apache.airavata.orchestrator.core; +import junit.framework.Assert; import org.apache.airavata.client.api.AiravataAPI; import org.apache.airavata.common.utils.AiravataUtils; import org.apache.airavata.model.experiment.*; @@ -48,10 +49,10 @@ public class OrchestratorTestWithGSISSH extends BaseOrchestratorTest { AiravataUtils.setExecutionAsServer(); super.setUp(); orchestrator = new SimpleOrchestratorImpl(); - createJobRequestWithDocuments(super.getDocumentCreator().getAiravataAPI()); + createJobRequestWithDocuments(); } - private void createJobRequestWithDocuments(AiravataAPI airavataAPI) { + private void createJobRequestWithDocuments() { //Using new airavata-api methods to store experiment metadata @@ -69,8 +70,6 @@ public class OrchestratorTestWithGSISSH extends BaseOrchestratorTest { HashMap<String, String> exInputs = new HashMap<String, String>(); exInputs.put("echo_input", "echo_output=hello"); - exInputs.put("copy_input", "file:///tmp/tmpstrace"); - exInputs.put("outputlocation", "./outputData/."); configurationData.setExperimentInputs(exInputs); configurationData.setAdvanceInputDataHandling(advancedInputDataHandling); @@ -86,15 +85,13 @@ public class OrchestratorTestWithGSISSH extends BaseOrchestratorTest { @Test public void noDescriptorTest() throws Exception { - -// boolean b = orchestrator.launchExperiment(experimentID); - -// if (b) { + boolean b = orchestrator.launchExperiment(experimentID); + if (b) { // This means orchestrator successfully accepted the job -// Assert.assertTrue(true); -// } else { -// Assert.assertFalse(true); -// } + Assert.assertTrue(true); + } else { + Assert.assertFalse(true); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/resources/airavata-server.properties ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/resources/airavata-server.properties b/modules/orchestrator/orchestrator-core/src/test/resources/airavata-server.properties index 881c8da..be41625 100644 --- a/modules/orchestrator/orchestrator-core/src/test/resources/airavata-server.properties +++ b/modules/orchestrator/orchestrator-core/src/test/resources/airavata-server.properties @@ -99,11 +99,11 @@ gfac.embedded=true ########################################################################### myproxy.server=myproxy.teragrid.org -myproxy.user=username -myproxy.pass=password +myproxy.user=ogce +myproxy.pass= myproxy.life=3600 # XSEDE Trusted certificates can be downloaded from https://software.xsede.org/security/xsede-certs.tar.gz -trusted.cert.location=/path/to/trusted/certificates +trusted.cert.location=/Users/lahirugunathilake/Downloads/certificates # SSH PKI key pair or ssh password can be used SSH based authentication is used. # if user specify both password authentication gets the higher preference @@ -251,4 +251,20 @@ amqp.broadcast.sender=org.apache.airavata.wsmg.client.amqp.rabbitmq.AMQPBroadcas registry.service.wsdl=http://localhost:${port}/${server.context-root}/services/RegistryService?wsdl # If false, disables two phase commit when submitting jobs -TwoPhase=true +TwoPhase=false + + +# credential store specific parameters +credential.store.keystore.url=airavata.jks +credential.store.keystore.alias=airavata +credential.store.keystore.password=airavata +notifier.enabled=false +#period in milliseconds +notifier.duration=5000 + +email.server=smtp.googlemail.com +email.server.port=465 +email.user=airavata +email.password=xxx +email.ssl=true [email protected] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/resources/gsissh.properties ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/resources/gsissh.properties b/modules/orchestrator/orchestrator-core/src/test/resources/gsissh.properties new file mode 100644 index 0000000..3fdf76d --- /dev/null +++ b/modules/orchestrator/orchestrator-core/src/test/resources/gsissh.properties @@ -0,0 +1,26 @@ +# +# +# 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. +# + +########################################################################### +# Specifies system level configurations as a key/value pairs. +########################################################################### + +StrictHostKeyChecking=no +ssh.session.timeout=360000 http://git-wip-us.apache.org/repos/asf/airavata/blob/ce902646/modules/orchestrator/orchestrator-core/src/test/resources/orchestrator.properties ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/test/resources/orchestrator.properties b/modules/orchestrator/orchestrator-core/src/test/resources/orchestrator.properties index 264a28e..b686181 100644 --- a/modules/orchestrator/orchestrator-core/src/test/resources/orchestrator.properties +++ b/modules/orchestrator/orchestrator-core/src/test/resources/orchestrator.properties @@ -20,7 +20,7 @@ job.submitter=org.apache.airavata.orchestrator.core.impl.EmbeddedGFACJobSubmitter job.validator=org.apache.airavata.orchestrator.core.validator.impl.SimpleAppDataValidator submitter.interval=10000 -threadpool.size=1 +threadpool.size=0 start.submitter=true embedded.mode=true enable.validation=false \ No newline at end of file
