Install sonic-platform-common package in platform-monitor docker for ledd (#1330)

* Install sonic-platform-common package in platform-monitor docker for ledd

* Specify Python wheel dependencies in docker-platform-monitor.mk; Remove explicit specifications from Dockerfile.j2
This commit is contained in:
Joe LeVeque 2018-01-22 10:52:52 -08:00 committed by GitHub
parent 5e01fb366e
commit ab26a5c589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 31 deletions

View File

@ -9,44 +9,30 @@ RUN apt-get update
# Install required packages # Install required packages
RUN apt-get install -y python-pip sensord fancontrol RUN apt-get install -y python-pip sensord fancontrol
{% if docker_platform_monitor_debs.strip() %} {% if docker_platform_monitor_debs.strip() -%}
# Copy built Debian packages # Copy all locally-built Debian package dependencies
COPY \ COPY{{' '}}
{% for deb in docker_platform_monitor_debs.split(' ') -%} {%- for deb in docker_platform_monitor_debs.split(' ') -%}
debs/{{ deb }}{{' '}} debs/{{ deb }}{{' '}}
{%- endfor -%} {%- endfor -%}
debs/ /debs/
{%- endif %}
{% if docker_platform_monitor_debs.strip() %} # Install all locally-built Debian package dependencies
# Install built Debian packages # and implicitly install their dependencies
RUN dpkg -i \ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/*.deb
{% for deb in docker_platform_monitor_debs.split(' ') -%} {% endif %}
debs/{{ deb }}{{' '}}
{%- endfor %}
{%- endif %}
{% if docker_platform_monitor_whls.strip() %} {% if docker_platform_monitor_whls.strip() -%}
# Copy built Python wheels # Copy all locally-built Python wheel dependencies
COPY \ COPY{{' '}}
{% for whl in docker_platform_monitor_whls.split(' ') -%} {%- for whl in docker_platform_monitor_whls.split(' ') -%}
python-wheels/{{ whl }}{{' '}} python-wheels/{{ whl }}{{' '}}
{%- endfor -%} {%- endfor -%}
python-wheels/ /python-wheels/
{%- endif %}
{% if docker_platform_monitor_whls.strip() %} # Install all locally-built Python wheel dependencies
# Install built Python wheels RUN pip install /python-wheels/*.whl
RUN pip install \ {% endif %}
{% for whl in docker_platform_monitor_whls.split(' ') -%}
python-wheels/{{ whl }}{{' '}}
{%- endfor %}
{%- endif %}
COPY python-wheels /python-wheels
# Install Python SwSS SDK (dependency of sonic-ledd)
RUN pip install /python-wheels/swsssdk-2.0.1-py2-none-any.whl
# Clean up # Clean up
RUN apt-get remove -y python-pip RUN apt-get remove -y python-pip

View File

@ -3,6 +3,8 @@
DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor $(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(SONIC_LEDD) $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(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) $(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)