Examples of AiravataAPI


Examples of org.apache.airavata.client.api.AiravataAPI

        registryURL = "http://" + serverUrl + ":" + port + "/" + serverContextName + "/api";

        log("Configurations - Registry URL : " + registryURL);

        PasswordCallback passwordCallback = new PasswordCallbackImpl();
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                passwordCallback);

        checkServerStartup(airavataAPI);

        log("Server successfully started .............................");
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

        }
    }

    protected void runWorkFlow(Workflow workflow, List<String> inputValues) throws Exception {

        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
        String workflowName = workflow.getName();
        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
                workflowName, getUserName(), null);
        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options);

        Assert.assertNotNull(experimentId);

        log.info("Run workflow completed ....");
        log.info("Starting monitoring ....");
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

        monitor(experimentId);
    }

    protected void runWorkFlowWithoutMonitor(Workflow workflow, List<String> inputValues) throws Exception {

        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
        String workflowName = workflow.getName();
        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
                workflowName, getUserName(), null);
        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options,
                new EventDataListenerAdapter() {
                    @Override
                    public void notify(EventDataRepository eventDataRepo, EventData eventData) {
                        // do nothing
                    }
                });

        Assert.assertNotNull(experimentId);
        airavataAPI.getExecutionManager().waitForExperimentTermination(experimentId);

        log.info("Run workflow completed ....");
        log.info("Starting monitoring ....");

        verifyOutput(experimentId, "echo_output=Airavata_Test");
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

        verifyOutput(experimentId, "echo_output=Airavata_Test");
    }

    protected void verifyOutput(String experimentId, String outputVerifyingString) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        log.info("Experiment ID Returned : " + experimentId);

        ExperimentData experimentData = airavataAPI.getProvenanceManager().getExperimentData(experimentId);

        log.info("Verifying output ...");

        List<WorkflowExecutionDataImpl> workflowInstanceData = experimentData.getWorkflowExecutionDataList();
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

            }
        }
    }

    private List<WorkflowInput> setupInputs(Workflow workflow, List<String> inputValues) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = airavataAPI.getWorkflowManager().getWorkflowInputs(workflow.getName());

        Assert.assertEquals(workflowInputs.size(), inputValues.size());

        int i = 0;
        for (String valueString : inputValues) {
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

        log.debug("Workflow compose - " + buffer.toString());
        return buffer.toString();
    }

    public void monitor(final String experimentId) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        final Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,
                new EventDataListenerAdapter() {

                    @Override
                    public void notify(EventDataRepository eventDataRepo, EventData eventData) {
                        Assert.assertNotNull(eventDataRepo);
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

                    runner = new PredicatedTaskRunner(provenanceWriterThreadPoolSize);
                    try {
                            List<HostDescription> hostList = getDefinedHostDescriptions();
                            for(HostDescription host:hostList){
                                // This will avoid the changes user is doing to one of the predefined Hosts during a restart of the system
                                AiravataAPI registry = getAiravataAPI();
                if(!registry.getApplicationManager().isHostDescriptorExists(host.getType().getHostName())){
                                    log.debug("Saving the predefined Host: " + host.getType().getHostName());
                                    registry.getApplicationManager().addHostDescription(host);
                                }
                            }
                    } catch (AiravataAPIInvocationException e) {
                        e.printStackTrace();
                    } catch (DescriptorRecordAlreadyExistsException e) {
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

        } catch (URISyntaxException e1) {
            throw new WorkflowRuntimeException(e1);
        }
        WorkflowInterpretorEventListener listener = null;
        WorkflowInterpreter interpreter = null;
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gatewayId, username);
    WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,topic,conf.getMessageBoxURL(), conf.getBrokerURL(), airavataAPI, conf, null, null);
        workflowInterpreterConfiguration.setGfacEmbeddedMode(gfacEmbeddedMode);
        workflowInterpreterConfiguration.setActOnProvenance(provenance);

        if (builder.getSecurityContext().getAmazonWebservices() != null) {
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

  }

    public void shutDown(ConfigurationContext configctx, AxisService service) {
        URI gfacURL = (URI) configctx.getProperty(SERVICE_URL);
        if (getAiravataAPI() != null && thread != null) {
            AiravataAPI registry = getAiravataAPI();
            try {
                registry.getAiravataManager().removeWorkflowInterpreterURI(gfacURL);
            } catch (AiravataAPIInvocationException e) {
                e.printStackTrace();
            }
            thread.interrupt();
            try {
View Full Code Here

Examples of org.apache.airavata.client.api.AiravataAPI

    private static final Logger log = LoggerFactory.getLogger(MonitorWorkflow.class);

    public static void monitor(final String experimentId) throws AiravataAPIInvocationException, URISyntaxException {
        PasswordCallback passwordCallback = new PasswordCallbackImpl(RunWorkflow.getUserName(),
                RunWorkflow.getPassword());
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(RunWorkflow.getRegistryURL()),
                RunWorkflow.getGatewayName(), RunWorkflow.getUserName(), passwordCallback);
        MonitorListener monitorListener = new MonitorListener();
        Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,
                monitorListener);
        log.info("Started the Workflow monitor");
        experimentMonitor.startMonitoring();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.