-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker-sonic for p4 switch * update build instructions
- Loading branch information
Showing
18 changed files
with
268 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM docker-base | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get install -y net-tools ethtool tcpdump ifupdown | ||
|
||
COPY ["deps/libthrift-0.9.3_*.deb", "deps/libhiredis0.13*.deb", "deps/redis-tools_*.deb", "deps/redis-server_*.deb", "deps/libswsscommon_*.deb", "deps/p4-bmv2_*.deb", "deps/p4-switch_*.deb", "deps/libsairedis_*.deb", "deps/syncd_*.deb", "deps/swss_*.deb", "deps/quagga_*.deb", "/deps/"] | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/libthrift-0.9.3_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/libhiredis0.13*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/redis-tools_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/redis-server_*.deb | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/libswsscommon_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/p4-bmv2_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/p4-switch_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/libsairedis_*.deb | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/syncd_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/swss_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/quagga_*.deb | ||
|
||
ADD port_config.ini /port_config.ini | ||
ADD startup.sh /scripts/startup.sh | ||
|
||
ADD rsyslog.conf /etc/rsyslog.conf | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /deps | ||
|
||
ENTRYPOINT /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# alias lanes | ||
Ethernet0 1 | ||
Ethernet1 2 | ||
Ethernet2 3 | ||
Ethernet3 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
############################################################################### | ||
# Managed by Ansible | ||
# file: ansible/roles/acs/templates/rsyslog.conf.j2 | ||
############################################################################### | ||
# | ||
# /etc/rsyslog.conf Configuration file for rsyslog. | ||
# | ||
# For more information see | ||
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html | ||
|
||
|
||
################# | ||
#### MODULES #### | ||
################# | ||
|
||
$ModLoad imuxsock # provides support for local system logging | ||
#$ModLoad imklog # provides kernel logging support | ||
#$ModLoad immark # provides --MARK-- message capability | ||
|
||
# provides UDP syslog reception | ||
#$ModLoad imudp | ||
#$UDPServerRun 514 | ||
|
||
# provides TCP syslog reception | ||
#$ModLoad imtcp | ||
#$InputTCPServerRun 514 | ||
|
||
|
||
########################### | ||
#### GLOBAL DIRECTIVES #### | ||
########################### | ||
#Set remote syslog server | ||
*.* @172.17.0.1:514 | ||
|
||
# | ||
# Use traditional timestamp format. | ||
# To enable high precision timestamps, comment out the following line. | ||
# | ||
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | ||
|
||
# Define a custom template | ||
$template ACSFileFormat,"%TIMESTAMP% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | ||
$ActionFileDefaultTemplate ACSFileFormat | ||
|
||
# | ||
# Set the default permissions for all log files. | ||
# | ||
$FileOwner root | ||
$FileGroup adm | ||
$FileCreateMode 0640 | ||
$DirCreateMode 0755 | ||
$Umask 0022 | ||
|
||
# | ||
# Where to place spool and state files | ||
# | ||
$WorkDirectory /var/spool/rsyslog | ||
|
||
# | ||
# Include all config files in /etc/rsyslog.d/ | ||
# | ||
$IncludeConfig /etc/rsyslog.d/*.conf | ||
|
||
|
||
############### | ||
#### RULES #### | ||
############### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
echo "Start rsyslog" | ||
service rsyslog start | ||
|
||
echo "Start redis server" | ||
service redis-server start | ||
|
||
echo "Veth setup" | ||
/usr/share/bmpd/tools/veth_setup.sh > /tmp/veth_setup.log 2>&1 | ||
|
||
echo "Disable IPv6" | ||
/usr/share/bmpd/tools/veth_disable_ipv6.sh > /tmp/veth_disable.log 2>&1 | ||
|
||
echo "Start BMV2" | ||
/run_bm.sh > /tmp/run_bm.log 2>&1 & | ||
sleep 15 | ||
|
||
redis-cli -n 1 set LOGLEVEL DEBUG | ||
|
||
echo "Start Syncd" | ||
syncd -N > /tmp/syncd.log 2>&1 & | ||
sleep 10 | ||
|
||
echo "Start Orchagent" | ||
orchagent $* > /tmp/orchagent.log 2>&1 & | ||
sleep 10 | ||
|
||
echo "Start Portsyncd" | ||
portsyncd -p /port_config.ini > /tmp/portsyncd.log 2>&1 & | ||
|
||
echo "Start Intfsync" | ||
intfsyncd > /tmp/intfsyncd.log 2>&1 & | ||
|
||
echo "Start Neighsyncd" | ||
neighsyncd > /tmp/neighsyncd.log 2>&1 & | ||
|
||
echo "Start Fpmsyncd" | ||
fpmsyncd > /tmp/fpmsyncd.log 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule behavioral-model
added at
0eb0d5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -x | ||
|
||
pushd behavioral-model; ./autogen.sh; dpkg-buildpackage -us -uc -b -j4; popd | ||
|
||
cp *.deb ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash -x | ||
|
||
pushd p4-hlir | ||
python setup.py --command-packages=stdeb.command bdist_deb | ||
popd | ||
|
||
cp p4-hlir/deb_dist/*.deb ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -x | ||
|
||
sudo pip install ctypesgen | ||
|
||
sudo pip install crc16 | ||
|
||
pushd switch | ||
|
||
mkdir -p p4-build/bmv2/switch | ||
mkdir -p p4-build/bmv2/pd_thrift_gen | ||
|
||
./autogen.sh | ||
dpkg-buildpackage -us -uc -b -j4 | ||
|
||
popd | ||
|
||
cp *.deb ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash -x | ||
|
||
pushd p4c-bm | ||
python setup.py --command-packages=stdeb.command bdist_deb | ||
popd | ||
|
||
cp p4c-bm/deb_dist/*.deb ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -x | ||
|
||
wget -nc http://pypi.python.org/packages/source/T/Tenjin/Tenjin-1.1.1.tar.gz | ||
tar xzf Tenjin-1.1.1.tar.gz | ||
pushd Tenjin-1.1.1 | ||
python setup.py --command-packages=stdeb.command bdist_deb | ||
popd | ||
cp Tenjin-1.1.1/deb_dist/*.deb ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -x | ||
|
||
wget -nc http://http.debian.net/debian/pool/main/t/thrift/thrift_0.9.3.orig.tar.gz | ||
wget -nc http://http.debian.net/debian/pool/main/t/thrift/thrift_0.9.3-2.debian.tar.xz | ||
wget -nc http://http.debian.net/debian/pool/main/t/thrift/thrift_0.9.3-2.dsc | ||
dpkg-source -x thrift_0.9.3-2.dsc | ||
cd thrift-0.9.3 | ||
dpkg-buildpackage -d -rfakeroot -b -us -uc | ||
cd .. | ||
cp *.deb ../ |