Hey there, just a quick question. If I init a sst ...
# help
d
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
Yup you can use typescript for stacks and python for your lambdas. Haven’t done is myself though
d
Appreciate the input! Gonna give it a test run very soon as well and see how it goes
s
I can confirm this works, I do it myself 🙂
d
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
@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
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
Hey @David Garcia, circling back to this, did you have any luck with this?
d
@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