Skip to content
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

Supports FRR-VRRP configuration #18617

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
402d685
Supports FRR-VRRP configuration
philo-micas Apr 10, 2024
de84639
update src/sonic-vrrpcfgd/vrrpcfgd/vrrpcfgd.py
philo-micas Apr 17, 2024
c0c924e
Update test_config.py
philo-micas Apr 22, 2024
b3f4e6c
run vrrpmgrd on frr container
philo-micas Apr 29, 2024
c60a6a2
Merge branch 'master' into master-Vrrp
philo-micas May 6, 2024
8e90332
Rename 0034-support-vrrp6-commands-and-tracking-interface.patch to 00…
philo-micas May 6, 2024
4cc0d8e
Merge branch 'master' into master-Vrrp
philo-micas Jul 26, 2024
212f0a4
Rename 0028-support-vrrp6-commands-and-tracking-interface.patch to 00…
philo-micas Jul 26, 2024
38c3563
Change the name of vrrpmgrd to macvlanmgrd
philo-micas Jul 30, 2024
903470d
update vrrp patch
philo-micas Aug 12, 2024
d41202f
Merge branch 'master' into master-Vrrp
philo-micas Aug 12, 2024
2485aab
Rename 0053-support-vrrp6-commands-and-tracking-interface.patch to 00…
philo-micas Sep 10, 2024
6f417ca
Merge branch 'master' into master-Vrrp
philo-micas Sep 10, 2024
3d4fff0
del vrrpcfgd
philo-micas Sep 27, 2024
2c70c75
Merge branch 'master' into master-Vrrp
philo-micas Oct 8, 2024
8b5bffd
add vrrpsyncd to swss container
philo-micas Oct 10, 2024
97eda69
triggle rebuild
philo-micas Oct 23, 2024
a7c6f9a
Update frrcfgd.py
philo-micas Oct 23, 2024
65aa4bd
Revert "Change the name of vrrpmgrd to macvlanmgrd"
philo-micas Oct 24, 2024
646ec99
fix zebra coredump
philo-micas Oct 31, 2024
e2629c3
update supervisord
philo-micas Oct 31, 2024
0bf2f23
update supervisord.conf.j2
philo-micas Oct 31, 2024
a99972f
triggle rebuild
philo-micas Oct 31, 2024
e8f3e5e
triggle rebuild
philo-micas Nov 6, 2024
8393781
triggle rebuild
philo-micas Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ program:zebra
program:staticd
program:bgpd
program:fpmsyncd
program:vrrpd
program:macvlanmgrd
{% 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
program:vrrpcfgd
{%- endif %}
44 changes: 43 additions & 1 deletion dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ dependent_startup=true
dependent_startup_wait_for=zebra:running
{% endif %}

[program:vrrpd]
command=/usr/lib/frr/vrrpd -A 127.0.0.1
priority=4
stopsignal=KILL
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=zebra:running

[program:bgpd]
command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
priority=5
Expand Down Expand Up @@ -125,13 +137,31 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running

[program:macvlanmgrd]
command=macvlanmgrd
priority=6
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=vrrpd:running

{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
[program:frrcfgd]
command=/usr/local/bin/frrcfgd
priority=6
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running
{% else %}
[program:bgpcfgd]
command=/usr/local/bin/bgpcfgd
{% endif %}
priority=6
autostart=false
autorestart=false
Expand All @@ -141,6 +171,18 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running

[program:vrrpcfgd]
command=/usr/local/bin/vrrpcfgd
priority=6
autostart=false
autorestart=true
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running
{% endif %}

{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
{% else %}
[program:staticroutebfd]
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-orchagent/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,4 @@ dependent_startup_wait_for=swssconfig:exited
environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log{{ asan_extra_options }}"
{% endif %}
{%- endif %}

18 changes: 16 additions & 2 deletions files/image_config/copp/copp_cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,17 @@
"red_action": "drop",
"trap_action": "trap",
"trap_priority": "1"

}
},
"queue2_group2": {
"cir":"300",
"cbs":"300",
"meter_type":"packets",
"mode":"sr_tcm",
"red_action":"drop",
"trap_action":"trap",
"trap_priority":"7",
"queue": "7"
}
},
"COPP_TRAP": {
"bgp": {
Expand Down Expand Up @@ -118,6 +127,11 @@
"trap_ids": "src_nat_miss,dest_nat_miss",
"trap_group": "queue1_group2"
},
"vrrp": {
"trap_ids": "vrrp,vrrpv6",
"trap_group": "queue2_group2",
"always_enabled": "true"
},
"sflow": {
"trap_group": "queue2_group1",
"trap_ids": "sample_packet"
Expand Down
4 changes: 2 additions & 2 deletions rules/docker-fpm-frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DOCKER_FPM_FRR = $(DOCKER_FPM_FRR_STEM).gz
DOCKER_FPM_FRR_DBG = $(DOCKER_FPM_FRR_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/$(DOCKER_FPM_FRR_STEM)
$(DOCKER_FPM_FRR)_PYTHON_WHEELS += $(SONIC_BGPCFGD) $(SONIC_FRR_MGMT_FRAMEWORK)
$(DOCKER_FPM_FRR)_PYTHON_WHEELS += $(SONIC_BGPCFGD) $(SONIC_FRR_MGMT_FRAMEWORK) $(SONIC_VRRPCFGD)

$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG2) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_FPM_FRR)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS)
Expand All @@ -28,7 +28,7 @@ SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR)
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG)

$(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp
$(DOCKER_FPM_FRR)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN
$(DOCKER_FPM_FRR)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --cap-add=CAP_NET_ADMIN
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if CAP_NET_ADMIN is the right capability.

In docker, I believe It should be NET_ADMIN but in that case looks duplicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to limit privileged flag for bgp container #14932, NET-ADMIN is required to use the iprouter2 command in vrrpmgr. Thanks.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iprouter2 command in vrrpmgr

Thanks double checked

$(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro

Expand Down
8 changes: 8 additions & 0 deletions rules/sonic_vrrpcfgd.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SPATH := $($(SONIC_VRRPCFGD)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic_vrrpcfgd.mk rules/sonic_vrrpcfgd.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

$(SONIC_VRRPCFGD)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_VRRPCFGD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(SONIC_VRRPCFGD)_DEP_FILES := $(DEP_FILES)
13 changes: 13 additions & 0 deletions rules/sonic_vrrpcfgd.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# sonic-vrrpcfgd package

SONIC_VRRPCFGD = sonic_vrrpcfgd-1.0-py3-none-any.whl
$(SONIC_VRRPCFGD)_SRC_PATH = $(SRC_PATH)/sonic-vrrpcfgd
# These dependencies are only needed because they are dependencies
# of sonic-config-engine and vrrpcfgd explicitly calls sonic-cfggen
# as part of its unit tests.
# TODO: Refactor unit tests so that these dependencies are not needed

$(SONIC_VRRPCFGD)_DEPENDS += $(SONIC_CONFIG_ENGINE_PY3)
$(SONIC_VRRPCFGD)_DEBS_DEPENDS += $(PYTHON_SWSSCOMMON)
$(SONIC_VRRPCFGD)_PYTHON_VERSION = 3
SONIC_PYTHON_WHEELS += $(SONIC_VRRPCFGD)
Loading
Loading