def _load_job_config(args): if args.base64: base64_job_config = args.base64 job_config = from_base64_json(base64_job_config) else: job_config = json.load(open(args.file, "r")) return job_config
def load(self): load_kwds = dict(app_name=self.app_name) if self.app_conf_base64: from pulsar.client.util import from_base64_json local_conf = from_base64_json(self.app_conf_base64) load_kwds["local_conf"] = local_conf else: load_kwds.update( dict( config_dir=self.config_dir, ini_path=self.ini_path, app_conf_path=self.app_conf_path, )) return load_app_configuration(**load_kwds)
def load(self): load_kwds = dict( app_name=self.app_name ) if self.app_conf_base64: from pulsar.client.util import from_base64_json local_conf = from_base64_json(self.app_conf_base64) load_kwds["local_conf"] = local_conf else: load_kwds.update(dict( config_dir=self.config_dir, ini_path=self.ini_path, app_conf_path=self.app_conf_path, )) return load_app_configuration(**load_kwds)
def run_task(): try: log.info("Running task %s" % task.task_id.value) task_data = from_base64_json(task.data) manager_options = task_data["manager"] config_builder = PulsarManagerConfigBuilder(**manager_options) manager, pulsar_app = manager_from_args(config_builder) job_config = task_data["job"] submit_job(manager, job_config) self.__task_update(driver, task, mesos_pb2.TASK_RUNNING) wait_for_job(manager, job_config) self.__task_update(driver, task, mesos_pb2.TASK_FINISHED) pulsar_app.shutdown() except Exception: log.exception("Failed to run, update, or monitor task %s" % task) raise