Open yusukegoto opened 8 months ago
Hey @yusukegoto 👋 Thanks for reporting. Could you provide a minimal reproducible example that I could try testing out on my side? It would be really helpful 🙇
@pgrzesik This is a link to my sample app. https://github.com/yusukegoto/sls-python-poetry-example
And I found out this happens at least with nodejs18.x. If I update two nodejs18.x
in serverless.yml with nodejs20.x
, package command succeeds 🤷♂️
Thanks a lot @yusukegoto 🙇 I'll try to reproduce with your example and will report back 👍
Thanks again @yusukegoto. I managed to reproduce the issue and understand what is causing it. The issue stems from the fact that when you don't use package.individually: true
, then the docker image is based on the provider runtime, which in this case is nodejs18.x
. The fact that it works with nodejs20.x
is actually surprising to me, I guess maybe that image includes Python with pip for some reason?
I'm honestly not sure about the resolution here. The options I see:
python
runtime on provider level. It's not ideal as having other runtime as default sounds valid.package.individually: true
in such cases. The downside here is that we potentially have multiple functions that use the same Python runtime that we could package toghether, not individually. But also, we could have different Python runtimes specified, in which we case we should force individual packaging. All of these solutions do not sound amazing to be fair, I'm leaning towards checking if all Python functions have the same runtime and if yes, then using that one and erroring out only in case of a mismatch. Of course that would only apply if provider-level runtime is non-python.
What do you think @yusukegoto ?
Are you certain it's a bug?
Are you using the latest plugin release?
Is there an existing issue for this?
Issue description
I got an error from
sls package
command when I mixed runtimes and enabled dockerizePip. This happens with poetry.Service configuration (serverless.yml) content
I'm using27b70f4d6a7e43fd0e9711bbb56752fee2762901 to get a fixed patch for mixed runtimes.