GitLab Serverless
about.gitlab.com
about.gitlab.com
Essentially, a good way to set something up that requires minimal maintenance.
[0] https://gist.github.com/shaunpud/35f77b542eaec7c7024bbb15c2e... [1] https://lowendbox.com
1. start with docker (or dokku), on a single server, it's easy enough to get going, automate CI/CD. Make sure your backups are working and relatively frequent.
2. Break your lower environments on to a separate server.
3. Break out your database, and set up redundancy at that layer. Leverage DBaaS if you can.
4. Grow to multiple app/api instances for redundancy, and setup rolling deployments.
5. Scale Vertically (bigger servers/instances)
6. Migrate to Kubernetes and expand your automation and tooling.
7. Break apart your application into smaller pieces to scale individually. Possibly leveraging platform tools like Lambda/Functions.
8. Work towards redundant datacenter and application data sharding to deliver a closer experience.
By the time you get to 5-6, you should be making money or have a good investor strategy in place for capital. There's very little need to go all out when at concept or earlier release stages.
6-8 may take place in a different order, depending on your needs.. but again, you should have money or have raised capital by this point, or you have a relatively good problem to have otherwise.
IIRC Stack Overflow grew vertically pretty big on a single server, then two (db/application split).
Our main path business path gets about 60,000 reqs min. For that, sure AWS Lambda would never compete. Not only would it cost more but you'd probably hit the concurrency limit in AWS Lambda.
But we also have an admin UI that gets about 2500 visits a day. We're running that for about $4 a month - with virtually no operational burden whatsoever, and with a reassurance of resilience.
We worked out that the inflection point of value is at about 3 million requests a month. (that's an fag packet estimate, arbitrarily expensive 'request', your mileage may vary).
Its no silver bullet, but for some applications, particularly personal projects, low traffic and startup scenarios it can be ideal.
A managed app runtime can be great though: for those who tried Google AppEngine back in the day, it was amazing to work with.
I'm curious about this statement because I'm currently working on a project where the intent is to port a legacy app to AWS Lambda. The legacy app is currently distributed across 96 VMs and handles ~ 50K reqs/min during normal times but can run into ~ 3M reqs/min during high demand.
Are you saying AWS Lambda can not scale to handle this type of demand and if so can you point me to some resources/references that explain this?
For the record, I'm not the one that came up with the architecture.
But also there is a per account per region concurrency limit of 1000 parallel executions. That's shared across all lambdas. If you hit it, requests will not be for-filed, increasing this limit is entirely at Amazons discretion, and wont they necessarily do it. I stand corrected, see comment.
https://docs.aws.amazon.com/lambda/latest/dg/limits.html
In your case 3m reqs/min will be fine if each request can be completed in no more than 20 milliseconds, and then you'll be on the knife edge.
If you wanted to reap the benefits of Lambda on the development side, loose the limits and keep server costs low(er) you could deploy OpenFaaS or similar in ECS. However you then loose the operational benefits of a managed solution.
(Source: I work on Lambda at AWS)
The term I like to associate with serverless is all peer-to-peer, not client-server architecture, for example any datwebsite, on datproject, and any zsite on zeronet.
There you dont have a server, really, a zite is a peer in a torrent swarm like any other, and can be found like any other torrent by its infohash (sha1) in the DHT, and can at any time go offline, while the swarm continues as nothing happened, new people can still access the zite from peers - and the zite despite rendering in a web-browser, can/should not really talk to any server, only to a peer-to-peer network. There is no "form submit" allowed on a zite, then it defeats the purpose of zeronet and similar techniques.
Another example is gun.js
1. Per invocation billing 2. No need to provision resources ahead of time
Taking AWS's example
1. EC2 is not serverless but Lambda is 2. RDS is not serverless but Aurora Serverless is.
"Serverless" is nowadays "AWS Lambda" (and similar products).
I wish people called it FaaS (function as a service), but they call it "serverless", and it's fine I guess
What "serverless" means, in the context of the article (and basically how anyone uses it today), is "AWS Lambda" (or FaaS). The name is kinda stupid, since it still uses servers; it's just that you don't need to care about them and scaling is done magically by Amazon.
This is a myth that really needs to be busted. There is almost no lock in with serverless. The serverless products from all the major providers are nearly identical.
The lock in comes from the services you are using within a particular cloud, which you can avoid if you want to by running everything else in k8s.
https://lowendbox.com/blog/hostedsimply-4gb-ram-ssd-cached-v...
EDIT: cheaper even, $1.58/month:
https://lowendbox.com/blog/n3servers-vps-hosting-and-hybrid-...
1) Hardware) 'I want to run Linux + Stack + App'. You get an empty rack, a network port and a power socket. You have to buy iron, install and maintain OS/platform, runtime environment and your service. Scaling requires more work and buying more stuff.
2) VMs) 'I want to run Stack + App'. Machine and OS is provided for you and maintained. You still have to build runtime environment and your app. Scaling doesn't require capex like (1), but still slow - you have to decide how much capacity you want.
3) Containers) Still 'I want to run Stack + App' but faster scaling so can be responsive rather than in advance. A halfway step to:
4) Serverless) 'I want to run App'. Runtime environment, hosting etc is all taken care of. You just write the app and everything else works at the capacity you need.
We've been aiming at this last level of abstraction for a while. As you pointed out, the classic VPS with LAMP got you some of the way there, but without the scaling advantages. Google App Engine got closer but was its own special world. Containers are an important technical enabler to doing it more portably.
1) Scaling doesn't really require more work. It needs a bigger investment because a hardware hypervisor costs significantly more than a vm... after all, that hard metal can host tens of VMs
2) you still need to manage your linux system and OS if you're buying a VM... the only thing you don't need to worry about is hardware. So, a faulty hard drive, hypervisor failover and similar stuff is taken care of. That doesn't mean that it works, however. It just means that somebody else will take care of it... though it might not work and you're entirely on their mercy to fix it
3) containers don't inherently give you better scaling either. creating images from VMs has been done for ages before docker was a thing, and provisioning a new Node from a VM Image is pretty easy if you're already using Terraform or similar.
you're just able to utilize a higher percentage of your hardware with containers, as you don't need to virtualize the kernel... so its a cost-cutting issue, not scaling
This is precisely the benefit. It lets you not require as much ops experience to get the same output as what once required a lot.
This is pretty neat because now more teams can do more stuff since lots of orgs don’t have good ops or can’t pay.
In many cases it's an additional abstraction, but there are advantages beyond just better hardware utilization.
Heck, a hardware server can boot in seconds if you skip POST entirely
As soon as the idle state is abstracted away, then it's serverless.
The other big change was removing the concept of servers/instances altogether so there is no step-wise scaling at all that you can see or control.
So it is just the natural progression of a shared LAMP host that’s worked well for 20 years.
Before, you had to open an account, provision a server, figure out your machine image, install dependencies, figure out error/process handling, deploy...
...figure out optimization, payment, RAM usage, longevity, how many instances do I need? What are peak hours, and should it autoscale?
No you just run a single command line and it's up in the cloud, figuring all that out for you automatically.
We have run into instances where the serverless model doesn't work so well, like when we updated our graphql API to query a postgres store - each lambda invocation created its own connection pool and would overload the database. Currently theres no way to reliably persist those somewhere else and have the lambdas pick up the persistent connection (like how a redis session store would work) - perhaps that will change. the lambdas work best when they're more-or-less "pure functions", so if you have to keep things like sql connection pools, or a session around, you still need your own persistent server.
I see this as a play to start leveraging all the machines they have hanging around for running jobs and gitlab instances, and I'm not against it as long as the Gitlab itself doesn't suffer. Are they planning to pivot to becoming a cloud provider like digital ocean? It feels like if they can manage orchestrating serverless functions they can manage orchestrating containers or VMs...
[0]: https://www.reddit.com/r/gitlab/comments/a54mc3/support_for_...
(I have this page favorited)
If anyone ever figures out the isolation problem I'd host an instance and/or ci servers in exchange for licence credit. Unfortunately the current gitlab-runner doesn't run on arm [1] but I wanted ci/cd to make containers for the project, 98% of the time it's idle.
1: https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/7...
Would love to hear some feedback if anyone has some.
I know what they mean with serverless, so that's not it.
- is this tied to CI in any way so stuff can get tested via knative?
- is this CI for functions to be deployed (via OpenFaaS or Lambda)?
- is this just a frontend for serverless backends?
I'm totally lost, I use GitLab as a hosted amount of git repos, with inclusion of CI runners, so maybe that's the wrong angle of approach? Which _problem_ does it solve? Is it to make using serverless easier? If I wanted to use 'functions' would I first have to install GitLab? Why would I use a code hosting platform for that?
If I try to install gitlab on Kubernetes I have no less than 4 ways to do it, and none of them work perfectly.
What problems are you hitting when installing GitLab on Kubernetes? You can always open an issue about it so it can be prioritized for fixing.
[1] - https://gitlab.com/gitlab-org/gitlab-ce/issues/29398
[2] - https://docs.gitlab.com/ee/user/project/clusters/#adding-an-...
We had multiple ways of installing on Kubernetes before but we reduced it to one canonical helm chart https://docs.gitlab.com/ee/install/kubernetes/gitlab_chart.h...
Yes. Until a couple months ago the 'official' way was a deprecated (but not yet replaced with anything not marked alpha) chart: https://gitlab.com/charts/gitlab-omnibus
FWIW, I use that to run GitLab on Kubernetes on AWS (not EKS).
Though the new 'container-native' (more separate containers for each service instead of one big omnibus container for the web app + git server + else) one is now out and 'official': https://gitlab.com/charts/gitlab-omnibus
So I hope to upgrade to that soon.
I'm a bit lost when it comes to GitLab because they are trying to do so much, so I'm confused if this is a change in strategy or natural next step for them.
Edit: Clarifying question.
Landmine experience in issue lists
Also, if you want to write the details, it would be great to open an issue https://gitlab.com/gitlab-org/gitlab-ce/issues. Thanks in advance.
Two, having to connect to the same block storage in exactly the same way to make everything work.
I just want to upload a backup that gitlab makes, and upload that somewhere (anywhere) to restore from that one tarball, regardless of where I’ve decided to host my current instance or data (or indeed, if I’ve decided to use block storage again or not).
1. Yes, you have to restore a backup on exactly the same version of GitLab and then upgrade that version. If you restore it to a different version the database scheme isn't correct.
2. You can restore a GitLab backup anywhere https://docs.gitlab.com/ee/raketasks/backup_restore.html as long as it is the same version. I think the output is a single file.
1. Gitlab is able to migrate up to a new version, so is there anything preventing it from getting up to a certain (older) version before running the last few migrations after restore?
If I set up a new instance it’s generally one or two minor versions higher than the old instance.
2. I swear I restored from my omnibus installation to Helm based gitlab and lose all my uploads and registry images. Cannot see from the docs why that would happen any more though.
Maybe it was the opposite, with me restoring the backup to the same block storage devices, and gitlab hiccuping on the fact that all the files it wanted to restore were already there.
2. It might be that this wasn't supported yet in the Helm chart at that time, I'm not sure.
For number 2, that sounds unexpected, and we would love for you to give us more details. https://gitlab.com/charts/gitlab/issues
https://gitlab.com/gitlab-org/gitlab-ce/issues/27217
Something like this. When I fixed the VERSION manually, there are other errors, as expected.
However the peculiar thing is the errors are not idempotent. Somethings there's some postgres wrong column error, other times it says you can't import the project because you can't have hyphens in project names. (which I don't)
Migration is hard, considering everything can be linked in Gitlab.
To be honest I don't understand why they prioritized this but it seems to me like Gitlab has a path to becoming a lot more than what Atlassian is right now; by owning not just the devops but also the cloud itself.
It sort of makes sense if that's something they aim for, but it'd be an uphill battle and to be honest I don't see it ever working out. But there's huge rewards there if it does work out. It's kind of the reverse of Amazon tried to do (AWS is trying to compete with Github etc by having their own code hosting and code deploy services, which doesn't ever lead anywhere except for die-hard AWS fans).
I'm giving Gitlab the benefit of the doubt on this for one simple reason: I was very doubtful of their current strategy of building in a monsterhouse of features to their product. Then I actually used it and was impressed with how smooth and useful it all is. It also took me actually using it to understand what exactly they were doing.
Most people are confused about Gitlab today because they compare it to Github, but Github really only does code hosting and barely even touches development lifecycle; whereas Gitlab is more like Atlassian (and goes beyond that, even). It owns code hosting, product management, development, and deployment. So the "natural next step" in that direction is devops, which they have already been playing with.
Only if you attach k8s right? Or can you leave services deployed with normal CI Jobs that don't end?
All this new Serverless functionality does is now provide a window to see the Serverless workload rather than just your traditional pods.
All brought to you by knative.
Jenkins-X serverless: Jenkins only runs when it has work to do and shuts down while idle.
Gitlab serverless: tooling to support FaaS creation
Serverless is such a silly word to begin with, now it's even more confusing.
Jenkins: only does CI/CD, needs to be integrated with a suite of other tools.
GitLab: end-to-end DevOps in one application that has native project planning, source code management, CI/CD, artifact repository, configuration management, and observability built-in.
So Jenkins-X Serverless is about the Jenkins service itself running in a serverless paradigm. Or "using Knative to run Jenkins"
GitLab Serverless is a configuration management feature that allows you to build, deploy, and manage your own serverless functions from the same place where your issues, code, artifacts, etc. are. Or "Using GitLab (which uses Knative) to run your functions."
Please help me understand why I would choose Serverless over heroku
- no capacity planning
- simple programming model
There are monitoring/observability tools for serverless (CloudWatch/Epsagon/Thundra/IOPipe)
One of the things that attracts me to Serverless is not paying anything (or vey little) until a project is properly off the ground.
But with things like Heroku there’s a ridiculous delay to start up if here hasn’t been a request for a while.
Does Serverless / this implementation of Serverless address that at all?
Kinda silly that it's required, but a good and super-cheap solution. Thanks.
I guess it's not quite nothing, but can't you just buy a cheap $5 (or even $2.50) VM, and run all of your small projects off of the same one.
The cost is pretty small, and you don't have to worry about how your going to migrate your code off the serverless platform later.
What I'd really like though is one place I can just put the code, test it and know I can leave it there when it gets bigger. That's the dream anyway, but I guess nothing's perfect!
I assume this should be "back up." Otherwise I'm missing what this has to do with backups.
Thank you for pointing this out and sorry for the confusion.
Since one of the big pros of serverless computing is only paying for the resources that you use, I am wondering if we will hit a point where preparing a trivial release is not worth the effort because it's simply too expensive. Paying 23 minutes of cloud computing for a simple typo adds up easily.
Is there really a big demand for this?
The name "serverless" is so unfortunate... On-demand would have been better.
tl;dr; GitLab have have a FaaS offering in alpha.
> It leverages Knative, which enables autoscaling down to zero and backup to run serverless workloads on Kubernetes.
So what are you referring to?
I think all money Amazon is throwing at serverless is to build a foundation to ultimately transform all their "managed" services into a serverless form. They already released serverless RDS (https://aws.amazon.com/rds/aurora/serverless/).
My understanding of Serverless was that it was synonymous with 'Functions as a Service'. What Knative seems to be doing is more like 'Backend as a Service'. I guess it's good to know that these two very different approaches are now both labeling themselves as 'Serverless'. I guess Knative is just hitchhiking on top of Amazon's marketing success around the 'Serverless' term.