Skip to content

Commit c6dcd7d

Browse files
author
Praveen Chaudhary
authored
[docker-sonic-vs/Dockerfile.j2]: Install new YANG PKGs in VS docker. (#4684)
Changes: . Install new YANG PKGs in VS docker. . Install fixed version on other PY PKGs. Signed-off-by: Praveen Chaudhary [email protected]
1 parent b48d274 commit c6dcd7d

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

platform/vs/docker-sonic-vs.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \
1313

1414
$(DOCKER_SONIC_VS)_PYTHON_DEBS += $(SONIC_UTILS)
1515

16+
$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_YANG_MODELS_PY3)
17+
$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_YANG_MGMT_PY)
18+
1619
ifeq ($(INSTALL_DEBUG_TOOLS), y)
1720
$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS_DBG) \
1821
$(LIBSWSSCOMMON_DBG) \

platform/vs/docker-sonic-vs/Dockerfile.j2

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ RUN apt-get install -y net-tools \
4444
tcpdump \
4545
python-scapy \
4646
conntrack \
47-
iptables
47+
iptables \
48+
python3-pip
4849

4950
RUN pip install setuptools
5051
RUN pip install py2_ipaddress
@@ -76,6 +77,23 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return
7677
{%- endfor %}
7778
{%- endif %}
7879

80+
{% if docker_sonic_vs_whls.strip() %}
81+
# copy all whl PKGs first,
82+
{% for whl in docker_sonic_vs_whls.split(' ') -%}
83+
COPY python-wheels/{{ whl }} python-wheels/
84+
{% endfor %}
85+
86+
# install PKGs after copying all PKGs to avoid dependency failure
87+
# use py3 to find python3 package, which is forced by wheel as of now
88+
{%- for whl in docker_sonic_vs_whls.split(' ') %}
89+
{%- if 'py3' in whl %}
90+
RUN pip3 install python-wheels/{{ whl }}
91+
{% else -%}
92+
RUN pip install python-wheels/{{ whl }}
93+
{%- endif %}
94+
{%- endfor %}
95+
{% endif %}
96+
7997
# Clean up
8098
RUN apt-get clean -y
8199
RUN apt-get autoclean -y

0 commit comments

Comments
 (0)