srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.53k stars 262 forks source link

swap embedded ssh transport with scrapligo #668

Open hellt opened 3 years ago

hellt commented 3 years ago

to add support for most popular network oses

steiler commented 1 year ago

@hellt what's the actual status?

hellt commented 1 year ago

@steiler it is available for implementation. although I'd say there is a first step that is more crucial to implement, that goes in parallel to what this issue describes.

We need to make sure clab has an option to configure the device(s) with the CLI commands upon the lab deployment. In essence, this means that a user should be able to provide a file with CLI commands, or a list of such commands in a clab file and those commands need to be "pushed" to the relevant nodes as if they were typed in by an operator. For this we need to leverage scrapligo.

Currently, we have a .topology.nodes[node].config structure that was designed to do complicated config templation stuff with clever things embedded, but I feel like it is far more important right now to deliver on the explained use case to make sure we have an easy way to provision network nodes with a config.

I was thinking of having a clab config push command that does that, as well as this functionality, can be reused to allow users to create an "over the top" config file that is applied once the lab is deployed automatically. Think of it as a config that users want to add on top of the clab default config

kellerza commented 1 year ago

This should be very close to what we need in containerlab - https://github.com/labctl/labctl/tree/main/utils/tx - it uses scrapligo where the standard driver reads .ssh/config for more advanced configurations (see here)

It implements your idea of "config push" as "config send" and on top of that "config commit" (similar to what exists of config engine in containerlab) and "config compare" for SR OS and SRL kinds. You can also override these KindMaps for other kinds