Add TELEMETRY_WRITABLE build option to enable telemetry write mode (default read-only) (#4209)

Add build flag TELEMETRY_WRITABLE. When set to "y" it will add a go build flag in the telemetry build that will enable telemetry write mode to allow configuration via gNMI Set RPC as well as operations via the gNOI RPC's. The default for TELEMETRY_WRITABLE is unset in which case telemetry is read-only. In read-only mode the Set RPC and all gNOI RPC's are disabled and will return an "Unsupported" error when called.

authored-by: Eric Seifert <eric@seifert.casa>
This commit is contained in:
Eric Seifert 2020-06-25 08:04:43 -07:00 committed by GitHub
parent cebb85b161
commit de07029352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,9 @@
# * Default: yes # * Default: yes
# * Values: yes, no # * Values: yes, no
# * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build # * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build
# * TELEMETRY_WRITABLE: Enable write/config operations via the gNMI interface.
# * Default: unset
# * Values: y
# * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache # * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache
# * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages # * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages
# * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none) # * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none)
@ -200,6 +203,7 @@ SONIC_BUILD_INSTRUCTION := make \
HTTPS_PROXY=$(https_proxy) \ HTTPS_PROXY=$(https_proxy) \
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \
SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \ SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \
TELEMETRY_WRITABLE=$(TELEMETRY_WRITABLE) \
EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \
BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \
SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \

View File

@ -131,6 +131,9 @@ ENABLE_RESTAPI = n
# ENABLE_NAT - build docker-sonic-nat for nat support # ENABLE_NAT - build docker-sonic-nat for nat support
ENABLE_NAT = y ENABLE_NAT = y
# TELEMETRY_WRITABLE - Enable write/config operations via the gNMI interface.
# Uncomment to enable:
# TELEMETRY_WRITABLE = y
# INSTALL_KUBERNETES - if set to y kubernetes packages are installed to be able to # INSTALL_KUBERNETES - if set to y kubernetes packages are installed to be able to
# run as worker node in kubernetes cluster. # run as worker node in kubernetes cluster.
INSTALL_KUBERNETES = n INSTALL_KUBERNETES = n

View File

@ -230,6 +230,8 @@ $(info "BLDENV" : "$(BLDENV)")
$(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)") $(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)")
$(info "ENABLE_SFLOW" : "$(ENABLE_SFLOW)") $(info "ENABLE_SFLOW" : "$(ENABLE_SFLOW)")
$(info "ENABLE_NAT" : "$(ENABLE_NAT)") $(info "ENABLE_NAT" : "$(ENABLE_NAT)")
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
$(info )
include Makefile.cache include Makefile.cache