-
Notifications
You must be signed in to change notification settings - Fork 4
Management cleanup #441
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
Management cleanup #441
Conversation
6c5b296
to
1d339c7
Compare
3a77ab1
to
7f5a5e7
Compare
1d339c7
to
3197f90
Compare
7f5a5e7
to
3183aca
Compare
246423e
to
0a28eb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This batch looks good again, awesome work!
mgmt/src/processor/proc.rs
Outdated
// check error | ||
req.reply_tx.send(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
0cd6638
to
b231ceb
Compare
3183aca
to
ce6247c
Compare
b231ceb
to
a2d87d8
Compare
ce6247c
to
81b4363
Compare
Move config database outside of model definition submodule. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The ConfigProcessor owns the config database, an frrmi and opens a channel to receive configuration requests. This aims at centra- lizing the config management outside of the specific RPC. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Decouple gRPC from management logic (processor) by spawning a ConfigProcessor task that listens over a channel requests from the gRPC server. The configuration processor fully owns the config database and the frrmi to apply configs in FRR. This way, the gRPC server: - needs only relay requests to the ConfigProcessor and receive responses back, to produce answers to the outside. - does not need access to the config database nor a lock on it. - needs not be aware about how configs are applied. This decouples the internal logic from the gRPC layer. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Let ConfigRequest and ConfigResponse variants that require a config carry instead a Box<GwConfig> so that both enums keep a small size. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
It would be better to validate outside of the gRPC as that way the validation would be performed regardless of how the config was learnt. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
We need to be able to apply a 'blank' config in order to flush the system (e.g. to roll back an unsuccesful configuration if no prior config was there). This patch adds a builder for a blank config. Such a config has a reserved generation id of 0 and it cannot be deleted. Since the config is stored in the config database, where configs are keyed by generation id, this means that attempting to add a config with generation id 0 will fail. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
A default VrfConfig is called "default" and marked as the default VRF. This is needed so that a blank config underlay VrfConfig has those values, which affect how the configs are applied. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
These are produced by default due to the gRPC server and provide very little relevant information for us. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Don't log parser errors if packets are captured with kernel driver on the loopback interface. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
When sending a config to frr-agent, include the genId so that the latter can log it. This helps troubleshooting. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
If a config is not successfully applied, don't keep it in the database. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
It was annotated initially as such, but the annotation was droppped. Add the annotation back again and use the Prefix associated method try_from_tuple() in gRPC as this was causing a panic when feeding bad prefixes. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Prefix, defined in the routing crate is used by crates mgmt and dataplane. Add a feature flag 'testing' so that external crates can use prefix converters that are only available for testing. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
a2d87d8
to
fac46e6
Compare
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Replace unix datagram-based frrmi implementation with one that uses unix stream sockets and handle connection failures and re-connects. Over the frrmi, "messages" are expected to be serialized as: |length(8)|genid(8)|data(variable)| in both directions, where: length: the number of octets contained in data genid: the generation id the message corredponds to, 0 in keepalives. data: string of length octets corresponding to a config or to a response. BREAKING-CHANGE: This will only work with an frr-agent using stream sockets. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Call GwConfigDatabase::remove() instead of the member remove() method, as the latter does not prevent the initial config from being deleted. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The previous code required BGP configuration to be present and would refuse to apply a config otherwise. Relax this by issuing only a warning as this will allow applying vanilla configs for the purpose of wiping out the system. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Probe the frr-agent before attempting to apply a config because this is cheap and there's little point in trying to apply a config if the frr-agent is down or unreachable since the operation will fail. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Partial implementation of Display for some Config objects to produce friendlier logs for testing, until the cli is integrated. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
a023d7b
into
pr/fredi/management-processor
This rides on #434This rides on #427
Assigning this to @daniel-noland since it targets and modifies #434