https://platformengineering.org logo
#platform-toolbox
Title
# platform-toolbox
l

Leonardo Romanato

02/28/2023, 2:42 PM
I was wondering how your development teams working in a cloud environment (AWS in my case) are testing their solution in the local environment (which in our case is their laptop). Usually it is serverless architecture involving Lambda, SQS, API Gateway; codebase is C# and Java mostly. Do you still use local dev? Or everything is pushed to a dev / preview environment? If local dev is present, which are the tools used? We are facing some complaints about them having to wait for a pipeline run in order to test.. of course we can improve our pipeline DevEx but it seems the complaint is more on the pipeline approach vs local dev rather than purely on the performance, meaning that even if they have available the smoothest pipeline ever, they would like to continue to use local dev as the first testing environment.
h

Hugo Pinheiro

02/28/2023, 2:49 PM
We use docker for our local env so cant comment on serverless, but I have seen teams that use serverless use https://localstack.cloud/ for their local
b

Brad Mongeon

02/28/2023, 2:50 PM
My related opinions: • Initial focus should be on unit tests, preferably following a TDD approach • For things like Lambda, stubbed integration tests can also be used that invoke the Lambda handlers directly. • I would avoid trying to replicate AWS services locally. Some folks have used LocalStack, but keeping that all working can become a chore. • For full “local” integration tests I would get to the cloud asap and use tools like SAM accelerate or CDK watch in order to achieve fast feedback ◦ Be careful that folks are not moving to integration tests too early or for most testing, I think this can be a crutch for not having adequate unit tests ◦ https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/https://aws.amazon.com/blogs/compute/accelerating-serverless-development-with-aws-sam-accelerate/
r

Romaric Philogène

02/28/2023, 4:10 PM
@Leonardo Romanato I think local dev and preview envs are complementary. One question: who wants to get access to those environments? Developers? QA engineers? Product Managers? Others?
l

Leonardo Romanato

02/28/2023, 4:26 PM
@Romaric Philogène Developers (including DevOps) and QA engineers
r

Romaric Philogène

02/28/2023, 6:38 PM
Ok so maybe Preview Environment would make sense to consider because those environments are shareable with anyone and does not required to install anything. They are basically running in the cloud. Would that make sense?
l

Leonardo Romanato

02/28/2023, 8:45 PM
Yes, make sense
But I am just wondering if anyone is working somewhere where local dev does not exists at all and everything is pushed directly to the first env in the chain
b

Brad Mongeon

02/28/2023, 9:42 PM
I think whether that will work depends upon how many devs are using that environment and what they are doing with it. Once you have interesting data involved then that environment could become brittle fast, or could be under a state of continual deployment.
If using canary deployments with good testing then it could be a great mature pattern (as long as folks don’t rely on doing most of their testing against that deployed environment).
e

Enrico La Cava

03/01/2023, 8:11 AM
we use lambda (and apigw, sns, sqs etc) and we decided to have preview envs for each open PR. We are using cdktf and the ideal cycle is that devs open a clean PR, their env goes up and they work there. It's not as good as it sounds. cdktf is slow and they need to wait 5min to have it running in the github action. We find a middle ground with them manually pushing changes to their PR-env. It is still very slow for their like.
l

Leonardo Romanato

03/01/2023, 8:24 AM
Thanks @Enrico La Cava! The word “slow” is already something that will create a lot of push backs, unfortunately, but I can have a look at cdktf
e

Enrico La Cava

03/01/2023, 8:26 AM
Our next iteration will be to replace cdktf with pulumi, that we are testing on other stuff and it seems way faster than cdktf (seconds vs minutes). But whatever it is, it will never feel as ok as running a local env. I am right now very much in doubt if I should use lambda for our next project and prefer a more classic, container-based, stack.
l

Leonardo Romanato

03/01/2023, 9:09 AM
Very interesting, thanks
r

Romaric Philogène

03/01/2023, 9:53 AM
@Enrico La Cava what do you use for your preview envs? Did you built it?
e

Enrico La Cava

03/01/2023, 9:56 AM
@Romaric Philogène I have a github pipeline with cdktf. Yes we build it internally.
r

Romaric Philogène

03/01/2023, 10:00 AM
If you have some blog articles/content talking about your integration I’m interested : )
e

Enrico La Cava

03/01/2023, 10:50 AM
Let me convice my devs to write about it.
a

Andre Marcelo-Tanner

03/11/2023, 2:52 PM
We use the serverless framework and CI jobs to deploy a unique environment on AWS Lambda per developer or PR. For local development its more unit test focused in Docker but you wont ever get the full experience if you dont use the cloud.
79 Views