-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Preproduction QA #1377
Open
MorningLightMountain713
wants to merge
17
commits into
development
Choose a base branch
from
preprod
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Live Preproduction QA #1377
Conversation
This file contains 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
MorningLightMountain713
changed the title
[WIP] Live Preproduction QA
Live Preproduction QA
Jul 25, 2024
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
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
andmaster
branch, so I've done testing on my fork. Works.Details:
simple-git
dep. This was the most used git npm module I could find - 4.4M weekly downloads.zelfluxlocal
db, 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.js
file. I.e. ip address etc.disablePreProd
is set, skip the entire process.isPreProd
key, 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
preProdNode
boolean 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 reboot
as 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