From f4b460908146c2cf3ffbf5c8e9941ec063d25f6b Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Wed, 17 Aug 2022 03:17:24 -0700 Subject: [PATCH] feat: grpc support Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> --- bentoctl_sagemaker/create_deployable.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bentoctl_sagemaker/create_deployable.py b/bentoctl_sagemaker/create_deployable.py index 83cac5f..28ddf7d 100644 --- a/bentoctl_sagemaker/create_deployable.py +++ b/bentoctl_sagemaker/create_deployable.py @@ -55,6 +55,13 @@ def create_deployable( with bento_metafile.open("r", encoding="utf-8") as metafile: info = BentoInfo.from_yaml_file(metafile) + enable_grpc = False + if hasattr(info.python, "extras_require"): + enable_grpc = ( + info.python.extras_require is not None + and "grpc" in info.python.extras_require + ) + options = asdict(info.docker) options["dockerfile_template"] = TEMPLATE_PATH @@ -65,6 +72,7 @@ def create_deployable( DockerOptions(**options).with_defaults(), str(deployable_path), use_conda=not info.conda.is_empty(), + enable_grpc=enable_grpc, ) )