def start(self, task, deploy_id=None, tag=None, do_use=False): """Run a benchmark task. :param task: a file with yaml/json configration :param deploy_id: a UUID of a deployment :param tag: optional tag for this task """ task = os.path.expanduser(task) with open(task, 'rb') as task_file: config_dict = yaml.safe_load(task_file.read()) try: task = api.create_task(deploy_id, tag) print("=" * 80) print(_("Task %(tag)s %(uuid)s is started") % {"uuid": task["uuid"], "tag": task["tag"]}) print("-" * 80) api.start_task(deploy_id, config_dict, task=task) self.detailed(task_id=task['uuid']) if do_use: use.UseCommands().task(task['uuid']) except exceptions.InvalidConfigException: return(1) except KeyboardInterrupt: api.abort_task(task['uuid']) raise
def abort(self, task_id=None): """Abort started benchmarking task. :param task_id: Task uuid """ api.abort_task(task_id)
def start(self, task, deploy_id=None, tag=None, do_use=False): """Start benchmark task. :param task: a file with yaml/json configration :param deploy_id: a UUID of a deployment :param tag: optional tag for this task """ task = os.path.expanduser(task) with open(task, 'rb') as task_file: config_dict = yaml.safe_load(task_file.read()) try: task = api.create_task(deploy_id, tag) print("=" * 80) print( _("Task %(tag)s %(uuid)s is started") % { "uuid": task["uuid"], "tag": task["tag"] }) print("-" * 80) api.start_task(deploy_id, config_dict, task=task) self.detailed(task_id=task['uuid']) if do_use: use.UseCommands().task(task['uuid']) except exceptions.InvalidConfigException: return (1) except KeyboardInterrupt: api.abort_task(task['uuid']) raise
def abort(self, task_id): """Force abort task :param task_uuid: Task uuid """ try: api.abort_task(task_id) except Exception as e: print(_("Something went wrong %s") % e)
def abort(self, task_id=None): """Force abort task :param task_id: Task uuid """ api.abort_task(task_id)