https://serverless-stack.com/ logo
#help
Title
# help
d

David Garcia

01/25/2022, 4:14 PM
Hey there, just a quick question. If I init a sst typescript project, can I make python lambdas that are deployed within that project by defining the runtime? There won't be a conflict due to different languages, right?
o

Omi Chowdhury

01/25/2022, 4:16 PM
Yup you can use typescript for stacks and python for your lambdas. Haven’t done is myself though
d

David Garcia

01/25/2022, 4:17 PM
Appreciate the input! Gonna give it a test run very soon as well and see how it goes
s

Seth Geoghegan

01/25/2022, 4:21 PM
I can confirm this works, I do it myself 🙂
d

David Garcia

01/25/2022, 8:05 PM
Seems I'm having certificate errors due to the python lambda being installed in a docker container. Is there an easy way to pass certs into the build cycle? I could probably modify whatever dockerfile is being used during the process but I'd like to avoid having to dig that deep into the source code. I'm getting an SSL verify error
f

Frank

01/26/2022, 7:44 AM
@David Garcia You can override Python’s bundle commands like this https://docs.serverless-stack.com/constructs/Function#configure-bundling-a-python-function
Just for reference, here’s the default installation steps if
installCommands
is not overridden https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/assets/python/Dockerfile.dependencies
d

David Garcia

01/26/2022, 1:37 PM
Yeah, the poetry install step is the one that's throwing the ssl error. I was trying to override the bundle commands and trying to add my cert to the python global certs but I'm not sure that's the right approach. I believe I need to copy the cert into the docker container and then set it with pip config, are you saying I can copy that dockerfile and add my own steps?
Also, interesting note, it says that poetry will only be installed if there is no requirements.txt, but I do have a requirements.txt in the same directory as my python lambda script file, which indicates to me that this step should be skipped, so I think I may have misconfigured something
f

Frank

02/24/2022, 1:30 AM
Hey @David Garcia, circling back to this, did you have any luck with this?
d

David Garcia

03/15/2022, 8:26 PM
@Frank I resolved it for myself, but I have another dev on my team that is encountering the same issue, but I don't really know what ended up resolving the issue. I will say that I think an escape hatch as far as being able to add a step to the docker build /before/ any process are run such as installing poetry, would be really helpful, so that we can add our cert into the container before anything else
@Frank some further info on the issue. To reproduce the problem, I just needed to add a requirements.txt file where the lambda is located in. This seems to kick off the process of downloading
pipenv
and
poetry
, which fails because the docker container doesn't have proper certs.
f

Frank

03/22/2022, 1:13 AM
3 Views