Pivity

Dev blog 27/07/2018

Last read Never
#1

Dev blog 27/07/2018

Last month I promised you a dev blog about jobs and how they work, unfortunately that won't happen. However, that's because jobs are the last major thing remaining before we can launch v3, and jobs are about 80% done.

This dev blog will be more of a rant than anything, as well as including some information about v3 at the end if you're not interested in our struggles.

So what better thing is there to talk about other than how much of a pain the previous week has been?


v3 infrastructure

Our new server infrastructure is quite advanced, and with each layer of complexity comes twice as much suffering. Why do I say this you ask? Well, then you clearly haven't had the joy of working with a Kubernetes cluster yet. I will try to explain.

We opted to use a piece of software called Rancher. Rancher acts as a controlpanel for your Kubernetes clusters, and makes life somewhat easier as you don't have to store and write a whole bunch of yaml files, which mind you, are the literal spawn of satan. I don't know if you tried to set up a Minecraft server as a kid, but those yaml files for any permission plugin always had my 13 year old self ripping my hair out. Of course, I've since understood where my 13 year old self went wrong, and so has every IDE ever. DON'T USE TABS IN YAML!

Enough about yaml, let's talk about the real issues. We started setting up Kubernetes last Saturday, and we've had to overcome a whole different array of hurdles along our way. This was neither of our first times working with Kubernetes, but it has some ways of making you very depressed no matter how many times you use it.

The first problem we ran into was the fact we have a Gitlab CI runner running in our cluster (a cluster is a collection of nodes(a node is a server)), this runner kept eating our CPU to the point where the usage was at 90%+ for the runner alone. You can imagine what happened next. We did not realize the cause of the issue at the time but we quickly learnt that whenever we ran a pipeline some anomalies started happening. First we noticed our web application being insanely slow, followed by it crashing completely. We thought okay, maybe we configured something wrong, but no, we pushed another few commits and a second pipeline started running simultaneously, but this time on the master node. Our entire cluster crashed. We thought that okay, maybe we just need to increase the RAM of our servers, so we did. Upped their RAM from 2GB each to 4GB each. We now had two nodes running etcd and being flagged as a worker, and one node running controlplane, etcd and being flagged as a worker.

Can you guess what happened next? Yeah, this didn't work either. Same problem. We thought that maybe we'll be fine if we don't run the worker on the master node, so we upped the node count to 5 so we could run two masters and three workers, all members of etcd. This still did not work. We moved the gitlab CI runner out of our cluster and it felt like all our problems were gone.

But they weren't. The website was still running insanely slow for a load balanced website running on multiple nodes. We quickly realized that all assets were loading really slowly. The cause of this: a connection to the website went like this: Client -> CloudFlare -> Load Balancer -> Internal k8s NGinx ingress -> Website. That's at least one step too many. The solution: Move all assets to the cloud so that the DOMContentLoaded time would be reduced significantly. Did this work? Sort of. Now we had a new issue! CloudFlare, despite being such a great service decided that it would not purge the cache of a single file for the life of me. I pasted the entire URL to the file as it told me to, with HTTPS and everything. After about an hour of waiting and trying again I tried to replace HTTPS with HTTP in the url as a last attempt. And lo and behold! It worked! Why? I don't know, beats me.

Is that all the problems? Noooooo, of course not! The website was still slower than we would have liked and we pinpointed the persistent storage disks as an issue. Increased the size, now they worked fine. Next up was our PostgreSQL cluster being slower than we would have liked. Solution? Swap from Rancher's inbuilt NGinx ingress to consul. Problem? The helm chart (helm is a repository of automated kubernetes pod/service configurations) that we were using for our PostgreSQL setup does not support consul, and the official helm chart for PostgreSQL didn't work with Rancher. One CLA signed and a pull request later and we now have a nonuple postgres setup running.

The website is now at an acceptable speed with automatic recovery using healthchecks for both liveness and readiness. The database is persistent, is backed up every hour onto a DigitalOcean spaces object storage repository and also has redundancy. Redis has redundancy as well. We can literally shut down one node and and the application will failover and continue working without downtime.


Highly available

All of this considered and it basically means that unless our highly available load balancer dies, we should in theory never have downtime. Of course, if DigitalOcean has network trouble or two nodes go down at once we will have an issue. If a database corruption ever occurs we will have a slight downtime while importing a backup, and some data loss but not an amount we can't deal with.

This are not all of the issues we ran into during the last week, but telling you about any more of them would probably bore you. You're probably not interested in our server infrastructure anyway.


When is v3, for real this time...

So when is v3 actually coming out? You already have the server's set up and everything!? Good question, we're aiming to finish jobs and a few other small things and then launch a beta for content creators to test and make themselves familiar with early the coming week.

The beta is strictly limited to content creators as we still don't want a whole lot of traffic going through the site, and if a serious bug is found it's limited to people who would be otherwise affected by such a bug.

Content curators will get access to v3 to familiarize themselves with the new UI and features before the beta officially starts.

When the public official release will come depends on how well the beta goes. I am going on a holiday starting the 8th and won't be back until the 14th, so if the beta goes badly and I don't get sufficient time to launch v3 it won't happen until after I'm back.


As usual, keep replies and discussions civil.

If you want to keep up with development you may join our discord and keep an eye on the #commits channel.

Winner x 4Friendly x 2Funny x 1Optimistic x 1
#2

Take your time Marcuz, we're all already proud of your work on gmodstore v3, can't wait for any beta-tests, would be more than happy to help. Good luck on any further development, hope you won't encounter many more issues.

Agree x 1Friendly x 1
#3

Very nice work on this. It's actually interesting to hear about the kinda issues you guys have had, shows you actually care that the community is kept in the loop.

I'm very excited for the beta, can't wait to test all this new stuff out.

As always, amazing work. We all appreciate the amount of work you and the other slaves put into it.<3

Friendly x 2
#4

This is really nice to see, I think a lot of people didn't know that making the next gmodstore takes so much effort. Finishing a certain thing seems easy, but in the end 99% won't know about everything around this (optimization, back-end edits and a lot of more things people don't know about)

Just wanna thank everyone committing to the upcoming gmodstore! Including all the members and content creators of course, making gmodstore what it currently is :)

Friendly x 2
#5

its been 3 days I want a refund : /

Agree x 1
#6

Progress is going well. Honestly just take your guys' time with it. I think we all can agree that we want a great functional finished product. Thanks, Marcuz & J0sh for keeping us updated on what is going on.

#7

Looks pretty good so far , one suggestion i have since i saw that there is Two-factor authentication on the profile security settings , would it be possible for content creators do select that only accounts which have the 2FA enabled are allowed do buy his scripts. This should reduce the amount of people who open disputes over paypal this particular script :)

#8
ByZerochainat 13th of August 2018 13:46:33
would it be possible for content creators do select that only accounts which have the 2FA enabled are allowed do buy his scripts. This should reduce the amount of people who open disputes over paypal this particular script :)

It doesn't make any sense, you want the 2FA on the paypal acc.

In 2.6 years, and in 2496 sales i had one guy that according to paypal (Even if i don't trust them) actually had his paypal account hacked.

Winner x 1
#9

2FA is only for content creators. For things like performing refunds, and other stuff that can't be undone.

#10

Will this change a major part of the websites looks and functionality?

Dumb x 1
#11
ByCodex | Piat 20th of August 2018 19:43:30
Will this change a major part of the websites looks and functionality?

No it won't

Funny x 1Winner x 1
#12
ByCodex | Piat 20th of August 2018 19:43:30
Will this change a major part of the websites looks and functionality?

Do you ever think before you post? Like at all? Or is bad posting just part of you.

Agree x 1Funny x 1Friendly x 1
#13
ByNookyavaat 20th of August 2018 21:28:37
Do you ever think before you post? Like at all? Or is bad posting just part of you.

I'd say it's apart of me, I'm trying to change that. Sorry!

Funny x 1Dumb x 1
#14
ByCodex | Piat 20th of August 2018 21:36:49
I'd say it's apart of me, I'm trying to change that. Sorry!

Then spend more time reading things and less time worrying about being a part of every thread. People respect an actual thought out post more that's actually informed instead of one that makes no sense, and has no effort.

Agree x 3Winner x 1
#15
ByNookyavaat 20th of August 2018 21:39:46
Then spend more time reading things and less time worrying about being a part of every thread. People respect an actual thought out post more that's actually informed instead of one that makes no sense, and has no effort.

Well do and I apologize...

Dumb x 4
Users viewing this thread
Nobody