Hey guys, My entire stack is written in TypeScript...
# sst
a
Hey guys, My entire stack is written in TypeScript, and my infra done with SST. Now… we hired some machine-learning guys, and they want to use Python… is somebody using a hybrid stack where you have some JS functions living with some other PY functions? Also looking for ideas on how to organize my mono-repo in this situation.
g
Hey Adrian, we’re not using SST yet, but we’ve got a hybrid JS and Python lambdas stack with serverless - I’ve used 2 approaches: • Separate repo for the Python stack and exporting ARNs of what’s necessary to import in the next stack (this was done for a particular API that is quite independent of the main project, so was a good clean line to separate it) • Same repo for the Python lambda functions, but a separate service/cloud formation stack (this was done for an API that “belongs” in the eco system of what we were building) Hope that helps.
a
Nice, thanks for your feedback.
s
We have a hybrid stack with SST same repo, but not a mono-repo though. Functions are mostly TS and couple in python. Infra with SST are all in TS including the infra for Python functions. We colocate our infra and functions code into it's own dir by a business process/workflow it belongs to. So our python functions are related and are just in one dir with its deps defined in
Pipfile
. One gotcha with defining the SST infra for python functions, the
srcPath
needed to be the dir where the file for python deps is in (my case
Pipfile
) not the root dir. That's important for how SST bundle and install python deps. More details here: https://docs.serverless-stack.com/constructs/Function#bundle . This setup works great for us so far, but I imagine if we have to add more business processes that needed to be written in python, we might have to figure out how to better share common packages/libs between them across multiple dirs. Hope that makes sense.