RunOnFlux / flux

Flux, Your Gateway to a Decentralized World. https://home.runonflux.io https://api.runonflux.io https://docs.runonflux.io https://source.runonflux.io https://wiki.runonflux.io
https://home.runonflux.io
GNU Affero General Public License v3.0
232 stars 309 forks source link

Live Preproduction QA #1377

Open MorningLightMountain713 opened 3 months ago

MorningLightMountain713 commented 3 months ago

Background

FluxOS is iterative software with a frequent release schedule, and constant change. Sometimes, critical components such as databases and networking are modified. The network's ~13k nodes relies on a steady, well tested codebase to ensure nodes maintain high uptime metrics.

At times, with a high rate of change, the risk of a release failure which could impact the entire network increases. To mitigate this risk, FluxOS proposes to include a preprod branch into the SDLC where potential impacting changes can be evaluated on live systems, before they are moved to general production.

The Problem

It's quite simple - in our current state, if we miss a catastrophic bug in our internal testing - we're one bad release away from torching the network.

Solution

Mitigate risk by deploying to a small percentage of the node fleet. I propose 7%. Which would be ~900 nodes total, however this will most likely be more like 5% actual numbers, so 650 nodes.

Current release process

PR from development -> master -> release made on master

New release process

PR from development -> preprod -> release made on preprod -> wait x days -> PR from preprod -> master -> release on master

The releases tag on preprod would get suffixed with _pre or something similar. Care would need to be taken to make sure watchdog is compatible. (should be fine I think)

Implementation

Open for discussion here. I thought I would get a PR in so we can discuss it before I write the tests - to make sure we agree this is the right way to go.

It's quite tricky to test as you need a preprod and master branch, so I've done testing on my fork. Works.

Details:

The reason we get the nodes to check if they are a preprod node every month is so we get a good variation of nodes on preprod. Note: it will only run this on startup. So if the node doesn't restart - it won't run the check.

We need to do additional tests on this before rolling out.

Rollout plan

I'd imagine it will need to go through the usual, development -> master process. From there, we would keep the preprod branch. As soon as it gets pushed to master, some nodes should start changing over to the preprod branch.

Then, the following week, we'd push from development to preprod and start the process.

Of note, I've added the preProdNode boolean to the flux/info endpoint, so we can get an aggregate view of how many nodes are on preProd.

Considerations

MorningLightMountain713 commented 3 months ago

Here is a node on preProd:

Screenshot 2024-07-25 at 2 54 43 PM