Skip to content
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

Refactor YANG bootstrap from online to offline #326

Closed
troglobit opened this issue Mar 4, 2024 · 7 comments · Fixed by #460
Closed

Refactor YANG bootstrap from online to offline #326

troglobit opened this issue Mar 4, 2024 · 7 comments · Fixed by #460
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@troglobit
Copy link
Contributor

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).

@wkz
Copy link
Contributor

wkz commented Apr 2, 2024

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). infix on vanilla builds,
    • %m: NIC specific part of base MAC. c0:ff:ee
  • /system/authentication/user/password: Augment model to allow the literal factory-default or 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).

@troglobit
Copy link
Contributor Author

troglobit commented May 3, 2024

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 like factory-default as well

  • /ietf-interface:interfaces could be extended with support for templates, or profiles

     interface e1
       type ethernet
       profile default
       ethernet speed-duplex 100 full
    
     interface default
       type profile
       ipv6
    

    The yang model could look something like:

     interface {
         leaf-ref profile;
           default "default";
     }
    

@jovatn
Copy link
Contributor

jovatn commented May 8, 2024

Should we make a break-down of this task?

@troglobit
Copy link
Contributor Author

troglobit commented May 8, 2024

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):

  1. Refactor bootstrap enough to be done pre-runtime (buildtime if possible), i.e., this task
  2. Upgrade sysrepo, liyang, libnetconf, netopeer2, et al #434
  3. Integrate CESNET/rousette for RESTCONF support #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.

@jovatn
Copy link
Contributor

jovatn commented May 13, 2024

Are these things part of this task or should we spawn or create subtasks?

@troglobit
Copy link
Contributor Author

@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.

@troglobit troglobit added this to the Infix v24.05 milestone May 16, 2024
@troglobit troglobit linked a pull request May 24, 2024 that will close this issue
13 tasks
@troglobit
Copy link
Contributor Author

Fixed in PR #460.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants