Package org.apache.airavata.gfac.core.provider

Examples of org.apache.airavata.gfac.core.provider.GFacProviderException


            outHandlerLst.add("de.fzj.unicore.uas.security.ProxyCertOutHandler");

            secProperties.setOutHandlerClassNames(outHandlerLst.toArray(new String[outHandlerLst.size()]));

        } catch (Exception e) {
            throw new GFacProviderException(e.getMessage(), e);
        }
    }
View Full Code Here


                        ec2client.describeInstances(describeInstancesRequest.
                                withInstanceIds(amazonSecurityContext.getInstanceId()));

                if (describeInstancesResult.getReservations().size() == 0 ||
                        describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
                    throw new GFacProviderException("Instance not found:" + amazonSecurityContext.getInstanceId());
                }

                instance = describeInstancesResult.getReservations().get(0).getInstances().get(0);

                // check instance keypair
                if (instance.getKeyName() == null || !instance.getKeyName().equals(KEY_PAIR_NAME)) {
                    throw new GFacProviderException("Keypair for instance:" + amazonSecurityContext.getInstanceId() +
                            " is not valid");
                }
            }

            jobExecutionContext.getNotificationService().publish(new EC2ProviderEvent("EC2 Instance " +
                    this.instance.getInstanceId() + " is running with public name " + this.instance.getPublicDnsName()));

        } catch (Exception e) {
            throw new GFacProviderException("Invalid Request",e);
        }

    }
View Full Code Here

            log.debug("RSL = " + rsl);
            GramJob job = new GramJob(rsl);
            return job;
        } catch (ToolsException te) {
            throw new GFacProviderException(te.getMessage(), te);
        }
    }
View Full Code Here

                    if(cpuCount>0){
                        app.setCpuCount(cpuCount);
                    }
                } catch (NullPointerException e) {
                    log.debug("No Value sent in WorkflowContextHeader for CPU Count, value in the Deployment Descriptor will be used");
                    new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int nodeCount = computionnalResource.getNodeCount();
                    if(nodeCount>0){
                        app.setNodeCount(nodeCount);
                    }
                } catch (NullPointerException e) {
                    log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    String queueName = computionnalResource.getQueueName();
                    if (queueName != null) {
                        if(app.getQueue() == null){
                            QueueType queueType = app.addNewQueue();
                            queueType.setQueueName(queueName);
                        }else{
                            app.getQueue().setQueueName(queueName);
                        }
                    }
                } catch (NullPointerException e) {
                    log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int maxwallTime = computionnalResource.getWallTimeLimit();
                    if(maxwallTime>0){
                        app.setMaxWallTime(maxwallTime);
                    }
                } catch (NullPointerException e) {
                    log.debug("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
        }
        if (app.getNodeCount() > 0) {
            jobAttr.set("hostCount", String.valueOf(app.getNodeCount()));
            log.debug("Setting number of Nodes to " + app.getCpuCount());
View Full Code Here

              String processers = Integer.toString(cpuCount);
            num.setStringValue(processers);
              JSDLUtils.getOrCreateSPMDApplication(value).setNumberOfProcesses(num);
                    }
                } catch (NullPointerException e) {
                    new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int nodeCount = computionResource.getNodeCount();
                    if(nodeCount>0){
                      appDepType.setNodeCount(nodeCount);
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    String queueName = computionResource.getQueueName();
                    if (queueName != null) {
                        if(appDepType.getQueue() == null){
                            QueueType queueType = appDepType.addNewQueue();
                            queueType.setQueueName(queueName);
                        }else{
                          appDepType.getQueue().setQueueName(queueName);
                        }
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
                try {
                    int maxwallTime = computionResource.getWallTimeLimit();
                    if(maxwallTime>0){
                      appDepType.setMaxWallTime(maxwallTime);
                    }
                } catch (NullPointerException e) {
                     new GFacProviderException("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used",e);
                }
        }
   
    if (appDepType.getCpuCount() > 0) {
      RangeValueType rangeType = new RangeValueType();
View Full Code Here

                    log.info("Invalid script reply received. Re-submitting job, id - " + job.getIDAsString());
                    try {
                        reSubmitJob(gateKeeper, jobExecutionContext, host);
                    } catch (GFacException e) {
                        throw new GFacProviderException
                                ("Error during re-submission. Original job submission data - " + errorMsg,  e);
                    }
                    return;
                }

            } else if (listener.getError() == GRAMProtocolErrorConstants.ERROR_AUTHORIZATION) {

                // re-submit with renewed credentials
                if (!authorisationFailedAttempt) {
                    authorisationFailedAttempt = true;
                    log.info("Authorisation error contacting provider. Re-submitting job with renewed credentials.");

                    try {
                        renewCredentials(jobExecutionContext);
                        reSubmitJob(gateKeeper, jobExecutionContext, host);
                    } catch (GFacException e) {
                        throw new GFacProviderException
                                ("Error during re-submission. Original job submission data - " + errorMsg,  e);
                    }

                    return;
                }
View Full Code Here

            FileUploader fileUploader = new FileUploader(
                uriWithoutProtocol, "input/" + fileName,
                Mode.overwrite);
            fileUploader.perform(storageClient);
          } catch (FileNotFoundException e3) {
            throw new GFacProviderException(
                "Error while staging-in, local file "+fileName+" not found", e3);
          } catch (Exception e) {
            throw new GFacProviderException("Cannot upload files", e);

          }

        }
      }
View Full Code Here

        try {
          fileDownloader.perform(storageClient);
           ((StringParameterType) outParam.getType()).setValue(outputLocation);
            stringMap.put(paramKey, outParam);
        } catch (Exception e) {
          throw new GFacProviderException(e.getLocalizedMessage(),e);
        }
      }

      else if ("StringArray".equals(paramDataType)) {
        String[] valueArray = ((StringArrayType) outParam.getType())
            .getValueArray();
        for (String v : valueArray) {
          String localFileName = v.substring(v.lastIndexOf("/")+1);;
          String outputLocation = downloadLocation+File.separator+localFileName;
          FileDownloader fileDownloader = new FileDownloader("output/"+v,outputLocation, Mode.overwrite);
          try {
            fileDownloader.perform(storageClient);
             ((StringParameterType) outParam.getType()).setValue(outputLocation);
            stringMap.put(paramKey, outParam);
          } catch (Exception e) {
            throw new GFacProviderException(e.getLocalizedMessage(),e);
          }
        }
      }
    }
     if (stringMap == null || stringMap.isEmpty()) {
             throw new GFacProviderException("Empty Output returned from the Application, Double check the application" +
                     "and ApplicationDescriptor output Parameter Names");
         }
   
    downloadStdOuts();
  }
View Full Code Here

    try {
      f1.perform(storageClient);
      String stdoutput = readFile(stdoutLocation);
      appDesc.setStandardOutput(stdoutput);
    } catch (Exception e) {
      throw new GFacProviderException(e.getLocalizedMessage(),e);
    }
    String stderrLocation = downloadLocation+File.separator+stderrFileName;
    FileDownloader f2 = new FileDownloader("output/"+stderrFileName,stderrLocation, Mode.overwrite);
    try {
      f2.perform(storageClient);
      String stderror = readFile(stderrLocation);
      appDesc.setStandardError(stderror);
    } catch (Exception e) {
      throw new GFacProviderException(e.getLocalizedMessage(),e);
    }
  }
View Full Code Here

            log.info(remoteFile);
            try {
              File runscript = createShellScript(jobExecutionContext);
                cluster.scpTo(remoteFile, runscript.getAbsolutePath());
            } catch (Exception e) {
                throw new GFacProviderException(e.getLocalizedMessage(), e);
            }
        }else{
           hpcType = true;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.core.provider.GFacProviderException

Copyright © 2018 www.massapicom. 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.