Skip to content
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

Add docker configuration for saiserver-brcm #44

Merged
merged 3 commits into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions dockers/docker-saiserver-brcm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM docker-base

RUN apt-get update

COPY ["/deps/libsaibcm*.deb","/deps/libopennsl_*.deb","/deps/python-sdk-api_*.deb", "/deps/iproute2_*.deb", "/deps/libthrift-0.9.3_*.deb", "/deps/libnl-3-200_*.deb", "/deps/libnl-genl-3-200_*.deb", "/deps/libnl-route-3-200_*.deb", "/deps/"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/deps/libsaibcm_*.deb

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source paths are actually relative in concept.


RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; \
dpkg_apt /deps/libopennsl_*.deb \
&& dpkg_apt /deps/libsaibcm_*.deb \
&& dpkg_apt /deps/libthrift-0.9.3_*.deb \
&& dpkg_apt /deps/libnl-3-200_*.deb \
&& dpkg_apt /deps/libnl-genl-3-200_*.deb \
&& dpkg_apt /deps/libnl-route-3-200_*.deb

COPY ["deps/saiserver", "start.sh", "/usr/bin/"]

COPY ["profile.ini", "portmap.ini", "/etc/sai/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge RUN commands into one to save docker image size.

RUN rm -rf /deps

ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]
33 changes: 33 additions & 0 deletions dockers/docker-saiserver-brcm/portmap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# alias lanes
Ethernet0 29,30,31,32
Ethernet4 25,26,27,28
Ethernet8 37,38,39,40
Ethernet12 33,34,35,36
Ethernet16 41,42,43,44
Ethernet20 45,46,47,48
Ethernet24 5,6,7,8
Ethernet28 1,2,3,4
Ethernet32 9,10,11,12
Ethernet36 13,14,15,16
Ethernet40 21,22,23,24
Ethernet44 17,18,19,20
Ethernet48 49,50,51,52
Ethernet52 53,54,55,56
Ethernet56 61,62,63,64
Ethernet60 57,58,59,60
Ethernet64 65,66,67,68
Ethernet68 69,70,71,72
Ethernet72 77,78,79,80
Ethernet76 73,74,75,76
Ethernet80 105,106,107,108
Ethernet84 109,110,111,112
Ethernet88 117,118,119,120
Ethernet92 113,114,115,116
Ethernet96 121,122,123,124
Ethernet100 125,126,127,128
Ethernet104 85,86,87,88
Ethernet108 81,82,83,84
Ethernet112 89,90,91,92
Ethernet116 93,94,95,96
Ethernet120 97,98,99,100
Ethernet124 101,102,103,104
1 change: 1 addition & 0 deletions dockers/docker-saiserver-brcm/profile.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/td2-s6000-32x40G.config.bcm
20 changes: 20 additions & 0 deletions dockers/docker-saiserver-brcm/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

function clean_up {
service rsyslog stop
}

start_bcm()
{
[ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0
[ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0
[ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0
}

trap clean_up SIGTERM SIGKILL

service rsyslog start

start_bcm

/usr/bin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini