News for hackers. Stuff that matters.
Re:How to Build Software Like an SRE by anonymousDan on Monday October 17, 2022 @06:27AM (#33231689)
How does this work in a serverless world? As far as I can tell local dev for most serverless environments that people actually care about is a joke.
Re:How to Build Software Like an SRE by dijit on Monday October 17, 2022 @06:48AM (#33231828)
Usually there is some sort of local development framework for serveless functions.

Most seem to use docker, here’s one for Google Cloud functions: https://cloud.google.com/functions/docs/running/overview

If you use something like “cloud run” then it’s containers anyway.

Re:How to Build Software Like an SRE by koblas on Monday October 17, 2022 @07:52AM (#33232313)
For golang, but would work in any language. What's really worked is the idea that your main loads configuration and injects all of the configured interfaces into your handler.

You then can build all of the testing on mocks/stubs to test the behavior. If you access a database you access in through the interface which can mimic the appropriate behavior for your code in test vs production. If you need to you can do local integration testing of the db access layer.

Re:How to Build Software Like an SRE by Hikikomori on Monday October 17, 2022 @07:59AM (#33232371)
With AWS SAM you can invoke functions locally, run api gateway and use step functions. There's also a 3rd party project to run various AWS services locally, can't remember the project name.

There's also SAM sync that syncs changes you make quickly, so if you have your own dev copy in AWS you can quickly test changes.

Re:How to Build Software Like an SRE by tyingq on Monday October 17, 2022 @09:14AM (#33233000)
There's also a fair amount of lambdas where you can just invoke the lambda handler yourself without anything special other than a compatible version of python/node/etc. Variations of things like:

node -e "console.log(require('./index').handler(require('./event.json')));"

Re:How to Build Software Like an SRE by nine_k on Monday October 17, 2022 @08:23AM (#33232556)
Having used localstack [1], I can vouch that it's not a joke.

[1]: https://github.com/localstack/localstack

Re:How to Build Software Like an SRE by thrauat on Tuesday October 18, 2022 @10:17AM (#33247549)
thanks for saying that! people are pretty skeptical about localstack when they hear about it for the first time, and don't understand how we could ever emulate something remotely resembling AWS. tbh sometimes i'm baffled myself, it's pretty crazy what it can already do (i work there).
Re:How to Build Software Like an SRE by methyl on Monday October 17, 2022 @08:48AM (#33232745)
For Cloudflare Workers, it's no longer a joke either: https://github.com/cloudflare/workerd
Re:How to Build Software Like an SRE by jasonhansel on Monday October 17, 2022 @09:12AM (#33232981)
Honestly, my answer is: don't use serverless, or at least have a non-serverless way of running your code locally, preferably outside of a container/VM. Otherwise you have no way of running or testing your code locally, much less attaching a debugger; IMHO this can slow down dev cycles so much that it cancels out the time saved by adopting a serverless architecture.
Re:How to Build Software Like an SRE by viridian on Monday October 17, 2022 @11:14AM (#33234619)
Most people building stuff quickly in serverless seem to eschew the concept of local entirely, and it's something I've recently started doing too. I make a code change locally and it gets picked up by the deployment of my stack associated with my feature branch the second I save the file.

It's an uncomfortable concept at first but I find it's helped me build things faster and has ultimately led to less rabbit hole chasing across multiple categories of issues.

Re:How to Build Software Like an SRE by oceanplexian on Monday October 17, 2022 @01:43PM (#33237144)
Serverless deployments aren't painfully slow like they are with Kubernetes or other container orchestration platforms. At least with AWS lambda you can change and deploy your code in <10 seconds and have it taking traffic (In an infinite number of "environments"). So developing locally is kind of pointless.
Re:How to Build Software Like an SRE by FridgeSeal on Monday October 17, 2022 @05:30PM (#33239766)
> Serverless deployments aren't painfully slow like they are with Kubernetes

What are you doing with your K8s cluster/containers that is making your deployments slow? My cluster at work pulls down containers faster than my local, and deployments are usually swapping within ~1 minute of being committed in git/the container build finishing…