V3 Developer Updates

Originally published at: https://quickbox.io/announcements/v3-developer-updates/

With the upcoming QuickBox v3 release we’ve decided to provide weekly updates on its current development status. These will be slightly technical as opposed to our normal announcements.

Our current release of QuickBox is packed full of features and as a result, it’s not as streamlined as we’d like it to be. This is primarily due to:

  • Our current choice in database
  • Lack of optimization
  • Our file structure

We’re pleased to announce however that these are being addressed in the next iteration of QuickBox!

The Goal

With v3 we’ll be shifting our database over to SQLite. We’ve spent a lot of time going through our use case, what datatypes we use and how scalable our database needs to be…and to be blunt, MySQL is overkill.

With SQLite, we’ll have the ability to incorporate some more functionality a little bit easier. Backing up and moving your QuickBox Installation to another server will be a breeze (As the SQLite database is stored in a single file). There’ll also be dramatically fewer overheads – the SQLite library is around 250KB in size compared to the 600MB that MySQL needs.

As most of our code is structured around MySQL, we’ve decided to opt for a complete rewrite of QuickBox. This will help us address some flaws in our code and optimize our scripts workflows. We’ll be utilizing libraries to significantly reduce each file’s size and enable us to easily add new functionality without any risk to existing software.

We’ll also be adhering to FHS in v3. You’ll find QuickBox in the /opt/ directory going forward. This will make it easier for us to scrape information for the dashboard instead of looking at the various locations we currently utilize.

Where are we now?

Over the last week, the main focus has been on the backbones of QuickBox v3. For this update, I’ll be going into our quality control, libraries, update path and what has been completed this week.

Quality Control

With v2, all code was tested on each distro that’s currently supported. If it works on each system it’s then pushed live. With v3 coding, some new practices have been implemented on top of this. All of our code is now tested via a GitLab Pipeline and a dedicated testing environment. When the Pipeline is triggered, the following happens:

  • All code is downloaded onto the testing environment
  • Each file is tested for bugs, vulnerabilities and poor practices
  • A report is generated which lists areas that require further work

This is helping us ensure that the QuickBox code is as secure and efficient as possible.

Libraries

Before we started the v3 development we discussed what areas could be improved. At the top of the list was duplicated code. With v2, 6.5% of the code is duplicated (That’s 16,934 lines)! To address this it was decided that libraries will be implemented. This allows us to reduce file sizes dramatically, as well as increase its maintainability. I’ve built the libraries from the ground up and we’ll be utilizing those in QuickBox v3.

Update path

This coming week the last v2 update will go live (2.4.0). This update will contain some small fixes to existing software, as well as prepare servers for the 3.0.0 update. The v3 update will need to be initiated manually (either by dashboard or CLI) as we don’t want to force anyone to change if they are happy to remain on v2. When the update is initiated everything will be converted automatically.

Heads Up! It is important to note that users running Xenial will not be able to upgrade to v3 as the end of its five-year LTS window is on April 30th 2021.

This week at QuickBox

I’ll split this section into framework and dashboard. JMSolo 👑 and I are currently focusing on each individually (I hate frontend, sorry JM).

Framework:

I’ve been hard at work on the installer, updater and libraries. The installer is now complete. It has some new features (A non-interactive mode) as well as a rollback feature if the installation fails.

CLI commands now have a verbose option. This will output everything that’s being done instead of the titles we were outputting before. Simply adding a -v will enable this for any command.

I’ve also completed dynamic languages for CLI this week. Depending on the language you choose all CLI output will be in that language.

The main v3 updater is also finished (Not to be confused with 2.4.0->3.0.0 updater). The updater now has dynamic checks to avoid redoing un-needed actions (Looking at python re-re-re installation!)

It’s now a lot quicker – have a look at the table below!

This table represents the time improvements from the current v2 QuickBox Pro updater to the new v3 method.
OLD/Current:
    real 2m25.809s
    user 0m34.523s
    sys 0m12.207s
New:
    real 0m20.133s
    user 0m10.435s
    sys 0m2.257s

Dashboard:

JMSolo 👑 has been hard at work optimizing the dashboard. With the new database, every function has to be redesigned from the ground up!

He’s completed the main bulk of the conversion and is now going through and optimizing each page. JM has been able to address some security concerns as well as reduce the file size dramatically.

Whilst it will retain the same look, the underlying code is a massive improvement!

The dashboard will also finally have dynamic grouping! Server admins will be able to create their own groups (with allowed software permissions) and assign users to them!

That’s it for this week! I’ll catch you all on the 5th!