[build] Add the possibility to disable compilation of teamd and radv containers. (#12920)
- Why I did it This optimization is needed for DPU SONiC. DPU SONiC runs a limited set of containers and teamd and radv containers are not part of them. Unlike the other containers, there was no possibility to disable teamd and radv containers compilation. To reduce DPU SONiC compilation time and reduce the image size this commit adds the possibility to disable their compilation. - How I did it Two new configuration options are added to rules/config file: INCLUDE_TEAMD INCLUDE_ROUTER_ADVERTISER By default to preserve the existing behavior both options are enabled. There are two ways to override them: To change option value to "n" in rules/config file. To override their value using SONIC_OVERRIDE_BUILD_VARS env variable: SONIC_OVERRIDE_BUILD_VARS="SONIC_INCLUDE_TEAMD=y SONIC_INCLUDE_ROUTER_ADVERTISER=n" - How to verify it The default behavior is preserved. To verify it compile the image without overriding new options. Install the image and verify that both teamd and radv containers are present and running. To verify the new options override them with "n" value. Compile and install image. Verify that no docker containers are present. Verify that SWSS can start without errors.
This commit is contained in:
parent
4ff15a64c3
commit
9988ff888b
@ -326,11 +326,27 @@ function check_ports_present()
|
||||
return 1
|
||||
}
|
||||
|
||||
function check_service_exists()
|
||||
{
|
||||
systemctl list-units --full -all 2>/dev/null | grep -Fq $1
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo true
|
||||
return
|
||||
else
|
||||
echo false
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
# DEPENDENT initially contains namespace independent services
|
||||
# namespace specific services are added later in this script.
|
||||
DEPENDENT="radv"
|
||||
DEPENDENT=""
|
||||
MULTI_INST_DEPENDENT=""
|
||||
|
||||
if [[ $(check_service_exists radv) == "true" ]]; then
|
||||
DEPENDENT="$DEPENDENT radv"
|
||||
fi
|
||||
|
||||
if [ "$DEV" ]; then
|
||||
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
|
||||
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
|
||||
@ -350,7 +366,7 @@ check_macsec
|
||||
check_ports_present
|
||||
PORTS_PRESENT=$?
|
||||
|
||||
if [[ $PORTS_PRESENT == 0 ]]; then
|
||||
if [[ $PORTS_PRESENT == 0 ]] && [[ $(check_service_exists teamd) == "true" ]]; then
|
||||
MULTI_INST_DEPENDENT="teamd"
|
||||
fi
|
||||
|
||||
|
@ -167,6 +167,12 @@ ENABLE_AUTO_TECH_SUPPORT = y
|
||||
# INCLUDE_MACSEC - build docker-macsec for macsec support
|
||||
INCLUDE_MACSEC = y
|
||||
|
||||
# INCLUDE_TEAMD - build docker-teamd for LAG protocol support
|
||||
INCLUDE_TEAMD ?= y
|
||||
|
||||
# INCLUDE_ROUTER_ADVERTISER - build docker-router-advertiser for router advertisements support
|
||||
INCLUDE_ROUTER_ADVERTISER ?= y
|
||||
|
||||
# INCLUDE_KUBERNETES - if set to y kubernetes packages are installed to be able to
|
||||
# run as worker node in kubernetes cluster.
|
||||
INCLUDE_KUBERNETES = n
|
||||
|
@ -19,10 +19,14 @@ $(DOCKER_ROUTER_ADVERTISER)_WARM_SHUTDOWN_BEFORE = swss
|
||||
$(DOCKER_ROUTER_ADVERTISER)_FAST_SHUTDOWN_BEFORE = swss
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
|
||||
ifeq ($(INCLUDE_ROUTER_ADVERTISER), y)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER)
|
||||
endif
|
||||
|
||||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ROUTER_ADVERTISER_DBG)
|
||||
ifeq ($(INCLUDE_ROUTER_ADVERTISER), y)
|
||||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ROUTER_ADVERTISER_DBG)
|
||||
endif
|
||||
|
||||
$(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv
|
||||
$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --privileged -t
|
||||
|
@ -23,10 +23,14 @@ $(DOCKER_TEAMD)_FAST_SHUTDOWN_BEFORE = syncd
|
||||
$(DOCKER_TEAMD)_FAST_SHUTDOWN_AFTER = swss
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD)
|
||||
ifeq ($(INCLUDE_TEAMD), y)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD)
|
||||
endif
|
||||
|
||||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_TEAMD_DBG)
|
||||
ifeq ($(INCLUDE_TEAMD), y)
|
||||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_TEAMD_DBG)
|
||||
endif
|
||||
|
||||
$(DOCKER_TEAMD)_CONTAINER_NAME = teamd
|
||||
$(DOCKER_TEAMD)_RUN_OPT += --privileged -t
|
||||
|
10
slave.mk
10
slave.mk
@ -204,6 +204,14 @@ ifeq ($(SONIC_INCLUDE_MACSEC),y)
|
||||
INCLUDE_MACSEC = y
|
||||
endif
|
||||
|
||||
ifneq ($(SONIC_INCLUDE_TEAMD),)
|
||||
override INCLUDE_TEAMD = $(SONIC_INCLUDE_TEAMD)
|
||||
endif
|
||||
|
||||
ifneq ($(SONIC_INCLUDE_ROUTER_ADVERTISER),)
|
||||
override INCLUDE_ROUTER_ADVERTISER = $(SONIC_INCLUDE_ROUTER_ADVERTISER)
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_AUTO_TECH_SUPPORT),y)
|
||||
ENABLE_AUTO_TECH_SUPPORT = y
|
||||
endif
|
||||
@ -406,6 +414,8 @@ $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)")
|
||||
$(info "INCLUDE_KUBERNETES_MASTER" : "$(INCLUDE_KUBERNETES_MASTER)")
|
||||
$(info "INCLUDE_MACSEC" : "$(INCLUDE_MACSEC)")
|
||||
$(info "INCLUDE_MUX" : "$(INCLUDE_MUX)")
|
||||
$(info "INCLUDE_TEAMD" : "$(INCLUDE_TEAMD)")
|
||||
$(info "INCLUDE_ROUTER_ADVERTISER" : "$(INCLUDE_ROUTER_ADVERTISER)")
|
||||
$(info "INCLUDE_BOOTCHART : "$(INCLUDE_BOOTCHART)")
|
||||
$(info "ENABLE_BOOTCHART : "$(ENABLE_BOOTCHART)")
|
||||
$(info "ENABLE_FIPS_FEATURE" : "$(ENABLE_FIPS_FEATURE)")
|
||||
|
Loading…
Reference in New Issue
Block a user