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

Dependencies are not packaged for the lambda which has Individual packaging (per lambda, not the top level). #744

Open
3 tasks done
amediantsev opened this issue Nov 22, 2022 · 6 comments
Labels

Comments

@amediantsev
Copy link

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you using the latest plugin release?

  • Yes, I'm using the latest plugin release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

When individual packaging is defined per lambda, dependencies are not packaged for that lambda.

I.e.
We have a such function in serverless.yml:

  MyIndividualFunction:
    module: src.my_module
    handler: my_file.my_handler
    package:
      individually: true

and such project structure:

src/
-- my_module/
---- my_file.py
---- requirements.txt

And libraries listed in requirements.txt are not packaged to the final MyIndividualFunction.zip

Service configuration (serverless.yml) content

N/A

Command name and used flags

N/A

Command output

N/A

Environment information

Framework Core: 1.83.0
Plugin: 3.8.4
SDK: 2.3.2
Components: 2.34.9

"serverless-python-requirements": "5.1.0"
@pgrzesik
Copy link
Collaborator

Hey @amediantsev, thanks for reporting and sorry you've run into trouble there. It looks like you're using an outdated version of the Framework and not up-to-date version of the plugin. Could you please upgrade to latest versions if possible first? It might be that the issue is already resolved in older versions of the plugin

@amediantsev
Copy link
Author

amediantsev commented Nov 23, 2022

@pgrzesik Thanks for responding. You are correct.
I have updated the framework and the plugin, but the result is the same, unfortunately.

Current versions:

Framework Core: 3.25.0 (local) 3.25.0 (global)
Plugin: 6.2.2
SDK: 4.3.2

{...
"serverless-python-requirements": "^6.0.0"
...}

@jonathan-grs
Copy link

@amediantsev I am not sure if you still have this issue.
What worked for me is removing serverless-python-requirements cache.
I found the directory by running this:

SLS_DEBUG=* sls package --verbose

Line specifying the cache dir starts with Using static cache of requirements found at

Hope that helps

@roy-firman
Copy link

@amediantsev did you get to solve this thing?
I am using the latest version and the packed zip includes the whole project (instead the module only) and does not include any of the requirements that exist in the req file inside the module defined.
any solution for this? where does it says it is supported?

@jacksoncassimiro
Copy link

I have the same issue trying to deploy inside a Bitbucket pipeline. Also, I'm using serverless compose to deploy two services:

  • the first containing a single lambda function
  • the second containing 3 lambda functions

The packaging for the second fails for 1 single lambda but randomly: sometimes it works, sometimes don't.

I'm using the most recent versions and nodejs 20.

@pgrzesik
Copy link
Collaborator

pgrzesik commented Jan 1, 2024

Hey @jacksoncassimiro 👋 Sorry you've ran into trouble. I've tried to reproduce this bug but I was not successful in my attempts. Would you have the ability to share a reproducible example by any chance? Does it only fail when working Compose?

If anyone else could provide a concrete repro example, I would be grateful 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants