Class NoGridStart

  • All Implemented Interfaces:
    GridStart

    public class NoGridStart
    extends java.lang.Object
    implements GridStart
    This class ends up running the job directly on the grid, without wrapping it in any other launcher executable. It ends up connecting the jobs stdio and stderr to condor commands to ensure they are sent back to the submit host.
    Version:
    $Revision$
    Author:
    Karan Vahi vahi@isi.edu
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CLASSNAME
      The basename of the class that is implmenting this.
      private PegasusBag mBag  
      private ADag mDAG  
      protected boolean mEnablingPartOfAggregatedJob
      An instance variable to track if enabling is happening as part of a clustered job.
      protected java.lang.String mExitParserArguments
      The argument string containing the arguments with which the exitcode is invoked on kickstart output.
      protected boolean mGenerateLOF
      A boolean indicating whether to generate lof files or not.
      protected LogManager mLogger
      The LogManager object which is used to log all the messages.
      protected PlannerOptions mPOptions
      The options passed to the planner.
      protected PegasusProperties mProps
      The object holding all the properties pertaining to Pegasus.
      protected SiteStore mSiteStore
      Handle to the site catalog store.
      protected SLS mSLS
      The handle to the SLS implementor
      protected java.lang.String mSubmitDir
      The submit directory where the submit files are being generated for the workflow.
      protected boolean mWorkerPackageStagingEnabled
      Boolean indicating whether worker package staging is enabled or not.
      static java.lang.String SHORT_NAME
      The SHORTNAME for this implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      NoGridStart()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addToFile​(java.io.File src, java.io.OutputStream out)
      Adds contents to an output stream.
      boolean canSetXBit()
      Indicates whether the enabling mechanism can set the X bit on the executable on the remote grid site, in addition to launching it on the remote grid stie
      private void construct​(Job job, java.lang.String key, java.lang.String value)
      Constructs a condor variable in the condor profile namespace associated with the job.
      java.lang.String defaultPOSTScript()
      Returns the SHORT_NAME for the POSTScript implementation that is used to be as default with this GridStart implementation.
      boolean enable​(AggregatedJob job, boolean isGlobusJob)
      Enables a job to run on the grid.
      AggregatedJob enable​(AggregatedJob aggJob, java.util.Collection jobs)
      Enables a collection of jobs and puts them into an AggregatedJob.
      boolean enable​(Job job, boolean isGlobusJob)
      Enables a job to run on the grid by launching it directly.
      java.lang.String generateListofFilenamesFile​(java.util.Set files, java.lang.String basename)
      Writes out the list of filenames file for the job.
      protected java.lang.String getDirectory​(Job job)
      Returns the directory in which the job should run.
      private java.lang.String getDirectoryKey​(Job job)
      Returns the directory that is associated with the job to specify the directory in which the job needs to run
      java.lang.String getVDSKeyValue()
      Returns the value of the vds profile with key as Pegasus.GRIDSTART_KEY, that would result in the loading of this particular implementation.
      java.lang.String getWorkerNodeDirectory​(Job job)
      Returns the directory in which the job executes on the worker node.
      protected java.lang.String handleTransferOfExecutable​(Job job)
      It changes the paths to the executable depending on whether we want to transfer the executable or not.
      void initialize​(PegasusBag bag, ADag dag)
      Initializes the GridStart implementation.
      private boolean removeDirectoryKey​(Job job)
      Returns a boolean indicating whether to remove remote directory information or not from the job.
      protected boolean requiresToSetDirectory​(Job job)
      Returns a boolean indicating whether we need to set the directory for the job or not.
      java.lang.String shortDescribe()
      Returns a short textual description in the form of the name of the class.
      void useFullPathToGridStarts​(boolean fullPath)
      Setter method to control whether a full path to Gridstart should be returned while wrapping a job or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mDAG

        private ADag mDAG
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The basename of the class that is implmenting this. Could have been determined by reflection.
        See Also:
        Constant Field Values
      • SHORT_NAME

        public static final java.lang.String SHORT_NAME
        The SHORTNAME for this implementation.
        See Also:
        Constant Field Values
      • mLogger

        protected LogManager mLogger
        The LogManager object which is used to log all the messages.
      • mProps

        protected PegasusProperties mProps
        The object holding all the properties pertaining to Pegasus.
      • mSubmitDir

        protected java.lang.String mSubmitDir
        The submit directory where the submit files are being generated for the workflow.
      • mExitParserArguments

        protected java.lang.String mExitParserArguments
        The argument string containing the arguments with which the exitcode is invoked on kickstart output.
      • mGenerateLOF

        protected boolean mGenerateLOF
        A boolean indicating whether to generate lof files or not.
      • mSLS

        protected SLS mSLS
        The handle to the SLS implementor
      • mPOptions

        protected PlannerOptions mPOptions
        The options passed to the planner.
      • mSiteStore

        protected SiteStore mSiteStore
        Handle to the site catalog store.
      • mEnablingPartOfAggregatedJob

        protected boolean mEnablingPartOfAggregatedJob
        An instance variable to track if enabling is happening as part of a clustered job. See Bug 21 comments on Pegasus Bugzilla
      • mWorkerPackageStagingEnabled

        protected boolean mWorkerPackageStagingEnabled
        Boolean indicating whether worker package staging is enabled or not.
    • Constructor Detail

      • NoGridStart

        public NoGridStart()
    • Method Detail

      • initialize

        public void initialize​(PegasusBag bag,
                               ADag dag)
        Initializes the GridStart implementation.
        Specified by:
        initialize in interface GridStart
        Parameters:
        bag - the bag of objects that is used for initialization.
        dag - the concrete dag so far.
      • enable

        public AggregatedJob enable​(AggregatedJob aggJob,
                                    java.util.Collection jobs)
        Enables a collection of jobs and puts them into an AggregatedJob. The assumption here is that all the jobs are being enabled by the same implementation. It enables the jobs and puts them into the AggregatedJob that is passed to it.
        Parameters:
        aggJob - the AggregatedJob into which the collection has to be integrated.
        jobs - the collection of jobs (Job) that need to be enabled.
        Returns:
        the AggregatedJob containing the enabled jobs.
        See Also:
        enable(Job,boolean)
      • enable

        public boolean enable​(AggregatedJob job,
                              boolean isGlobusJob)
        Enables a job to run on the grid. This also determines how the stdin,stderr and stdout of the job are to be propogated. To grid enable a job, the job may need to be wrapped into another job, that actually launches the job. It usually results in the job description passed being modified modified.
        Specified by:
        enable in interface GridStart
        Parameters:
        job - the Job object containing the job description of the job that has to be enabled on the grid.
        isGlobusJob - is true, if the job generated a line universe = globus, and thus runs remotely. Set to false, if the job runs on the submit host in any way.
        Returns:
        boolean true if enabling was successful,else false.
      • enable

        public boolean enable​(Job job,
                              boolean isGlobusJob)
        Enables a job to run on the grid by launching it directly. It ends up running the executable directly without going through any intermediate launcher executable. It connects the stdio, and stderr to underlying condor mechanisms so that they are transported back to the submit host.
        Specified by:
        enable in interface GridStart
        Parameters:
        job - the Job object containing the job description of the job that has to be enabled on the grid.
        isGlobusJob - is true, if the job generated a line universe = globus, and thus runs remotely. Set to false, if the job runs on the submit host in any way.
        Returns:
        boolean true if enabling was successful,else false in case when the path to kickstart could not be determined on the site where the job is scheduled.
      • handleTransferOfExecutable

        protected java.lang.String handleTransferOfExecutable​(Job job)
        It changes the paths to the executable depending on whether we want to transfer the executable or not. Currently, the transfer_executable is only handled for staged compute jobs, where Pegasus is staging the binaries to the remote site.
        Parameters:
        job - the Job containing the job description.
        Returns:
        the path that needs to be set as the executable key. If transfer_executable is not set the path to the executable is returned as is.
      • canSetXBit

        public boolean canSetXBit()
        Indicates whether the enabling mechanism can set the X bit on the executable on the remote grid site, in addition to launching it on the remote grid stie
        Specified by:
        canSetXBit in interface GridStart
        Returns:
        false, as no wrapper executable is being used.
      • getVDSKeyValue

        public java.lang.String getVDSKeyValue()
        Returns the value of the vds profile with key as Pegasus.GRIDSTART_KEY, that would result in the loading of this particular implementation. It is usually the name of the implementing class without the package name.
        Specified by:
        getVDSKeyValue in interface GridStart
        Returns:
        the value of the profile key.
        See Also:
        org.griphyn.cPlanner.namespace.Pegasus#GRIDSTART_KEY
      • shortDescribe

        public java.lang.String shortDescribe()
        Returns a short textual description in the form of the name of the class.
        Specified by:
        shortDescribe in interface GridStart
        Returns:
        short textual description.
      • defaultPOSTScript

        public java.lang.String defaultPOSTScript()
        Returns the SHORT_NAME for the POSTScript implementation that is used to be as default with this GridStart implementation.
        Specified by:
        defaultPOSTScript in interface GridStart
        Returns:
        the identifier for the NoPOSTScript POSTScript implementation.
        See Also:
        POSTScript.shortDescribe()
      • requiresToSetDirectory

        protected boolean requiresToSetDirectory​(Job job)
        Returns a boolean indicating whether we need to set the directory for the job or not.
        Parameters:
        job - the job for which to set directory.
        Returns:
      • getDirectory

        protected java.lang.String getDirectory​(Job job)
        Returns the directory in which the job should run.
        Parameters:
        job - the job in which the directory has to run.
        Returns:
      • getDirectoryKey

        private java.lang.String getDirectoryKey​(Job job)
        Returns the directory that is associated with the job to specify the directory in which the job needs to run
        Parameters:
        job - the job
        Returns:
        the condor key . can be initialdir or remote_initialdir
      • removeDirectoryKey

        private boolean removeDirectoryKey​(Job job)
        Returns a boolean indicating whether to remove remote directory information or not from the job. This is determined on the basis of the style key that is associated with the job.
        Parameters:
        job - the job in question.
        Returns:
        boolean
      • construct

        private void construct​(Job job,
                               java.lang.String key,
                               java.lang.String value)
        Constructs a condor variable in the condor profile namespace associated with the job. Overrides any preexisting key values.
        Parameters:
        job - contains the job description.
        key - the key of the profile.
        value - the associated value.
      • generateListofFilenamesFile

        public java.lang.String generateListofFilenamesFile​(java.util.Set files,
                                                            java.lang.String basename)
        Writes out the list of filenames file for the job.
        Parameters:
        files - the list of PegasusFile objects contains the files whose stat information is required.
        basename - the basename of the file that is to be created
        Returns:
        the full path to lof file created, else null if no file is written out.
      • addToFile

        private void addToFile​(java.io.File src,
                               java.io.OutputStream out)
                        throws java.io.IOException
        Adds contents to an output stream.
        Parameters:
        src -
        out -
        Throws:
        java.io.IOException
      • getWorkerNodeDirectory

        public java.lang.String getWorkerNodeDirectory​(Job job)
        Returns the directory in which the job executes on the worker node.
        Specified by:
        getWorkerNodeDirectory in interface GridStart
        Parameters:
        job -
        Returns:
        the full path to the directory where the job executes
      • useFullPathToGridStarts

        public void useFullPathToGridStarts​(boolean fullPath)
        Description copied from interface: GridStart
        Setter method to control whether a full path to Gridstart should be returned while wrapping a job or not.
        Specified by:
        useFullPathToGridStarts in interface GridStart
        Parameters:
        fullPath - if set to true, indicates that full path would be used.