Skip to content

Commit

Permalink
factored out parse_args (#4213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuyi Xue committed Jul 14, 2022
1 parent 4f848fd commit 685f5cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions python/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.coverage*
vscode
25 changes: 15 additions & 10 deletions python/seldon_core/microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,7 @@ def setup_logger(log_level: str, debug_mode: bool) -> logging.Logger:
return logger


def main():
LOG_FORMAT = (
"%(asctime)s - %(name)s:%(funcName)s:%(lineno)s - %(levelname)s: %(message)s"
)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logger.info("Starting microservice.py:main")
logger.info(f"Seldon Core version: {__version__}")

sys.path.append(os.getcwd())
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("interface_name", type=str, help="Name of the user interface.")

Expand Down Expand Up @@ -358,7 +350,20 @@ def main():
help="Number of GPRC workers.",
)

args, remaining = parser.parse_known_args()
return parser.parse_known_args()


def main():
LOG_FORMAT = (
"%(asctime)s - %(name)s:%(funcName)s:%(lineno)s - %(levelname)s: %(message)s"
)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logger.info("Starting microservice.py:main")
logger.info(f"Seldon Core version: {__version__}")

sys.path.append(os.getcwd())

args, remaining = parse_args()

if len(remaining) > 0:
logger.error(
Expand Down

0 comments on commit 685f5cf

Please sign in to comment.