Skip to content

Commit

Permalink
Make gg_framework parameterized
Browse files Browse the repository at this point in the history
  • Loading branch information
faromero committed Sep 10, 2021
1 parent 316f685 commit 10a3741
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions function-images/gg_framework/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
import helloworld_pb2
import helloworld_pb2_grpc

import json
import os
import sys
import json
import argparse
from base64 import b64decode, b64encode

curdir = os.path.dirname(__file__)
Expand All @@ -49,6 +50,16 @@

app = Flask(__name__)

def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--host', '-H', type=str, required=False,
dest='host', default='0.0.0.0',
help='App host IP')
parser.add_argument('--port', '-p', type=int, required=False,
dest='port', default=50051,
help='App port')
return parser.parse_args()

def is_hash_for_thunk(hash):
return len(hash) > 0 and hash[0] == 'T'

Expand Down Expand Up @@ -130,4 +141,6 @@ def hello():


if __name__ == '__main__':
app.run(host="0.0.0.0", port=50051, debug=True)
args = get_args()
app.run(host=args.host, port=args.port, debug=True)

0 comments on commit 10a3741

Please sign in to comment.