Page MenuHomeVyOS Platform

Replace legacy loadFile with config_diff
In progress, NormalPublicENHANCEMENT

Description

The possibility of replacing loadFile with config_diff was mentioned in the description in T4295. The generalization of 'diff functions' in the course of T5317 support the plan of defining batch set/delete operations of a cstore instance within a call to diff. One expects performance to be comparable, and the lack of useful error reporting in loadFile can be addressed.

Details

Version
vyos-1.4
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

jestabro changed the task status from Open to In progress.Jan 16 2024, 2:41 AM

The working implementation is linked below; performance is not yet comparable to the legacy loadFile, though there are obvious points of optimization to be made. The general framework will be submitted for PR to support other development, with load_config as an illustrative example, but not yet a replacement for loadFile.

https://github.com/jestabro/vyos1x-adapter
https://github.com/vyos/vyos1x-config/compare/master...jestabro:vy-adapter
https://github.com/vyos/vyos-1x/compare/current...jestabro:vy-adapter
https://github.com/vyos/vyatta-cfg/compare/current...jestabro:vy-adapter
https://github.com/vyos/libvyosconfig/compare/master...jestabro:vy-adapter

This will be readied for PR without adding the external package vyos1x-adapter; that version has already been completed and will be linked below.

Links for PR in preparation:
https://github.com/vyos/vyos1x-config/compare/current...jestabro:vy-adapter
https://github.com/vyos/vyatta-cfg/compare/current...jestabro:vy-adapter
https://github.com/vyos/vyos-1x/compare/current...jestabro:vy-adapter
https://github.com/vyos/libvyosconfig/compare/current...jestabro:vy-adapter

Note that the last will need to be updated with the vyos1x-config commit hash after it is merged, as pinning is now done during the libvyosconfig build.

The suggestion to replace the native C api with ctypes, in order to avoid a build dependency on libvyattta-cfg.so, still requires calling dlopen when building the derived libarary libvyosconfig; the above retains the original approach which provides other advantages.

This work has been generalized and simplified for use with the minimal vyconf daemon:
https://vyos.dev/T6717

This PR will be closed when following completion of T6717.