Replies: 7 comments 2 replies
-
|
Another can of worms ;) I would love to keep the simple "modules are configured in the order they're listed" approach, same for config and plugin parameters. In most cases that works well, and even in the "SR with IS-IS" case the order of configuration does not matter. Of course you might have a case where a module configuration depends on another module. We could add configure_after attribute to check ordering of modules. Whether we'd report an error or reorder them (with a warning) is another decision to be discussed. Regardless, if you want to go for SR-with-BGP, we would need a Python module for SR that would set dependencies based on configured parameters in its initialization phase because it doesn't make sense to make SR dependent on BGP if in reality it runs perfectly fine without it as long as you don't use BGP-related SR features. |
Beta Was this translation helpful? Give feedback.
-
Makes sense. In all other cases (including #2) I'll keep the order as requested by the user. That will result in minimum number of rearrangements (and thus minimal amount of surprise ;). |
Beta Was this translation helpful? Give feedback.
-
|
Implemented in 5dd57b1. Turns out it was easier to do reordering along the lines of the original idea by @jbemmel , so sr, isis, bgp turns into isis, bgp, sr and not into minimally-reordered isis, sr, bgp. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the idea. It doesn't work because we're dealing with a topological sort not a linear sort. Looks like I intuitively wrote a variation of Kahn's algorithm ;) |
Beta Was this translation helpful? Give feedback.
-
|
Right, it could be made to work but it would have to impose a total ordering.
Instead of returning 0, it should always return +1 or -1. And the tie breaker could be the user’s provided order, i.e. index(m1) - index(m2) in the provided list
…Sent from my iPhone
On Dec 25, 2021, at 2:01 AM, Ivan Pepelnjak ***@***.***> wrote:
Thanks for the idea. It doesn't work because we're dealing with a topological sort not a linear sort.
Looks like I intuitively wrote a variation of Kahn's algorithm ;)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
|
Right, it could be made to work but it would have to impose a total ordering.
That’s the problem — some items are not comparable.
Imagine the “sr, bgp, isis” order and a simple swap sort.
Comparison #1: sr vs bgp. No need to reorder, sr is not dependent on BGP
Comparison #2: bgp vs isis. No need to reorder.
End result: “sr, bgp, isis”. Tested with real code :(
The tie breaker could have been the number of dependencies. That would probably work.
Instead of returning 0, it should always return +1 or -1. And the tie breaker could be the user’s provided order, i.e. index(m1) - index(m2) in the provided list
Sent from my iPhone
On Dec 25, 2021, at 2:01 AM, Ivan Pepelnjak ***@***.***> wrote:
Thanks for the idea. It doesn't work because we're dealing with a topological sort not a linear sort.
Looks like I intuitively wrote a variation of Kahn's algorithm ;)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
|
Implemented in 5dd57b1 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It looks like modules are currently processed in the order declared. For example, from routing sr-mpls-bgp example:
'sr' depends on 'isis', but this order of deployment is currently not enforced(?)
Also, there can be a case where 'sr' modifies 'bgp' configuration - there would seem to be a preferred execution order:
(in my case I tried to configure a BGP shortcut for SR, which fails because BGP AS is not configured)
Beta Was this translation helpful? Give feedback.
All reactions