From 78c803851c2a30b8f2a39dd8b75bcf345023178d Mon Sep 17 00:00:00 2001 From: lguohan Date: Wed, 5 Aug 2020 13:23:12 -0700 Subject: [PATCH] [build]: combine feature and container feature table (#5081) 1. remove container feature table 2. do not generate feature entry if the feature is not included in the image 3. rename ENABLE_* to INCLUDE_* for better clarity 4. rename feature status to feature state 5. [submodule]: update sonic-utilities * 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (#1015) (HEAD, origin/master, origin/HEAD) [lguohan] * c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (#1023) [lguohan] * dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (#1016) [Arun Saravanan Balachandran] * 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (#1022) [lguohan] Signed-off-by: Guohan Lu --- Makefile.work | 8 ++-- build_debian.sh | 2 +- files/build_scripts/mask_disabled_services.py | 2 +- files/build_templates/init_cfg.json.j2 | 29 +++++++++----- .../build_templates/sonic_debian_extension.j2 | 6 +-- files/image_config/hostcfgd/hostcfgd | 34 ++++++++-------- files/scripts/supervisor-proc-exit-listener | 29 +++++++------- platform/marvell-arm64/rules.mk | 2 +- platform/marvell-armhf/rules.mk | 2 +- rules/config | 27 +++++++------ rules/docker-nat.mk | 4 +- rules/docker-restapi.mk | 2 +- rules/docker-sflow.mk | 4 +- rules/docker-sonic-mgmt-framework.mk | 4 +- rules/docker-telemetry.mk | 4 +- rules/sonic-mgmt-framework.mk | 2 +- slave.mk | 40 ++++++++++--------- 17 files changed, 107 insertions(+), 94 deletions(-) diff --git a/Makefile.work b/Makefile.work index 687b3cb488..9c2a56af70 100644 --- a/Makefile.work +++ b/Makefile.work @@ -9,7 +9,7 @@ # through http. # * ENABLE_ZTP: Enables zero touch provisioning. # * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart. -# * INSTALL_KUBERNETES: Allows including Kubernetes +# * INCLUDE_KUBERNETES: Allows including Kubernetes # * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports # * by default for TOR switch. # * ENABLE_SYNCD_RPC: Enables rpc-based syncd builds. @@ -166,7 +166,7 @@ SONIC_BUILD_INSTRUCTION := make \ ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \ ENABLE_ZTP=$(ENABLE_ZTP) \ SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \ - INSTALL_KUBERNETES=$(INSTALL_KUBERNETES) \ + INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \ KUBERNETES_VERSION=$(KUBERNETES_VERSION) \ KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \ K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \ @@ -181,8 +181,8 @@ SONIC_BUILD_INSTRUCTION := make \ KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \ HTTP_PROXY=$(http_proxy) \ HTTPS_PROXY=$(https_proxy) \ - SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ - SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \ + SONIC_ENABLE_SYSTEM_TELEMETRY=$(INCLUDE_SYSTEM_TELEMETRY) \ + SONIC_ENABLE_RESTAPI=$(INCLUDE_RESTAPI) \ EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \ $(SONIC_OVERRIDE_BUILD_VARS) diff --git a/build_debian.sh b/build_debian.sh index 544a6cbd42..9eb27f19f8 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -207,7 +207,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION} sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common gnupg2 -if [ "$INSTALL_KUBERNETES" == "y" ] +if [ "$INCLUDE_KUBERNETES" == "y" ] then ## Install Kubernetes echo '[INFO] Install kubernetes' diff --git a/files/build_scripts/mask_disabled_services.py b/files/build_scripts/mask_disabled_services.py index e2597ac686..f3a1d76bf1 100755 --- a/files/build_scripts/mask_disabled_services.py +++ b/files/build_scripts/mask_disabled_services.py @@ -9,5 +9,5 @@ with open(INIT_CFG_FILE_PATH) as init_cfg_file: init_cfg = json.load(init_cfg_file) if 'FEATURE' in init_cfg: for feature_name, feature_props in init_cfg['FEATURE'].items(): - if 'status' in feature_props and feature_props['status'] == 'disabled': + if 'state' in feature_props and feature_props['state'] == 'disabled': subprocess.run(['systemctl', 'mask', '{}.service'.format(feature_name)]) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 90980fe069..63d54989f5 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -17,18 +17,27 @@ {% endfor %} } }, +{%- set features = [("bgp", "enabled", "enabled"), + ("database", "enabled", "disabled"), + ("dhcp_relay", "enabled", "enabled"), + ("lldp", "enabled", "enabled"), + ("pmon", "enabled", "enabled"), + ("radv", "enabled", "enabled"), + ("snmp", "enabled", "enabled"), + ("swss", "enabled", "enabled"), + ("syncd", "enabled", "enabled"), + ("teamd", "enabled", "enabled")] %} +{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", "enabled")) %}{% endif %} +{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", "enabled")) %}{% endif %} +{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", "enabled")) %}{% endif %} +{%- if include_restapi == "y" %}{% do features.append(("restapi", "disabled", "enabled")) %}{% endif %} +{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", "enabled")) %}{% endif %} +{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", "enabled")) %}{% endif %} "FEATURE": { -{%- for feature, status in [("sflow", "disabled"), ("telemetry", "enabled")] %} +{%- for feature, state, autorestart in features %} "{{feature}}": { - "status": "{{status}}" - }{% if not loop.last %},{% endif -%} -{% endfor %} - }, - "CONTAINER_FEATURE": { -{%- for container in ["bgp", "database", "dhcp_relay", "lldp", "nat", "pmon", "radv", "restapi", "sflow", - "snmp", "swss", "syncd", "teamd", "telemetry"] %} - "{{container}}": { - "auto_restart": "{% if container == "database" %}disabled{% else %}enabled{% endif %}", + "state": "{{state}}", + "auto_restart": "{{autorestart}}", "high_mem_alert": "disabled" }{% if not loop.last %},{% endif -%} {% endfor %} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index e6e0ca10b7..f9f9b49e71 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -267,7 +267,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install azure-s sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install watchdog==0.10.2 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install futures==3.3.0 -{% if install_kubernetes == "y" %} +{% if include_kubernetes == "y" %} # Copy kubelet service files # Keep it disabled until join, else it continuously restart and as well spew too many # non-required log lines wasting syslog resources. @@ -425,7 +425,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS ta {% endif %} {% endfor %} -{% if install_kubernetes == "y" %} +{% if include_kubernetes == "y" %} ## Pull in kubernetes docker images echo "pulling universal k8s images ..." sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker pull k8s.gcr.io/pause:${K8s_GCR_IO_PAUSE_VERSION} @@ -471,7 +471,7 @@ sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netn # It implements delayed start of services sudo cp $BUILD_TEMPLATES/snmp.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "snmp.timer" | sudo tee -a $GENERATED_SERVICE_FILE -{% if enable_system_telemetry == 'y' %} +{% if include_system_telemetry == 'y' %} sudo cp $BUILD_TEMPLATES/telemetry.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "telemetry.timer" | sudo tee -a $GENERATED_SERVICE_FILE {% endif %} diff --git a/files/image_config/hostcfgd/hostcfgd b/files/image_config/hostcfgd/hostcfgd index 8a3dbd15b6..4fd47df605 100755 --- a/files/image_config/hostcfgd/hostcfgd +++ b/files/image_config/hostcfgd/hostcfgd @@ -41,8 +41,8 @@ def obfuscate(data): return data -def update_feature_status(feature_name, status): - if status == "enabled": +def update_feature_state(feature_name, state): + if state == "enabled": start_cmds = [] start_cmds.append("sudo systemctl unmask {}.service".format(feature_name)) start_cmds.append("sudo systemctl enable {}.service".format(feature_name)) @@ -56,7 +56,7 @@ def update_feature_status(feature_name, status): .format(err.cmd, err.returncode, err.output)) continue syslog.syslog(syslog.LOG_INFO, "Feature '{}' is enabled and started".format(feature_name)) - elif status == "disabled": + elif state == "disabled": stop_cmds = [] stop_cmds.append("sudo systemctl stop {}.service".format(feature_name)) stop_cmds.append("sudo systemctl disable {}.service".format(feature_name)) @@ -71,7 +71,7 @@ def update_feature_status(feature_name, status): continue syslog.syslog(syslog.LOG_INFO, "Feature '{}' is stopped and disabled".format(feature_name)) else: - syslog.syslog(syslog.LOG_ERR, "Unexpected status value '{}' for feature '{}'".format(status, feature_name)) + syslog.syslog(syslog.LOG_ERR, "Unexpected state value '{}' for feature '{}'".format(state, feature_name)) class Iptables(object): @@ -268,19 +268,19 @@ class HostConfigDaemon: self.iptables = Iptables() self.iptables.load(lpbk_table) - def update_all_feature_statuses(self): + def update_all_feature_states(self): feature_table = self.config_db.get_table('FEATURE') for feature_name in feature_table.keys(): if not feature_name: syslog.syslog(syslog.LOG_WARNING, "Feature is None") continue - status = feature_table[feature_name]['status'] - if not status: - syslog.syslog(syslog.LOG_WARNING, "Status of feature '{}' is None".format(feature_name)) + state = feature_table[feature_name]['state'] + if not state: + syslog.syslog(syslog.LOG_WARNING, "Eanble state of feature '{}' is None".format(feature_name)) continue - update_feature_status(feature_name, status) + update_feature_state(feature_name, state) def aaa_handler(self, key, data): self.aaacfg.aaa_update(key, data) @@ -310,29 +310,29 @@ class HostConfigDaemon: self.iptables.iptables_handler(key, data, add) - def feature_status_handler(self, key, data): + def feature_state_handler(self, key, data): feature_name = key feature_table = self.config_db.get_table('FEATURE') if feature_name not in feature_table.keys(): syslog.syslog(syslog.LOG_WARNING, "Feature '{}' not in FEATURE table".format(feature_name)) return - status = feature_table[feature_name]['status'] - if not status: - syslog.syslog(syslog.LOG_WARNING, "Status of feature '{}' is None".format(feature_name)) + state = feature_table[feature_name]['state'] + if not state: + syslog.syslog(syslog.LOG_WARNING, "Enable state of feature '{}' is None".format(feature_name)) return - update_feature_status(feature_name, status) + update_feature_state(feature_name, state) def start(self): - # Update all feature statuses once upon starting - self.update_all_feature_statuses() + # Update all feature states once upon starting + self.update_all_feature_states() self.config_db.subscribe('AAA', lambda table, key, data: self.aaa_handler(key, data)) self.config_db.subscribe('TACPLUS_SERVER', lambda table, key, data: self.tacacs_server_handler(key, data)) self.config_db.subscribe('TACPLUS', lambda table, key, data: self.tacacs_global_handler(key, data)) self.config_db.subscribe('LOOPBACK_INTERFACE', lambda table, key, data: self.lpbk_handler(key, data)) - self.config_db.subscribe('FEATURE', lambda table, key, data: self.feature_status_handler(key, data)) + self.config_db.subscribe('FEATURE', lambda table, key, data: self.feature_state_handler(key, data)) self.config_db.listen() diff --git a/files/scripts/supervisor-proc-exit-listener b/files/scripts/supervisor-proc-exit-listener index 04a2a50013..e81e6b31a8 100755 --- a/files/scripts/supervisor-proc-exit-listener +++ b/files/scripts/supervisor-proc-exit-listener @@ -11,21 +11,20 @@ import swsssdk from supervisor import childutils # Each line of this file should specify either one critical process or one -# critical process group, (as defined in supervisord.conf file), in the +# critical process group, (as defined in supervisord.conf file), in the # following format: # # program: # group: CRITICAL_PROCESSES_FILE = '/etc/supervisor/critical_processes' -# This table in databse contains the features for container and each -# feature for a row will be configured a state or number. -CONTAINER_FEATURE_TABLE_NAME = 'CONTAINER_FEATURE' +# The FEATURE table in config db contains auto-restart field +FEATURE_TABLE_NAME = 'FEATURE' # Read the critical processes/group names from CRITICAL_PROCESSES_FILE def get_critical_group_and_process_list(): critical_group_list = [] - critical_process_list = [] + critical_process_list = [] with open(CRITICAL_PROCESSES_FILE, 'r') as file: for line in file: @@ -43,7 +42,7 @@ def get_critical_group_and_process_list(): else: syslog.syslog(syslog.LOG_ERR, "Syntax of the line {} in critical_processes file is incorrect. Exiting...".format(line)) sys.exit(6) - + return critical_group_list, critical_process_list def main(argv): @@ -82,23 +81,23 @@ def main(argv): if container_name != 'database': config_db = swsssdk.ConfigDBConnector() config_db.connect() - container_features_table = config_db.get_table(CONTAINER_FEATURE_TABLE_NAME) - if not container_features_table: - syslog.syslog(syslog.LOG_ERR, "Unable to retrieve container features table from Config DB. Exiting...") + features_table = config_db.get_table(FEATURE_TABLE_NAME) + if not features_table: + syslog.syslog(syslog.LOG_ERR, "Unable to retrieve features table from Config DB. Exiting...") sys.exit(2) - if not container_features_table.has_key(container_name): - syslog.syslog(syslog.LOG_ERR, "Unable to retrieve features for container '{}'. Exiting...".format(container_name)) + if not features_table.has_key(container_name): + syslog.syslog(syslog.LOG_ERR, "Unable to retrieve feature '{}'. Exiting...".format(container_name)) sys.exit(3) - restart_feature = container_features_table[container_name].get('auto_restart') + restart_feature = features_table[container_name].get('auto_restart') if not restart_feature: - syslog.syslog(syslog.LOG_ERR, "Unable to determine auto-restart feature status for container '{}'. Exiting...".format(container_name)) + syslog.syslog(syslog.LOG_ERR, "Unable to determine auto-restart feature status for '{}'. Exiting...".format(container_name)) sys.exit(4) - # If container is database or auto-restart feature is enabled and at the same time + # If container is database or auto-restart feature is enabled and at the same time # a critical process exited unexpectedly, terminate supervisor - if ((container_name == 'database' or restart_feature == 'enabled') and expected == 0 and + if ((container_name == 'database' or restart_feature == 'enabled') and expected == 0 and (processname in critical_process_list or groupname in critical_group_list)): MSG_FORMAT_STR = "Process {} exited unxepectedly. Terminating supervisor..." msg = MSG_FORMAT_STR.format(payload_headers['processname']) diff --git a/platform/marvell-arm64/rules.mk b/platform/marvell-arm64/rules.mk index b61a7a87c3..22fe398eba 100644 --- a/platform/marvell-arm64/rules.mk +++ b/platform/marvell-arm64/rules.mk @@ -7,7 +7,7 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/docker-ptf-mrvl.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/linux-kernel-arm64.mk -ENABLE_SYSTEM_TELEMETRY = "" +INCLUDE_SYSTEM_TELEMETRY = "" ENABLE_SYNCD_RPC = "" diff --git a/platform/marvell-armhf/rules.mk b/platform/marvell-armhf/rules.mk index 809e46bd17..99872ce72e 100644 --- a/platform/marvell-armhf/rules.mk +++ b/platform/marvell-armhf/rules.mk @@ -8,7 +8,7 @@ include $(PLATFORM_PATH)/docker-ptf-mrvl.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/linux-kernel-armhf.mk -ENABLE_SYSTEM_TELEMETRY = "" +INCLUDE_SYSTEM_TELEMETRY = "" ENABLE_SYNCD_RPC = "" SONIC_ALL += $(SONIC_ONE_IMAGE) \ diff --git a/rules/config b/rules/config index 0076650e54..08b779cf98 100644 --- a/rules/config +++ b/rules/config @@ -79,9 +79,6 @@ ENABLE_ORGANIZATION_EXTENSIONS = y #SONIC_DEBUGGING_ON = y #SONIC_PROFILING_ON = y -# ENABLE_SYSTEM_TELEMETRY - build docker-sonic-telemetry for system telemetry support -ENABLE_SYSTEM_TELEMETRY = y - # DEFAULT_KERNEL_PROCURE_METHOD - default method for obtaining kernel # build: build kernel from source # download: download pre-built kernel from Azure storage. @@ -99,21 +96,25 @@ FRR_USER_GID = 300 # Default VS build memory preparation DEFAULT_VS_PREPARE_MEM = yes -# ENABLE_SYSTEM_SFLOW - build docker-sonic-sflow for sFlow support -ENABLE_SFLOW = y -# ENABLE_MGMT_FRAMEWORK - build docker-sonic-mgt-framework for CLI and REST server support -ENABLE_MGMT_FRAMEWORK = y +# INCLUDE_SYSTEM_TELEMETRY - build docker-sonic-telemetry for system telemetry support +INCLUDE_SYSTEM_TELEMETRY = y -# ENABLE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs -ENABLE_RESTAPI = n +# INCLUDE_SFLOW - build docker-sflow for sFlow support +INCLUDE_SFLOW = y -# ENABLE_NAT - build docker-sonic-nat for nat support -ENABLE_NAT = y +# INCLUDE_MGMT_FRAMEWORK - build docker-sonic-mgmt-framework for CLI and REST server support +INCLUDE_MGMT_FRAMEWORK = y -# INSTALL_KUBERNETES - if set to y kubernetes packages are installed to be able to +# INCLUDE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs +INCLUDE_RESTAPI = n + +# INCLUDE_NAT - build docker-nat for nat support +INCLUDE_NAT = y + +# INCLUDE_KUBERNETES - if set to y kubernetes packages are installed to be able to # run as worker node in kubernetes cluster. -INSTALL_KUBERNETES = n +INCLUDE_KUBERNETES = n # KUBERNETES_VERSION - Set to the required version. # K8s_GCR_IO_PAUSE_VERSION - Version of k8s universal pause container image diff --git a/rules/docker-nat.mk b/rules/docker-nat.mk index eb6bd16ccd..431b944e65 100644 --- a/rules/docker-nat.mk +++ b/rules/docker-nat.mk @@ -13,13 +13,13 @@ $(DOCKER_NAT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_P $(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -ifeq ($(ENABLE_NAT), y) +ifeq ($(INCLUDE_NAT), y) SONIC_DOCKER_IMAGES += $(DOCKER_NAT) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_NAT) SONIC_STRETCH_DOCKERS += $(DOCKER_NAT) endif -ifeq ($(ENABLE_NAT), y) +ifeq ($(INCLUDE_NAT), y) SONIC_DOCKER_DBG_IMAGES += $(DOCKER_NAT_DBG) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_NAT_DBG) SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_NAT_DBG) diff --git a/rules/docker-restapi.mk b/rules/docker-restapi.mk index bd91aabd86..ef56789dd7 100644 --- a/rules/docker-restapi.mk +++ b/rules/docker-restapi.mk @@ -10,7 +10,7 @@ $(DOCKER_RESTAPI)_PATH = $(DOCKERS_PATH)/$(DOCKER_RESTAPI_STEM) $(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -ifeq ($(ENABLE_RESTAPI), y) +ifeq ($(INCLUDE_RESTAPI), y) SONIC_DOCKER_IMAGES += $(DOCKER_RESTAPI) SONIC_STRETCH_DOCKERS += $(DOCKER_RESTAPI) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_RESTAPI) diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk index 67724ad7c5..915b9ad9b7 100644 --- a/rules/docker-sflow.mk +++ b/rules/docker-sflow.mk @@ -14,13 +14,13 @@ $(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE $(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_SFLOW) -ifeq ($(ENABLE_SFLOW), y) +ifeq ($(INCLUDE_SFLOW), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SFLOW) SONIC_STRETCH_DOCKERS += $(DOCKER_SFLOW) endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SFLOW_DBG) -ifeq ($(ENABLE_SFLOW), y) +ifeq ($(INCLUDE_SFLOW), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SFLOW_DBG) SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SFLOW_DBG) endif diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index f07b8d023d..e714664604 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -14,13 +14,13 @@ SONIC_DOCKER_IMAGES += $(DOCKER_MGMT_FRAMEWORK) $(DOCKER_MGMT_FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_MGMT_FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) -ifeq ($(ENABLE_MGMT_FRAMEWORK), y) +ifeq ($(INCLUDE_MGMT_FRAMEWORK), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT_FRAMEWORK) SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT_FRAMEWORK) endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_MGMT_FRAMEWORK_DBG) -ifeq ($(ENABLE_MGMT_FRAMEWORK), y) +ifeq ($(INCLUDE_MGMT_FRAMEWORK), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_MGMT_FRAMEWORK_DBG) SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_MGMT_FRAMEWORK_DBG) endif diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 04f1871f33..446993f55f 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -13,13 +13,13 @@ $(DOCKER_TELEMETRY)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_TELEMETRY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) SONIC_DOCKER_IMAGES += $(DOCKER_TELEMETRY) -ifeq ($(ENABLE_SYSTEM_TELEMETRY), y) +ifeq ($(INCLUDE_SYSTEM_TELEMETRY), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TELEMETRY) SONIC_STRETCH_DOCKERS += $(DOCKER_TELEMETRY) endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) -ifeq ($(ENABLE_SYSTEM_TELEMETRY), y) +ifeq ($(INCLUDE_SYSTEM_TELEMETRY), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_TELEMETRY_DBG) endif diff --git a/rules/sonic-mgmt-framework.mk b/rules/sonic-mgmt-framework.mk index a57ce6b1b0..871c9ee57f 100644 --- a/rules/sonic-mgmt-framework.mk +++ b/rules/sonic-mgmt-framework.mk @@ -1,6 +1,6 @@ # SONiC mgmt-framework package -ifeq ($(ENABLE_MGMT_FRAMEWORK), y) +ifeq ($(INCLUDE_MGMT_FRAMEWORK), y) SONIC_MGMT_FRAMEWORK = sonic-mgmt-framework_1.0-01_amd64.deb $(SONIC_MGMT_FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-mgmt-framework diff --git a/slave.mk b/slave.mk index f066030d56..c01657c1d4 100644 --- a/slave.mk +++ b/slave.mk @@ -88,8 +88,8 @@ ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y) ENABLE_PFCWD_ON_START = y endif -ifeq ($(SONIC_ENABLE_SYSTEM_TELEMETRY),y) -ENABLE_SYSTEM_TELEMETRY = y +ifeq ($(SONIC_INCLUDE_SYSTEM_TELEMETRY),y) +INCLUDE_SYSTEM_TELEMETRY = y endif ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) @@ -97,11 +97,11 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) # Issue: qemu crashes when it uses "go get url" # Qemu Support: https://bugs.launchpad.net/qemu/+bug/1838946 # Golang Support: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/golang-nuts/1txPOGa4aGc -ENABLE_SYSTEM_TELEMETRY = N +INCLUDE_SYSTEM_TELEMETRY = n endif -ifeq ($(SONIC_ENABLE_RESTAPI),y) -ENABLE_RESTAPI = y +ifeq ($(SONIC_INCLUDE_RESTAPI),y) +INCLUDE_RESTAPI = y endif ifeq ($(SONIC_ENABLE_SYNCD_RPC),y) @@ -112,12 +112,12 @@ ifeq ($(SONIC_INSTALL_DEBUG_TOOLS),y) INSTALL_DEBUG_TOOLS = y endif -ifeq ($(SONIC_ENABLE_SFLOW),y) -ENABLE_SFLOW = y +ifeq ($(SONIC_INCLUDE_SFLOW),y) +INCLUDE_SFLOW = y endif -ifeq ($(SONIC_ENABLE_NAT),y) -ENABLE_NAT = y +ifeq ($(SONIC_INCLUDE_NAT),y) +INCLUDE_NAT = y endif @@ -187,7 +187,6 @@ $(info "USERNAME" : "$(USERNAME)") $(info "PASSWORD" : "$(PASSWORD)") $(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)") $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") -$(info "INSTALL_KUBERNETES" : "$(INSTALL_KUBERNETES)") $(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)") $(info "INSTALL_DEBUG_TOOLS" : "$(INSTALL_DEBUG_TOOLS)") $(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)") @@ -199,8 +198,6 @@ $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)") -$(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)") -$(info "ENABLE_RESTAPI" : "$(ENABLE_RESTAPI)") $(info "ENABLE_ZTP" : "$(ENABLE_ZTP)") $(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)") $(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)") @@ -208,8 +205,12 @@ $(info "KERNEL_PROCURE_METHOD" : "$(KERNEL_PROCURE_METHOD)") $(info "BUILD_TIMESTAMP" : "$(BUILD_TIMESTAMP)") $(info "BLDENV" : "$(BLDENV)") $(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)") -$(info "ENABLE_SFLOW" : "$(ENABLE_SFLOW)") -$(info "ENABLE_NAT" : "$(ENABLE_NAT)") +$(info "INCLUDE_MGMT_FRAMEWORK" : "$(INCLUDE_MGMT_FRAMEWORK)") +$(info "INCLUDE_SYSTEM_TELEMETRY" : "$(INCLUDE_SYSTEM_TELEMETRY)") +$(info "INCLUDE_RESTAPI" : "$(INCLUDE_RESTAPI)") +$(info "INCLUDE_SFLOW" : "$(INCLUDE_SFLOW)") +$(info "INCLUDE_NAT" : "$(INCLUDE_NAT)") +$(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)") $(info ) ifeq ($(SONIC_USE_DOCKER_BUILDKIT),y) @@ -656,12 +657,15 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export sonic_asic_platform="$(patsubst %-$(CONFIGURED_ARCH),%,$(CONFIGURED_PLATFORM))" export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)" export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)" - export enable_system_telemetry="$(ENABLE_SYSTEM_TELEMETRY)" - export enable_restapi="$(ENABLE_RESTAPI)" export enable_ztp="$(ENABLE_ZTP)" - export enable_nat="$(ENABLE_NAT)" + export include_system_telemetry="$(INCLUDE_SYSTEM_TELEMETRY)" + export include_restapi="$(INCLUDE_RESTAPI)" + export include_nat="$(INCLUDE_NAT)" + export include_sflow="$(INCLUDE_SFLOW)" + export include_mgmt_framework="$(INCLUDE_MGMT_FRAMEWORK)" + export include_iccpd="$(INCLUDE_ICCPD)" export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)" - export install_kubernetes="$(INSTALL_KUBERNETES)" + export include_kubernetes="$(INCLUDE_KUBERNETES)" export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)" export installer_debs="$(addprefix $(STRETCH_DEBS_PATH)/,$($*_INSTALLS))" export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(STRETCH_DEBS_PATH)/$(deb))))"