Skip to content

Commit 5d5d573

Browse files
authored
[dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699)
The `-sv2` suffix was used to differentiate SNMP Dockers when we transitioned from "SONiCv1" to "SONiCv2", about four years ago. The old Docker materials were removed long ago; there is no need to keep this suffix. Removing it aligns the name with all the other Dockers. Also edit Monit configuration to detect proper snmp-subagent command line in Buster, and make snmpd command line matching more robust.
1 parent 2e93a92 commit 5d5d573

12 files changed

+52
-52
lines changed

dockers/docker-snmp-sv2/Dockerfile.j2 dockers/docker-snmp/Dockerfile.j2

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ RUN apt-get update && \
1919
make \
2020
ipmitool
2121

22-
{% if docker_snmp_sv2_debs.strip() -%}
22+
{% if docker_snmp_debs.strip() -%}
2323
# Copy locally-built Debian package dependencies
24-
{{ copy_files("debs/", docker_snmp_sv2_debs.split(' '), "/debs/") }}
24+
{{ copy_files("debs/", docker_snmp_debs.split(' '), "/debs/") }}
2525

2626
# Install locally-built Debian packages and implicitly install their dependencies
27-
{{ install_debian_packages(docker_snmp_sv2_debs.split(' ')) }}
27+
{{ install_debian_packages(docker_snmp_debs.split(' ')) }}
2828
{%- endif %}
2929

3030
# Fix for hiredis compilation issues for ARM
@@ -46,12 +46,12 @@ RUN python3 -m pip install --no-cache-dir \
4646
pyyaml \
4747
smbus
4848

49-
{% if docker_snmp_sv2_whls.strip() -%}
49+
{% if docker_snmp_whls.strip() -%}
5050
# Copy locally-built Python wheel dependencies
51-
{{ copy_files("python-wheels/", docker_snmp_sv2_whls.split(' '), "/python-wheels/") }}
51+
{{ copy_files("python-wheels/", docker_snmp_whls.split(' '), "/python-wheels/") }}
5252

5353
# Install locally-built Python wheel dependencies
54-
{{ install_python3_wheels(docker_snmp_sv2_whls.split(' ')) }}
54+
{{ install_python3_wheels(docker_snmp_whls.split(' ')) }}
5555
{% endif %}
5656

5757
RUN python3 -m sonic_ax_impl install

dockers/docker-snmp-sv2/base_image_files/monit_snmp dockers/docker-snmp/base_image_files/monit_snmp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## snmpd
55
## snmpd_subagent
66
###############################################################################
7-
check process snmpd matching "/usr/sbin/snmpd -f"
7+
check process snmpd matching "/usr/sbin/snmpd\s"
88
if does not exist for 5 times within 5 cycles then alert
99

10-
check process snmp_subagent matching "python3.6 -m sonic_ax_impl"
10+
check process snmp_subagent matching "python3 -m sonic_ax_impl"
1111
if does not exist for 5 times within 5 cycles then alert
File renamed without changes.
File renamed without changes.
File renamed without changes.

platform/generic/rules.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ include $(PLATFORM_PATH)/aboot-image.mk
22
include $(PLATFORM_PATH)/onie-image.mk
33

44
SONIC_ALL += $(DOCKER_DATABASE) \
5+
$(DOCKER_SNMP) \
56
$(DOCKER_LLDP) \
6-
$(DOCKER_SNMP_SV2) \
77
$(DOCKER_PLATFORM_MONITOR) \
88
$(DOCKER_DHCP_RELAY) \
99
$(DOCKER_PTF) \

rules/docker-snmp-sv2.dep

-11
This file was deleted.

rules/docker-snmp-sv2.mk

-32
This file was deleted.

rules/docker-snmp.dep

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
DPATH := $($(DOCKER_SNMP)_PATH)
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-snmp.mk rules/docker-snmp.dep
4+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
5+
DEP_FILES += $(shell git ls-files $(DPATH))
6+
7+
$(DOCKER_SNMP)_CACHE_MODE := GIT_CONTENT_SHA
8+
$(DOCKER_SNMP)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
9+
$(DOCKER_SNMP)_DEP_FILES := $(DEP_FILES)
10+
11+
$(eval $(call add_dbg_docker,$(DOCKER_SNMP),$(DOCKER_SNMP_DBG)))

rules/docker-snmp.mk

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# docker image for snmp agent
2+
3+
DOCKER_SNMP_STEM = docker-snmp
4+
DOCKER_SNMP = $(DOCKER_SNMP_STEM).gz
5+
DOCKER_SNMP_DBG = $(DOCKER_SNMP_STEM)-$(DBG_IMAGE_MARK).gz
6+
7+
$(DOCKER_SNMP)_PATH = $(DOCKERS_PATH)/docker-snmp
8+
9+
## TODO: remove LIBPY3_DEV if we can get pip3 directly
10+
$(DOCKER_SNMP)_DEPENDS += $(SNMP) $(SNMPD)
11+
12+
$(DOCKER_SNMP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS)
13+
$(DOCKER_SNMP)_DBG_DEPENDS += $(SNMP_DBG) $(SNMPD_DBG) $(LIBSNMP_DBG)
14+
15+
$(DOCKER_SNMP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES)
16+
17+
$(DOCKER_SNMP)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3) $(SWSSSDK_PY3) $(ASYNCSNMP_PY3)
18+
$(DOCKER_SNMP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
19+
20+
SONIC_DOCKER_IMAGES += $(DOCKER_SNMP)
21+
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SNMP)
22+
23+
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_DBG)
24+
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_DBG)
25+
26+
$(DOCKER_SNMP)_CONTAINER_NAME = snmp
27+
$(DOCKER_SNMP)_RUN_OPT += --privileged -t
28+
$(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
29+
# mount Arista platform python libraries to support corresponding platforms SNMP power status query
30+
$(DOCKER_SNMP)_RUN_OPT += -v /usr/lib/python3/dist-packages/arista:/usr/lib/python3/dist-packages/arista:ro
31+
$(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
32+
$(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d

0 commit comments

Comments
 (0)