News for hackers. Stuff that matters.
Re:The Serverless Revolution Has Stalled by wiremine on Monday October 12, 2020 @08:27PM (#24761089)
> It's so slow (iteration speed) and you need to jump through a billion hoops of complexity all over the place. Even dealing with something as simple as loading environment variables for both local and "real" function invokes required way too much effort.

Honestly, it reminds me of PHP development years ago: running it locally sucked, so you need to upload it to the server and test your work. It. Sucked.

Re:The Serverless Revolution Has Stalled by kortilla on Monday October 12, 2020 @08:32PM (#24761122)
It was actually pretty good if you had an IDE with sftp/scp support because you could save a file, refresh your browser, and have immediate new results.
Re:The Serverless Revolution Has Stalled by nickjj on Monday October 12, 2020 @09:34PM (#24761427)
Yeah this wasn't too bad and it was what I used to do back in the day with Notepad++. By the time you hit save in your editor, your changes were ready to be reloaded in the browser.

With SAM we're talking ~6-7 seconds with an SSD to build + LOCALLY invoke a new copy of a fairly simple function where you're changing 1 line of code, and you need to do this every time you change your code.

That's even with creating a custom Makefile command to roll up the build + invoke into 1 human action. The wait time is purely waiting for SAM to do what it needs to do.

With a more traditional non-Serverless set up, with or without Docker (using volumes) the turn around time is effectively instant. You can make your code change and by the time you reload your browser it's all good to go. This is speaking from a Python, Ruby, Elixir and Node POV.

Re:The Serverless Revolution Has Stalled by iCarrot on Tuesday October 13, 2020 @02:10AM (#24762745)
The workaround my team uses is to make two entries to start the webapp: one for SAM, one for local. For fast iteration we just `npm start`, and when we're ready to do more elaborated testing we run with SAM. This works pretty well so far.
Re:The Serverless Revolution Has Stalled by coolg54321 on Tuesday October 13, 2020 @04:25AM (#24763461)
I think it was the other way around, you could just start wamp/mamp/xampp copy the file to public folder and everything just worked
Re:The Serverless Revolution Has Stalled by olyjohn on Tuesday October 13, 2020 @02:48PM (#24768775)
I'm not sure why that's PHP's fault? I never had problems running it locally... and to "get my code to the servers" was as easy as a git pull from the server which is probably the 2nd laziest way of accomplishing that.
Re:The Serverless Revolution Has Stalled by nicky0 on Tuesday October 13, 2020 @02:54AM (#24762975)
Out of genuine interest... is there a modern solution to this problem with PHP/MySQL?

(I'm still doing the "upload to server to test" thing.... I've tried MAMP and Vagrant/VirtualBox for local dev but both of them seem horribly complex compared to what we can do with local dev with node.js/mongo and so on.)

Re:The Serverless Revolution Has Stalled by pantelisk on Tuesday October 13, 2020 @03:11AM (#24763067)
"docker-compose up" and your OS, codebase, dependecies and data is up and running locally in the exposed local port of your preference. You can even split parts in different layers to mimic a services/cross-region logic.

Of course this won't fix the fact that you have a lambda behind api gateway that does some heic->jpg conversion and can't be hit outside the DMZ, or some esoteric SQS queue that you can't mimmic locally - but it should get you almost there.

Re:The Serverless Revolution Has Stalled by mtnGoat on Tuesday October 13, 2020 @04:12PM (#24769793)
this doesnt solve the OPs problems though, if Vagrant is complex, so would be a docker image. the problem is the user doesn't know how to manage/configure the underlying complexity of the OS and needed services, which would still be a problem if using docker. unless you find that perfect docker image with every dep you need... but that would also be true with vagrant.
Re:The Serverless Revolution Has Stalled by methodin on Tuesday October 13, 2020 @03:38AM (#24763197)
FWIW I haven't hit any scenario out of the basic services that localstack couldn't run locally. I even have it executing Terraform on localstack as if it was AWS (without IAM which is indeed a problem when I forget to create/update policies)!
Re:The Serverless Revolution Has Stalled by bernawil on Tuesday October 13, 2020 @10:19AM (#24765763)
and there's localstack for those cases.
Re:The Serverless Revolution Has Stalled by jeroenhd on Tuesday October 13, 2020 @05:39AM (#24763852)
Just run PHP and MySQL locally? Native PHP on Windows is horrible to set up, but with WSL/WSL2 you suddenly can get a normal Linux environment without much hassle.

sudo apt install nginx php mysql, point the www directory of nginx to something on your computer (/mnt/c/projects/xyz) and you've got a running setup. Or run Linux in general, that's what most people I've seen work on backends seem to do. You can run the same flavour of software that your deployment server runs so it'll save you time testing and comparing API changes or version incompatibilities as well.

I don't know any solution for macOS but you can probably get the necessary software via Brew if you're so inclined. Then run the built-in PHP web server (php -s) and you get the same effect.

Re:The Serverless Revolution Has Stalled by fart32 on Tuesday October 13, 2020 @09:00AM (#24765157)
What's horrible about it? I just download it, unzip to Program Files, add the folder to my %PATH% and that's about it. I didn't find myself in a situation where I would need an Apache or other webserver, the built-in one is good enough. It also makes using different versions easy, no need to deal with Apache and CGI/FPM. You just use other PHP executable.
Re:The Serverless Revolution Has Stalled by fetbaffe on Tuesday October 13, 2020 @11:17AM (#24766394)
I find it easier to handle multiple PHP versions on Windows than on Linux. As you say just download zip,unpack somewhere copy php.ini-development to php.ini, and you can do this for every minor PHP-version.

Apache is almost as easy, download zip, unpack & configure apache conf to use your php.

MySQL is somewhat more complicated because you need to run an setup script after unpacking the zip.

Re:The Serverless Revolution Has Stalled by dpacmittal on Tuesday October 13, 2020 @02:56AM (#24762995)
Php has an inbuilt server you can run with `php -s`
Re:The Serverless Revolution Has Stalled by nicbou on Tuesday October 13, 2020 @05:48AM (#24763899)
I always run stuff inside docker. If it runs on my machine, it will run in production.
Re:The Serverless Revolution Has Stalled by OriPekelman on Tuesday October 13, 2020 @03:38AM (#24763199)
try https://lando.dev/ uses docker under the hood... but simplifies it all to the extreme.