Skip to content

Commit

Permalink
Upgrade PMON container to bookworm (sonic-net#18291)
Browse files Browse the repository at this point in the history
* Update PMON to bookworm

- Use locally built ipmitool
- Use latest version of smartmontools from Bookworm Debian repos
- Update locally built lm-sensors to match version in Bookworm
- Update grpcio and grpcio-tools python packages to match version in
  Bookworm

* [PMON] Update smartmontool version >= 7.4
  • Loading branch information
ArunSaravananBalachandran authored Apr 5, 2024
1 parent bed3718 commit be01b37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dockers/docker-platform-monitor/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
Expand All @@ -15,7 +15,6 @@ RUN apt-get update && \
apt-get install -y \
build-essential \
python3-dev \
ipmitool \
librrd8 \
librrd-dev \
rrdtool \
Expand All @@ -27,17 +26,18 @@ RUN apt-get update && \
libpci3 \
iputils-ping \
pciutils \
ethtool && \
# smartmontools version should match the installed smartmontools in sonic_debian_extension build template
smartmontools=7.2-1 \
ethtool
apt-get install -y -t bookworm-backports \
smartmontools

# On Arista devices, the sonic_platform wheel is not installed in the container.
# Instead, the installation directory is mounted from the host OS. However, this method
# doesn't ensure all dependencies are installed in the container. So here we
# install any dependencies required by the Arista sonic_platform package.
# TODO: eliminate the need to install these explicitly.
RUN pip3 install grpcio==1.39.0 \
grpcio-tools==1.39.0
RUN pip3 install grpcio==1.51.1 \
grpcio-tools==1.51.1

# Barefoot platform vendors' sonic_platform packages import these Python libraries
RUN pip3 install thrift==0.13.0 netifaces
Expand Down
13 changes: 7 additions & 6 deletions rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER_PLATFORM_MONITOR_DBG = $(DOCKER_PLATFORM_MONITOR_STEM)-$(DBG_IMAGE_MARK).

$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM)

$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(IPMITOOL)


$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3)
Expand All @@ -27,13 +27,14 @@ ifeq ($(PDDF_SUPPORT),y)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY3)
endif

$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(LIBSENSORS_DBG)
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LM_SENSORS_DBG) $(SENSORD_DBG)
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(IPMITOOL_DBG)

$(DOCKER_PLATFORM_MONITOR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
$(DOCKER_PLATFORM_MONITOR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BOOKWORM)

$(DOCKER_PLATFORM_MONITOR)_VERSION = 1.0.0
$(DOCKER_PLATFORM_MONITOR)_PACKAGE_NAME = pmon
Expand Down Expand Up @@ -66,5 +67,5 @@ $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/SmartCmd
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/bin/ethtool
$(DOCKER_PLATFORM_MONITOR)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

SONIC_BULLSEYE_DOCKERS += $(DOCKER_PLATFORM_MONITOR)
SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_PLATFORM_MONITOR_DBG)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_PLATFORM_MONITOR)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_PLATFORM_MONITOR_DBG)
2 changes: 1 addition & 1 deletion rules/lm-sensors.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LM_SENSORS_PATCH_VERSION = 0
LIBSENSORS_VERSION = 5

LM_SENSORS_VERSION=$(LM_SENSORS_MAJOR_VERSION).$(LM_SENSORS_MINOR_VERSION).$(LM_SENSORS_PATCH_VERSION)
LM_SENSORS_VERSION_FULL=$(LM_SENSORS_VERSION)-7
LM_SENSORS_VERSION_FULL=$(LM_SENSORS_VERSION)-7.1

LM_SENSORS = lm-sensors_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(LM_SENSORS)_SRC_PATH = $(SRC_PATH)/lm-sensors
Expand Down
4 changes: 4 additions & 0 deletions sonic-slave-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ RUN patch -p1 -i /disable-non-manylinux.patch /usr/local/lib/python3.11/dist-pac
# For building sonic-utilities
RUN pip3 install fastentrypoints mock

# For building sonic_ycabled
# Note: Match version in bookworm
RUN pip3 install grpcio==1.51.1 grpcio-tools==1.51.1

# For running Python unit tests
RUN pip3 install pytest-runner==5.2
RUN pip3 install mockredispy==2.9.3
Expand Down

0 comments on commit be01b37

Please sign in to comment.