This message was deleted.
# ask-for-help
s
This message was deleted.
c
@ericyang what version of BentoML you are using?
you can find out by
import bentoml; bentoml.__version__
e
@Chaoyu bentoml: 0.5.3 aws-sam-cli: 0.33.1
c
@ericyang could you try run it with
--debug
option and provide us the log output?
Copy code
!bentoml --debug deployment create quick-start-guide-deployment2 \
    --bento=IrisClassifier:{svc.version} \
    --platform=aws-lambda \
    --region=us-east-2
e
I tried
--debug
but not work, this is output by added
--verbose
Copy code
[2019-12-06 13:23:28,425] DEBUG - Using BentoML with local Yatai server
[2019-12-06 13:23:28,588] DEBUG - Upgrading tables to the latest revision
[2019-12-06 13:23:30,538] DEBUG - Creating s3 bucket: btml-default-quick-start-guide-deployment123-7d9cf7 in region us-east-2
[2019-12-06 13:23:31,124] DEBUG - Uploading artifacts to S3 bucket
[2019-12-06 13:23:31,125] DEBUG - This lambda deployment requires uploading artifacts to s3
[2019-12-06 13:23:31,133] DEBUG - Uploading __init__.py to s3 btml-default-quick-start-guide-deployment123-7d9cf7/default/quick-start-guide-deployment123/artifacts/IrisClassifier/20191206112853_50C2F0/__init__.py
[2019-12-06 13:23:32,966] DEBUG - Uploading model.pkl to s3 btml-default-quick-start-guide-deployment123-7d9cf7/default/quick-start-guide-deployment123/artifacts/IrisClassifier/20191206112853_50C2F0/model.pkl
[2019-12-06 13:23:33,796] DEBUG - Created temporary directory: /private/var/folders/h6/m1nwlj4d0wvcnl65y7t3fxtm0000gn/T/bentoml-temp-6m4u2eup
[2019-12-06 13:23:33,796] DEBUG - Generating cloudformation template.yaml for lambda project at /private/var/folders/h6/m1nwlj4d0wvcnl65y7t3fxtm0000gn/T/bentoml-temp-6m4u2eup
Traceback (most recent call last):
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/bin/bentoml", line 8, in <module>
    sys.exit(cli())
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/cli/deployment.py", line 316, in create
    yatai_service,
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/yatai/python_api.py", line 296, in create_deployment
    apply_response = apply_deployment(deployment_dict, yatai_service)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/yatai/python_api.py", line 343, in apply_deployment
    ApplyDeploymentRequest(deployment=deployment_pb)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/yatai/yatai_service_impl.py", line 118, in ApplyDeployment
    response = operator.apply(request.deployment, self, previous_deployment)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/deployment/aws_lambda/__init__.py", line 188, in apply
    prev_deployment,
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/deployment/aws_lambda/__init__.py", line 278, in _apply
    validate_lambda_template(template_file_path)
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/bentoml/deployment/aws_lambda/utils.py", line 156, in validate_lambda_template
    validator.is_valid()
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samcli/commands/validate/lib/sam_template_validator.py", line 60, in is_valid
    template = sam_translator.translate(sam_template=self.sam_template, parameter_values={})
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samtranslator/translator/translator.py", line 67, in translate
    deployment_preference_collection = DeploymentPreferenceCollection()
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samtranslator/model/preferences/deployment_preference_collection.py", line 41, in __init__
    self.codedeploy_iam_role = self._codedeploy_iam_role()
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samtranslator/model/preferences/deployment_preference_collection.py", line 99, in _codedeploy_iam_role
    ArnGenerator.generate_aws_managed_policy_arn('service-role/AWSCodeDeployRoleForLambda')
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samtranslator/translator/arn_generator.py", line 29, in generate_aws_managed_policy_arn
    return 'arn:{}:iam::aws:policy/{}'.format(ArnGenerator.get_partition_name(),
  File "/Users/ericyang/miniconda3/envs/test-env-bentoml/lib/python3.7/site-packages/samtranslator/translator/arn_generator.py", line 49, in get_partition_name
    region_string = region.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
b
hi @ericyang I think this is the problem with BentoML code was not tested under the context of default
region
wasn't set for AWS. I am able to reproduce your error. I am fixing it now and will submit a PR. In the mean time, if you want to move forward without any blocking. You could do this to set default region in your
.aws/config
file.
Copy code
[default]
region = us-east-1
Thank you for catching this bug! @ericyang
e
@Bo by setting in config file, it can start to build lambda project! Your welcome! Also thank you guys for helping this issue!
building lambda project if succeed but met error after built, need help! command,
Copy code
!bentoml --verbose deployment create quick-start-guide-deployment13 \
    --bento IrisClassifier:{svc.version} \
    --platform aws-lambda \
error message,
Copy code
[2019-12-06 15:51:21,530] INFO - ApplyDeployment (quick-start-guide-deployment13, namespace default) succeeded
Created deployment quick-start-guide-deployment13, failed to retrieve latest status. INTERNAL:An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id default-quick-start-guide-deployment13 does not exist
b
hi @ericyang I have few suspects of this, but unfortunately, I am not able to reproduce your issue at the moment. Here is a few thing you could do to help me discover why you are receiving this error. 1. If the error message is all of the logs you saw in Jupyter notebook, can you run the same create command in your console to get the full list? (I saw you have --verbose on, there should be more logs than the very last lines) 2. The new release of Scikit-learn will break the quickstart, Can you lock the scikit-learn version to 0.20.3 in the BentoService definition cell?
Copy code
@env(pip_dependencies=['scikit-learn==0.20.3'])
3. Before you run the `create`command, could you run
delete
command first to make sure we are in a clean state?
Copy code
bentoml deployment delete quick-start-guide-deployment13
Thank you for helping us! Looking forward to see your logs and help you move forward.
e
@Bo I've set sklearn version to 0.20.3, also delete deployment before creating it Attached my full error log and notebook files! Thanks your help!
faced another error when running SageMaker example, try again but still error,
Failed to create deployment sentiment-sagemaker4. INTERNAL:Can't find proper Arn role for Sagemaker, please create one and try again
b
Thanks for the logs and notebook @ericyang. My initial hunch is something mis-configured with aws access. Let me look throu both deployment logs and your notebooks before I get back to you.
e
ok, thank you!