def start(self): # Select how we are going to start it cls = RUNNER_CLS_MAPPING[cfg_helpers.fetch_run_type(self.cfg)] instance = cls(self.cfg, self.component_name, self.trace_dir) am_started = 0 for app_info in self._get_apps_to_start(): app_name = app_info["name"] app_pth = app_info.get("path", app_name) app_dir = app_info.get("app_dir", self.app_dir) # Adjust the program options now that we have real locations program_opts = utils.param_replace_list( self._get_app_options(app_name), self._get_param_map(app_name), ) # Start it with the given settings LOG.debug("Starting [%s] with options [%s]", app_name, ", ".join(program_opts)) info_fn = instance.start( app_name, (app_pth, app_dir, program_opts), ) LOG.debug("Started [%s] details are in [%s]", app_name, info_fn) # This trace is used to locate details about what to stop self.tracewriter.started_info(app_name, info_fn) am_started += 1 return am_started
def start(self): # Select how we are going to start it cls = RUNNER_CLS_MAPPING[cfg_helpers.fetch_run_type(self.cfg)] instance = cls(self.cfg, self.component_name, self.trace_dir) am_started = 0 for app_info in self._get_apps_to_start(): app_name = app_info["name"] app_pth = app_info.get("path", app_name) app_dir = app_info.get("app_dir", self.app_dir) # Adjust the program options now that we have real locations program_opts = utils.param_replace_list( self._get_app_options(app_name), self._get_param_map(app_name), ) # Start it with the given settings LOG.debug("Starting %r with options (%s)", app_name, ", ".join(program_opts)) info_fn = instance.start(app_name, (app_pth, app_dir, program_opts), ) LOG.info("Started %r details are in %r", app_name, info_fn) # This trace is used to locate details about what to stop self.tracewriter.started_info(app_name, info_fn) am_started += 1 return am_started
def configure(self): # First make a pass and make sure all runtime (e.g. upstart) # config files are in place.... cls = RUNNER_CLS_MAPPING[cfg_helpers.fetch_run_type(self.cfg)] instance = cls(self.cfg, self.component_name, self.trace_dir) tot_am = 0 for app_info in self._get_apps_to_start(): app_name = app_info["name"] app_pth = app_info.get("path", app_name) app_dir = app_info.get("app_dir", self.app_dir) # Adjust the program options now that we have real locations program_opts = utils.param_replace_list(self._get_app_options(app_name), self._get_param_map(app_name)) # Configure it with the given settings LOG.debug("Configuring runner for program [%s]", app_name) cfg_am = instance.configure(app_name, (app_pth, app_dir, program_opts)) LOG.debug("Configured %s files for runner for program [%s]", cfg_am, app_name) tot_am += cfg_am return tot_am
def configure(self): # First make a pass and make sure all runtime (e.g. upstart) # config files are in place.... cls = RUNNER_CLS_MAPPING[cfg_helpers.fetch_run_type(self.cfg)] instance = cls(self.cfg, self.component_name, self.trace_dir) tot_am = 0 for app_info in self._get_apps_to_start(): app_name = app_info["name"] app_pth = app_info.get("path", app_name) app_dir = app_info.get("app_dir", self.app_dir) # Adjust the program options now that we have real locations program_opts = utils.param_replace_list( self._get_app_options(app_name), self._get_param_map(app_name), ) # Configure it with the given settings LOG.debug("Configuring runner for program [%s]", app_name) cfg_am = instance.configure(app_name, (app_pth, app_dir, program_opts)) LOG.debug("Configured %s files for runner for program [%s]", cfg_am, app_name) tot_am += cfg_am return tot_am