-
Notifications
You must be signed in to change notification settings - Fork 82
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
Speed up roles/0-init by almost 50% (by moving 2 things to detected_network.yml) [and later remove them almost entirely] #3272
Conversation
Testing a MEDIUM-sized IIAB install on Ubuntu Server 22.04 is underway (currently wrapping up Stage 7, looking good!) |
So overall you lose 10 seconds by running the same code twice during iiab-install, spit on #2959 which would alert the user to the fact there is no internet to complete the install. Now in place of just recording there was no internet present to explain a potential failure of any other single role, there is no recorded feedback at all as the code moved to specific roles. |
You broke the vnstat role roles/vnstat/tasks/install.yml |
Don't toss more code on top, just back out of this idea. |
We need to optimize for the common case:
|
Thought the common case is to catch the problem early like validate does, record the event to help explain why any role may fail and potentially do something other than run a role that is going to fail. Now with 'rapid-testing cycles' I think you are referring to using runrole repeatedly during testing or development.
The slowest part would be the 4 pings and the dns name lookup. This was part of the debugging routine to detect proxy issues that other users were having, if you can't get a heart beat then apt and friends are sure to fail in some cryptic fashion. |
Yes. That's a big opportunity. Possibly we can try to target getting roles/0-init under 10-15 seconds (for poor people too, eager to craft their own IIAB's out of junkier hardware) before end of year. |
Other option prior to pulling out the detection out of 0-init would of been to make the detection optional on the iiab_stage > 9, new installs could run the detection and optionally react if something is funny while runrole is usually run with the install complete, iiab_stage at 9 when doing developmental work. The admin-console runs with stage being 9, so suppressed there and would cover runrole needing internet when debugging a single role that might of crashed during iiab-install. So where is the issue (how do we improve 0-init times) where this sort of stuff is discussed at? |
Internet detection was for getting packages and for roles that do downloads. Not sure if kiwix catalog is still downloaded. I guess Khan videos are not; not sure about language packs. cmdsrv has a function to detect internet that is pretty fast. |
Almost all roles do downloads when installing, knowing if the internet was reachable when the roles didn't have the install,yml split required the detection. After the mass adoption of the install.yml layout within the roles the need for internet_available went away #2972 sans for 2 roles. Networking doesn't need the detection sans for the workaround for networkd-dispatcher and there are other ways to tell if the run is install mode but nobody asked what alternatives there might be, just dumped code into the network role. I know admin-console has it's own detection so it makes no sense to have the proxy detection within network, that is way too late for any kind of useful action or recording of the startup state that having the info in runtime section of the iiab.ini file provided. I'll ask the question again where is the issue (how do we improve 0-init times) where this sort of stuff is discussed at? Given 3264 is specifically network related refactoring why no mention of this change there before it was implemented? |
This PR accelerates roles/0-init by almost 50% (~20 seconds instead of ~30 seconds) which is a real win to help new IIAB testers and old — to de-bureaucratize and focus.
Good enough for now. More improvements will surely be possible over time — without sacrificing critical validation etc (the whole purpose of testing!)
Whether vars
internet_available
andgw_active
are really needed at all (or whether they should evolve into something else, etc) can be resolved over time. For now, they are moved from roles/0-init to roles/network/tasks/detected_network.ymlI want to get this merged quickly to help testers of all kind, who are tired of "hurry up and wait" workflows.
This PR is tested on Mint 20.
Please consider @jvonau's PR below which has many other good ideas to follow in July:
PS roles/1-prep/tasks/main.yml is also cleaned up, to communicate clearly when
/etc/iiab/iiab.env
is being populated.Related: