Refactor YANG bootstrap from online to offline
Currently, loading of all YANG models at runtime takes a LOT of time -- on the main quad-core Cortex A72 platform it takes up to 15 seconds!
The reason for us not using the defaults created offline (at build time) is that sysrepo only allows initializing the factory datastore (per yang model) when loading the YANG model.
After discussions in the team we think one avenue to explore here is to patch sysrepo to unlock loading factory using sysrepoctl at least once at boot. This would allow us to load device specific factory data, e.g. admin user's default password (unique per device).
As part of this task we might consider making some other changes to our model:
/system/hostname: Support%-specifiers. We should probably support at least:%i: OS ID (from/etc/os-release).infixon vanilla builds,%m: NIC specific part of base MAC.c0:ff:ee
/system/authentication/user/password: Augment model to allow the literalfactory-defaultor similar. This would indicate that the device's factory password, whatever it may be, should be used.
This would make it easier to support having static factory-configs, though there are still problems to solve there I think (SSH server keys come to mind).
- #435
Further discussions on this topic have yielded the following ideas:
-
We will need to add support for yescrypt, and similar, so updating the password hash pattern in ietf-system for
$y$will open up for alos carrying a string likefactory-defaultas well- #435
-
/ietf-interface:interfacescould be extended with support for templates, or profilesinterface e1 type ethernet profile default ethernet speed-duplex 100 full interface default type profile ipv6The yang model could look something like:
interface { leaf-ref profile; default "default"; }- #436
Should we make a break-down of this task?
Great idea, with the work of @mattiaswal we now know more about it, and the work has also shifted a bit. It looks something like this (to be added to the issue summary if we agree):
- Refactor bootstrap enough to be done pre-runtime (buildtime if possible), i.e., this task
- #434
- #433
There are more steps, but focus has moved slightly from speeding up boot to enabling upgrade of sysrepo to get rousette integrated so we get RESTCONF support for the proper WebUI.
Are these things part of this task or should we spawn or create subtasks?
- #432
- #435
@jovatn + @mattiaswal I've made a breakdown into more tasks now. Would've been great if there was a "depends-on" relationship for issues on GitHub ... anyway, we should have a CCB meeting and plan these.
Fixed in PR #460.