Skip to content

Commit

Permalink
[docker-platform-monitor] Convert ledd from polling-based to subscrip…
Browse files Browse the repository at this point in the history
…tion-based model (#1623)
  • Loading branch information
jleveque authored Apr 20, 2018
1 parent cde9a60 commit 1df7c9a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
43 changes: 21 additions & 22 deletions dockers/docker-platform-monitor/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@ FROM docker-config-engine
# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

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

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

{% if docker_platform_monitor_debs.strip() -%}
# Copy all locally-built Debian package dependencies
COPY{{' '}}
{%- for deb in docker_platform_monitor_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
/debs/

# Install all locally-built Debian package dependencies
# and implicitly install their dependencies
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/*.deb
{% endif %}
# Copy locally-built Debian package dependencies
{%- for deb in docker_platform_monitor_debs.split(' ') %}
COPY debs/{{ deb }} /debs/
{%- endfor %}

# Install locally-built Debian packages and implicitly install their dependencies
{%- for deb in docker_platform_monitor_debs.split(' ') %}
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/{{ deb }}
{%- endfor %}
{%- endif %}

{% if docker_platform_monitor_whls.strip() -%}
# Copy all locally-built Python wheel dependencies
COPY{{' '}}
{%- for whl in docker_platform_monitor_whls.split(' ') -%}
python-wheels/{{ whl }}{{' '}}
{%- endfor -%}
/python-wheels/

# Install all locally-built Python wheel dependencies
RUN pip install /python-wheels/*.whl
# Copy locally-built Python wheel dependencies
{%- for whl in docker_platform_monitor_whls.split(' ') %}
COPY python-wheels/{{ whl }} /python-wheels/
{%- endfor %}

# Install locally-built Python wheel dependencies
{%- for whl in docker_platform_monitor_whls.split(' ') %}
RUN pip install /python-wheels/{{ whl }}
{%- endfor %}
{% endif %}

# Clean up
Expand Down
2 changes: 1 addition & 1 deletion rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(SONIC_LEDD)
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_LEDD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-platform-daemons

0 comments on commit 1df7c9a

Please sign in to comment.