Open cosmic-ascendant opened 2 weeks ago
@walln Did you have a different approach lined up for this? Or should I try to PR a fix based on the current implementation. Thanks
I've been toying with a few ways to get this working but have yet to come up with something I like; a few other issues have been created about working in monorepos that overlap with this issue. The main problem is resolving all the needed Python files and preserving their relative structure, which is non-trivial given all the ways I have seen people trying to make this work and how sst dev works. If you need an immediate fix, I suggest filing a PR, as I am unsure when I will have something ready.
I see, thanks. Understandable that a nice fix covering the myriad of ways people want to organize their project structure is proving difficult. I'm squeaking by for the moment needing only one python lambda container, but if I meet a wall I'll propose a PR. Perhaps could be helpful if we consolidate a thread on the various project structures and proposed benefits/shortcomings of approaches
Given a project structure like so:
with an sst config like
upon issuing
sst deploy
we find that the build output forFunctionA-src
looks like:The result being that all lambda functions are copied into any other given lambda function, which expands the image size to be the union of all lambda functions. I believe the pattern to follow when seeking to include other functions or libraries would be to use
copyFiles
as discussed in https://github.com/sst/ion/issues/1139.I believe the source of this behavior seems to originate in
/platform/src/runtime/python.ts
Namely we are passing the directory into
getPythonFiles
instead of the handler filepath. However, I find that when I passfile
instead ofparsed.dir
, some needed dependencies are then missing. So perhaps something more is needed here..