Skip to content

Commit

Permalink
Updating docker-orchagent/syncd Dockerfile and start.sh (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
stcheng authored Sep 22, 2016
1 parent f19d445 commit 623fdbf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 36 deletions.
22 changes: 12 additions & 10 deletions dockers/docker-orchagent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ FROM docker-base

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/bin/"]
COPY ["deps/libhiredis0.13*.deb", "deps/libnl-3-200_*.deb", "deps/libnl-genl-3-200_*.deb", "deps/libnl-route-3-200_*.deb", "deps/libswsscommon_*.deb", "deps/libsairedis_*.deb", "deps/swss_*.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/libnl-3-200_*.deb \
&& dpkg_apt /deps/libnl-genl-3-200_*.deb \
&& dpkg_apt /deps/libnl-route-3-200_*.deb \
&& dpkg_apt /deps/libswsscommon_*.deb \
&& dpkg_apt /deps/libsairedis_*.deb \
&& dpkg_apt /deps/swss_*.deb

RUN apt-get install -f -y ifupdown bridge-utils redis-tools

COPY start.sh /usr/bin/start.sh

Expand Down
38 changes: 21 additions & 17 deletions dockers/docker-orchagent/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash

function start_app {
orchagent $ORCHAGENT_ARGS &
portsyncd $PORTSYNCD_ARGS &
intfsyncd &
neighsyncd &
swssconfig &
}

function clean_up {
kill -9 $ORCHAGENT_PID
kill -9 $PORTSYNCD_PID
kill -9 $INTFSYNCD_PID
kill -9 $NEIGHSYNCD_PID
pkill -9 orchagent
pkill -9 portsyncd
pkill -9 intfsyncd
pkill -9 neighsyncd
service rsyslog stop
exit
}
Expand All @@ -27,16 +35,12 @@ elif [ "$onie_platform" == "x86_64-mlnx_x86-r5.0.1400" ]; then
fi

service rsyslog start
orchagent $ORCHAGENT_ARGS &
ORCHAGENT_PID=$!
sleep 5
portsyncd $PORTSYNCD_ARGS &
PORTSYNCD_PID=$!
sleep 5
intfsyncd &
INTFSYNCD_PID=$!
sleep 5
neighsyncd &
NEIGHSYNCD_PID=$!

read
while true; do
# Check if syncd starts
result=`echo -en "SELECT 1\nHLEN HIDDEN" | redis-cli | sed -n 2p`
if [ "$result" != "0" ]; then
start_app
read
fi
sleep 1
done
9 changes: 6 additions & 3 deletions dockers/docker-syncd-mlnx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return
&& dpkg_apt /deps/iproute2_*.deb \
&& dpkg_apt /deps/mft*.deb \

&& dpkg_apt /deps/libhiredis0.13*.deb \
&& dpkg_apt /deps/libswsscommon_*.deb \
&& dpkg_apt /deps/mlnx-sai_*.deb \
&& dpkg_apt /deps/libhiredis0.13*.deb \
&& dpkg_apt /deps/libnl-3-200_*.deb \
&& dpkg_apt /deps/libnl-genl-3-200_*.deb \
&& dpkg_apt /deps/libnl-route-3-200_*.deb \
&& dpkg_apt /deps/libswsscommon_*.deb \
&& dpkg_apt /deps/mlnx-sai_*.deb \
&& 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
Expand Down
15 changes: 9 additions & 6 deletions dockers/docker-syncd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ FROM docker-base

RUN apt-get update

COPY ["deps/libhiredis0.13*.deb", "deps/libswsscommon_*.deb", "deps/libopennsl_*.deb", "deps/libsaibcm_*.deb", "deps/libsairedis_*.deb", "deps/syncd_*.deb", "/deps/"]
COPY ["deps/libhiredis0.13*.deb", "deps/libnl-3-200_*.deb", "deps/libnl-genl-3-200_*.deb", "deps/libnl-route-3-200_*.deb", "deps/libswsscommon_*.deb", "deps/libopennsl_*.deb", "deps/libsaibcm_*.deb", "deps/libsairedis_*.deb", "deps/syncd_*.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/libopennsl_*.deb \
&& dpkg_apt /deps/libsaibcm_*.deb \
&& dpkg_apt /deps/libsairedis_*.deb \
dpkg_apt /deps/libhiredis0.13*.deb \
&& dpkg_apt /deps/libnl-3-200_*.deb \
&& dpkg_apt /deps/libnl-genl-3-200_*.deb \
&& dpkg_apt /deps/libnl-route-3-200_*.deb \
&& dpkg_apt /deps/libswsscommon_*.deb \
&& dpkg_apt /deps/libopennsl_*.deb \
&& dpkg_apt /deps/libsaibcm_*.deb \
&& dpkg_apt /deps/libsairedis_*.deb \
&& dpkg_apt /deps/syncd_*.deb

## TODO: add kmod into Depends
Expand Down

0 comments on commit 623fdbf

Please sign in to comment.