Skip to content

Commit

Permalink
[docker-sonic-vs/Dockerfile.j2]: Install new YANG PKGs in VS docker. (#…
Browse files Browse the repository at this point in the history
…68)

Changes:
. Install new YANG PKGs in VS docker.
. Install fixed version on other PY PKGs.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
  • Loading branch information
Praveen Chaudhary authored Apr 27, 2020
1 parent ee42653 commit 8ec96b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install 'netifaces==0.10.7'

# Get package to support Dynamic Port Breakout
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install xmltodict
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install jsondiff
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install xmltodict==0.12.0
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install jsondiff==1.2.0

## Create /var/run/redis folder for docker-database to mount
sudo mkdir -p $FILESYSTEM_ROOT/var/run/redis
Expand Down
3 changes: 2 additions & 1 deletion platform/vs/docker-sonic-vs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \

$(DOCKER_SONIC_VS)_PYTHON_DEBS += $(SONIC_UTILS)

$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_YANG_MGMT_PY2)
$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_YANG_MODELS_PY3)
$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_YANG_MGMT_PY)

ifeq ($(INSTALL_DEBUG_TOOLS), y)
$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS_DBG) \
Expand Down
27 changes: 15 additions & 12 deletions platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ RUN apt-get install -y net-tools \
python-scapy \
jq \
conntrack \
iptables
iptables \
python3-pip

RUN pip install setuptools
RUN pip install py2_ipaddress
Expand Down Expand Up @@ -90,19 +91,21 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return
{%- endif %}

{% if docker_sonic_vs_whls.strip() %}
COPY \
# copy all whl PKGs first,
{% for whl in docker_sonic_vs_whls.split(' ') -%}
python-wheels/{{ whl }}{{' '}}
{%- endfor -%}
python-wheels/
{%- endif -%}

{% if docker_sonic_vs_whls.strip() %}
RUN pip install \
{% for whl in docker_sonic_vs_whls.split(' ') -%}
python-wheels/{{ whl }}{{' '}}
COPY python-wheels/{{ whl }} python-wheels/
{% endfor %}

# install PKGs after copying all PKGs to avoid dependency failure
# use py3 to find python3 package, which is forced by wheel as of now
{%- for whl in docker_sonic_vs_whls.split(' ') %}
{%- if 'py3' in whl %}
RUN pip3 install python-wheels/{{ whl }}
{% else -%}
RUN pip install python-wheels/{{ whl }}
{%- endif %}
{%- endfor %}
{%- endif -%}
{% endif %}

# Clean up
RUN apt-get clean -y
Expand Down

0 comments on commit 8ec96b2

Please sign in to comment.