-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Python functions fail to build with mono repo structure / nested folders #4114
Comments
I am having a related issue, except the errors appear to differ. I have the following structure:
Local (sst dev) actually works fine, but its only after deployment I get an error in lambda log (with and without container)
The suggested PR fix had no material change to this. On the other hand, if I have the following structure, all is well.
I have not tested it, but it appears @walln 's example (https://github.com/walln/sst-modal/tree/main/packages) has a nested layout of which I assume is working? |
@cmanou i'm getting the same error as @cosmic-ascendant w/ the PR:
Both the container and non-container functions fail with the same error. |
To add some color, given a monorepo setup like so:
The lambda bundle looks like this:
Hence we can see how the lambda handlers get moved up from their expected directories to the root. A fix to this would likely also take care of #4003 #4062 |
For zip deployments, one could do something ugly like this temporarily: async run() {
const functionA = new sst.aws.Function("FunctionA", {
python: {
container: false,
},
handler: "packages/functions/function_a/lambda.handler",
runtime: "python3.11",
url: true,
copyFiles: [{ from: "packages/functions/function_a/lambda.py", to: "packages/functions/function_a/lambda.py" }]
}); Which does allow allow the handler to run with its dependencies. But would break resource linking. |
It seems as though when you have a python function defined as follows
You'll hit the following error during the build
Guessing this needs to trim the target path to be of the same parent as the project file
https://github.com/sst/ion/blob/5b183e67ed7b9134cd05577b2d417fc7d482534b/platform/src/runtime/python.ts#L73C1-L76C7
The text was updated successfully, but these errors were encountered: