mirror of
https://github.com/clearml/clearml-serving
synced 2025-02-11 23:23:49 +00:00
Add --debug
This commit is contained in:
parent
7a78743b7c
commit
435c537bca
@ -37,7 +37,7 @@ def cmd_triton(args):
|
|||||||
if not args.id and not args.name:
|
if not args.id and not args.name:
|
||||||
raise ValueError("Serving service must have a name, use --name <service_name>")
|
raise ValueError("Serving service must have a name, use --name <service_name>")
|
||||||
|
|
||||||
if args.id:
|
if args.id and not args.project and not args.name:
|
||||||
a_serving = ServingService(task_id=args.id)
|
a_serving = ServingService(task_id=args.id)
|
||||||
else:
|
else:
|
||||||
a_serving = ServingService(task_project=args.project, task_name=args.name, engine_type='triton')
|
a_serving = ServingService(task_project=args.project, task_name=args.name, engine_type='triton')
|
||||||
@ -87,10 +87,11 @@ def cmd_launch(args):
|
|||||||
a_serving.launch_engine(queue_name=args.queue)
|
a_serving.launch_engine(queue_name=args.queue)
|
||||||
|
|
||||||
|
|
||||||
def cli():
|
def cli(verbosity):
|
||||||
title = 'clearml-serving - CLI for launching ClearML serving engine'
|
title = 'clearml-serving - CLI for launching ClearML serving engine'
|
||||||
print(title)
|
print(title)
|
||||||
parser = ArgumentParser(prog='clearml-serving', description=title)
|
parser = ArgumentParser(prog='clearml-serving', description=title)
|
||||||
|
parser.add_argument('--debug', action='store_true', help='Print debug messages')
|
||||||
subparsers = parser.add_subparsers(help='Serving engine commands', dest='command')
|
subparsers = parser.add_subparsers(help='Serving engine commands', dest='command')
|
||||||
|
|
||||||
# create the launch command
|
# create the launch command
|
||||||
@ -142,6 +143,7 @@ def cli():
|
|||||||
parser_trt.set_defaults(func=cmd_triton)
|
parser_trt.set_defaults(func=cmd_triton)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
verbosity['debug'] = args.debug
|
||||||
args = restore_state(args)
|
args = restore_state(args)
|
||||||
|
|
||||||
if args.command:
|
if args.command:
|
||||||
@ -151,12 +153,15 @@ def cli():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
verbosity = dict(debug=False)
|
||||||
try:
|
try:
|
||||||
cli()
|
cli(verbosity)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('\nUser aborted')
|
print('\nUser aborted')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print('\nError: {}'.format(ex))
|
print('\nError: {}'.format(ex))
|
||||||
|
if verbosity.get('debug'):
|
||||||
|
raise ex
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user