Commit eccabd82 authored by Daniele Venzano's avatar Daniele Venzano

Make the gateway image name configurable, remove the private registry configuration

parent fbbee1ac
......@@ -505,8 +505,8 @@ class ArgumentParser(argparse.ArgumentParser):
return keys
def _open_config_files(self, command_line_args):
"""Tries to parse config file path(s) from within command_line_args.
Returns a list of opened config files, including files specified on the
"""Tries to parse config file path(s) from within command_line_args.
Returns a list of opened config files, including files specified on the
commandline as well as any default_config_files specified in the
constructor that are present on disk.
......@@ -538,14 +538,14 @@ class ArgumentParser(argparse.ArgumentParser):
arg_parser._add_action(action)
# make parser not exit on error by replacing its error method.
# Otherwise it sys.exits(..) if, for example, config file
# Otherwise it sys.exits(..) if, for example, config file
# is_required=True and user doesn't provide it.
def error_method(self, message):
pass
arg_parser.error = types.MethodType(error_method, arg_parser)
# check whether the user provided a value
# check whether the user provided a value
parsed_arg = arg_parser.parse_known_args(args=command_line_args)
if not parsed_arg:
continue
......@@ -589,7 +589,7 @@ class ArgumentParser(argparse.ArgumentParser):
return r.getvalue()
def print_values(self, file=sys.stdout):
def print_values(self, file=sys.stderr):
"""Prints the format_values() string (to sys.stdout or another file)."""
file.write(self.format_values())
......
......@@ -41,7 +41,8 @@ def load_configuration(test_conf=None):
args_for_writing_out_config_file=["--write-config"])
argparser.add_argument('--debug', action='store_true', help='Enable debug output')
argparser.add_argument('--swarm', help='Swarm/Docker API endpoint (ex.: zk://zk1:2181,zk2:2181 or http://swarm:2380)', default='http://localhost:2375')
argparser.add_argument('--private-registry', help='Docker private registry address (ex.: 10.0.0.1:5000)', default='10.0.0.1:5000')
argparser.add_argument('--guest-gateway-image-name', help='Docker image for guests gateway container (ex.: zoerepo/guest-gateway)', default='zoerepo/guest-gateway')
argparser.add_argument('--user-gateway-image-name', help='Docker image for users gateway container (ex.: zoerepo/guest-gateway)', default='zoerepo/guest-gateway')
argparser.add_argument('--state-dir', help='Directory where state checkpoints are saved', default='/var/lib/zoe')
argparser.add_argument('--listen-address', help='REST API listen address', default='0.0.0.0')
argparser.add_argument('--listen-port', help='REST API listen port', default='4850')
......@@ -52,7 +53,7 @@ def load_configuration(test_conf=None):
argparser.add_argument('--influxdb-enable', action="store_true", help='Enable metric output toward influxDB')
argparser.add_argument('--passlib-rounds', type=int, help='Number of hashing rounds for passwords', default=60000)
argparser.add_argument('--gelf-address', help='Enable Docker GELF log output to this destination (ex. udp://1.2.3.4:1234)', default='')
argparser.add_argument('--workspace-base-path', help='Path where user workspaces will be created by Zoe. Must be visible at this path on all Swarm hosts.', default='/mnt/nfs/zoe-workspaces')
argparser.add_argument('--workspace-base-path', help='Path where user workspaces will be created by Zoe. Must be visible at this path on all Swarm hosts.', default='/mnt/zoe-workspaces')
argparser.add_argument('--enable-hdfs-workspace', help='Enable support for creating workspaces in HDFS', action='store_true')
argparser.add_argument('--hdfs-namenode', help='IP:port of the NameNode to use for workspace management', default='127.0.0.1:8020')
argparser.add_argument('--hdfs-network', help='If HDFS is in a Docker network, provide here the network ID', default='')
......@@ -60,6 +61,7 @@ def load_configuration(test_conf=None):
opts = argparser.parse_args()
if opts.debug:
argparser.print_values()
_conf = opts
else:
_conf = test_conf
......
......@@ -173,9 +173,9 @@ class PlatformManager:
}
copts.restart = True
if user.role == 'guest':
image = get_conf().private_registry + '/zoerepo/guest-gateway'
image = get_conf().guest_gateway_image_name
else:
image = get_conf().private_registry + '/zoerepo/guest-gateway' # TODO: create an image with ssh
image = get_conf().user_gateway_image_name
cont_info = self.swarm.spawn_container(image, copts)
if cont_info is None:
raise ZoeException('Cannot create user gateway container')
......
......@@ -25,7 +25,6 @@ class TestConf:
def __init__(self):
self.debug = True
self.zk = 'zk:2181'
self.private_registry = '127.0.0.1:5000'
self.state_dir = '/tmp/zoe'
self.zoeadmin_password = 'test'
self.passlib_rounds = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment