All Self-Hosted Faas Solutions Suck?
I have a few small projects where I need a server as backend. That means I need to run a server, which usually means I need to do a lot of stuff. BUT these are astonishingly simple backends. Usually just one endpoint, which does one thing.
For example, consider nombres a website where you can examine historical information about names in Argentina. Like, how has the popularity of the name "Juan" changed over time?
Like this:
That is literally one function that takes as argument names, does a couple of queries to a database, builds a chart and returns that. Deploying that should not require me setting up infrastructure specially because I have like 5 or 10 of those and they are accessed 10 times a day or so.
If I were to use "the cloud" the solution would be to use AWS Lambda, or the similar clones in Azure or Google Cloud. But I don't want to pay for things, so I looked for a way to do that in my own server, which I already have and has more than enough power to handle it.
So, I did it! I used faasd which lead to a whole slew of problems that you can see in this post.
Basically faasd hates sharing the machine it's in with anything else, so I segregated it to a VM using Ignite. Now, I am considering moving to a newer, more powerful server (A Radxa Rock 5C) and I look at setting up Ignite and ... it's obsolete.
It says the replacement is Flintlock... which is "on hold", which means abandoned.
So I try setting up a VM using libvirt, but since this is arm64, things are a bit complicated, so I say, damn, let's just use QEmu, which works ... as long as I don't use KVM, because it makes the VM super flaky.
So I can choose a super flaky VM, or a very slow VM, or use obsolete software, all because I want to run a function that takes a few seconds to run and is accessed 10 times a day and faasd is needy.
So, I sayd, what the heck, faasd can't be the only thing. Let's look again!
- OpenFaas: by the same people as faasd, needs kubernetes, way overkill
- Fx: looks good and simple, literally doesn't work.
You don't believe me? Here is what happens when I follow the instructions to run fx, on a normal x86 machine:
> curl -o- https://raw.githubusercontent.com/metrue/fx/master/scripts/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1471 100 1471 0 0 4138 0 --:--:-- --:--:-- --:--:-- 4143
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8635 100 8635 0 0 17948 0 --:--:-- --:--:-- --:--:-- 17914
Downloading fx from https://github.com/metrue/fx/releases/download/0.9.48-alpha.d91a7a0/fx_0.9.48-alpha.d91a7a0_Tux_64-
Download complete, saved to /home/ralsina/fx/fx.tar.gz
Installing fx to /home/ralsina/fx
fx
fx installed successfully at /home/ralsina/fx
fx version 0.9.48
Cleaning up /home/ralsina/fx/fx.tar.gz
> cat > func.js
module.exports = (ctx) => {
ctx.body = 'hello world'
}
> ./fx up -p 8080 func.js
2024/06/28 10:52:54 info provisioning localhost ...
*****************
exit status 125
*****************
I spent an hour or so on it, it just doesn't work.
What else is out there?
- Apache OpenWhisk looks promising, I will try it out next, need to see if it works in my resource-limited server.
If it doesn't work out I swear I am rolling my own.
UPDATE: Looks like I am rolling my own: