aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.5k stars 1.17k forks source link

Add support for sam build for nodejs8.10 runtime #798

Closed ejhayes closed 5 years ago

ejhayes commented 5 years ago

Description:

It appears that build is only supported for python:

sam build
2018-11-27 00:47:08 Building resource 'MyNodejsLambdaFunction'
Error: 'nodejs8.10' runtime is not supported
Build Failed

It looks like this is currently set to only support python: https://github.com/awslabs/aws-sam-cli/blob/1b92321faaccf98d51176ad244ac88185dee2061/samcli/lib/build/app_builder.py#L48

Will nodejs be supported at some point in the future? This is useful for packages that require different binaries than my local development environment.

Steps to reproduce the issue:

  1. Run sam build for a function that uses nodejs8.10 runtime

Observed result:

sam build
2018-11-27 00:47:08 Building resource 'MyNodejsLambdaFunction'
Error: 'nodejs8.10' runtime is not supported
Build Failed

Expected result: Should run npm within a lambda container.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc) Mac v10.13.6 (High Sierra)

Output of sam --version:

SAM CLI, version 0.7.0

Optional Debug logs:

$ sam build --debug
Build Failed
2018-11-27 01:02:46 Using SAM Template at /var/opt/template.yaml
2018-11-27 01:02:46 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-11-27 01:02:46 Changing event name from before-call.apigateway to before-call.api-gateway
2018-11-27 01:02:46 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-11-27 01:02:46 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-11-27 01:02:46 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-11-27 01:02:46 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-11-27 01:02:46 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2018-11-27 01:02:46 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-11-27 01:02:46 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2018-11-27 01:02:46 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-11-27 01:02:46 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2018-11-27 01:02:46 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-11-27 01:02:46 Changing event name from before-call.apigateway to before-call.api-gateway
2018-11-27 01:02:46 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-11-27 01:02:46 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-11-27 01:02:46 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-11-27 01:02:46 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-11-27 01:02:46 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2018-11-27 01:02:46 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-11-27 01:02:46 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2018-11-27 01:02:46 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-11-27 01:02:46 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2018-11-27 01:02:46 'build' command is called
2018-11-27 01:02:46 Collected default values for parameters: {}
2018-11-27 01:02:46 2 resources found in the template
2018-11-27 01:02:46 Found Serverless function with name='MyNodejsLambdaFunction' and CodeUri='functions/MyNodejsLambdaFunction/src'
2018-11-27 01:02:46 Building resource 'MyNodejsLambdaFunction'
Error: 'nodejs8.10' runtime is not supported
sanathkr commented 5 years ago

Yes indeed! @gojko and the rest of Claudiajs team is going to help port over claudia pack command to sam build. See this thread - https://github.com/awslabs/aws-sam-cli/pull/743#pullrequestreview-170803039

ejhayes commented 5 years ago

Awesome, thanks @sanathkr !

jfuss commented 5 years ago

This was released in v0.9.0

Closing