Closed hounddog22030 closed 1 year ago
Hi @hounddog22030,
Good morning.
Thanks for reporting the issue. Upon investigating further:
--function-architecture
for dotnet lambda package
command sets the --runtime argument if it is not already included as part of MSBuild parameters. For --function-architecture
set as arm64
, the --runtime
argument is set to linux-arm64
.dotnet lambda package-ci
command doesn't appear to have --function-architecture
as one of the supported parameters as evident from PackageCICommandOptions.For dotnet lambda package-ci
command, the workaround is to specify --msbuild-parameters
with value --runtime linux-arm64
. In other words, the command would look like dotnet lambda package-ci ... --msbuild-parameters "--runtime linux-arm64"
. Please let me know if it works for you.
Thanks, Ashish
Please let me know if it works for you.<<
Yep. Thanks! Do you want me to do a PR to add that to the documentation?
Please let me know if it works for you.<<
Yep. Thanks! Do you want me to do a PR to add that to the documentation?
@hounddog22030 I don't think this workaround should be a part documentation update. This should instead be discussed with team on the missing --function-architecture
for dotnet lambda package-ci
command. I would label this is a bug
so that it could be discussed with the team.
@hounddog22030 For the package-ci
command the tool uses the CloudFormation to determine what architecture to package the function for. So if you want to use ARM then set the Architectures
property on the function.
"Get": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "AWSServerless96::AWSServerless96.Functions::Get",
"Runtime": "dotnet6",
"Architectures" : ["arm64"],
"CodeUri": "",
"MemorySize": 256,
"Timeout": 30,
"Role": null,
"Policies": [
"AWSLambdaBasicExecutionRole"
],
"Events": {
"RootGet": {
"Type": "Api",
"Properties": {
"Path": "/",
"Method": "GET"
}
}
}
}
}
Thanks @normj for the inputs.
@hounddog22030 Please refer existing example template https://github.com/aws/aws-extensions-for-dotnet-cli/blob/master/testapps/TestServerlessWebApp/serverless-arm.template as reference. If this helps, kindly confirm if this issue could be closed.
@hounddog22030 For the
package-ci
command the tool uses the CloudFormation to determine what architecture to package the function for. So if you want to use ARM then set theArchitectures
property on the function."Get": { "Type": "AWS::Serverless::Function", "Properties": { "Handler": "AWSServerless96::AWSServerless96.Functions::Get", "Runtime": "dotnet6", "Architectures" : ["arm64"], "CodeUri": "", "MemorySize": 256, "Timeout": 30, "Role": null, "Policies": [ "AWSLambdaBasicExecutionRole" ], "Events": { "RootGet": { "Type": "Api", "Properties": { "Path": "/", "Method": "GET" } } } } }
I have confirmed this is as @normj describes. Didn't see that coming ;-) Do you want me to do a PR to document that?
@hounddog22030 I think a doc PR makes sense. I assume we are talking on the README. Also I realized the help on dotnet lambda package-ci --help
is pretty bad. If you want to make PR to improve it that would be great https://github.com/aws/aws-extensions-for-dotnet-cli/blob/master/src/Amazon.Lambda.Tools/Commands/PackageCICommand.cs#L15
PR: #229
I didn't dive into https://github.com/aws/aws-extensions-for-dotnet-cli/blob/master/src/Amazon.Lambda.Tools/Commands/PackageCICommand.cs#L15 (yet)
@hounddog22030 Somehow I do not see any concrete changes in the PR https://github.com/aws/aws-extensions-for-dotnet-cli/pull/229.
I think a doc PR makes sense
Per @normj, I did a "doc PR". Do you not see
PR: #229 I didn't dive into https://github.com/aws/aws-extensions-for-dotnet-cli/blob/master/src/Amazon.Lambda.Tools/Commands/PackageCICommand.cs#L15 (yet)
@hounddog22030 Somehow I do not see any concrete changes in the PR #229.
Sorry, I think the push failed. Please check again, I've pushed and verified it's there now.
Thanks for the doc PR @hounddog22030. I have merged in the changes.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the issue
We are trying to use
dotnet lambda package-ci
to package for arm64dotnet lambda package --help
documentation shows-farch | --function-architecture The architecture of the Lambda function. Valid values: x86_64 or arm64. Default is x86_64
Yet,
dotnet lambda package-ci --help
shows no switch for architecture.We have issued:
dotnet lambda package-ci ... --runtime linux-arm64
dotnet lambda package-ci ... --function-architecture arm64 --msbuild-parameters "--arch linux-arm64"
dotnet lambda package-ci ... --function-architecture arm64
These do not produce any arm64 results, all produce the publish command as something like
dotnet publish --output "/codebuild/output/src054284391/src/bbapi/WebApi/./bin/Release/net6.0/publish" --configuration "Release" --framework "net6.0" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained false
or an errorLinks
https://github.com/aws/aws-extensions-for-dotnet-cli