Skip to content
Permalink
Browse files

aws lambda deployment v2 (#380)

* use aws sam for lambda deployment 2.0

* update deployment pb for lambda

* use python lib for clean up files

* pep8

* add s3_region, s3_path option for lambda

* change name from s3_prefix to s3_path

* update app.py template

* adding tests for lambda operator v2

* use urllib from six

* move download_artifacts from app.py to bentoml

* add more tests

* format for pop8

* update config setting name

* Add tests for apply success

* update apply and _apply

* update base on comments

* update base on comments

* update variable naming

* update base on comments

* drop support for python2

* parse version without packaging lib

* pep8

* remove s3 path/region param

* remove s3_path related

* remove s3_path, s3_region option for lambda

* pep8 format

* refactor api_name check

* update logger level

* pep8 and cleanup after finish with the temp dir

* add aws-sam-cli to setup.py

* make sure use created s3 bucket for apply

* turn on sam by default

* mock where it counts

* renaming funcs

* move s3 functions to utils/s3

* update base on comments

* move from string to py file

* update env naming for lambda deployment
  • Loading branch information
yubozhao committed Nov 26, 2019
1 parent 698e3f1 commit 49105440fd7606550feabd5b377418b86c91710a
@@ -233,6 +233,21 @@ def deployment():
@click.option(
'--replicas',
help='Number of replicas. Option applicable to platform: Kubernetes',
type=click.INT,
)
@click.option(
'--memory-size',
help='Memory size for lambda function. '
'Option applicable to platform: aws-lambda',
type=click.INT,
default=1024,
)
@click.option(
'--timeout',
help='function timeout for lambda function. '
'Option applicable to platform: aws-lambda',
type=click.INT,
default=6,
)
@click.option(
'--service-name',
@@ -265,6 +280,8 @@ def create(
replicas,
service_name,
service_type,
memory_size,
timeout,
wait,
):
# converting platform parameter to DeploymentOperator name in proto
@@ -280,6 +297,8 @@ def create(
'replicas': replicas,
'service_name': service_name,
'service_type': service_type,
'memory_size': memory_size,
'timeout': timeout,
}
yatai_service = get_yatai_service()
result = create_deployment(
@@ -371,7 +390,7 @@ def apply(deployment_yaml, output, wait):
namespace=deployment_yaml.get('namespace'),
message='Applying deployment',
)
if result_state.status.status_code != status_pb2.OK:
if result_state.status.status_code != status_pb2.Status.OK:
_echo(
'Created deployment {name}, failed to retrieve latest'
' status. {error_code}:{error_message}'.format(
@@ -75,3 +75,7 @@ default_region = us-west2
[sagemaker]
default_instance_type = ml.m4.xlarge
default_instance_count = 1

[experiment]
# This is experiment deployment method for Lambda, using AWS's SAM tool
aws_lambda_v2 = true

0 comments on commit 4910544

Please sign in to comment.
You can’t perform that action at this time.