Skip to content

Refactor YANG bootstrap from online to offline #326

Closed

Description

@troglobit

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

Activity

  1. converted this from a draft issue on Mar 4, 2024
  2. wkz commented on Apr 2, 2024

    @wkz
    Contributor

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

  3. added
    enhancement
    on Apr 4, 2024
  4. pinned this issue on May 1, 2024
  5. troglobit commented on May 3, 2024

    @troglobit
    ContributorAuthor

    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";
       }
      
  6. moved this from Todo to In progress in Infix & C:oon May 3, 2024
  7. jovatn commented on May 8, 2024

    @jovatn
    Contributor

    Should we make a break-down of this task?

  8. troglobit commented on May 8, 2024

    @troglobit
    ContributorAuthor

    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.

  9. jovatn commented on May 13, 2024

    @jovatn
    Contributor
  10. troglobit commented on May 13, 2024

    @troglobit
    ContributorAuthor

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

  11. added this to the Infix v24.05 milestone on May 16, 2024
  12. linked a pull request that will close this issueInstall yang modules during build #460on May 24, 2024
  13. troglobit commented on May 24, 2024

    @troglobit
    ContributorAuthor

    Fixed in PR #460.

  14. moved this from In progress to Done in Infix & C:oon May 24, 2024
  15. unpinned this issue on Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions