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

Updating docker-orchagent/syncd Dockerfile and start.sh #9

Merged
merged 1 commit into from
Sep 22, 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
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/"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where to get the dependency 'libnl-3-200_*.deb'?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also update Makefile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

open an issue in github and do it later.


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