-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frrcfgd] introduce frrcfgd to manage frr config when frr_mgmt_framew…
…ork_config is true (#5142) - Support for non-template based FRR configurations (BGP, route-map, OSPF, static route..etc) using config DB schema. - Support for save & restore - Jinja template based config-DB data read and apply to FRR during startup **- How I did it** - add frrcfgd service - when frr_mgmg_framework_config is set, frrcfgd starts in bgp container - when user changed the BGP or other related table entries in config DB, frrcfgd will run corresponding VTYSH commands to program on FRR. - add jinja template to generate FRR config file to be used by FRR daemons while bgp container restarted **- How to verify it** 1. Add/delete data on config DB and then run VTYSH "show running-config" command to check if FRR configuration changed. 1. Restart bgp container and check if generated FRR config file is correct and run VTYSH "show running-config" command to check if FRR configuration is consistent with attributes in config DB Co-authored-by: Zhenhong Zhao <[email protected]>
- Loading branch information
Showing
42 changed files
with
5,976 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} | ||
{% include "/usr/local/sonic/frrcfgd/bgpd.conf.j2" %} | ||
{% else %} | ||
{% include "/usr/share/sonic/templates/bgpd/bgpd.conf.j2" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }} | ||
{ | ||
"frr_mgmt_framework_config": | ||
{% if "frr_mgmt_framework_config" in DEVICE_METADATA["localhost"].keys() %} | ||
"{{ DEVICE_METADATA["localhost"]["frr_mgmt_framework_config"] }}" | ||
{% else %} | ||
"" | ||
{% endif %}, | ||
"docker_routing_config_mode": | ||
{% if "docker_routing_config_mode" in DEVICE_METADATA["localhost"].keys() %} | ||
"{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }}" | ||
{% else %} | ||
"" | ||
{% endif %} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} | ||
{% include "/usr/local/sonic/frrcfgd/frr.conf.j2" %} | ||
{% else %} | ||
{% include "/usr/share/sonic/templates/frr.conf.j2" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} | ||
{% include "/usr/local/sonic/frrcfgd/staticd.conf.j2" %} | ||
{% else %} | ||
{% include "/usr/share/sonic/templates/staticd/staticd.conf.j2" %} | ||
{% endif %} |
12 changes: 12 additions & 0 deletions
12
dockers/docker-fpm-frr/frr/supervisord/critical_processes.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
program:zebra | ||
program:staticd | ||
program:bgpd | ||
program:fpmsyncd | ||
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} | ||
program:bfdd | ||
program:ospfd | ||
program:pimd | ||
program:frrcfgd | ||
{% else %} | ||
program:bgpcfgd | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SPATH := $($(SONIC_FRR_MGMT_FRAMEWORK)_SRC_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-frr-mgmt-framework.mk rules/sonic-frr-mgmt-framework.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(SPATH)) | ||
|
||
$(SONIC_FRR_MGMT_FRAMEWORK)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(SONIC_FRR_MGMT_FRAMEWORK)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(SONIC_FRR_MGMT_FRAMEWORK)_DEP_FILES := $(DEP_FILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# sonic-frr-mgmt-framework package | ||
|
||
SONIC_FRR_MGMT_FRAMEWORK = sonic_frr_mgmt_framework-1.0-py3-none-any.whl | ||
$(SONIC_FRR_MGMT_FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-frr-mgmt-framework | ||
# These dependencies are only needed because they are dependencies | ||
# of sonic-config-engine and frrcfgd explicitly calls sonic-cfggen | ||
# as part of its unit tests. | ||
# TODO: Refactor unit tests so that these dependencies are not needed | ||
|
||
$(SONIC_FRR_MGMT_FRAMEWORK)_DEPENDS += $(SONIC_CONFIG_ENGINE_PY3) | ||
$(SONIC_FRR_MGMT_FRAMEWORK)_DEBS_DEPENDS += $(PYTHON_SWSSCOMMON) | ||
$(SONIC_FRR_MGMT_FRAMEWORK)_PYTHON_VERSION = 3 | ||
SONIC_PYTHON_WHEELS += $(SONIC_FRR_MGMT_FRAMEWORK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.eggs/ | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
frrcfgd/*.pyc | ||
tests/*.pyc | ||
tests/__pycache__/ | ||
.idea | ||
.coverage | ||
frrcfgd/__pycache__/ | ||
venv | ||
tests/.coverage* |
Empty file.
Oops, something went wrong.