Merge "Revert "Add scheduler hint for zunclient""
This commit is contained in:
@@ -112,13 +112,6 @@ class CreateContainer(command.ShowOne):
|
|||||||
metavar='<command>',
|
metavar='<command>',
|
||||||
nargs=argparse.REMAINDER,
|
nargs=argparse.REMAINDER,
|
||||||
help='Send command to the container')
|
help='Send command to the container')
|
||||||
parser.add_argument(
|
|
||||||
'--hint',
|
|
||||||
metavar='key=value',
|
|
||||||
action='append',
|
|
||||||
default=[],
|
|
||||||
help='Container hint key/value pairs for scheduler to select'
|
|
||||||
' host. May be used multiple times.')
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
@@ -141,9 +134,6 @@ class CreateContainer(command.ShowOne):
|
|||||||
if parsed_args.interactive:
|
if parsed_args.interactive:
|
||||||
opts['interactive'] = True
|
opts['interactive'] = True
|
||||||
|
|
||||||
hints = zun_utils.format_args(parsed_args.hint)
|
|
||||||
opts['hint'] = hints
|
|
||||||
|
|
||||||
opts = zun_utils.remove_null_parms(**opts)
|
opts = zun_utils.remove_null_parms(**opts)
|
||||||
container = client.containers.create(**opts)
|
container = client.containers.create(**opts)
|
||||||
columns = _container_columns(container)
|
columns = _container_columns(container)
|
||||||
@@ -586,13 +576,6 @@ class RunContainer(command.ShowOne):
|
|||||||
metavar='<command>',
|
metavar='<command>',
|
||||||
nargs=argparse.REMAINDER,
|
nargs=argparse.REMAINDER,
|
||||||
help='Send command to the container')
|
help='Send command to the container')
|
||||||
parser.add_argument(
|
|
||||||
'--hint',
|
|
||||||
metavar='key=value',
|
|
||||||
action='append',
|
|
||||||
default=[],
|
|
||||||
help='Container hint key/value pairs for scheduler to select'
|
|
||||||
' host. May be used multiple times.')
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
@@ -615,9 +598,6 @@ class RunContainer(command.ShowOne):
|
|||||||
if parsed_args.interactive:
|
if parsed_args.interactive:
|
||||||
opts['interactive'] = True
|
opts['interactive'] = True
|
||||||
|
|
||||||
hints = zun_utils.format_args(parsed_args.hint)
|
|
||||||
opts['hint'] = hints
|
|
||||||
|
|
||||||
opts = zun_utils.remove_null_parms(**opts)
|
opts = zun_utils.remove_null_parms(**opts)
|
||||||
container = client.containers.run(**opts)
|
container = client.containers.run(**opts)
|
||||||
columns = _container_columns(container)
|
columns = _container_columns(container)
|
||||||
|
@@ -21,8 +21,7 @@ from zunclient import exceptions
|
|||||||
|
|
||||||
CREATION_ATTRIBUTES = ['name', 'image', 'command', 'cpu', 'memory',
|
CREATION_ATTRIBUTES = ['name', 'image', 'command', 'cpu', 'memory',
|
||||||
'environment', 'workdir', 'labels', 'image_pull_policy',
|
'environment', 'workdir', 'labels', 'image_pull_policy',
|
||||||
'restart_policy', 'interactive', 'image_driver',
|
'restart_policy', 'interactive', 'image_driver']
|
||||||
'hint']
|
|
||||||
|
|
||||||
|
|
||||||
class Container(base.Resource):
|
class Container(base.Resource):
|
||||||
|
@@ -85,12 +85,6 @@ def _show_container(container):
|
|||||||
metavar='<command>',
|
metavar='<command>',
|
||||||
nargs=argparse.REMAINDER,
|
nargs=argparse.REMAINDER,
|
||||||
help='Send command to the container')
|
help='Send command to the container')
|
||||||
@utils.arg('--hint',
|
|
||||||
action='append',
|
|
||||||
default=[],
|
|
||||||
metavar='<key=value>',
|
|
||||||
help='Container hint key/value pairs for scheduler to select'
|
|
||||||
' host. May be used multiple times.')
|
|
||||||
def do_create(cs, args):
|
def do_create(cs, args):
|
||||||
"""Create a container."""
|
"""Create a container."""
|
||||||
opts = {}
|
opts = {}
|
||||||
@@ -103,10 +97,6 @@ def do_create(cs, args):
|
|||||||
opts['labels'] = zun_utils.format_args(args.label)
|
opts['labels'] = zun_utils.format_args(args.label)
|
||||||
opts['image_pull_policy'] = args.image_pull_policy
|
opts['image_pull_policy'] = args.image_pull_policy
|
||||||
opts['image_driver'] = args.image_driver
|
opts['image_driver'] = args.image_driver
|
||||||
|
|
||||||
hints = zun_utils.format_args(args.hint)
|
|
||||||
opts['hint'] = hints
|
|
||||||
|
|
||||||
if args.command:
|
if args.command:
|
||||||
opts['command'] = ' '.join(args.command)
|
opts['command'] = ' '.join(args.command)
|
||||||
if args.restart:
|
if args.restart:
|
||||||
@@ -425,12 +415,6 @@ def do_kill(cs, args):
|
|||||||
metavar='<command>',
|
metavar='<command>',
|
||||||
nargs=argparse.REMAINDER,
|
nargs=argparse.REMAINDER,
|
||||||
help='Send command to the container')
|
help='Send command to the container')
|
||||||
@utils.arg('--hint',
|
|
||||||
action='append',
|
|
||||||
default=[],
|
|
||||||
metavar='<key=value>',
|
|
||||||
help='Container hint key/value pairs for scheduler to select'
|
|
||||||
' host. May be used multiple times.')
|
|
||||||
def do_run(cs, args):
|
def do_run(cs, args):
|
||||||
"""Run a command in a new container."""
|
"""Run a command in a new container."""
|
||||||
opts = {}
|
opts = {}
|
||||||
@@ -443,10 +427,6 @@ def do_run(cs, args):
|
|||||||
opts['labels'] = zun_utils.format_args(args.label)
|
opts['labels'] = zun_utils.format_args(args.label)
|
||||||
opts['image_pull_policy'] = args.image_pull_policy
|
opts['image_pull_policy'] = args.image_pull_policy
|
||||||
opts['image_driver'] = args.image_driver
|
opts['image_driver'] = args.image_driver
|
||||||
|
|
||||||
hints = zun_utils.format_args(args.hint)
|
|
||||||
opts['hint'] = hints
|
|
||||||
|
|
||||||
if args.command:
|
if args.command:
|
||||||
opts['command'] = ' '.join(args.command)
|
opts['command'] = ' '.join(args.command)
|
||||||
if args.restart:
|
if args.restart:
|
||||||
|
Reference in New Issue
Block a user