Skip to content

Commit 7a9053e

Browse files
author
Lee Yang
committed
move travis spark setup to script
1 parent 36b6015 commit 7a9053e

File tree

3 files changed

+25
-39
lines changed

3 files changed

+25
-39
lines changed

.travis.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@ matrix:
44
python: 2.7
55
dist: xenial
66
before_install:
7-
- curl -LO http://www-us.apache.org/dist/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz
8-
- export SPARK_HOME=./spark
9-
- mkdir $SPARK_HOME
10-
- tar -xf spark-2.4.4-bin-hadoop2.7.tgz -C $SPARK_HOME --strip-components=1
11-
- export PATH=$SPARK_HOME/bin:$PATH
12-
- export SPARK_LOCAL_IP=127.0.0.1
13-
- export SPARK_CLASSPATH=./lib/tensorflow-hadoop-1.0-SNAPSHOT.jar
14-
- export PYTHONPATH=$(pwd)
15-
install:
7+
- source scripts/travis_install_spark.sh
168
- pip install --upgrade pip
9+
install:
1710
- pip install -r requirements.txt
1811
- pip install mock
1912
script:
@@ -22,24 +15,14 @@ matrix:
2215
python: 3.6
2316
dist: xenial
2417
before_install:
25-
- curl -LO http://www-us.apache.org/dist/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz
26-
- export SPARK_HOME=./spark
27-
- mkdir $SPARK_HOME
28-
- tar -xf spark-2.4.4-bin-hadoop2.7.tgz -C $SPARK_HOME --strip-components=1
29-
- export PATH=$SPARK_HOME/bin:$PATH
30-
- export SPARK_LOCAL_IP=127.0.0.1
31-
- export SPARK_CLASSPATH=./lib/tensorflow-hadoop-1.0-SNAPSHOT.jar
32-
- export PYTHONPATH=$(pwd)
33-
install:
18+
- source scripts/travis_install_spark.sh
3419
- pip install --upgrade pip
20+
install:
3521
- pip install -r requirements.txt
3622
- pip list
3723
script:
3824
- sphinx-build -b html docs/source docs/build/html
3925
- test/run_tests.sh
40-
# - language: java
41-
# dist: xenial
42-
# jdk: oraclejdk8
4326
notifications:
4427
email: false
4528
deploy:
@@ -62,11 +45,3 @@ deploy:
6245
python: 3.6
6346
tags: true
6447
condition: "$TRAVIS_TAG =~ ^v.*$"
65-
- provider: script
66-
script: mvn deploy -DskipTests --settings .travis.settings.xml
67-
skip_cleanup: true
68-
# on:
69-
# branch: master
70-
# jdk: oraclejdk8
71-
# tags: true
72-
# condition: "$TRAVIS_TAG =~ ^scala_.*$"

scripts/local-setup-spark.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

scripts/travis_install_spark.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# TensorFlow 2.0.0 is tested/supported on Ubuntu 16 (xenial) or later
4+
# But Travis' xenial build env uses JDK11, while Spark requires JDK8
5+
6+
# Install JDK8
7+
add-apt-repository -y ppa:openjdk-r/ppa
8+
apt-get update
9+
apt-get install -y openjdk-8-jdk --no-install-recommends
10+
update-java-alternatives -s java-1.8.0-openjdk-amd64
11+
12+
# Download and install Spark
13+
curl -LO http://www-us.apache.org/dist/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz
14+
export SPARK_HOME=./spark
15+
mkdir $SPARK_HOME
16+
tar -xf spark-2.4.4-bin-hadoop2.7.tgz -C $SPARK_HOME --strip-components=1
17+
export SPARK_LOCAL_IP=127.0.0.1
18+
export SPARK_CLASSPATH=./lib/tensorflow-hadoop-1.0-SNAPSHOT.jar
19+
export PATH=$SPARK_HOME/bin:$PATH
20+
export PYTHONPATH=$(pwd)
21+
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

0 commit comments

Comments
 (0)