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

Deployment as serverless application does not work #153

Open
demeringo opened this issue Feb 6, 2023 · 1 comment
Open

Deployment as serverless application does not work #153

demeringo opened this issue Feb 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@demeringo
Copy link
Collaborator

demeringo commented Feb 6, 2023

Bug description

Current version of API cannot be deployed as serverless app anymore (see #152).

To Reproduce

Try to deploy using serverless framework: deployment fails.

npm i
serverless deploy --stage dev --verbose

Deploying boavizta-api to stage dev (eu-west-1)

Packaging
Generating requirements.txt from Pipfile
Parsed requirements.txt from Pipfile in /home/olivier/atelier/boavizta/boaviztapi/.serverless/requirements.txt
Using static cache of requirements found at /home/olivier/.cache/serverless-python-requirements/ec80065591b22d7da5b1f799d978adee62702c9e636fdd6402f9049b86321529_x86_64_slspyc
Excluding development dependencies for function "app"
Packaging Python Requirements Lambda Layer
Found cached Python Requirements Lambda Layer file
Retrieving CloudFormation stack
Uploading
Uploading CloudFormation file to S3
Uploading State file to S3
Uploading service app.zip file to S3 (279.01 kB)
Uploading service pythonRequirements.zip file to S3 (94.64 MB)
Updating CloudFormation stack
Creating new change set
Waiting for new change set to be created
Change Set did not reach desired state, retrying
Executing created change set
  UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - boavizta-api-dev
  UPDATE_IN_PROGRESS - AWS::Lambda::LayerVersion - PythonRequirementsLambdaLayer
  UPDATE_FAILED - AWS::Lambda::LayerVersion - PythonRequirementsLambdaLayer
  UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - boavizta-api-dev
  UPDATE_COMPLETE - AWS::Lambda::LayerVersion - PythonRequirementsLambdaLayer
  UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - boavizta-api-dev
  DELETE_COMPLETE - AWS::Lambda::LayerVersion - PythonRequirementsLambdaLayer
  UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - boavizta-api-dev

✖ Stack boavizta-api-dev failed to deploy (54s)
Environment: linux, node 19.0.0, framework 3.18.2, plugin 6.2.2, SDK 4.3.2
Credentials: Local, "plmis" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
UPDATE_FAILED: PythonRequirementsLambdaLayer (AWS::Lambda::LayerVersion)
Unzipped size must be smaller than 262144000 bytes (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 30de9f86-b8cd-428f-bde2-735d5a6c19ec; Proxy: null)

View the full error: https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aeu-west-1%3A852378600785%3Astack%2Fboavizta-api-dev%2F7541d4b0-e630-11ec-adeb-0abd2632f243

1 deprecation found: run 'serverless doctor' for more details

This seems to be due to the size of zipped dependencies that exceed AWS limit.

Expected behavior

serverless deploy should work

It may involve adapting the servereless.yml deployment (maybe use a docker image or different layer as a workaround to the heavy dependency zip).

As a workaround, until issue is fixed, we suggest to deploy the API as a docker container (using ECS on AWS for example).

JSON OUTPUT

Additional context

It seems that we have 2 options:

  • Use separate EFS storage to deploy dependencies separately
  • Deploy a docker image as serverless (which seems simpler to me).

See:

@demeringo demeringo added the bug Something isn't working label Feb 6, 2023
@demeringo demeringo self-assigned this Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant