summaryrefslogtreecommitdiffstats
path: root/clover/clovisor/build.sh
diff options
context:
space:
mode:
authorStephen Wong <stephen.kf.wong@gmail.com>2018-09-11 23:37:33 +0000
committerStephen Wong <stephen.kf.wong@gmail.com>2018-11-01 06:42:03 +0000
commit56b8e050641fef01ada624b1eb715aa8177bb5bd (patch)
tree09c02d64ae53e2f0f25d49443dfb8ca78813c6e9 /clover/clovisor/build.sh
parent257e0d846ade5b1051c3734ad6a2d5bea4ce4ca7 (diff)
CLOVER-43: Initial commit for Clovisor
Part of Clover's initial task (during project proposal) is to explore cloud native network tracing tools. Clover the project proposes Clovisor as a way for Clover to use the IOvisor (https://www.iovisor.org/) to perform network tracing. This is the first commit of this module Please note that the BPF code used in this commit were only tested with Linux kernel 4.14+ --- hence, if ubuntu is used, and one prefers LTS, the requirement is 18.04+ A different patch will track the redis and k8s API server watcher code Also, a design doc will be added in the future (TBD) Signed-off-by: Stephen Wong <stephen.kf.wong@gmail.com> Change-Id: I30d9f9d474b8703097c470d39628e86bc788f9b6
Diffstat (limited to 'clover/clovisor/build.sh')
-rwxr-xr-xclover/clovisor/build.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/clover/clovisor/build.sh b/clover/clovisor/build.sh
new file mode 100755
index 0000000..4503d5a
--- /dev/null
+++ b/clover/clovisor/build.sh
@@ -0,0 +1,45 @@
+# Copyright (c) Authors of Clover
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+
+GOVERSION=1.10.3
+OS=linux
+ARCH=amd64
+GOPATH=/home/ubuntu/go
+CLIENTGOVERSION=v8.0.0
+
+SRCDIR=`pwd`
+
+wget https://dl.google.com/go/go$GOVERSION.$OS-$ARCH.tar.gz
+sudo tar -C /usr/local -xzf go$GOVERSION.$OS-$ARCH.tar.gz
+export PATH=$PATH:/usr/local/go/bin
+export PATH=$GOPATH/bin:$PATH
+
+sudo apt install -y gcc
+sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D4284CDD
+echo "deb https://repo.iovisor.org/apt/bionic bionic main" | sudo tee /etc/apt/sources.list.d/iovisor.list
+sudo apt-get update -y
+sudo apt-get install -y bcc-tools libbcc-examples linux-headers-$(uname -r)
+
+go get github.com/google/gopacket
+go get github.com/iovisor/gobpf
+go get github.com/opentracing/opentracing-go
+go get github.com/pkg/errors
+go get github.com/uber/jaeger-client-go
+go get github.com/vishvananda/netlink
+go get github.com/vishvananda/netns
+go get golang.org/x/sys/unix
+
+go get github.com/tools/godep
+go get k8s.io/client-go/...
+cd $GOPATH/src/k8s.io/client-go
+git checkout $CLIENTGOVERSION
+godep restore ./...
+
+cd $SRCDIR/libclovisor
+go build .
+cd ../
+go build -o clovisor .