Examples of HostDescriptionType


Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

      }
    }
    return result;
  }
    private void loadData() {
      HostDescriptionType t = getOriginalHostDescription().getType();
      hostIdTextField.setText(t.getHostName());
    hostAddressTextField.setText(t.getHostAddress());
    boolean isGlobus = t instanceof GlobusHostType;
    if (isGlobus){
      cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_GLOBUS);
      globusGateKeeperTextField.setText(arrayToString(((GlobusHostType) t).getGlobusGateKeeperEndPointArray()));
      GridFTPTextField.setText(arrayToString(((GlobusHostType) t).getGridFTPEndPointArray()));
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

          if (deployDesc!=null){
            ApplicationDeploymentDescriptionType appType = deployDesc.getApplicationDescription().getType();
            if (appType.getApplicationName()==null){
              appType.addNewApplicationName();
              }
            HostDescriptionType hostType = deployDesc.getHostDescription().getType();
            appType.getApplicationName().setStringValue(hostType.getHostName()+"_application");
            getDeployments().put(hostType.getHostName(), deployDesc);
            updateDeploymentTable();
          }
        } catch (RegistryException e1) {
          setError(e1.getLocalizedMessage());
          e1.printStackTrace();
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

public class LocalDirectorySetupHandler implements GFacHandler {
    private static final Logger log = LoggerFactory.getLogger(LocalDirectorySetupHandler.class);

    public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
        log.info("Invoking GramDirectorySetupHandler ...");
        HostDescriptionType type = jobExecutionContext.getApplicationContext().getHostDescription().getType();
        ApplicationDescription applicationDeploymentDescription = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
        ApplicationDeploymentDescriptionType app = applicationDeploymentDescription.getType();
        log.debug("working diectroy = " + app.getStaticWorkingDirectory());
        log.debug("temp directory = " + app.getScratchWorkingDirectory());
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

    }

    public void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException, GFacException {
        log.info("Invoking GSISSH Provider Invoke ...");
        jobExecutionContext.getNotifier().publish(new StartExecutionEvent());
        HostDescriptionType host = jobExecutionContext.getApplicationContext().
                getHostDescription().getType();
        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().
                getApplicationDeploymentDescription().getType();
        JobDetails jobDetails = new JobDetails();
       String taskID = jobExecutionContext.getTaskData().getTaskID();
        try {
            Cluster cluster = null;
            if (jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT) != null) {
                cluster = ((GSISecurityContext) jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getPbsCluster();
            }
            if (cluster == null) {
                throw new GFacProviderException("Security context is not set properly");
            } else {
                log.info("Successfully retrieved the Security Context");
            }
            // This installed path is a mandetory field, because this could change based on the computing resource
            JobDescriptor jobDescriptor = GFACGSISSHUtils.createJobDescriptor(jobExecutionContext, app, cluster);

            log.info(jobDescriptor.toXML());
           
            jobDetails.setJobDescription(jobDescriptor.toXML());
           
            String jobID = cluster.submitBatchJob(jobDescriptor);
            jobExecutionContext.setJobDetails(jobDetails);
            if(jobID == null){
                jobDetails.setJobID("none");
                GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.FAILED);
            }else{
                jobDetails.setJobID(jobID);
                GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.SUBMITTED);
            }


            // Now job has submitted to the resource, its up to the Provider to parse the information to daemon handler
            // to perform monitoring, daemon handlers can be accessed from anywhere
            List<ThreadedHandler> daemonHandlers = GFacImpl.getDaemonHandlers();
            ThreadedHandler pullMonitorHandler = null;
            ThreadedHandler pushMonitorHandler = null;
            String monitorMode = ((GsisshHostType) host).getMonitorMode();
            for(ThreadedHandler threadedHandler:daemonHandlers){
                if("org.apache.airavata.gfac.monitor.handlers.GridPullMonitorHandler".equals(threadedHandler.getClass().getName())){
                    pullMonitorHandler = threadedHandler;
                    if("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PULL.equals(monitorMode)){
                        log.info("Job is launched successfully now parsing it to monitoring in pull mode, JobID Returned:  " + jobID);
                        pullMonitorHandler.invoke(jobExecutionContext);
                    }else{
                        log.error("Currently we only support Pull and Push monitoring and monitorMode should be PULL" +
                                " to handle by the GridPullMonitorHandler");
                    }
                }else if ("org.apache.airavata.gfac.monitor.handlers.GridPushMonitorHandler".equals(threadedHandler.getClass().getName())){
                    pushMonitorHandler = threadedHandler;
                    if("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PUSH.equals(monitorMode)){
                        log.info("Job is launched successfully now parsing it to monitoring in push mode, JobID Returned:  " + jobID);
                        pushMonitorHandler.invoke(jobExecutionContext);
                    }else{
                        log.error("Currently we only support Pull and Push monitoring and monitorMode should be PUSH" +
                                " to handle by the GridPushMonitorHandler");
                    }
                }
                // have to handle the GridPushMonitorHandler logic
            }
            if(pullMonitorHandler == null && pushMonitorHandler==null && ExecutionMode.ASYNCHRONOUS.equals(jobExecutionContext.getGFacConfiguration().getExecutionMode())){
                log.error("No Daemon handler is configured in gfac-config.xml, either pull or push, so monitoring will not invoked" +
                        ", execution is configured as asynchronous, so Outhandler will not be invoked");
            }
            // we know this host is type GsiSSHHostType
        } catch (SSHApiException e) {
            String error = "Error submitting the job to host " + host.getHostAddress() + " message: " + e.getMessage();
            log.error(error);
            jobDetails.setJobID("none");
          GFacUtils.saveJobStatus(jobExecutionContext, jobDetails,JobState.FAILED);
           GFacUtils.saveErrorDetails(jobExecutionContext, error, CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR);
            throw new GFacProviderException(error, e);
        } catch (Exception e) {
          String error = "Error submitting the job to host " + host.getHostAddress() + " message: " + e.getMessage();
           log.error(error);
            jobDetails.setJobID("none");
          GFacUtils.saveJobStatus(jobExecutionContext, jobDetails,JobState.FAILED);
           GFacUtils.saveErrorDetails(jobExecutionContext, error, CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR);
            throw new GFacProviderException(error, e);
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

        //TODO: why it is tightly coupled with gridftp
//        GlobusHostType host = (GlobusHostType) jobExecutionContext.getApplicationContext().getHostDescription().getType();

        //TODO: make it more reusable
        HostDescriptionType hostType = jobExecutionContext.getApplicationContext().getHostDescription().getType();



        if(hostType instanceof GlobusHostType){
          gridFTPEndpointArray = ((GlobusHostType) hostType).getGridFTPEndPointArray();
        }
        else if (hostType instanceof UnicoreHostType){
          gridFTPEndpointArray = ((UnicoreHostType) hostType).getGridFTPEndPointArray();
        }
       


        ApplicationDescription applicationDeploymentDescription = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
        ApplicationDeploymentDescriptionType app = applicationDeploymentDescription.getType();
        GridFtp ftp = new GridFtp();

        try {

            GSSCredential gssCred = ((GSISecurityContext)jobExecutionContext.
                    getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getGssCredentials();

            if (gridFTPEndpointArray == null || gridFTPEndpointArray.length == 0) {
              gridFTPEndpointArray = new String[]{hostType.getHostAddress()};
            }
            boolean success = false;
            GFacHandlerException pe = null;// = new ProviderException("");
            for (String endpoint : gridFTPEndpointArray) {
                try {
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

        hostId = this.hostIdTextField.getText();
        String hostAddress = this.hostAddressTextField.getText();

        setHostId(hostId);
        setHostLocation(hostAddress);
        HostDescriptionType host = getHostDescription().getType();
        if(host instanceof GlobusHostType) {
          ((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(this.gateKeeperTextField.getText());
            ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(this.gridFTPTextField.getText());
        }else if (host instanceof UnicoreHostType){
          ((UnicoreHostType)hostDescription.getType()).addUnicoreBESEndPoint(this.gateKeeperTextField.getText());
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

        globusPanel.add(gridFTPTextField);
        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
        return globusPanel;
  }
    private void loadData() {
      HostDescriptionType t = getOriginalHostDescription().getType();
      hostIdTextField.setText(t.getHostName());
    hostAddressTextField.setText(t.getHostAddress());
    if (t instanceof GlobusHostType){
      cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_GLOBUS);
      gateKeeperTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGlobusGateKeeperEndPointArray()));
      gridFTPTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGridFTPEndPointArray()));
    }else if (t instanceof SSHHostType){
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

        //TODO: why it is tightly coupled with gridftp
//        GlobusHostType host = (GlobusHostType) jobExecutionContext.getApplicationContext().getHostDescription().getType();

        //TODO: make it more reusable
        HostDescriptionType hostType = jobExecutionContext.getApplicationContext().getHostDescription().getType();

        if(jobExecutionContext.getApplicationContext().getHostDescription().getType() instanceof GlobusHostType){
          gridFTPEndpointArray = ((GlobusHostType) hostType).getGridFTPEndPointArray();
        }
        else if (jobExecutionContext.getApplicationContext().getHostDescription().getType() instanceof UnicoreHostType){
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.HostDescriptionType

       log.info("Invoking GridFTPOutputHandler ...");
       super.invoke(jobExecutionContext);
       
       ApplicationDeploymentDescriptionType app = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType();

      HostDescriptionType hostType = jobExecutionContext.getApplicationContext().getHostDescription().getType();
      String[] gridFTPEndpointArray = null;
      String hostName = null;
       if(jobExecutionContext.getApplicationContext().getHostDescription().getType() instanceof GlobusHostType){
          gridFTPEndpointArray = ((GlobusHostType) hostType).getGridFTPEndPointArray();
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.HostDescriptionType

    }

    public static void removeHostDesc(RegistryService registryService, String hostDescAsStr)
            throws GfacException {
        try {
            HostDescriptionType appDesc = HostDescriptionDocument.Factory.parse(hostDescAsStr)
                    .getHostDescription();
            registryService.removeHostDesc(appDesc.getHostName());
        } catch (XmlException e) {
            throw new GfacException(e,FaultCode.LocalError);
        }
    }
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.