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

Travis mac build #761

Merged
merged 17 commits into from
Feb 22, 2017
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
3 changes: 3 additions & 0 deletions .travis-scripts/linux/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
60 changes: 60 additions & 0 deletions .travis-scripts/linux/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
set -e
export CC="gcc-4.8"
export CXX="g++-4.8"
wget https://s3.amazonaws.com/download.draios.com/dependencies/cmake-3.3.2.tar.gz
tar -xzf cmake-3.3.2.tar.gz
cd cmake-3.3.2
./bootstrap --prefix=/usr
make
sudo make install
cd ..
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
make VERBOSE=1
make package
cd ..
test/sysdig_trace_regression.sh build/userspace/sysdig/sysdig build/userspace/sysdig/chisels $TRAVIS_BRANCH
rm -rf build
pushd $(mktemp -d --tmpdir sysdig.XXXXXXXXXX)
wget http://download.draios.com/dependencies/zlib-1.2.8.tar.gz
tar -xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
sudo make install
cd ..
wget https://github.com/open-source-parsers/jsoncpp/archive/0.10.5.tar.gz
tar zxvf 0.10.5.tar.gz
cd jsoncpp-0.10.5
cmake -DBUILD_SHARED_LIBS=ON .
make
sudo make install
cd ..
wget https://s3.amazonaws.com/download.draios.com/dependencies/libb64-1.2.src.zip
unzip libb64-1.2.src.zip
cd libb64-1.2
make
sudo cp -r include/* /usr/local/include/
sudo cp src/libb64.a /usr/local/lib/
cd ..
wget http://download.draios.com/dependencies/jq-1.5.tar.gz
tar -xzf jq-1.5.tar.gz
cd jq-1.5
./configure --disable-maintainer-mode
make LDFLAGS=-all-static
sudo cp ./jq.h /usr/local/include/
sudo cp ./jv.h /usr/local/include/
sudo cp .libs/libjq.a /usr/local/lib/
cd ..
popd
rm -rf userspace/libsinsp/third-party/jsoncpp
sudo apt-get install libncurses5-dev libluajit-5.1-dev libcurl4-openssl-dev libssl-dev
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_BUNDLED_DEPS=OFF
make VERBOSE=1
make package
cd ..
test/sysdig_trace_regression.sh build/userspace/sysdig/sysdig build/userspace/sysdig/chisels $TRAVIS_BRANCH
4 changes: 4 additions & 0 deletions .travis-scripts/linux/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
sudo apt-get --force-yes install g++-4.8
sudo apt-get install rpm linux-headers-$(uname -r)
sudo apt-get purge libncurses5-dev cmake libcurl4-openssl-dev zlib1g-dev
2 changes: 2 additions & 0 deletions .travis-scripts/osx/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
brew update
7 changes: 7 additions & 0 deletions .travis-scripts/osx/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_ZLIB=OFF
make install
../test/sysdig_trace_regression.sh $(which sysdig) ./userspace/sysdig/chisels $TRAVIS_BRANCH
12 changes: 12 additions & 0 deletions .travis-scripts/osx/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
function install_if_not_present(){
brew ls | grep ${1}
if [[ ${?} -ne 0 ]]; then
brew install ${1}
else
echo "dependency ${1} already installed"
fi
}
install_if_not_present "cmake"
install_if_not_present "luajit"
install_if_not_present "coreutils"
70 changes: 6 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,18 @@
language: c
os:
- linux
- osx
env:
- BUILD_TYPE=Debug
- BUILD_TYPE=Release
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- .travis-scripts/${TRAVIS_OS_NAME}/before_install.sh
install:
- sudo apt-get --force-yes install g++-4.8
- sudo apt-get install rpm linux-headers-$(uname -r)
- sudo apt-get purge libncurses5-dev cmake libcurl4-openssl-dev zlib1g-dev
- .travis-scripts/${TRAVIS_OS_NAME}/install.sh
before_script:
- export KERNELDIR=/lib/modules/$(ls /lib/modules | sort | head -1)/build
script:
- set -e
- export CC="gcc-4.8"
- export CXX="g++-4.8"
- wget https://s3.amazonaws.com/download.draios.com/dependencies/cmake-3.3.2.tar.gz
- tar -xzf cmake-3.3.2.tar.gz
- cd cmake-3.3.2
- ./bootstrap --prefix=/usr
- make
- sudo make install
- cd ..
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- make VERBOSE=1
- make package
- cd ..
- test/sysdig_trace_regression.sh build/userspace/sysdig/sysdig build/userspace/sysdig/chisels $TRAVIS_BRANCH
- rm -rf build
- pushd $(mktemp -d --tmpdir sysdig.XXXXXXXXXX)
- wget http://download.draios.com/dependencies/zlib-1.2.8.tar.gz
- tar -xzf zlib-1.2.8.tar.gz
- cd zlib-1.2.8
- ./configure
- make
- sudo make install
- cd ..
- wget https://github.com/open-source-parsers/jsoncpp/archive/0.10.5.tar.gz
- tar zxvf 0.10.5.tar.gz
- cd jsoncpp-0.10.5
- cmake -DBUILD_SHARED_LIBS=ON .
- make
- sudo make install
- cd ..
- wget https://s3.amazonaws.com/download.draios.com/dependencies/libb64-1.2.src.zip
- unzip libb64-1.2.src.zip
- cd libb64-1.2
- make
- sudo cp -r include/* /usr/local/include/
- sudo cp src/libb64.a /usr/local/lib/
- cd ..
- wget http://download.draios.com/dependencies/jq-1.5.tar.gz
- tar -xzf jq-1.5.tar.gz
- cd jq-1.5
- ./configure --disable-maintainer-mode
- make LDFLAGS=-all-static
- sudo cp ./jq.h /usr/local/include/
- sudo cp ./jv.h /usr/local/include/
- sudo cp .libs/libjq.a /usr/local/lib/
- cd ..
- popd
- rm -rf userspace/libsinsp/third-party/jsoncpp
- sudo apt-get install libncurses5-dev libluajit-5.1-dev libcurl4-openssl-dev libssl-dev
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_BUNDLED_DEPS=OFF
- make VERBOSE=1
- make package
- cd ..
- test/sysdig_trace_regression.sh build/userspace/sysdig/sysdig build/userspace/sysdig/chisels $TRAVIS_BRANCH
- .travis-scripts/${TRAVIS_OS_NAME}/build.sh
notifications:
webhooks:
urls:
Expand Down
15 changes: 11 additions & 4 deletions test/sysdig_trace_regression.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/bin/bash
set -eu
set -exu

SCRIPT=$(readlink -f $0)
BASEDIR=$(dirname $SCRIPT)
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
SCRIPT=$(readlink -f $0)
TMPBASE=${4:-$(mktemp -d --tmpdir sysdig.XXXXXXXXXX)}
elif [[ "$unamestr" == 'Darwin' ]]; then
SCRIPT=$(greadlink -f $0)
unset TMPDIR #make shure that mktemp on mac will generate the folder under /tmp
TMPBASE=${4:-$(mktemp -d -t sysdig)}
fi

BASEDIR=$(dirname $SCRIPT)
SYSDIG=$1
CHISELS=$2
TMPBASE=${4:-$(mktemp -d --tmpdir sysdig.XXXXXXXXXX)}
TRACEDIR="${TMPBASE}/traces"
RESULTDIR="${TMPBASE}/results"
BASELINEDIR="${TMPBASE}/baseline"
Expand Down