-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Requirements for SDN networks (#11)
* Added sflow build to OVS * Added python overrides * Update ubuntu.dockerfile * Updates on onos frr * Onos updates * Updates * Trying with Zulu * Onos build with ZULU jre * onos log to stdout * Sflow + SflowRT * ONOS with hsflowsd * hsflowd * Added hping3 * Added parallel
- Loading branch information
1 parent
060db9d
commit c63de77
Showing
15 changed files
with
287 additions
and
52 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
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,11 @@ | ||
#!/bin/bash | ||
echo "build_hsflowd on platform: $1" | ||
|
||
git clone --depth=1 https://github.com/sflow/host-sflow \ | ||
&& cd host-sflow \ | ||
&& make deb FEATURES="NFLOG PCAP TCP DOCKER KVM OVS DBUS SYSTEMD DROPMON PSAMPLE DENT CONTAINERD" | ||
|
||
for deb in `ls *.deb`; do cp "$deb" "/packages/${deb/hsflowd/hsflowd-$1}"; done | ||
echo "" | ||
echo "files in /packages:" | ||
ls -l /packages |
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 @@ | ||
ARG image=unibaktr/alpine | ||
ARG ALPINE_VERSION=3.19 | ||
|
||
FROM golang:alpine${ALPINE_VERSION} as build | ||
RUN apk --update add \ | ||
libpcap-dev \ | ||
build-base \ | ||
linux-headers \ | ||
gcc \ | ||
git \ | ||
openssl-dev \ | ||
util-linux-dev | ||
RUN git clone --depth=1 --branch=master https://github.com/sflow/host-sflow.git | ||
WORKDIR host-sflow | ||
RUN make all install FEATURES="DOCKER PCAP OVS TCP DROPMON CONTAINERD CONTAINERDGO K8S" PROCFS=/rootproc | ||
|
||
FROM $image as complete | ||
COPY --from=build /usr/sbin/hsflowd_containerd /usr/sbin/hsflowd_containerd | ||
COPY --from=build /usr/sbin/hsflowd /usr/sbin/hsflowd | ||
COPY --from=build /etc/hsflowd/ /etc/hsflowd/ | ||
COPY ovs/start.sh / | ||
COPY ovs/supervisord.conf /etc/supervisord.conf | ||
RUN apk add --no-cache tini dmidecode libpcap libuuid uuidgen supervisor openvswitch && \ | ||
chmod +x /start.sh && \ | ||
ln -s /proc /rootproc && \ | ||
/usr/bin/ovsdb-tool create /etc/openvswitch/conf.db && \ | ||
mkdir -pv /var/run/openvswitch/ | ||
|
||
|
||
#HEALTHCHECK CMD pidof hsflowd > /dev/null || exit 1 | ||
#CMD ["/sbin/tini","--","/start.sh"] | ||
ENTRYPOINT /usr/bin/supervisord -c /etc/supervisord.conf |
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,79 @@ | ||
#!/bin/sh | ||
|
||
COLLECTOR="${COLLECTOR:-127.0.0.1}" | ||
PORT="${PORT:-6343}" | ||
POLLING="${POLLING:-30}" | ||
SAMPLING="${SAMPLING:-1000}" | ||
NET="${NET:-docker}" | ||
DROPMON="${DROPMON:-disable}" | ||
DEBUG="${DEBUG:-none}" | ||
|
||
CONF='/etc/hsflowd.conf' | ||
|
||
case "$DEBUG" in | ||
none) | ||
FLAGS='-d' | ||
;; | ||
info) | ||
FLAGS='-dd' | ||
;; | ||
fine) | ||
FLAGS='-ddd' | ||
;; | ||
finer) | ||
FLAGS='-dddd' | ||
;; | ||
finest) | ||
FLAGS='-ddddd' | ||
;; | ||
*) | ||
FLAGS='-d' | ||
;; | ||
esac | ||
|
||
printf "sflow {\n" > $CONF | ||
printf " sampling=$SAMPLING\n" >> $CONF | ||
printf " sampling.bps_ratio=0\n" >> $CONF | ||
printf " polling=$POLLING\n" >> $CONF | ||
for ip in $COLLECTOR | ||
do | ||
printf " collector { ip=$ip udpport=$PORT }\n" >> $CONF | ||
done | ||
if [ -e /var/run/docker.sock ] | ||
then | ||
printf " docker { }\n" >> $CONF | ||
elif [ -e /run/containerd/containerd.sock ] | ||
then | ||
printf " k8s { markTraffic=on eof=on }\n" >> $CONF | ||
fi | ||
if [ "$DROPMON" = "enable" ] | ||
then | ||
printf " dropmon { limit=50 start=on sw=on hw=off }\n" >> $CONF | ||
fi | ||
case "$NET" in | ||
docker) | ||
printf " pcap { dev=docker0 }\n" >> $CONF | ||
printf " pcap { dev=docker_gwbridge }\n" >> $CONF | ||
;; | ||
ovs) | ||
printf " ovs { }\n" >> $CONF | ||
;; | ||
flannel) | ||
printf " pcap { dev=cni0 }\n" >> $CONF | ||
;; | ||
host) | ||
printf " tcp { }\n" >> $CONF | ||
printf " pcap { speed=1G- }\n" >> $CONF | ||
;; | ||
*) | ||
printf " tcp { }\n" >> $CONF | ||
for dev in `ls /sys/class/net/ | grep "$NET"` | ||
do | ||
printf " pcap { dev=$dev }\n" >> $CONF | ||
done | ||
;; | ||
esac | ||
printf "}\n" >> $CONF | ||
|
||
echo "Sending sFlow to $COLLECTOR UDP port $PORT" | ||
exec /usr/sbin/hsflowd $FLAGS |
Oops, something went wrong.