Exemple #1
0
    def __init__(self,
                 aCmdLineParameters,
                 aSysArgs,
                 aConfigPath=None,
                 aSingleRun=False,
                 aAddOpts=False):
        """Initialize ApplicationSetup object."""
        lsf_info = self._getAppConfig('lsf')
        self._mAppsInfo = ApplicationsInfo(lsf_info)

        # Setting the config path for access in master run (so we can pass it to forrest run)
        self._mAppsInfo.mConfigPath = aConfigPath

        # Getting workflow lists
        (single_run_app_opts,
         sequence_app_opts) = self._getWorkflow(aConfigPath)

        # Populate single run applications options
        if aSingleRun:
            """ TODO: The output directory hasn't been initialized when
             we get to this point, so we aren't able to determine if the 
             workflow file should be written to output/regression/ or 
             output/performance/ yet. Ideally we would set up all of 
             master run before doing any application setup, but the 
             current implementation is the other way around. Fixing this
             issue is too large an effort for something this small, but
             this should be revisited when 1) we decide to knock out
             some of the major technical debt that master run has
             accrued, 2) we decide on being able to include workflow in
             control files, or 3) we decide to start explicitly logging
             workflow files. For now, workflow is being passed into
             forrest run via the config file."""

            # self._mAppsInfo.mConfigPath = self._buildTemporaryWorkflowFile(single_run_app_opts, sequence_app_opts)

            for app_name, app_opts in single_run_app_opts:
                app_info = self._getAppConfig(app_name)
                self._mAppsInfo.addSingleRunApplication(app_info)
                self._addWorkflowToSysArgs(aSysArgs, app_name, app_opts)

        # Populate sequence applications options
        for app_name, app_opts in sequence_app_opts:
            app_info = self._getAppConfig(app_name)
            self._mAppsInfo.addSequenceApplication(app_info)
            if aSingleRun:  # We don't need to add these to forrest run's command line
                self._addWorkflowToSysArgs(aSysArgs, app_name, app_opts)

        # Add options from applications if necessary
        if aAddOpts:
            self._addAppOptions(aCmdLineParameters)

        self._mAppsInfo.mCmdLineOpts = CmdLineOpts(aCmdLineParameters,
                                                   aSysArgs)

        # Let applications that have added parameters receive the parsed result.
        if aAddOpts:
            self._resolveParameters()
Exemple #2
0
    def __init__(
        self,
        aCmdLineParameters,
        aSysArgs,
        aConfigPath=None,
        aSingleRun=False,
        aAddOpts=False,
    ):
        """Initialize ApplicationSetup object."""
        lsf_info = self._getAppConfig("lsf")
        self._mAppsInfo = ApplicationsInfo(lsf_info)

        # Setting the config path for access in master run (so we can pass it
        # to forrest run)
        self._mAppsInfo.mConfigPath = aConfigPath

        # Getting workflow lists
        (single_run_app_opts,
         sequence_app_opts) = self._getWorkflow(aConfigPath)

        # Populate single run applications options
        if aSingleRun:
            for app_name, app_opts in single_run_app_opts:
                app_info = self._getAppConfig(app_name)
                self._mAppsInfo.addSingleRunApplication(app_info)
                self._addWorkflowToSysArgs(aSysArgs, app_name, app_opts)

        # Populate sequence applications options
        for app_name, app_opts in sequence_app_opts:
            app_info = self._getAppConfig(app_name)
            self._mAppsInfo.addSequenceApplication(app_info)
            if (aSingleRun
                ):  # We don't need to add these to forrest run's command line
                self._addWorkflowToSysArgs(aSysArgs, app_name, app_opts)

        # Add options from applications if necessary
        if aAddOpts:
            self._addAppOptions(aCmdLineParameters)

        self._mAppsInfo.mCmdLineOpts = CmdLineOpts(aCmdLineParameters,
                                                   aSysArgs)

        # Let applications that have added parameters receive the parsed
        # result.
        if aAddOpts:
            self._resolveParameters()