Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 714B1100AC for ; Fri, 7 Mar 2014 17:26:25 +0000 (UTC) Received: (qmail 86953 invoked by uid 500); 7 Mar 2014 17:26:24 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 86919 invoked by uid 500); 7 Mar 2014 17:26:23 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 86902 invoked by uid 99); 7 Mar 2014 17:26:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 17:26:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 711EB93A173; Fri, 7 Mar 2014 17:26:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: raminder@apache.org To: commits@airavata.apache.org Date: Fri, 07 Mar 2014 17:26:22 -0000 Message-Id: In-Reply-To: <80e725aa156645738980ec25c7d3f205@git.apache.org> References: <80e725aa156645738980ec25c7d3f205@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] git commit: Merged clients for MPI samples. AIRAVATA-1059 Merged clients for MPI samples. AIRAVATA-1059 Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/2ea8b5c4 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/2ea8b5c4 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/2ea8b5c4 Branch: refs/heads/master Commit: 2ea8b5c415a8735f6a1b822ca10766a7cbcfb793 Parents: 21040ae 3dd2bf0 Author: raminder Authored: Fri Mar 7 12:21:27 2014 -0500 Committer: raminder Committed: Fri Mar 7 12:21:27 2014 -0500 ---------------------------------------------------------------------- .../airavata/api/server/AiravataAPIServer.java | 19 +- .../client/samples/CreateLaunchExperiment.java | 35 +- .../main/resources/airavata-client.properties | 8 +- .../airavata/client/tools/DocumentCreator.java | 158 ++++- modules/airavata-job-monitor/pom.xml | 5 + .../job/monitor/AiravataJobStatusUpdator.java | 5 +- .../monitor/impl/pull/qstat/QstatMonitor.java | 79 ++- .../impl/pull/qstat/ResourceConnection.java | 238 +------ .../airavata/job/monitor/util/CommonUtils.java | 20 + .../airavata/job/monitor/AMQPMonitorTest.java | 4 +- .../airavata/job/monitor/QstatMonitorTest.java | 3 +- .../main/resources/schemas/HostDescription.xsd | 2 + modules/distribution/airavata-server/pom.xml | 5 + .../src/main/assembly/bin-assembly.xml | 2 + .../src/main/resources/conf/SLURMTemplate.xslt | 69 +++ .../org/apache/airavata/gfac/cpi/GFacImpl.java | 28 +- .../gfac/provider/impl/GSISSHProvider.java | 3 +- .../core/gfac/services/impl/BigRed2Test.java | 7 +- .../gfac/services/impl/GSISSHProviderTest.java | 3 +- modules/integration-tests/pom.xml | 144 +++-- .../apache/airavata/integration/BaseCaseIT.java | 405 ++++++------ .../airavata/integration/ForEachCaseIT.java | 32 +- .../WorkflowIntegrationTestBase.java | 182 +++--- .../integration/WorkflowSamplesCaseIT.java | 23 +- .../src/test/resources/PBSTemplate.xslt | 77 +++ .../test/resources/airavata-client.properties | 66 -- .../src/test/resources/gfac-config.xml | 90 +++ .../src/test/resources/gsissh.properties | 26 + .../client/OrchestratorClientFactoryTest.java | 11 +- .../client/sample/OrchestratorClientSample.java | 6 +- .../orchestrator/core/BaseOrchestratorTest.java | 6 +- .../orchestrator/core/NewOrchestratorTest.java | 18 +- .../registry/jpa/impl/ExperimentRegistry.java | 6 +- .../jpa/resources/TaskDetailResource.java | 2 +- .../xbaya/invoker/EmbeddedGFacInvoker.java | 9 +- .../apache/airavata/gsi/ssh/api/Cluster.java | 15 +- .../airavata/gsi/ssh/api/job/JobDescriptor.java | 25 +- .../ssh/api/job/JobManagerConfiguration.java | 38 ++ .../airavata/gsi/ssh/api/job/OutputParser.java | 58 ++ .../gsi/ssh/api/job/PBSJobConfiguration.java | 93 +++ .../gsi/ssh/api/job/PBSOutputParser.java | 141 +++++ .../gsi/ssh/api/job/SlurmJobConfiguration.java | 93 +++ .../gsi/ssh/api/job/SlurmOutputParser.java | 106 ++++ .../gsi/ssh/impl/GSISSHAbstractCluster.java | 417 +++++++++++++ .../airavata/gsi/ssh/impl/PBSCluster.java | 617 +------------------ .../airavata/gsi/ssh/util/CommonUtils.java | 12 +- .../src/main/resources/SLURMTemplate.xslt | 69 +++ .../main/resources/schemas/PBSJobDescriptor.xsd | 5 + .../gsi/ssh/impl/DefaultSSHApiTest.java | 88 ++- .../airavata/gsi/ssh/impl/VanilaSSHTest.java | 5 +- .../gsissh/src/test/resources/gsissh.properties | 26 + 51 files changed, 2169 insertions(+), 1435 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/2ea8b5c4/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java ---------------------------------------------------------------------- diff --cc airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java index 78ebeb9,62f0cfd..92a1c80 --- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java +++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java @@@ -60,8 -60,8 +60,10 @@@ public class CreateLaunchExperiment AiravataUtils.setExecutionAsClient(); final Airavata.Client airavata = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT); System.out.println("API version is " + airavata.GetAPIVersion()); - addDescriptors(); - final String expId = createExperimentForStampede(airavata); + addDescriptors(); - final String expId = createExperiment(airavata); ++ final String expId = createExperimentForTrestles(airavata); ++// final String expId = createUS3ExperimentForTrestles(airavata); ++// final String expId = createExperimentForStampede(airavata); System.out.println("Experiment ID : " + expId); launchExperiment(airavata, expId); System.out.println("Launched successfully"); @@@ -121,10 -121,10 +123,11 @@@ public static void addDescriptors() throws AiravataAPIInvocationException,ApplicationSettingsException { try { DocumentCreator documentCreator = new DocumentCreator(getAiravataAPI()); - // documentCreator.createEchoAppLocalHostDocs(); - // documentCreator.createEchoAppGramDocs(); - documentCreator.createEchoAppGSISSHDocs(); - // documentCreator.createUltrascanGSISSHDocs(); + documentCreator.createLocalHostDocs(); + documentCreator.createGramDocs(); + documentCreator.createPBSDocs(); ++ documentCreator.createMPIPBSDocs(); + documentCreator.createSlurmDocs(); } catch (AiravataAPIInvocationException e) { logger.error("Unable to create airavata API", e.getMessage()); throw new AiravataAPIInvocationException(e); @@@ -166,63 -166,12 +169,66 @@@ output.setValue(""); exOut.add(output); - Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs); + Experiment simpleExperiment = + ExperimentModelUtil.createSimpleExperiment("project1", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs); simpleExperiment.setExperimentOutputs(exOut); - ComputationalResourceScheduling scheduling = - ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128"); + ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "uot111"); + scheduling.setResourceHostId("gsissh-trestles"); + UserConfigurationData userConfigurationData = new UserConfigurationData(); + userConfigurationData.setAiravataAutoSchedule(false); + userConfigurationData.setOverrideManualScheduledParams(false); + userConfigurationData.setComputationalResourceScheduling(scheduling); + simpleExperiment.setUserConfigurationData(userConfigurationData); + return client.createExperiment(simpleExperiment); + } catch (AiravataSystemException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new AiravataSystemException(e); + } catch (InvalidRequestException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new InvalidRequestException(e); + } catch (AiravataClientException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new AiravataClientException(e); + }catch (TException e) { + logger.error("Error occured while creating the experiment...", e.getMessage()); + throw new TException(e); + } + } + - public static String createUS3Experiment (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException { ++ public static String createUS3ExperimentForTrestles (Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException { + try{ + List exInputs = new ArrayList(); + DataObjectType input = new DataObjectType(); + input.setKey("input"); + input.setType(DataType.URI.toString()); + input.setValue("file:///home/airavata/input/hpcinput.tar"); + exInputs.add(input); + + List exOut = new ArrayList(); + DataObjectType output = new DataObjectType(); + output.setKey("output"); + output.setType(DataType.URI.toString()); + output.setValue(""); + DataObjectType output1 = new DataObjectType(); + output1.setKey("stdout"); + output1.setType(DataType.STD_OUT.toString()); + output1.setValue(""); + DataObjectType output2 = new DataObjectType(); + output2.setKey("stderr"); + output2.setType(DataType.STD_ERR.toString()); + output2.setValue(""); + exOut.add(output); + exOut.add(output1); + exOut.add(output2); + + + Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("project1", "admin", "US3Experiment", "UltrascanApp", "UltrascanApp", exInputs); + simpleExperiment.setExperimentOutputs(exOut); + + ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 2, 32, 0, "normal", 0, 0, 0, "uot111"); ++ ++ scheduling.setResourceHostId("gsissh-trestles"); UserConfigurationData userConfigurationData = new UserConfigurationData(); userConfigurationData.setAiravataAutoSchedule(false); http://git-wip-us.apache.org/repos/asf/airavata/blob/2ea8b5c4/airavata-api/airavata-client-sdks/java-client-samples/src/main/resources/airavata-client.properties ---------------------------------------------------------------------- diff --cc airavata-api/airavata-client-sdks/java-client-samples/src/main/resources/airavata-client.properties index ff4de88,ff4de88..fd95cdb --- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/resources/airavata-client.properties +++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/resources/airavata-client.properties @@@ -35,17 -35,17 +35,17 @@@ class.registry.accessor=org.apache.aira ########################Registry JPA Implementation Settings######################## #for mysql [AiravataJPARegistry] #registry.jdbc.driver=com.mysql.jdbc.Driver --#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data ++#registry.jdbc.url=jdbc:mysql://gw111.iu.xsede.org:3306/airavata #for derby [AiravataJPARegistry] registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver --registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata ++registry.jdbc.url=jdbc:derby://gw111.iu.xsede.org:1530/persistent_data;create=true;user=airavata;password=airavata registry.jdbc.user=airavata --registry.jdbc.password=airavata ++registry.jdbc.password=airavata12 start.derby.server.mode=true --validationQuery=SELECT 1 from Configuration ++validationQuery=SELECT 1 from CONFIGURATION jpa.connection.properties=MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,testWhileIdle=true,testOnBorrow=true defauly.registry.user=admin default.registry.password=admin http://git-wip-us.apache.org/repos/asf/airavata/blob/2ea8b5c4/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java ---------------------------------------------------------------------- diff --cc modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java index 9fbaa5c,60c53d5..4bba2e6 --- a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java +++ b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java @@@ -304,122 -306,106 +306,218 @@@ public class DocumentCreator e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } - - public void createUltrascanGSISSHDocs() { + ++ public void createMPIPBSDocs() { + HostDescription host = new HostDescription(GsisshHostType.type); + host.getType().setHostAddress(hpcHostAddress); + host.getType().setHostName(gsiSshHostName); ++ ((GsisshHostType) host.getType()).setPort(22); ++ ((GsisshHostType) host.getType()).setInstalledPath("/opt/torque/bin/"); + + 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 = "UltrascanApp"; ++ String serviceName = "UltrascanAPP"; + ServiceDescription serv = new ServiceDescription(); + serv.getType().setName(serviceName); + + List inputList = new ArrayList(); + List outputList = new ArrayList(); + + + InputParameterType input = InputParameterType.Factory.newInstance(); + input.setParameterName("input"); + ParameterType parameterType = input.addNewParameterType(); + parameterType.setType(DataType.URI); + parameterType.setName("URI"); + - // InputParameterType input1 = InputParameterType.Factory.newInstance(); - // input1.setParameterName("jobXML"); - // ParameterType parameterType1 = input1.addNewParameterType(); - // parameterType1.setType(DataType.URI); - // parameterType1.setName("URI"); - + OutputParameterType output = OutputParameterType.Factory.newInstance(); + output.setParameterName("output"); - ParameterType parameterType2 = output.addNewParameterType(); - parameterType2.setType(DataType.URI); - parameterType2.setName("URL"); ++ ParameterType parameterType1 = output.addNewParameterType(); ++ parameterType1.setType(DataType.URI); ++ parameterType1.setName("URI"); + - OutputParameterType stdout = OutputParameterType.Factory.newInstance(); - stdout.setParameterName("stdout"); - ParameterType parameterType3 = stdout.addNewParameterType(); - parameterType3.setType(DataType.STD_OUT); - parameterType3.setName("String"); ++ OutputParameterType output1 = OutputParameterType.Factory.newInstance(); ++ output1.setParameterName("stdout"); ++ ParameterType parameterType2 = output1.addNewParameterType(); ++ parameterType2.setType(DataType.STD_OUT); ++ parameterType2.setName("StdOut"); + - OutputParameterType stderr = OutputParameterType.Factory.newInstance(); - stderr.setParameterName("stderr"); - ParameterType parameterType4 = stderr.addNewParameterType(); - parameterType4.setType(DataType.STD_ERR); - parameterType4.setName("String"); ++ OutputParameterType output2 = OutputParameterType.Factory.newInstance(); ++ output2.setParameterName("stderr"); ++ ParameterType parameterType3 = output2.addNewParameterType(); ++ parameterType3.setType(DataType.STD_ERR); ++ parameterType3.setName("StdErr"); + + inputList.add(input); + outputList.add(output); - ++ outputList.add(output1); ++ outputList.add(output2); ++ + 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("Ultrascan"); ++ name.setStringValue("UltrascanAPP"); + app.setApplicationName(name); + ProjectAccountType projectAccountType = app.addNewProjectAccount(); + projectAccountType.setProjectAccountNumber("uot111"); + + QueueType queueType = app.addNewQueue(); + queueType.setQueueName("normal"); + + app.setCpuCount(1); + app.setJobType(JobTypeType.MPI); - app.setNodeCount(2); - app.setProcessorsPerNode(64); ++ app.setNodeCount(32); ++ app.setProcessorsPerNode(2); + app.setMaxWallTime(10); + /* + * Use bat file if it is compiled on Windows + */ + app.setExecutableLocation("/home/us3/trestles/bin/us_mpi_analysis"); + + /* + * Default tmp location + */ + String tempDir = "/oasis/projects/nsf/uot111/us3/airavata-workdirs/"; + String date = (new Date()).toString(); + date = date.replaceAll(" ", "_"); + date = date.replaceAll(":", "_"); + + tempDir = tempDir + File.separator + + "Ultrascan" + "_" + 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/"); + app.setJobSubmitterCommand("/opt/mvapich2/pgi/ib/bin/mpiexec"); - + try { + airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, gsiSshHostName, appDesc); + } catch (AiravataAPIInvocationException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } + } + public void createSlurmDocs() { + HostDescription host = new HostDescription(GsisshHostType.type); + host.getType().setHostAddress("stampede.tacc.xsede.org"); + host.getType().setHostName("stampede-host"); + ((GsisshHostType) host.getType()).setJobManager("slurm"); + ((GsisshHostType) host.getType()).setPort(2222); + + + 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 = "SimpleEcho3"; + ServiceDescription serv = new ServiceDescription(); + serv.getType().setName(serviceName); + + List inputList = new ArrayList(); + List outputList = new ArrayList(); + + + 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("TG-STA110014S"); + + QueueType queueType = app.addNewQueue(); + queueType.setQueueName("normal"); + + app.setCpuCount(1); + app.setJobType(JobTypeType.SERIAL); + app.setNodeCount(1); + app.setProcessorsPerNode(1); + app.setMaxWallTime(10); + /* + * Use bat file if it is compiled on Windows + */ + app.setExecutableLocation("/bin/echo"); + + /* + * Default tmp location + */ + String tempDir = "/home1/01437/ogce"; + 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("/usr/bin/"); + + try { + airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, "stampede-host", appDesc); + } catch (AiravataAPIInvocationException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } + } public AiravataAPI getAiravataAPI() { return airavataAPI;