Make GRPC port configurable
diff --git a/chameleon/main.py b/chameleon/main.py
index fa63210..dbbca2f 100755
--- a/chameleon/main.py
+++ b/chameleon/main.py
@@ -33,14 +33,15 @@
defs = dict(
- #consul=os.environ.get('CONSUL', 'localhost:8500'),
- instance_id=os.environ.get('INSTANCE_ID', os.environ.get('HOSTNAME', '1')),
config=os.environ.get('CONFIG', './chameleon.yml'),
- internal_host_address=os.environ.get('INTERNAL_HOST_ADDRESS',
- get_my_primary_local_ipv4()),
+ consul=os.environ.get('CONSUL', 'localhost:8500'),
external_host_address=os.environ.get('EXTERNAL_HOST_ADDRESS',
get_my_primary_local_ipv4()),
+ grpc_endpoint=os.environ.get('GRPC_ENDPOINT', 'localhost:50055'),
fluentd=os.environ.get('FLUENTD', None),
+ instance_id=os.environ.get('INSTANCE_ID', os.environ.get('HOSTNAME', '1')),
+ internal_host_address=os.environ.get('INTERNAL_HOST_ADDRESS',
+ get_my_primary_local_ipv4()),
rest_port=os.environ.get('REST_PORT', 8881),
)
@@ -58,13 +59,11 @@
default=defs['config'],
help=_help)
- '''
_help = '<hostname>:<port> to consul agent (default: %s)' % defs['consul']
parser.add_argument(
'-C', '--consul', dest='consul', action='store',
default=defs['consul'],
help=_help)
- '''
_help = ('<hostname> or <ip> at which Chameleon is reachable from outside '
'the cluster (default: %s)' % defs['external_host_address'])
diff --git a/voltha/main.py b/voltha/main.py
index 5c87795..a3badea 100755
--- a/voltha/main.py
+++ b/voltha/main.py
@@ -36,15 +36,16 @@
from voltha.structlog_setup import setup_logging
defs = dict(
- consul=os.environ.get('CONSUL', 'localhost:8500'),
- instance_id=os.environ.get('INSTANCE_ID', os.environ.get('HOSTNAME', '1')),
config=os.environ.get('CONFIG', './voltha.yml'),
- interface=os.environ.get('INTERFACE', get_my_primary_interface()),
- internal_host_address=os.environ.get('INTERNAL_HOST_ADDRESS',
- get_my_primary_local_ipv4()),
+ consul=os.environ.get('CONSUL', 'localhost:8500'),
external_host_address=os.environ.get('EXTERNAL_HOST_ADDRESS',
get_my_primary_local_ipv4()),
fluentd=os.environ.get('FLUENTD', None),
+ grpc_port=os.environ.get('GRPC_PORT', 50055),
+ instance_id=os.environ.get('INSTANCE_ID', os.environ.get('HOSTNAME', '1')),
+ internal_host_address=os.environ.get('INTERNAL_HOST_ADDRESS',
+ get_my_primary_local_ipv4()),
+ interface=os.environ.get('INTERFACE', get_my_primary_interface()),
rest_port=os.environ.get('REST_PORT', 8880),
)
@@ -76,6 +77,14 @@
default=defs['external_host_address'],
help=_help)
+ _help = ('port number of the GRPC service exposed by voltha (default: %s)'
+ % defs['grpc_port'])
+ parser.add_argument('-g', '--grpc-port',
+ dest='grpc_port',
+ action='store',
+ default=defs['grpc_port'],
+ help=_help)
+
_help = ('<hostname>:<port> to fluentd server (default: %s). (If not '
'specified (None), the address from the config file is used'
% defs['fluentd'])
@@ -220,7 +229,7 @@
consul=self.args.consul)
init_rest_service(self.args.rest_port)
- self.grpc_server = VolthaGrpcServer().run()
+ self.grpc_server = VolthaGrpcServer(self.args.grpc_port).run()
self.log.info('started-internal-services')