Hello <@U01J5Q8HV5Z> <@U01JVDKASAC> could you help...
# seed
a
Hello @Jay @Frank could you help me regarding serverless framework + lerna + localstack project I am running in seed.run?
f
Hi @Anatol, what’s the issue you are running up again?
a
Thanks for your quick checking in.. I am running serverless framework based app on seed.run. It's a monorepo by lerna + yarn workspaces.
For integration tests, I am using localstack run by docker-compose.
so in our repo, I have 2 services to deploy to localstack.
but no way to run
sls deploy -s local
command in host shell after
docker-compose up
so wondering how I can accomplish this on seed.run
For example, after run
docker-compose up
command and initialize some resources like SSM parameters, I need to deploy 2 services to running localstack.
let me know if you understood my problem
I've checked official doc of seed.run, but I couldn't find any guide regarding this part.
But I think this is the common use case to run tests and deploy monorepo app on any CI platform.
so I'd like to get some guide for this process.
This is the last build link for my app.
before proceeding actual deployment of each services, I'd like to run localstack and deploy all services to it and run integration tests.. When only passing tests, I'd make the actual deployment phase happening
f
Thanks for the details. I’m looking at the build you shared above, I see 4 services in the app. In which service are you running the
docker-compose up
?
a
@Frank yup right.
in the root folder, I have
docker-compose.yml
as localstack recommends, so as a first step, I will launch
docker-compose up
on local and then I'd love to deploy 4 services (each subdirectory is a service and has serverless.yml) to this running localstack.
f
Oh I see. Let me say it back and see if I’m correct. So you have 4 services in the repo. Before deploying to AWS, you want to deploy all 4 of them to LocalStack first, run some test. And if the tests pass, you will then deploy them to AWS. Is that right?
a
@Frank yup, correct! That's the workflow I'd like to build on seed.run
or I could create
local
stage in seed.run and just deploy all services to localstack without deploying to AWS and then run integration tests as post deploy phase.
but the problem is that seed.run will use different build machines per each service, so wondering how to deploy all services to only one build machine which is running localstack.
f
Ah gotcha. Although you can technically do this on Seed (ie. spin up localstack; manually deploy 4 services to localstack; and then run the tests, do all these steps inside the
before_build
hook), the more common pattern we see team do is using the PR workflow to test against real resources.
With PR workflow enabled, Seed deploys each PR to it’s own stage (ie. stage name is prXXXX). And run the integration tests inside the Post-Deploy phase. And you can merge the PR if the test pass. On PR merge, Seed will automatically remove the PR stage.
Another option would be to run the localstack test in GitHub Actions, and after the tests pass, deploy to Seed using the Seed CLI.
So yeah, a couple of options here. See which one makes sense, and I can go into more details.
a
ahh Thanks for your detailed explanation and guide @Frank ! I make sense with your 1st option for PR workflow.. I will look into it further more and get back to you.. Actually, I've noticed some hard limitations with localstack regarding performance and missing features.. so I think it will better to perform tests on PR remote stage and promote it to prod manually.. Thanks for your kindness guide 🙂
f
All good! Yeah you can promote to prod manually, or in the Post Deploy phase of the PR stage, use the CLI to auto deploy to prod after the tests pass.