Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot publish application with ARM64 support #3346

Closed
EldarAliiev opened this issue Oct 1, 2021 · 7 comments
Closed

Cannot publish application with ARM64 support #3346

EldarAliiev opened this issue Oct 1, 2021 · 7 comments
Labels
area/publish sam publish command stage/in-progress A fix is being worked on

Comments

@EldarAliiev
Copy link

Description:

Cannot publish new version of my SAM application with architecture selector.

Steps to reproduce:

Define possible architectures as parameter:

Parameters:
  FunctionArchitecture:
    Type: String
    Description: Lambda function architecture (x86_64, arm64)
    AllowedValues:
      - x86_64
      - arm64
    Default: x86_64
...

Use this parameter as function architecture:

Resources:
  LambdaFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: .
      Handler: index.handler
      Runtime: nodejs12.x
      Architectures:
      - Ref: FunctionArchitecture
...

Observed result:

2021-10-01 21:24:54,937 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2021-10-01 21:24:54,938 | Using config file: samconfig.toml, config environment: default
2021-10-01 21:24:54,938 | Expand command line arguments to:
2021-10-01 21:24:54,938 | --template_file=/usr/app/src/src/cloudwatch/packaged.yaml --semantic_version=1.0.7 
Publish Failed
2021-10-01 21:24:56,045 | Failed to publish application to serverlessrepo
Traceback (most recent call last):
  File "samcli/commands/publish/command.py", line 86, in do_cli
  File "serverlessrepo/publish.py", line 70, in publish_application
serverlessrepo.exceptions.ServerlessRepoClientError: Invalid Serverless Application Specification document. Number of errors found: 1. Errors: Resource with id [LambdaFunction] is invalid. property Architectures not defined for resource of type AWS::Serverless::Function
2021-10-01 21:24:56,046 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '77f8e448-7839-4350-b6cc-7dce12570319', 'installationId': '3bd4db58-2d09-4808-a908-5cab90eab61e', 'sessionId': 'fb1752a3-2b32-44fc-9334-1a71bb99aa25', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.7.10', 'samcliVersion': '1.33.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam publish', 'duration': 1107, 'exitReason': 'ServerlessRepoClientError', 'exitCode': 1}}]}
2021-10-01 21:24:56,773 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Invalid Serverless Application Specification document. Number of errors found: 1. Errors: Resource with id [LambdaFunction] is invalid. property Architectures not defined for resource of type AWS::Serverless::Function
Please follow the instructions in https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-publishing-applications.html

Expected result:

Application should be published without any issue.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Linux
  2. If using SAM CLI, sam --version: 1.33.0
  3. AWS region: eu-central-1

Add --debug flag to any SAM CLI commands you are running

@bitconym
Copy link

bitconym commented Oct 2, 2021

Similar problem I have with building lambdas and layers with sam build --use-container aws/serverless-application-model#2166 (comment)
I think SAM is not yet ready and fully tested for arm64 so will wait for a fix/update.
Using the latest SAM CLICI btw.

@qingchm
Copy link
Contributor

qingchm commented Oct 7, 2021

Hey thanks for the callout and I would recommend moving this issue into SAMCLI repo! https://github.com/aws/aws-sam-cli

@qingchm qingchm transferred this issue from aws/serverless-application-model Oct 8, 2021
@qingchm qingchm added area/build sam build command area/publish sam publish command and removed area/build sam build command labels Oct 8, 2021
@bitconym
Copy link

bitconym commented Oct 8, 2021

This worked for me: aws/serverless-application-model#2166 (comment)

@qingchm
Copy link
Contributor

qingchm commented Oct 8, 2021

@EldarAliiev The problem you are having is due to SAR (the repo you are publishing to) not yet supporting the Architectures field. We could reproduce your failure on AWS console as well. Already working to have SAR get in sync with SAM's latest changes and support Architectures, we will update you once this is supported!

@qingchm qingchm added the stage/in-progress A fix is being worked on label Oct 8, 2021
@qingchm
Copy link
Contributor

qingchm commented Oct 13, 2021

@EldarAliiev Hey can you verify if you can publish now?

@EldarAliiev
Copy link
Author

Looks like it works fine. Thanks a lot!

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/publish sam publish command stage/in-progress A fix is being worked on
Projects
None yet
Development

No branches or pull requests

3 participants