Hey Team, looking for some thoughts / suggestions....
# help
r
Hey Team, looking for some thoughts / suggestions. I have a service I need to deploy running some long running python natural language processing. I’m looking at using Fargate. Unfortunately a lambda wont cut it. I need the process to run for potentially more than 15 minutes and I need some control over the execution env. So Fargate seems like a good solution. I’m wondering what are some best practices people have found / used when using Fargate with SST. My main questions are: 1. how do you develop on Fargate when it needs to interact with Lambdas and other resources in the dev environment? 2. how do you deploy a Fargate task without it taking ~10 min to deploy every time you run sst start? Really appreciate any of your thoughts and suggestions.
a
I think you should really consider aws step-functions before looking towards ECS / Fargate.
r
? Isn’t AWS Step Functions a coordination service?
like an AWS step function would call a lambda or other endpoint, right?
a
It is but it allows you to persist execution states and thus run long-lived tasks which lambdas directly can’t.
yes, as the conditions meet, lambdas are triggered as per your needs.
r
so if a lambda times out the step function would queue off another lambda with the same execution state?
a
no, it won’t. but you can architect your long-running task in such a way that it’s broken into many small tasks which can be executed sequentially / parallely as you need and once everything is processed you update your db with the final result and complete the flow.
r
yeah…. that would be nice.
a
if it's not possible, it's usually best to use SQS, SNS and maybe step functions to communicate between serverless parts of your system and non-serverless
or maybe S3 with triggers, depending on what you do
it's tempting to orchestrate some huge cron logic, but it's usually a bit fragile, better to stay event based if possible
f
lemme throw in another option, CodeBuild. It’s not a conventional option lol.
r
I appreciate all the other options. But just staying to the premise of needing to run something on Fargate are there any best practices for doing this on SST?
one thing in particular is many of these python nlp packages don’t install nicely on mac and really only play nicely on a specific linux env. Hence running the dev environment on docker would be really nice.
f
Just to clarify, the Live Lambda dev currently only support Lambda functions.
running the dev environment on docker would be really nice
I’ve seen ppl run
sst start
inside docker.
r
yeah, that makes sense. I was wondering if you had thoughts on running a dev environment in fargate and using vscode to
docker exec
to push code to the remote container and what not.
🤯
interesting….
I assume you have to setup the mappings to route traffic appropriately from the lambda to the container?