Open
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
preprodbranch 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
_preor 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
preprodandmasterbranch, so I've done testing on my fork. Works.Details:
simple-gitdep. This was the most used git npm module I could find - 4.4M weekly downloads.zelfluxlocaldb, with unique key index. This is a key value store we can use for storing state. This is the first step to removing the state out of theuserconfig.jsfile. I.e. ip address etc.disablePreProdis set, skip the entire process.isPreProdkey, either from the db, or it "rolls the dice" using the 7% probability, to see if it should be a preprod node. If it was over a month since the last time it took a chance, it will roll the dice again.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
preProdNodeboolean to the flux/info endpoint, so we can get an aggregate view of how many nodes are on preProd.Considerations
sudo apt-get update -y sudo apt-get --with-new-pkgs upgrade -y && sudo apt autoremove -y && cd && cd zelflux && git checkout . && git checkout master && git reset --hard origin/master && git pull sudo rebootas we don't want people changing the branch. It wouldn't be the end of the world as it would mean flux would just switch back again if it was on preprod, but better to avoid