[vs] add teamsyncd into vs docker (#1112)

* [vs] add teamsyncd into vs docker

* add build badge for virtual switch
This commit is contained in:
lguohan 2017-11-03 17:13:39 -07:00 committed by GitHub
parent 4e1fb6850f
commit 875bdf6be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 86 additions and 61 deletions

1
.gitignore vendored
View File

@ -51,6 +51,7 @@ dockers/docker-teamd/Dockerfile
dockers/docker-sonic-mgmt/Dockerfile dockers/docker-sonic-mgmt/Dockerfile
platform/*/docker-syncd-*/Dockerfile platform/*/docker-syncd-*/Dockerfile
platform/*/docker-syncd-*-rpc/Dockerfile platform/*/docker-syncd-*-rpc/Dockerfile
platform/vs/docker-sonic-vs/Dockerfile
# Installer-related files and directories # Installer-related files and directories
installer/x86_64/platforms/ installer/x86_64/platforms/

View File

@ -2,7 +2,8 @@ Broadcom: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/broad
Cavium: [![Cavium](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/) Cavium: [![Cavium](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/)
Centec: [![Centec](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/) Centec: [![Centec](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/)
Mellanox: [![Mellanox](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all) Mellanox: [![Mellanox](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all)
P4: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all) P4: [![P4](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
VS: [![VS](https://sonic-jenkins.westus.cloudapp.azure.com/job/vs/job/buildimage-vs-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/vs/job/buildimage-vs-all)
# sonic-buildimage # sonic-buildimage
@ -10,7 +11,7 @@ P4: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buil
# Description # Description
Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatiable network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [document](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all). Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatiable network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/Azure/SONiC/wiki/Supported-Devices-and-Platforms)
# Hardware # Hardware
Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04. Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04.
@ -47,6 +48,7 @@ The SONiC installer contains all docker images needed. SONiC uses one image for
- PLATFORM=cavium - PLATFORM=cavium
- PLATFORM=centec - PLATFORM=centec
- PLATFORM=p4 - PLATFORM=p4
- PLATFORM=vs
For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices. For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices.
@ -92,6 +94,7 @@ This may take a while, but it is a one-time action, so please be patient.
- docker-syncd-cavm.gz: docker image for the daemon to sync database and Cavium switch ASIC (gzip tar archive) - docker-syncd-cavm.gz: docker image for the daemon to sync database and Cavium switch ASIC (gzip tar archive)
- docker-syncd-mlnx.gz: docker image for the daemon to sync database and Mellanox switch ASIC (gzip tar archive) - docker-syncd-mlnx.gz: docker image for the daemon to sync database and Mellanox switch ASIC (gzip tar archive)
- docker-sonic-p4.gz: docker image for all-in-one for p4 software switch (gzip tar archive) - docker-sonic-p4.gz: docker image for all-in-one for p4 software switch (gzip tar archive)
- docker-sonic-vs.gz: docker image for all-in-one for software virtual switch (gzip tar archive)
## Contribution Guide ## Contribution Guide

View File

@ -4,14 +4,72 @@ HOWTO Use Virtual Switch
1. Create a docker with 32 front panel port 1. Create a docker with 32 front panel port
``` ```
docker run -id --name sw debian bash $ docker run -id --name sw debian bash
sudo ./create_vnet.sh sw $ sudo ./create_vnet.sh sw
$ ip netns list
sw-srv31 (id: 37)
sw-srv30 (id: 35)
sw-srv29 (id: 34)
sw-srv28 (id: 33)
sw-srv27 (id: 32)
sw-srv26 (id: 31)
sw-srv25 (id: 30)
sw-srv24 (id: 29)
sw-srv23 (id: 28)
sw-srv22 (id: 27)
sw-srv21 (id: 26)
sw-srv20 (id: 25)
sw-srv19 (id: 24)
sw-srv18 (id: 23)
sw-srv17 (id: 22)
sw-srv16 (id: 21)
sw-srv15 (id: 20)
sw-srv14 (id: 19)
sw-srv13 (id: 18)
sw-srv12 (id: 17)
sw-srv11 (id: 16)
sw-srv10 (id: 15)
sw-srv9 (id: 14)
sw-srv8 (id: 13)
sw-srv7 (id: 12)
sw-srv6 (id: 11)
sw-srv5 (id: 10)
sw-srv4 (id: 9)
sw-srv3 (id: 8)
sw-srv2 (id: 7)
sw-srv1 (id: 6)
sw-srv0 (id: 5)
``` ```
2. Create sonic virtual switch docker 2. Start sonic virtual switch docker
``` ```
docker run --privileged --network container:sw -d docker-sonic-vs $ docker run --privileged --network container:sw -d docker-sonic-vs
``` ```
3. Run test in virtual switch docker (TBD) 3. Setup IP in the virtual switch docker
```
$ docker exec -it vs bash
root@2e9b5c2dc2a2:/# ifconfig Ethernet0 10.0.0.0/31 up
root@2e9b5c2dc2a2:/# ifconfig Ethernet4 10.0.0.2/31 up
```
4. Setup IP in the server network namespace
```
$ sudo ip netns exec sw-srv0 ifconfig eth0 10.0.0.1/31
$ sudo ip netns exec sw-srv0 ip route add default via 10.0.0.0
$ sudo ip netns exec sw-srv1 ifconfig eth0 10.0.0.3/31
$ sudo ip netns exec sw-srv1 ip route add default via 10.0.0.2
```
5. Ping from sw-srv0 to sw-srv1
```
$ sudo ip netns exec sw-srv0 ping 10.0.0.3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
64 bytes from 10.0.0.3: icmp_seq=1 ttl=63 time=0.137 ms
64 bytes from 10.0.0.3: icmp_seq=2 ttl=63 time=0.148 ms
64 bytes from 10.0.0.3: icmp_seq=3 ttl=63 time=0.149 ms
```

View File

@ -2,7 +2,7 @@
DOCKER_SONIC_VS = docker-sonic-vs.gz DOCKER_SONIC_VS = docker-sonic-vs.gz
$(DOCKER_SONIC_VS)_PATH = $(PLATFORM_PATH)/docker-sonic-vs $(DOCKER_SONIC_VS)_PATH = $(PLATFORM_PATH)/docker-sonic-vs
$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) $(SYNCD_VS) $(REDIS_SERVER) $(REDIS_TOOLS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_DEVICE_DATA) $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) $(SYNCD_VS) $(REDIS_SERVER) $(REDIS_TOOLS) $(PYTHON_SWSSCOMMON) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_DEVICE_DATA)
ifeq ($(SONIC_ROUTING_STACK), quagga) ifeq ($(SONIC_ROUTING_STACK), quagga)
$(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA) $(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA)

View File

@ -1,51 +0,0 @@
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y net-tools \
ethtool \
tcpdump \
ifupdown \
bridge-utils \
python-ply \
libqt5core5a \
libqt5network5 \
libboost-program-options1.55.0 \
libboost-system1.55.0 \
libboost-thread1.55.0 \
libgmp10 \
libjudydebian1 \
libnanomsg0 \
libdaemon0 \
libjansson4 \
libjemalloc1 \
openssh-client \
openssh-server \
libc-ares2 \
iproute
COPY \
debs/libnl-route-3-200_3.2.27-1_amd64.deb debs/libnl-genl-3-200_3.2.27-1_amd64.deb debs/libnl-nf-3-200_3.2.27-1_amd64.deb debs/libhiredis0.13_0.13.3-2_amd64.deb debs/libnl-3-200_3.2.27-1_amd64.deb debs/libnl-cli-3-200_3.2.27-1_amd64.deb debs/libswsscommon_1.0.0_amd64.deb debs/libsairedis_1.0.0_amd64.deb debs/libsaimetadata_1.0.0_amd64.deb debs/libteam5_1.26-1_amd64.deb debs/libsaivs_1.0.0_amd64.deb debs/swss_1.0.0_amd64.deb debs/syncd-vs_1.0.0_amd64.deb debs/redis-server_3.2.4-1~bpo8+1_amd64.deb debs/redis-tools_3.2.4-1~bpo8+1_amd64.deb debs/libteamdctl0_1.26-1_amd64.deb debs/libteam-utils_1.26-1_amd64.deb debs/sonic-device-data_1.0-1_all.deb debs/quagga_0.99.24.1-2.1_amd64.deb debs/
RUN dpkg -i \
debs/libnl-route-3-200_3.2.27-1_amd64.deb debs/libnl-genl-3-200_3.2.27-1_amd64.deb debs/libnl-nf-3-200_3.2.27-1_amd64.deb debs/libhiredis0.13_0.13.3-2_amd64.deb debs/libnl-3-200_3.2.27-1_amd64.deb debs/libnl-cli-3-200_3.2.27-1_amd64.deb debs/libswsscommon_1.0.0_amd64.deb debs/libsairedis_1.0.0_amd64.deb debs/libsaimetadata_1.0.0_amd64.deb debs/libteam5_1.26-1_amd64.deb debs/libsaivs_1.0.0_amd64.deb debs/swss_1.0.0_amd64.deb debs/syncd-vs_1.0.0_amd64.deb debs/redis-server_3.2.4-1~bpo8+1_amd64.deb debs/redis-tools_3.2.4-1~bpo8+1_amd64.deb debs/libteamdctl0_1.26-1_amd64.deb debs/libteam-utils_1.26-1_amd64.deb debs/sonic-device-data_1.0-1_all.deb debs/quagga_0.99.24.1-2.1_amd64.deb
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
RUN sed -ri 's/^daemonize yes$/daemonize no/; \
s/^logfile .*$/logfile ""/; \
s/^# syslog-enabled no$/syslog-enabled no/; \
s/^# unixsocket/unixsocket/ \
' /etc/redis/redis.conf
COPY ["50-default.conf", "/etc/rsyslog.d/"]
COPY ["start.sh", "orchagent.sh", "/usr/bin/"]
COPY ["brcm.profile.ini", "/usr/share/sonic/device/vswitch/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
ENTRYPOINT ["/usr/bin/supervisord"]

View File

@ -25,7 +25,8 @@ RUN apt-get install -y net-tools \
openssh-client \ openssh-client \
openssh-server \ openssh-server \
libc-ares2 \ libc-ares2 \
iproute iproute \
libpython2.7
COPY \ COPY \
{% for deb in docker_sonic_vs_debs.split(' ') -%} {% for deb in docker_sonic_vs_debs.split(' ') -%}

View File

@ -26,6 +26,8 @@ supervisorctl start intfsyncd
supervisorctl start neighsyncd supervisorctl start neighsyncd
supervisorctl start teamsyncd
# Start arp_update when VLAN exists # Start arp_update when VLAN exists
# VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` # VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
# if [ "$VLAN" != "" ]; then # if [ "$VLAN" != "" ]; then

View File

@ -66,3 +66,11 @@ autostart=false
autorestart=false autorestart=false
stdout_logfile=syslog stdout_logfile=syslog
stderr_logfile=syslog stderr_logfile=syslog
[program:teamsyncd]
command=/usr/bin/teamsyncd
priority=9
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

View File

@ -12,6 +12,9 @@ SONIC_DPKG_DEBS += $(LIBSWSSCOMMON)
LIBSWSSCOMMON_DEV = libswsscommon-dev_1.0.0_amd64.deb LIBSWSSCOMMON_DEV = libswsscommon-dev_1.0.0_amd64.deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV))) $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV)))
PYTHON_SWSSCOMMON = python-swsscommon_1.0.0_amd64.deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON_SWSSCOMMON)))
LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_amd64.deb LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_amd64.deb
$(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON)
$(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON)

@ -1 +1 @@
Subproject commit 2e94b54e3626a4acd73bb3edb2f94d61793ee0e4 Subproject commit a6f74b67a58074439d8f3dbf84fa8ecc0a2e06a6