Skip to content

Commit

Permalink
add port and metrics_port as command line args to seldon-core-microse…
Browse files Browse the repository at this point in the history
…rvice
  • Loading branch information
ntorba605 committed Jul 24, 2020
1 parent e84f710 commit 7275ff0
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions python/seldon_core/microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,22 @@ def main():
help="Force the Flask app to run single-threaded. Also applies to Gunicorn.",
)

parser.add_argument(
"--port",
type=int,
default=int(os.environ.get(SERVICE_PORT_ENV_NAME, DEFAULT_PORT)),
help="Set port of seldon service",
)

parser.add_argument(
"--metrics_port",
type=int,
default=int(
os.environ.get(METRICS_SERVICE_PORT_ENV_NAME, DEFAULT_METRICS_PORT)
),
help="Set port of seldon service",
)

args = parser.parse_args()
parameters = parse_parameters(json.loads(args.parameters))

Expand Down Expand Up @@ -313,10 +329,8 @@ def main():
else:
user_object = user_class(**parameters)

port = int(os.environ.get(SERVICE_PORT_ENV_NAME, DEFAULT_PORT))
metrics_port = int(
os.environ.get(METRICS_SERVICE_PORT_ENV_NAME, DEFAULT_METRICS_PORT)
)
port = args.port
metrics_port = args.metrics_port

if args.tracing:
tracer = setup_tracing(args.interface_name)
Expand Down

0 comments on commit 7275ff0

Please sign in to comment.