You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/09/04 12:14:50 UTC
[1/2] thrift git commit: THRIFT-3907 Skip Docker image build on CI
when unchanged
Repository: thrift
Updated Branches:
refs/heads/master d2b4f2483 -> 2c64bddc0
THRIFT-3907 Skip Docker image build on CI when unchanged
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/93fb7ead
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/93fb7ead
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/93fb7ead
Branch: refs/heads/master
Commit: 93fb7eadd093e561e3c7122dc9eb084ca033047d
Parents: d2b4f24
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Sun Sep 4 17:00:11 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sun Sep 4 21:13:32 2016 +0900
----------------------------------------------------------------------
.travis.yml | 39 +++++++++++-------------------
build/docker/centos/Dockerfile | 2 +-
build/docker/centos/scripts/keepit | 1 -
build/docker/centos6/Dockerfile | 2 +-
build/docker/centos6/scripts/keepit | 1 -
build/docker/check_unmodified.sh | 41 ++++++++++++++++++++++++++++++++
build/docker/debian/Dockerfile | 2 +-
build/docker/debian/scripts/dpkg.sh | 5 ----
build/docker/scripts/dpkg.sh | 5 ++++
build/docker/ubuntu/Dockerfile | 2 +-
build/docker/ubuntu/scripts/dpkg.sh | 5 ----
11 files changed, 64 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 847a5f8..fc5f953 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,16 +26,16 @@ services:
- docker
install:
- - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
- - travis_retry travis_wait docker build -q -t thrift-build build/docker/$DISTRO
+ - (travis_wait ./build/docker/check_unmodified.sh $DISTRO && touch .unmodified) || true
+ - if [ ! -f .unmodified ]; then travis_retry travis_wait docker build -q -t thrift-build:$DISTRO build/docker/$DISTRO; fi
script:
- - docker run --net=host -e BUILD_LIBS="$BUILD_LIBS" $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG
+ - docker run --net=host -e BUILD_LIBS="$BUILD_LIBS" $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build:$DISTRO build/docker/scripts/$SCRIPT $BUILD_ARG
env:
global:
- TEST_NAME=""
- - BUILD_CMD="none"
+ - SCRIPT="cmake.sh"
- BUILD_ARG=""
- BUILD_ENV="-e CC=clang -e CXX=clang++"
- DISTRO=ubuntu
@@ -44,12 +44,12 @@ env:
matrix:
# TODO: Break up by protocol types to avoid 50min limit
- TEST_NAME="Cross Language Tests"
- BUILD_CMD="../cross-test.sh"
+ SCRIPT="cross-test.sh"
BUILD_ARG="--enable-tutorial=no"
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
- TEST_NAME="Cross Language Tests (Debian)"
- BUILD_CMD="../cross-test.sh"
+ SCRIPT="cross-test.sh"
BUILD_ARG="--enable-tutorial=no"
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
DISTRO=debian
@@ -57,78 +57,67 @@ env:
# TODO: Remove them once migrated to CMake
# Autotools builds
- TEST_NAME="C C++ C# D Erlang Haxe Go (automake)"
- BUILD_CMD="../autotools.sh"
+ SCRIPT="autotools.sh"
BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
- TEST_NAME="C C++ - GCC (automake)"
- BUILD_CMD="../autotools.sh"
+ SCRIPT="autotools.sh"
BUILD_ARG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-dart --without-ruby --without-haskell --without-go --without-haxe --without-d"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="Java Lua PHP Ruby Dart (automake)"
- BUILD_CMD="../autotools.sh"
+ SCRIPT="autotools.sh"
BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-nodejs --without-python --without-perl"
# These are flaky (due to cabal and npm network/server failures) and also have lengthy output
- TEST_NAME="Haskell Node.js Python Perl (automake)"
- BUILD_CMD="../autotools.sh"
+ SCRIPT="autotools.sh"
BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-php --without-php_extension --without-ruby"
# CMake build
- TEST_NAME="All"
- BUILD_CMD="../cmake.sh"
- TEST_NAME="All (Debian)"
- BUILD_CMD="../cmake.sh"
DISTRO=debian
- TEST_NAME="C C++ - GCC"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="C++ (Boost Thread)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP TESTING TUTORIALS"
BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
- TEST_NAME="C++ (Boost Thread - GCC)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP TESTING TUTORIALS"
BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="C++ (Std Thread)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP TESTING TUTORIALS"
BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
- TEST_NAME="C++ (Std Thread - GCC)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP TESTING TUTORIALS"
BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="Compiler (mingw)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS=""
BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
BUILD_ENV=""
- TEST_NAME="All - GCC (CentOS)"
- BUILD_CMD="../cmake.sh"
BUILD_ENV="-e CC=gcc -e CXX=g++"
DISTRO=centos
- TEST_NAME="C C++ - Clang (CentOS)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
DISTRO=centos
- TEST_NAME="Python 2.6 (CentOS 6)"
- BUILD_CMD="../cmake.sh"
BUILD_LIBS="PYTHON TESTING TUTORIALS"
BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
BUILD_ENV="-e CC=gcc -e CXX=g++"
@@ -136,20 +125,20 @@ env:
# Distribution
- TEST_NAME="make dist"
- BUILD_CMD="../make-dist.sh"
+ SCRIPT="make-dist.sh"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="Debian Packages"
- BUILD_CMD="../dpkg.sh"
+ SCRIPT="dpkg.sh"
BUILD_ENV="-e CC=gcc -e CXX=g++"
- TEST_NAME="make dist (Debian)"
- BUILD_CMD="../make-dist.sh"
+ SCRIPT="make-dist.sh"
BUILD_ENV="-e CC=gcc -e CXX=g++"
DISTRO=debian
- TEST_NAME="Debian Packages (Debian)"
- BUILD_CMD="../dpkg.sh"
+ SCRIPT="dpkg.sh"
BUILD_ENV="-e CC=gcc -e CXX=g++"
DISTRO=debian
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/centos/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/centos/Dockerfile b/build/docker/centos/Dockerfile
index a31492b..59bbfd6 100644
--- a/build/docker/centos/Dockerfile
+++ b/build/docker/centos/Dockerfile
@@ -138,5 +138,5 @@ RUN rm -rf /tmp/* && \
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
-COPY scripts $THRIFT_ROOT
+COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/centos/scripts/keepit
----------------------------------------------------------------------
diff --git a/build/docker/centos/scripts/keepit b/build/docker/centos/scripts/keepit
deleted file mode 100644
index cb885df..0000000
--- a/build/docker/centos/scripts/keepit
+++ /dev/null
@@ -1 +0,0 @@
-keep it
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/centos6/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/centos6/Dockerfile b/build/docker/centos6/Dockerfile
index 4df75de..aa19731 100644
--- a/build/docker/centos6/Dockerfile
+++ b/build/docker/centos6/Dockerfile
@@ -50,5 +50,5 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
-COPY scripts $THRIFT_ROOT
+COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/centos6/scripts/keepit
----------------------------------------------------------------------
diff --git a/build/docker/centos6/scripts/keepit b/build/docker/centos6/scripts/keepit
deleted file mode 100644
index cb885df..0000000
--- a/build/docker/centos6/scripts/keepit
+++ /dev/null
@@ -1 +0,0 @@
-keep it
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/check_unmodified.sh
----------------------------------------------------------------------
diff --git a/build/docker/check_unmodified.sh b/build/docker/check_unmodified.sh
new file mode 100755
index 0000000..564e4c1
--- /dev/null
+++ b/build/docker/check_unmodified.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Download prebuilt docker image and compare Dockerfile hash values
+
+set -ex
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+DISTRO=$1
+SRC_IMG=thrift/thrift-build:$DISTRO
+
+function try_pull {
+ docker pull $SRC_IMG
+ cd ${SCRIPT_DIR}/$DISTRO
+ docker run $SRC_IMG bash -c 'cd .. && sha512sum Dockerfile' > .Dockerfile.sha512
+ sha512sum -c .Dockerfile.sha512
+}
+
+if try_pull; then
+ echo Dockerfile seems identical. No need to rebuild from scratch.
+else
+ echo Either Dockerfile has changed or pull failure. Need to build brand new one.
+ exit 1
+fi
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/debian/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/debian/Dockerfile b/build/docker/debian/Dockerfile
index 285c85b..99eda7a 100644
--- a/build/docker/debian/Dockerfile
+++ b/build/docker/debian/Dockerfile
@@ -186,5 +186,5 @@ ENV LC_ALL C.UTF-8
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
-COPY scripts $THRIFT_ROOT
+COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/debian/scripts/dpkg.sh
----------------------------------------------------------------------
diff --git a/build/docker/debian/scripts/dpkg.sh b/build/docker/debian/scripts/dpkg.sh
deleted file mode 100755
index 3ba0cd4..0000000
--- a/build/docker/debian/scripts/dpkg.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -ev
-
-dpkg-buildpackage -tc -us -uc
-ls -al ..
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/scripts/dpkg.sh
----------------------------------------------------------------------
diff --git a/build/docker/scripts/dpkg.sh b/build/docker/scripts/dpkg.sh
new file mode 100755
index 0000000..3ba0cd4
--- /dev/null
+++ b/build/docker/scripts/dpkg.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -ev
+
+dpkg-buildpackage -tc -us -uc
+ls -al ..
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/ubuntu/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index 2797a1c..7792aae 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -204,5 +204,5 @@ ENV PATH /usr/lib/dart/bin:$PATH
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
-COPY scripts $THRIFT_ROOT
+COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src
http://git-wip-us.apache.org/repos/asf/thrift/blob/93fb7ead/build/docker/ubuntu/scripts/dpkg.sh
----------------------------------------------------------------------
diff --git a/build/docker/ubuntu/scripts/dpkg.sh b/build/docker/ubuntu/scripts/dpkg.sh
deleted file mode 100755
index 3ba0cd4..0000000
--- a/build/docker/ubuntu/scripts/dpkg.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -ev
-
-dpkg-buildpackage -tc -us -uc
-ls -al ..
[2/2] thrift git commit: THRIFT-3918 Run subset of make cross
Posted by ns...@apache.org.
THRIFT-3918 Run subset of make cross
This closes #1079
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2c64bddc
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2c64bddc
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2c64bddc
Branch: refs/heads/master
Commit: 2c64bddc0085de94b01d00bc0e98615562f631d7
Parents: 93fb7ea
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Sun Sep 4 15:33:40 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sun Sep 4 21:13:40 2016 +0900
----------------------------------------------------------------------
.travis.yml | 20 +++++++++++++++-----
Makefile.am | 11 +++++++----
build/docker/scripts/cross-test.sh | 2 +-
3 files changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/2c64bddc/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index fc5f953..81a88c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,15 +42,25 @@ env:
- BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
matrix:
- # TODO: Break up by protocol types to avoid 50min limit
- - TEST_NAME="Cross Language Tests"
+ - TEST_NAME="Cross Language Tests (Binary and Header Protocols)"
SCRIPT="cross-test.sh"
- BUILD_ARG="--enable-tutorial=no"
+ BUILD_ARG="-'(binary|header)'"
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
- - TEST_NAME="Cross Language Tests (Debian)"
+ - TEST_NAME="Cross Language Tests (Debian) (Binary and Header Protocols)"
SCRIPT="cross-test.sh"
- BUILD_ARG="--enable-tutorial=no"
+ BUILD_ARG="-'(binary|header)'"
+ BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
+ DISTRO=debian
+
+ - TEST_NAME="Cross Language Tests (Compact and JSON Protocols)"
+ SCRIPT="cross-test.sh"
+ BUILD_ARG="-'(compact|json)'"
+ BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
+
+ - TEST_NAME="Cross Language Tests (Debian) (Compact and JSON Protocols)"
+ SCRIPT="cross-test.sh"
+ BUILD_ARG="-'(compact|json)'"
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
DISTRO=debian
http://git-wip-us.apache.org/repos/asf/thrift/blob/2c64bddc/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 10fe49a..38dd8c9 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,15 +56,18 @@ CROSS_PY=$(PYTHON)
endif
if WITH_PYTHON
-cross: precross
+crossfeature: precross
$(CROSS_PY) test/test.py --retry-count 3 --features .* --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED)
- $(CROSS_PY) test/test.py --retry-count 3 --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)
else
# feature test needs python build
-cross: precross
- $(CROSS_PY) test/test.py -s --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)
+crossfeature:
endif
+cross-%: precross crossfeature
+ $(CROSS_PY) test/test.py --retry-count 3 --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED) --regex "$*"
+
+cross: cross-.*
+
TIMES = 1 2 3
fail: precross
$(CROSS_PY) test/test.py || true
http://git-wip-us.apache.org/repos/asf/thrift/blob/2c64bddc/build/docker/scripts/cross-test.sh
----------------------------------------------------------------------
diff --git a/build/docker/scripts/cross-test.sh b/build/docker/scripts/cross-test.sh
index 4da7813..43581a5 100755
--- a/build/docker/scripts/cross-test.sh
+++ b/build/docker/scripts/cross-test.sh
@@ -6,7 +6,7 @@ set -ev
make -j3 precross
set +e
-make cross
+make cross$1
RET=$?
if [ $RET -ne 0 ]; then