Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 17 additions & 31 deletions dockers/docker-platform-monitor/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,30 @@ RUN apt-get update
# Install required packages
RUN apt-get install -y python-pip sensord fancontrol

{% if docker_platform_monitor_debs.strip() %}
# Copy built Debian packages
COPY \
{% for deb in docker_platform_monitor_debs.split(' ') -%}
{% 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/
{%- endif %}
/debs/

{% if docker_platform_monitor_debs.strip() %}
# Install built Debian packages
RUN dpkg -i \
{% for deb in docker_platform_monitor_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
{%- endif %}
# 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 %}

{% if docker_platform_monitor_whls.strip() %}
# Copy built Python wheels
COPY \
{% for whl in docker_platform_monitor_whls.split(' ') -%}
{% 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/
{%- endif %}

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

COPY python-wheels /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
# Install all locally-built Python wheel dependencies
RUN pip install /python-wheels/*.whl
{% endif %}

# Clean up
RUN apt-get remove -y python-pip
Expand Down
2 changes: 2 additions & 0 deletions rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
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)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)

SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)
Expand Down