Skip to content

Commit 380432c

Browse files
committed
[HOTFIX] Fix CI build failure on branch-0.6
1 parent f1c8041 commit 380432c

File tree

2 files changed

+132
-27
lines changed

2 files changed

+132
-27
lines changed

.travis.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,32 @@ addons:
2828
- r-packages-precise
2929
packages:
3030
- r-base-dev
31-
- r-cran-evaluate
32-
- r-cran-base64enc
3331

3432
matrix:
3533
include:
3634
# Test all modules with spark 2.0.0 and scala 2.11
3735
- jdk: "oraclejdk7"
38-
env: SCALA_VER="2.11" SPARK_VER="2.0.0" HADOOP_VER="2.3" PROFILE="-Pspark-2.0 -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
36+
env: SCALA_VER="2.11" SPARK_VER="2.0.2" HADOOP_VER="2.6" PROFILE="-Pspark-2.0 -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
3937

4038
# Test all modules with scala 2.10
4139
- jdk: "oraclejdk7"
42-
env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
40+
env: SCALA_VER="2.10" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
4341

4442
# Test all modules with scala 2.11
4543
- jdk: "oraclejdk7"
46-
env: SCALA_VER="2.11" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
44+
env: SCALA_VER="2.11" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
4745

48-
# Test spark module for 1.5.2
46+
# Test selenium with spark module for 1.6.3
4947
- jdk: "oraclejdk7"
50-
env: SCALA_VER="2.10" SPARK_VER="1.5.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.5 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"
51-
52-
# Test spark module for 1.4.1
53-
- jdk: "oraclejdk7"
54-
env: SCALA_VER="2.10" SPARK_VER="1.4.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.4 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"
55-
56-
# Test spark module for 1.3.1
57-
- jdk: "oraclejdk7"
58-
env: SCALA_VER="2.10" SPARK_VER="1.3.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.3 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"
59-
60-
# Test spark module for 1.2.2
61-
- jdk: "oraclejdk7"
62-
env: SCALA_VER="2.10" SPARK_VER="1.2.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.2 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"
63-
64-
# Test spark module for 1.1.1
65-
- jdk: "oraclejdk7"
66-
env: SCALA_VER="2.10" SPARK_VER="1.1.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.1 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"
67-
68-
# Test selenium with spark module for 1.6.1
69-
- jdk: "oraclejdk7"
70-
env: TEST_SELENIUM="true" SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.AbstractFunctionalSuite -DfailIfNoTests=false"
48+
env: TEST_SELENIUM="true" SCALA_VER="2.10" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Phadoop-2.6 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.AbstractFunctionalSuite -DfailIfNoTests=false"
7149

7250
before_install:
7351
- "ls -la .spark-dist ${HOME}/.m2/repository/.cache/maven-download-plugin"
7452
- mkdir -p ~/R
7553
- echo 'R_LIBS=~/R' > ~/.Renviron
7654
- R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org', lib='~/R')"
55+
- R -e "install.packages('evaluate', repos = 'http://cran.us.r-project.org', lib='~/R')"
56+
- R -e "install.packages('base64enc', repos = 'http://cran.us.r-project.org', lib='~/R')"
7757
- export R_LIBS='~/R'
7858
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1024x16"
7959
- ./dev/change_scala_version.sh $SCALA_VER

travis_check.py

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#
18+
# This script checks build status of given pullrequest identified by author and commit hash.
19+
#
20+
# usage)
21+
# python travis_check.py [author] [commit hash] [check interval (optional)]
22+
#
23+
# example)
24+
# # full hash
25+
# python travis_check.py Leemoonsoo 1f2549a38f440ebfbfe2d32a041684e3e39b496c
26+
#
27+
# # with short hash
28+
# python travis_check.py Leemoonsoo 1f2549a
29+
#
30+
# # with custom check interval
31+
# python travis_check.py Leemoonsoo 1f2549a 5,60,60
32+
33+
import os, sys, getopt, traceback, json, requests, time
34+
35+
author = sys.argv[1]
36+
commit = sys.argv[2]
37+
38+
# check interval in sec
39+
check = [5, 60, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 600, 600, 600, 600, 600, 600]
40+
41+
if len(sys.argv) > 3:
42+
check = map(lambda x: int(x), sys.argv[3].split(","))
43+
44+
def info(msg):
45+
print("[" + time.strftime("%Y-%m-%d %H:%M:%S") + "] " + msg)
46+
sys.stdout.flush()
47+
48+
info("Author: " + author + ", commit: " + commit)
49+
50+
51+
def getBuildStatus(author, commit):
52+
travisApi = "https://api.travis-ci.org/"
53+
54+
# get latest 25 builds
55+
resp = requests.get(url=travisApi + "/repos/" + author + "/zeppelin/builds")
56+
data = json.loads(resp.text)
57+
build = None
58+
59+
if len(data) == 0:
60+
return build;
61+
62+
for b in data:
63+
if b["commit"][:len(commit)] == commit:
64+
resp = requests.get(url=travisApi + "/repos/" + author + "/zeppelin/builds/" + str(b["id"]))
65+
build = json.loads(resp.text)
66+
break
67+
68+
return build
69+
70+
def status(index, msg, jobId):
71+
return '{:20}'.format("[" + str(index+1) + "] " + msg) + "https://travis-ci.org/" + author + "/zeppelin/jobs/" + str(jobId)
72+
73+
def printBuildStatus(build):
74+
failure = 0
75+
running = 0
76+
77+
for index, job in enumerate(build["matrix"]):
78+
result = job["result"]
79+
jobId = job["id"]
80+
81+
if job["started_at"] == None and result == None:
82+
print(status(index, "Not started", jobId))
83+
running = running + 1
84+
elif job["started_at"] != None and job["finished_at"] == None:
85+
print(status(index, "Running ...", jobId))
86+
running = running + 1
87+
elif job["started_at"] != None and job["finished_at"] != None:
88+
if result == None:
89+
print(status(index, "Not completed", jobId))
90+
failure = failure + 1
91+
elif result == 0:
92+
print(status(index, "OK", jobId))
93+
else:
94+
print(status(index, "Error " + str(result), jobId))
95+
failure = failure + 1
96+
else:
97+
print(status(index, "Unknown state", jobId))
98+
failure = failure + 1
99+
100+
return failure, running
101+
102+
103+
for sleep in check:
104+
info("--------------------------------")
105+
time.sleep(sleep);
106+
info("Get build status ...")
107+
build = getBuildStatus(author, commit)
108+
if build == None:
109+
info("Can't find build for commit " + commit + " from " + author)
110+
sys.exit(2)
111+
112+
print("Build https://travis-ci.org/" + author + "/zeppelin/builds/" + str(build["id"]))
113+
failure, running = printBuildStatus(build)
114+
115+
print(str(failure) + " job(s) failed, " + str(running) + " job(s) running/pending")
116+
117+
if failure != 0:
118+
sys.exit(1)
119+
120+
if failure == 0 and running == 0:
121+
info("CI Green!")
122+
sys.exit(0)
123+
124+
info("Timeout")
125+
sys.exit(1)

0 commit comments

Comments
 (0)