Skip to content

Commit 1df7c9a

Browse files
authored
[docker-platform-monitor] Convert ledd from polling-based to subscription-based model (#1623)
1 parent cde9a60 commit 1df7c9a

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

dockers/docker-platform-monitor/Dockerfile.j2

+21-22
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,34 @@ FROM docker-config-engine
33
# Make apt-get non-interactive
44
ENV DEBIAN_FRONTEND=noninteractive
55

6-
# Update apt's package index files
6+
# Update apt's cache of available packages
77
RUN apt-get update
88

99
# Install required packages
10-
RUN apt-get install -y python-pip sensord fancontrol
10+
RUN apt-get install -y python-pip libpython2.7 sensord fancontrol
1111

1212
{% if docker_platform_monitor_debs.strip() -%}
13-
# Copy all locally-built Debian package dependencies
14-
COPY{{' '}}
15-
{%- for deb in docker_platform_monitor_debs.split(' ') -%}
16-
debs/{{ deb }}{{' '}}
17-
{%- endfor -%}
18-
/debs/
19-
20-
# Install all locally-built Debian package dependencies
21-
# and implicitly install their dependencies
22-
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/*.deb
23-
{% endif %}
13+
# Copy locally-built Debian package dependencies
14+
{%- for deb in docker_platform_monitor_debs.split(' ') %}
15+
COPY debs/{{ deb }} /debs/
16+
{%- endfor %}
17+
18+
# Install locally-built Debian packages and implicitly install their dependencies
19+
{%- for deb in docker_platform_monitor_debs.split(' ') %}
20+
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/{{ deb }}
21+
{%- endfor %}
22+
{%- endif %}
2423

2524
{% if docker_platform_monitor_whls.strip() -%}
26-
# Copy all locally-built Python wheel dependencies
27-
COPY{{' '}}
28-
{%- for whl in docker_platform_monitor_whls.split(' ') -%}
29-
python-wheels/{{ whl }}{{' '}}
30-
{%- endfor -%}
31-
/python-wheels/
32-
33-
# Install all locally-built Python wheel dependencies
34-
RUN pip install /python-wheels/*.whl
25+
# Copy locally-built Python wheel dependencies
26+
{%- for whl in docker_platform_monitor_whls.split(' ') %}
27+
COPY python-wheels/{{ whl }} /python-wheels/
28+
{%- endfor %}
29+
30+
# Install locally-built Python wheel dependencies
31+
{%- for whl in docker_platform_monitor_whls.split(' ') %}
32+
RUN pip install /python-wheels/{{ whl }}
33+
{%- endfor %}
3534
{% endif %}
3635

3736
# Clean up

rules/docker-platform-monitor.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz
44
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor
5-
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(SONIC_LEDD)
5+
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_LEDD)
66
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2)
77
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
88
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)

0 commit comments

Comments
 (0)