a02255e2f4
[sonic-yang-models]: First version of yang models for Port, VLan, Interface, PortChannel, loopback and ACL. YANG models as per Guidelines. Guideline doc: https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md [sonic-yang-models/tests]: YANG model test code and JSON input for testing. [sonic-yang-models/setup.py]: Build infra for yang models. **- What I did** Created Yang model for Sonic. Tables: PORT, VLAN, VLAN_INTERFACE, VLAN_MEMBER, ACL_RULE, ACL_TABLE, INTERFACE. Created build infra files using which a new package (sonic-yang-models) can be build and can be deployed on sonic switches. Yang models will be part of this new package. **- How I did it** Wrote yang models based on Guideline doc: https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md and https://github.com/Azure/SONiC/wiki/Configuration. Wrote python wheel Package infra which runs test for these Yang models using a json files which consists configuration as per yang models. These configs are for negative tests, which means we want to test that most must condition, pattern and when condition works as expected. **- How to verify it** Build Logs and testing: ——————————————————————————————————— ``` /sonic/src/sonic-yang-models /sonic running test running egg_info writing top-level names to sonic_yang_models.egg-info/top_level.txt writing dependency_links to sonic_yang_models.egg-info/dependency_links.txt writing sonic_yang_models.egg-info/PKG-INFO reading manifest file 'sonic_yang_models.egg-info/SOURCES.txt' writing manifest file 'sonic_yang_models.egg-info/SOURCES.txt' running build_ext ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK running bdist_wheel running build running build_py (Reading database ... 155852 files and directories currently installed.) Preparing to unpack .../libyang_1.0.73_amd64.deb ... Unpacking libyang (1.0.73) over (1.0.73) ... Setting up libyang (1.0.73) ... Processing triggers for libc-bin (2.24-11+deb9u4) ... Processing triggers for man-db (2.7.6.1-2) ... (Reading database ... 155852 files and directories currently installed.) Preparing to unpack .../libyang-cpp_1.0.73_amd64.deb ... Unpacking libyang-cpp (1.0.73) over (1.0.73) ... Setting up libyang-cpp (1.0.73) ... Processing triggers for libc-bin (2.24-11+deb9u4) ... (Reading database ... 155852 files and directories currently installed.) Preparing to unpack .../python3-yang_1.0.73_amd64.deb ... Unpacking python3-yang (1.0.73) over (1.0.73) ... Setting up python3-yang (1.0.73) ... INFO:YANG-TEST:module: sonic-vlan is loaded successfully ERROR:YANG-TEST:Could not get module: sonic-head INFO:YANG-TEST:module: sonic-portchannel is loaded successfully INFO:YANG-TEST:module: sonic-acl is loaded successfully INFO:YANG-TEST:module: sonic-loopback-interface is loaded successfully ERROR:YANG-TEST:Could not get module: sonic-port INFO:YANG-TEST:module: sonic-interface is loaded successfully INFO:YANG-TEST: ------------------- Test 1: Configure a member port in VLAN_MEMBER table which does not exist.--------------------- libyang[0]: Leafref "/sonic-port:sonic-port/sonic-port:PORT/sonic-port:PORT_LIST/sonic-port:port_name" of value "Ethernet156" points to a non -existing leaf. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlan_name='Vlan100'][port='Ethernet156']/port) INFO:YANG-TEST:Configure a member port in VLAN_MEMBER table which does not exist. Passed INFO:YANG-TEST: ------------------- Test 2: Configure non-existing ACL_TABLE in ACL_RULE.--------------------- libyang[0]: Leafref "/sonic-acl:sonic-acl/sonic-acl:ACL_TABLE/sonic-acl:ACL_TABLE_LIST/sonic-acl:ACL_TABLE_NAME" of value "NOT-EXIST" points to a non-existing leaf. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NOT-EXIST'][RULE_NAME='Rule_20']/ACL_TABLE_NAME) INFO:YANG-TEST:Configure non-existing ACL_TABLE in ACL_RULE. Passed INFO:YANG-TEST: ------------------- Test 3: Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE.--------------------- libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RU LE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4'][RULE_NAME='Rule_40']/ICMPV6_CODE) INFO:YANG-TEST:Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE. Passed INFO:YANG-TEST: INFO:YANG-TEST: ------------------- Test 4: Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.--------------------- libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RU LE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4'][RULE_NAME='Rule_20']/SRC_IPV6) INFO:YANG-TEST:Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE. Passed ------------------- Test 5: Configure l4_src_port_range as 99999-99999 in ACL_RULE--------------------- libyang[0]: Value "99999-99999" does not satisfy the constraint "([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])-([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])" (range, length, or pattern). (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V6'][RULE_NAME='Rule_20']/L4_SRC_PORT_RANGE) INFO:YANG-TEST:Configure l4_src_port_range as 99999-99999 in ACL_RULE Passed INFO:YANG-TEST: ------------------- Test 6: Configure empty string as ip-prefix in INTERFACE table.--------------------- libyang[0]: Invalid value "" in "ip-prefix" element. (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_LIST[interface='Ethernet8'][ip-prefix='']/ip-prefix) INFO:YANG-TEST:Configure empty string as ip-prefix in INTERFACE table. Passed INFO:YANG-TEST: ------------------- Test 7: Configure Wrong family with ip-prefix for VLAN_Interface Table--------------------- libyang[0]: Must condition "(contains(../ip-prefix, ':') and current()='IPv6') or (contains(../ip-prefix, '.') and current()='IPv4')" not satisfied. (path: /sonic-vlan:sonic-vlan/VLAN_INTERFACE/VLAN_INTERFACE_LIST[vlanid='100'][ip-prefix='2a04:5555:66:7777::1/64']/family) INFO:YANG-TEST:Configure Wrong family with ip-prefix for VLAN_Interface Table Passed INFO:YANG-TEST: ------------------- Test 8: Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.--------------------- libyang[0]: When condition "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPV6ANY'])" not satisfied. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NS W-PACL-V6'][RULE_NAME='Rule_20']/DST_IPV6) INFO:YANG-TEST:Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE. Passed INFO:YANG-TEST: ------------------- Test 9: Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE.--------------------- libyang[0]: Value "0x080C" does not satisfy the constraint "(0x88CC|0x8100|0x8915|0x0806|0x0800|0x86DD|0x8847)" (range, length, or pattern). (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4'][RULE_NAME='Rule_40']/INNER_ETHER_TYPE) INFO:YANG-TEST:Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE. Passed INFO:YANG-TEST: ------------------- Test 10: Add dhcp_server which is not in correct ip-prefix format.--------------------- libyang[0]: Invalid value "10.186.72.566" in "dhcp_servers" element. (path: /sonic-vlan:sonic-vlan/VLAN/VLAN_LIST/dhcp_servers[.='10.186.72.566']) INFO:YANG-TEST:Add dhcp_server which is not in correct ip-prefix format. Passed INFO:YANG-TEST: ------------------- Test 11: Configure undefined acl_table_type in ACL_TABLE table.--------------------- libyang[0]: Invalid value "LAYER3V4" in "type" element. (path: /sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V6']/type) INFO:YANG-TEST:Configure undefined acl_table_type in ACL_TABLE table. Passed INFO:YANG-TEST: ------------------- Test 12: Configure undefined packet_action in ACL_RULE table.--------------------- libyang[0]: Invalid value "SEND" in "PACKET_ACTION" element. (path: /sonic-acl:sonic-acl/ACL_RULE/ACL_RULE_LIST/PACKET_ACTION) INFO:YANG-TEST:Configure undefined packet_action in ACL_RULE table. Passed INFO:YANG-TEST: ------------------- Test 13: Configure wrong value for tagging_mode.--------------------- libyang[0]: Invalid value "non-tagged" in "tagging_mode" element. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST/tagging_mode) INFO:YANG-TEST:Configure wrong value for tagging_mode. Passed INFO:YANG-TEST: ------------------- Test 14: Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.--------------------- libyang[0]: Leafref "../../../VLAN/VLAN_LIST/vlanid" of value "200" points to a non-existing leaf. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlanid='200'][port='Ethernet0']/vlanid) libyang[0]: Leafref "../../../VLAN/VLAN_LIST/vlanid" of value "200" points to a non-existing leaf. (path: /sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlanid='200'][port='Ethernet0']/vlanid) INFO:YANG-TEST:Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table. Passed INFO:YANG-TEST:All Test Passed ../../target/debs/stretch/libyang0.16_0.16.105-1_amd64.deb installtion failed ../../target/debs/stretch/libyang-cpp0.16_0.16.105-1_amd64.deb installtion failed ../../target/debs/stretch/python2-yang_0.16.105-1_amd64.deb installtion failed YANG Tests passed Passed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree copying tests/yangModelTesting.py -> build/lib/tests copying tests/test_sonic_yang_models.py -> build/lib/tests copying tests/__init__.py -> build/lib/tests running egg_info writing top-level names to sonic_yang_models.egg-info/top_level.txt writing dependency_links to sonic_yang_models.egg-info/dependency_links.txt writing sonic_yang_models.egg-info/PKG-INFO reading manifest file 'sonic_yang_models.egg-info/SOURCES.txt' writing manifest file 'sonic_yang_models.egg-info/SOURCES.txt' installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/tests copying build/lib/tests/yangModelTesting.py -> build/bdist.linux-x86_64/wheel/tests copying build/lib/tests/test_sonic_yang_models.py -> build/bdist.linux-x86_64/wheel/tests copying build/lib/tests/__init__.py -> build/bdist.linux-x86_64/wheel/tests running install_data creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data creating build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-head.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-acl.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-interface.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-loopback-interface.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-port.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-portchannel.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models copying ./yang-models/sonic-vlan.yang -> build/bdist.linux-x86_64/wheel/sonic_yang_models-1.0.data/data/yang-models ```
435 lines
14 KiB
Django/Jinja
435 lines
14 KiB
Django/Jinja
{%- if CONFIGURED_ARCH == "armhf" %}
|
||
FROM multiarch/debian-debootstrap:armhf-stretch
|
||
{%- elif CONFIGURED_ARCH == "arm64" %}
|
||
FROM multiarch/debian-debootstrap:arm64-stretch
|
||
{%- else -%}
|
||
FROM debian:stretch
|
||
{%- endif %}
|
||
|
||
MAINTAINER gulv@microsoft.com
|
||
|
||
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
|
||
|
||
RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian stretch-backports main" >> /etc/apt/sources.list
|
||
|
||
{%- if CONFIGURED_ARCH == "armhf" %}
|
||
RUN echo "deb [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \
|
||
echo "deb-src [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=armhf] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=armhf] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo 'deb [arch=armhf] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list
|
||
{%- elif CONFIGURED_ARCH == "arm64" %}
|
||
RUN echo "deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \
|
||
echo "deb-src [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb [arch=arm64] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo "deb-src [arch=arm64] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||
echo 'deb [arch=arm64] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list
|
||
{%- endif %}
|
||
|
||
## Make apt-get non-interactive
|
||
ENV DEBIAN_FRONTEND=noninteractive
|
||
|
||
RUN apt-get update && apt-get install -y \
|
||
apt-utils \
|
||
default-jre-headless \
|
||
openssh-server \
|
||
curl \
|
||
wget \
|
||
unzip \
|
||
git \
|
||
build-essential \
|
||
libtool \
|
||
lintian \
|
||
sudo \
|
||
dh-make \
|
||
dh-exec \
|
||
kmod \
|
||
libtinyxml2-4 \
|
||
libboost-program-options1.62-dev \
|
||
libtinyxml2-dev \
|
||
python \
|
||
python-pip \
|
||
libncurses5-dev \
|
||
texinfo \
|
||
dh-autoreconf \
|
||
python3-pip \
|
||
doxygen \
|
||
devscripts \
|
||
git-buildpackage \
|
||
perl-modules \
|
||
libswitch-perl \
|
||
dh-systemd \
|
||
# For quagga build
|
||
libreadline-dev \
|
||
texlive-latex-base \
|
||
texlive-generic-recommended \
|
||
texlive-fonts-recommended \
|
||
libpam0g-dev \
|
||
libpam-dev \
|
||
libcap-dev \
|
||
imagemagick \
|
||
ghostscript \
|
||
groff \
|
||
libpcre3-dev \
|
||
gawk \
|
||
chrpath \
|
||
# For frr build
|
||
libc-ares-dev \
|
||
libsnmp-dev \
|
||
libjson-c3 \
|
||
libjson-c-dev \
|
||
libsystemd-dev \
|
||
python-ipaddr \
|
||
libcmocka-dev \
|
||
python3-all-dev \
|
||
python3-all-dbg \
|
||
install-info \
|
||
logrotate \
|
||
# For libnl3 (local) build
|
||
cdbs \
|
||
# For SAI meta build
|
||
libxml-simple-perl \
|
||
graphviz \
|
||
aspell \
|
||
# For linux build
|
||
bc \
|
||
fakeroot \
|
||
build-essential \
|
||
devscripts \
|
||
quilt \
|
||
stgit \
|
||
# For platform-modules build
|
||
module-assistant \
|
||
# For thrift build\
|
||
gem2deb \
|
||
libboost-all-dev \
|
||
libevent-dev \
|
||
libglib2.0-dev \
|
||
libqt4-dev \
|
||
python-all-dev \
|
||
python-twisted \
|
||
phpunit \
|
||
libbit-vector-perl \
|
||
openjdk-8-jdk \
|
||
javahelper \
|
||
maven-debian-helper \
|
||
ant \
|
||
libmaven-ant-tasks-java \
|
||
libhttpclient-java \
|
||
libslf4j-java \
|
||
libservlet3.1-java \
|
||
qt5-default \
|
||
pkg-php-tools \
|
||
# For mellanox sdk build
|
||
libpcre3 \
|
||
libpcre3-dev \
|
||
byacc \
|
||
flex \
|
||
libglib2.0-dev \
|
||
bison \
|
||
expat \
|
||
libexpat1-dev \
|
||
dpatch \
|
||
libdb-dev \
|
||
iptables-dev \
|
||
ctags \
|
||
# For mellanox sai build
|
||
libtool-bin \
|
||
libxml2-dev \
|
||
# For BFN sdk build
|
||
libusb-1.0-0-dev \
|
||
libcurl3-nss-dev \
|
||
libunwind8-dev \
|
||
telnet \
|
||
libc-ares2 \
|
||
libgoogle-perftools4 \
|
||
# For build image
|
||
cpio \
|
||
squashfs-tools \
|
||
zip \
|
||
# For broadcom sdk build
|
||
{%- if CONFIGURED_ARCH == "amd64" %}
|
||
linux-compiler-gcc-6-x86 \
|
||
{%- endif %}
|
||
{%- if CONFIGURED_ARCH == "armhf" %}
|
||
linux-compiler-gcc-6-arm \
|
||
{%- endif %}
|
||
linux-kbuild-4.9 \
|
||
# teamd build
|
||
libdaemon-dev \
|
||
libdbus-1-dev \
|
||
libjansson-dev \
|
||
# For cavium sdk build
|
||
libpcap-dev \
|
||
dnsutils \
|
||
libusb-dev \
|
||
# For debian image reconfiguration
|
||
augeas-tools \
|
||
# For p4 build
|
||
libyaml-dev \
|
||
libevent-dev \
|
||
libjudy-dev \
|
||
libedit-dev \
|
||
libnanomsg-dev \
|
||
python-stdeb \
|
||
# For redis build
|
||
libjemalloc-dev \
|
||
liblua5.1-0-dev \
|
||
lua-bitop-dev \
|
||
lua-cjson-dev \
|
||
# For mft kernel module build
|
||
dkms \
|
||
# For python3.5 build
|
||
sharutils \
|
||
libncursesw5-dev \
|
||
libbz2-dev \
|
||
liblzma-dev \
|
||
libgdbm-dev \
|
||
tk-dev \
|
||
blt-dev \
|
||
libmpdec-dev \
|
||
libbluetooth-dev \
|
||
locales \
|
||
libsqlite3-dev \
|
||
libgpm2 \
|
||
time \
|
||
net-tools \
|
||
xvfb \
|
||
python-sphinx \
|
||
python3-sphinx \
|
||
# For Jenkins static analysis, unit testing and code coverage
|
||
cppcheck \
|
||
clang \
|
||
pylint \
|
||
python-pytest \
|
||
gcovr \
|
||
python-pytest-cov \
|
||
python-parse \
|
||
# For snmpd
|
||
default-libmysqlclient-dev \
|
||
libssl1.0-dev \
|
||
libperl-dev \
|
||
libpci-dev \
|
||
libpci3 \
|
||
libsensors4 \
|
||
libsensors4-dev \
|
||
libwrap0-dev \
|
||
# For lldpd
|
||
debhelper \
|
||
autotools-dev \
|
||
libbsd-dev \
|
||
pkg-config \
|
||
check \
|
||
# For mpdecimal
|
||
docutils-common \
|
||
libjs-sphinxdoc \
|
||
libjs-underscore \
|
||
python-docutils \
|
||
python-jinja2 \
|
||
python-markupsafe \
|
||
python-pygments \
|
||
python-roman \
|
||
python-sphinx \
|
||
sphinx-common \
|
||
python3-sphinx \
|
||
# For sonic config engine testing
|
||
python-lxml \
|
||
python-jinja2 \
|
||
python-netaddr \
|
||
python-ipaddr \
|
||
python-yaml \
|
||
python3-yaml \
|
||
# For lockfile
|
||
procmail \
|
||
# For pam_tacplus build
|
||
autoconf-archive \
|
||
# For iproute2
|
||
cm-super-minimal \
|
||
libatm1-dev \
|
||
libelf-dev \
|
||
libmnl-dev \
|
||
libselinux1-dev \
|
||
linuxdoc-tools \
|
||
lynx \
|
||
texlive-latex-extra \
|
||
texlive-latex-recommended \
|
||
iproute2 \
|
||
# For python-click build
|
||
python-sphinx \
|
||
python-docutils \
|
||
python3-all \
|
||
python3-setuptools \
|
||
python3-sphinx \
|
||
python3-docutils \
|
||
python3-requests \
|
||
python3-pytest \
|
||
python3-colorama \
|
||
# For bash
|
||
texi2html \
|
||
# For initramfs
|
||
bash-completion \
|
||
{%- if CONFIGURED_ARCH == "amd64" %}
|
||
# For sonic vs image build
|
||
dosfstools \
|
||
qemu-kvm \
|
||
libvirt-clients \
|
||
{%- endif %}
|
||
# For lm-sensors
|
||
librrd8 \
|
||
librrd-dev \
|
||
rrdtool \
|
||
# For smartmontools 6.6-1
|
||
automake1.11 \
|
||
libselinux1-dev \
|
||
# For kdump-tools
|
||
liblzo2-dev \
|
||
# For iptables
|
||
libnetfilter-conntrack-dev \
|
||
libnftnl-dev \
|
||
# For SAI3.7
|
||
libprotobuf-dev \
|
||
# For DHCP Monitor tool
|
||
libexplain-dev \
|
||
libevent-dev
|
||
|
||
## Config dpkg
|
||
## install the configuration file if it’s currently missing
|
||
RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confmiss"
|
||
## combined with confold: overwrite configuration files that you have not modified
|
||
RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef"
|
||
## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix
|
||
RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold"
|
||
|
||
# For smartmontools 6.6-1
|
||
RUN apt-get -t stretch-backports install -y debhelper
|
||
|
||
# For linux build
|
||
RUN apt-get -y build-dep linux
|
||
|
||
# For gobgp and telemetry build
|
||
RUN export VERSION=1.11.5 \
|
||
{%- if CONFIGURED_ARCH == "armhf" %}
|
||
&& wget https://storage.googleapis.com/golang/go$VERSION.linux-armv6l.tar.gz \
|
||
&& tar -C /usr/local -xzf go$VERSION.linux-armv6l.tar.gz \
|
||
{%- elif CONFIGURED_ARCH == "arm64" %}
|
||
&& wget https://storage.googleapis.com/golang/go$VERSION.linux-arm64.tar.gz \
|
||
&& tar -C /usr/local -xzf go$VERSION.linux-arm64.tar.gz \
|
||
{%- else %}
|
||
&& wget https://storage.googleapis.com/golang/go$VERSION.linux-amd64.tar.gz \
|
||
&& tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz \
|
||
{%- endif %}
|
||
&& echo 'export GOROOT=/usr/local/go' >> /etc/bash.bashrc \
|
||
&& echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \
|
||
&& rm go$VERSION.linux-*.tar.gz
|
||
|
||
# For p4 build
|
||
RUN pip install \
|
||
ctypesgen==0.r125 \
|
||
crc16
|
||
|
||
# For sonic config engine testing
|
||
RUN pip install pyangbind==0.6.0
|
||
# Note: force upgrade debian packaged jinja2, if installed
|
||
RUN pip install --force-reinstall --upgrade "jinja2>=2.10"
|
||
|
||
# For templating
|
||
RUN pip install j2cli==0.3.10
|
||
|
||
# Remove python-click 6.6
|
||
RUN apt-get purge -y python-click
|
||
# For sonic utilities testing
|
||
RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fastentrypoints
|
||
|
||
# For sonic snmpagent mock testing
|
||
RUN pip3 install mockredispy==2.9.3
|
||
|
||
RUN pip3 install "PyYAML>=5.1"
|
||
|
||
# For sonic-platform-common testing
|
||
RUN pip3 install redis
|
||
|
||
# For supervisor build
|
||
RUN pip install meld3 mock
|
||
|
||
# For vs image build
|
||
RUN pip install pexpect==4.6.0
|
||
|
||
# For sonic-utilities build
|
||
RUN pip install mockredispy==2.9.3
|
||
RUN pip install pytest-runner==4.4
|
||
RUN pip install setuptools==40.8.0
|
||
|
||
# For sonic_yang_mgmt build
|
||
RUN pip install ijson==2.6.1
|
||
RUN pip3 install ijson==2.6.1
|
||
RUN pip install jsondiff==1.2.0
|
||
RUN pip install xmltodict==0.12.0
|
||
RUN pip install pyang==2.1.1
|
||
|
||
# For mgmt-framework build
|
||
RUN pip install mmh3
|
||
|
||
# Install dependencies for isc-dhcp-relay build
|
||
RUN apt-get -y build-dep isc-dhcp
|
||
|
||
# Install vim
|
||
RUN apt-get install -y vim
|
||
|
||
# Install rsyslog
|
||
RUN apt-get install -y rsyslog
|
||
|
||
RUN apt-get install -y libgtest-dev
|
||
RUN apt-get install -y libarchive13 librhash0
|
||
RUN apt-get -t stretch-backports install -y libuv1
|
||
# Install cmake/cmake-data 3.13.2-1_bpo9+1
|
||
# latest cmake 3.16.3 break the build libyang 1.0.73
|
||
RUN wget -O cmake-data_3.13.2-1_bpo9+1_all.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake-data_3.13.2-1_bpo9%2B1_all.deb?st=2020-03-27T02%3A22%3A24Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=Xby%2Bm3OZOjPB%2FSlDbHD65yDcPzAgoys%2FA3vK8RB4BzA%3D"
|
||
RUN dpkg -i cmake-data_3.13.2-1_bpo9+1_all.deb || apt-get install -f
|
||
{% if CONFIGURED_ARCH == "armhf" %}
|
||
RUN wget -O cmake_3.13.2-1_bpo9+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_armhf.deb?st=2020-03-27T02%3A29%3A41Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=sWt7kxrFumn020d2GeutGJ716cuQsFwmAmgU%2BJ0kqnk%3D"
|
||
RUN dpkg -i cmake_3.13.2-1_bpo9+1_armhf.deb || apt-get install -f
|
||
{% elif CONFIGURED_ARCH == "arm64" %}
|
||
RUN wget -O cmake_3.13.2-1_bpo9+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_arm64.deb?st=2020-03-27T02%3A28%3A38Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=rrHMkLi29aI8yH6s52ILCY8VcEbNFrzYT2DmC5RwOgs%3D"
|
||
RUN dpkg -i cmake_3.13.2-1_bpo9+1_arm64.deb || apt-get install -f
|
||
{% else %}
|
||
RUN wget -O cmake_3.13.2-1_bpo9+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_amd64.deb?st=2020-03-27T02%3A27%3A21Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=4MvmmDBQuicFEJYakLm7xCNU19yJ8GIP4ankFSnITKY%3D"
|
||
RUN dpkg -i cmake_3.13.2-1_bpo9+1_amd64.deb || apt-get install -f
|
||
{% endif %}
|
||
RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest
|
||
|
||
RUN mkdir /var/run/sshd
|
||
EXPOSE 22
|
||
|
||
# Install depot-tools (for git-retry)
|
||
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /usr/share/depot_tools
|
||
ENV PATH /usr/share/depot_tools:$PATH
|
||
|
||
# Install docker engine 17.03.2~ce-0 inside docker and enable experimental feature
|
||
RUN apt-get update
|
||
RUN apt-get install -y \
|
||
apt-transport-https \
|
||
ca-certificates \
|
||
curl \
|
||
gnupg2 \
|
||
software-properties-common
|
||
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
|
||
RUN add-apt-repository \
|
||
"deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian \
|
||
$(lsb_release -cs) \
|
||
stable"
|
||
RUN apt-get update
|
||
{%- if CONFIGURED_ARCH == "amd64" %}
|
||
RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-stretch
|
||
{%- else %}
|
||
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian
|
||
{%- endif %}
|
||
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker
|