-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cavium customization for docker containers #5
Changes from 32 commits
627601b
a2e5392
812386c
c579148
3696be4
3758f4a
4d25304
0d206ce
a84d9ee
9cf983a
2ecc885
91ece10
a8f5de7
3bcf0a1
c41491f
25343a0
cdb4d87
f204471
c902f7f
0f95042
4628780
aacc331
2b4447b
1b84594
c7400f3
d755335
2159d36
f14be7e
64c8c08
01b2b8a
5c894bd
d3f1ffb
4d07d62
df63535
8c56068
6f0dd41
3783e42
b16e0a3
958ce61
f196059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ sudo debootstrap --variant=minbase --arch amd64 jessie $FILESYSTEM_ROOT http://f | |
## Config hostname and hosts, otherwise 'sudo ...' will complain 'sudo: unable to resolve host ...' | ||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '$HOSTNAME' > /etc/hostname" | ||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '127.0.0.1 $HOSTNAME' >> /etc/hosts" | ||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '127.0.0.1 localhost' >> /etc/hosts" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line should be in default /etc/hosts, no need to add. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please advise how to add it to default /etc/hosts because when we deploy Linux image there is no such entry inside /etc/hosts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the debootstrap will create a default /etc/hosts, with content "127.0.0.1 localhost". Could you double check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use PR - #4 to create a distributive and it has no such entry in /etc/hosts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct. There is no such file after debootstrap. Please ignore the previous comment. |
||
|
||
## Config basic fstab | ||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c 'echo "proc /proc proc defaults 0 0" >> /etc/fstab' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM docker-base | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can reuse the docker-orchagent for this. We do not vendor specific orchagent docker. @stcheng will add start command to config copp rule. port_config_cavm.ini can be loaded based on the $onie_platform. see https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-orchagent/start.sh#L22 |
||
|
||
RUN apt-get update | ||
|
||
COPY ["deps/libhiredis0.13*.deb", "deps/libswsscommon_*.deb", "deps/libsairedis_*.deb", "/deps/"] | ||
|
||
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/libswsscommon_*.deb | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/libsairedis_*.deb | ||
|
||
RUN apt-get install -f -y ifupdown bridge-utils | ||
|
||
## Copy executable binaries | ||
COPY ["deps/orchagent","deps/swssconfig","deps/portsyncd","deps/intfsyncd","deps/neighsyncd","/usr/local/bin/"] | ||
|
||
COPY start.sh /usr/bin/start.sh | ||
COPY port_config_cavm.ini /usr/local/bin/ | ||
COPY copp.json /usr/local/bin/ | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /deps | ||
|
||
ENTRYPOINT /usr/bin/start.sh \ | ||
&& /bin/bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this file. sonic will use the same https://github.com/Azure/sonic-swss/blob/master/swssconfig/sample/copp.config.json across different platforms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copp configuration is mainly driven from the user need, for example which types of packet should be prioritized, what the policer rate is. There maybe some cases when different platform may need to have different policer rate upper bound. But given the policer we current set, it should not be an issue. @stcheng, can you add the run swssconfig in the orchagent start.sh? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lguohan the swssconfig is added to the start.sh script. |
||
{ | ||
"COPP_TABLE:Group.P1": { | ||
"trap_ids": "stp,arp_req,arp_resp,ttl_error,lacp,lldp,ip2me", | ||
"trap_action": "trap" | ||
}, | ||
"OP": "SET" | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# alias lanes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we move this file to docker-orchagent/ and then use onie_platform to decide with port_config.ini to load? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
Ethernet1 0,1,2,3 | ||
Ethernet2 4,5,6,7 | ||
Ethernet3 8,9,10,11 | ||
Ethernet4 12,13,14,15 | ||
Ethernet5 16,17,18,19 | ||
Ethernet6 20,21,22,23 | ||
Ethernet7 24,25,26,27 | ||
Ethernet8 28,29,30,31 | ||
Ethernet9 32,33,34,35 | ||
Ethernet10 36,37,38,39 | ||
Ethernet11 40,41,42,43 | ||
Ethernet12 44,45,46,47 | ||
Ethernet13 48,49,50,51 | ||
Ethernet14 52,53,54,55 | ||
Ethernet15 56,57,58,59 | ||
Ethernet16 60,61,62,63 | ||
Ethernet17 64,65,66,67 | ||
Ethernet18 68,69,70,71 | ||
Ethernet19 72,73,74,75 | ||
Ethernet20 76,77,78,79 | ||
Ethernet21 80,81,82,83 | ||
Ethernet22 84,85,86,87 | ||
Ethernet23 88,89,90,91 | ||
Ethernet24 92,93,94,95 | ||
Ethernet25 96,97,98,99 | ||
Ethernet26 100,101,102,103 | ||
Ethernet27 104,105,106,107 | ||
Ethernet28 108,109,110,111 | ||
Ethernet29 112,113,114,115 | ||
Ethernet30 116,117,118,119 | ||
Ethernet31 120,121,122,123 | ||
Ethernet32 124,125,126,127 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
. /host/machine.conf | ||
|
||
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'` | ||
|
||
ORCHAGENT_ARGS="-m $MAC_ADDRESS" | ||
|
||
PORTSYNCD_ARGS="-p /usr/local/bin/port_config_cavm.ini" | ||
|
||
service rsyslog start | ||
swssconfig /usr/local/bin/copp.json | ||
orchagent $ORCHAGENT_ARGS & | ||
sleep 5 | ||
portsyncd $PORTSYNCD_ARGS & | ||
sleep 5 | ||
intfsyncd & | ||
sleep 5 | ||
neighsyncd & |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM docker-base | ||
|
||
RUN apt-get update | ||
|
||
COPY ["deps/libhiredis0.13*.deb", "deps/libswsscommon_*.deb", "deps/libsairedis_*.deb", "deps/syncd_*.deb", "deps/sai*.deb", "deps/libsai*.deb", "deps/xp-tools*.deb", "deps/xpshell*.deb", "/deps/"] | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; \ | ||
dpkg_apt /deps/libhiredis0.13*.deb \ | ||
&& dpkg_apt /deps/libswsscommon_*.deb \ | ||
&& dpkg_apt /deps/sai*.deb \ | ||
&& dpkg_apt /deps/libsai*.deb \ | ||
&& dpkg_apt /deps/xp-tools*.deb \ | ||
&& dpkg_apt /deps/xpshell*.deb \ | ||
&& dpkg_apt /deps/libsairedis_*.deb \ | ||
&& dpkg_apt /deps/syncd_*.deb | ||
|
||
RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev | ||
|
||
COPY ["start.sh", "/usr/bin/"] | ||
COPY ["profile.ini", "/usr/bin/"] | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /deps | ||
|
||
ENTRYPOINT /usr/bin/start.sh \ | ||
&& /bin/bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mode=1 | ||
hwId=as7512 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
export XP_ROOT=/usr/bin/ | ||
|
||
service rsyslog start | ||
syncd -p /usr/bin/profile.ini -N |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Get vendor SAI SDK | ||
## https://github.com/Azure/sonic-buildimage/blob/master/README.md#3-get-vendor-sai-sdk | ||
|
||
libsai.deb | ||
sai.deb | ||
xp-tools.deb | ||
xpshell.deb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need 'target/sonic-generic.bin'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are adding it in different PR - #4