Skip to content

Commit

Permalink
Use CentOS 6 (instead of 7) on Travis CI, whenever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Sep 24, 2017
1 parent c318465 commit 22f9ebd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ matrix:

- jdk: oraclejdk8
os: linux
env: PROJ=opencv,chilitags,flandmark,openblas,mxnet,hdf5,caffe OS=linux-x86
env: PROJ=opencv,flandmark,openblas,hdf5,caffe OS=linux-x86
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
Expand Down Expand Up @@ -394,6 +394,11 @@ matrix:
env: PROJ=artoolkitplus OS=linux-x86
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=chilitags OS=linux-x86
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=mkl OS=linux-x86
Expand Down Expand Up @@ -424,6 +429,11 @@ matrix:
env: PROJ=cuda OS=linux-x86
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=mxnet OS=linux-x86
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=tensorflow OS=linux-x86
Expand All @@ -447,7 +457,7 @@ matrix:

- jdk: oraclejdk8
os: linux
env: PROJ=opencv,chilitags,flandmark,openblas,mxnet,hdf5,caffe OS=linux-x86_64
env: PROJ=opencv,flandmark,openblas,hdf5,caffe OS=linux-x86_64
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
Expand Down Expand Up @@ -490,6 +500,11 @@ matrix:
env: PROJ=artoolkitplus OS=linux-x86_64
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=chilitags OS=linux-x86_64
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=mkl OS=linux-x86_64
Expand Down Expand Up @@ -520,6 +535,11 @@ matrix:
env: PROJ=cuda OS=linux-x86_64
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=mxnet OS=linux-x86_64
install: true
script: ./ci/install-travis.sh
- jdk: oraclejdk8
os: linux
env: PROJ=tensorflow OS=linux-x86_64
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ Once everything installed and configured, simply execute
```bash
$ mvn install --projects .,opencv,ffmpeg,flycapture,libdc1394,libfreenect,videoinput,artoolkitplus,etc.
```
inside the directory containing the parent `pom.xml` file, by specifying only the desired child modules in the command, but **without the leading period "." in the comma-separated list of projects, the parent `poml.xml` file itself might not get installed.** Please refer to the comments inside the `pom.xml` file for further details.
inside the directory containing the parent `pom.xml` file, by specifying only the desired child modules in the command, but **without the leading period "." in the comma-separated list of projects, the parent `poml.xml` file itself might not get installed.** Please refer to the comments inside the `pom.xml` file for further details. From the "platform" subdirectory, we can also install the "platform" artifacts with a similar command:

```bash
$ cd platform
$ mvn install --projects ../opencv/platform,../ffmpeg/platform,etc. -Djavacpp.platform.host
```


### The `cppbuild.sh` scripts
Expand Down
20 changes: 12 additions & 8 deletions ci/install-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ touch $HOME/vars.list
if [ "$TRAVIS_OS_NAME" == "osx" ]; then export JAVA_HOME=$(/usr/libexec/java_home); fi

if [[ "$OS" == "linux-x86" ]] || [[ "$OS" == "linux-x86_64" ]] || [[ "$OS" =~ android ]]; then
CENTOS_VERSION=6
if [[ "libfreenect2 librealsense chilitags llvm mxnet tensorflow skia " =~ "$PROJ " ]] || [[ "$OS" =~ android ]]; then
CENTOS_VERSION=7
fi
echo "Starting docker for x86_64 and x86 linux"
docker run -d -ti -e CI_DEPLOY_USERNAME -e CI_DEPLOY_PASSWORD -e "container=docker" -v $HOME:$HOME -v $TRAVIS_BUILD_DIR/../:$HOME/build -v /sys/fs/cgroup:/sys/fs/cgroup nvidia/cuda:8.0-cudnn6-devel-centos7 /usr/sbin/init > /dev/null
docker run -d -ti -e CI_DEPLOY_USERNAME -e CI_DEPLOY_PASSWORD -e "container=docker" -v $HOME:$HOME -v $TRAVIS_BUILD_DIR/../:$HOME/build -v /sys/fs/cgroup:/sys/fs/cgroup nvidia/cuda:8.0-cudnn6-devel-centos$CENTOS_VERSION /bin/bash > /dev/null
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
echo "Container id is $DOCKER_CONTAINER_ID please wait while updates applied"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install epel-release" > /dev/null
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install clang gcc-c++ gcc-gfortran java-devel maven python numpy swig git file which wget unzip tar bzip2 gzip xz patch make cmake3 libtool perl nasm yasm alsa-lib-devel freeglut-devel glfw-devel gtk2-devel libusb-devel libusb1-devel zlib-devel SDL-devel" > /dev/null
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install centos-release-scl-rh epel-release" > /dev/null
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "yum -y install devtoolset-3-toolchain maven30 clang gcc-c++ gcc-gfortran java-devel maven python numpy swig git file which wget unzip tar bzip2 gzip xz patch make cmake3 libtool perl nasm yasm alsa-lib-devel freeglut-devel glfw-devel gtk2-devel libusb-devel libusb1-devel zlib-devel SDL-devel" > /dev/null
if [ "$OS" == "linux-x86" ]; then
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "rpm -qa | sed s/.x86_64$/.i686/ | xargs yum -y install > /dev/null"
fi
Expand Down Expand Up @@ -247,20 +251,20 @@ if [[ "$OS" == "linux-x86" ]] || [[ "$OS" == "linux-x86_64" ]] || [[ "$OS" =~ a
while true; do echo .; docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "tail -10 $HOME/build/javacpp-presets/buildlogs/$PROJ.log"; sleep 300; done &
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "Not a pull request so attempting to deploy using docker"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets;mvn deploy -U -Djavacpp.copyResources --settings ./ci/settings.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -l $HOME/build/javacpp-presets/buildlogs/$PROJ.log -pl .,$PROJ"; export BUILD_STATUS=$?
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets; /opt/rh/maven30/root/usr/bin/mvn deploy -U -Djavacpp.copyResources --settings ./ci/settings.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -l $HOME/build/javacpp-presets/buildlogs/$PROJ.log -pl .,$PROJ"; export BUILD_STATUS=$?
else
echo "Pull request so install using docker"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets;mvn install -U --settings ./ci/settings.xml -Djavacpp.copyResources -Dmaven.test.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Dmaven.javadoc.skip=true -Djavacpp.platform=$OS -l $HOME/build/javacpp-presets/buildlogs/$PROJ.log -pl .,$PROJ"; export BUILD_STATUS=$?
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets; /opt/rh/maven30/root/usr/bin/mvn install -U --settings ./ci/settings.xml -Djavacpp.copyResources -Dmaven.test.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Dmaven.javadoc.skip=true -Djavacpp.platform=$OS -l $HOME/build/javacpp-presets/buildlogs/$PROJ.log -pl .,$PROJ"; export BUILD_STATUS=$?
fi
else
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "Not a pull request so attempting to deploy using docker"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets;mvn deploy -U -Djavacpp.copyResources --settings ./ci/settings.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -pl .,$PROJ"; export BUILD_STATUS=$?
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets; /opt/rh/maven30/root/usr/bin/mvn deploy -U -Djavacpp.copyResources --settings ./ci/settings.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -pl .,$PROJ"; export BUILD_STATUS=$?
if [ $BUILD_STATUS -eq 0 ]; then
echo "Deploying platform"
for i in ${PROJ//,/ }
do
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "cd $HOME/build/javacpp-presets/$i; mvn -U -f platform/pom.xml -Djavacpp.platform=$OS --settings ../ci/settings.xml deploy"; export BUILD_STATUS=$?
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "cd $HOME/build/javacpp-presets/$i; /opt/rh/maven30/root/usr/bin/mvn -U -f platform/pom.xml -Djavacpp.platform=$OS --settings ../ci/settings.xml deploy"; export BUILD_STATUS=$?
if [ $BUILD_STATUS -ne 0 ]; then
echo "Build Failed"
exit $BUILD_STATUS
Expand All @@ -270,7 +274,7 @@ if [[ "$OS" == "linux-x86" ]] || [[ "$OS" == "linux-x86_64" ]] || [[ "$OS" =~ a

else
echo "Pull request so install using docker"
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets;mvn install -U --settings ./ci/settings.xml -Djavacpp.copyResources -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -pl .,$PROJ"; export BUILD_STATUS=$?
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec ". $HOME/vars.list; cd $HOME/build/javacpp-presets; /opt/rh/maven30/root/usr/bin/mvn install -U --settings ./ci/settings.xml -Djavacpp.copyResources -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \$BUILD_COMPILER \$BUILD_ROOT -Djavacpp.platform=$OS -pl .,$PROJ"; export BUILD_STATUS=$?
fi
fi
echo "Build status $BUILD_STATUS"
Expand Down

0 comments on commit 22f9ebd

Please sign in to comment.