Skip to content

Commit 0925f3b

Browse files
committed
PARQUET-1573: Add a docker development image and use it in travis
Enable travis cache for .m2 directories and the build docker image to boost speed too.
1 parent 63cfb56 commit 0925f3b

File tree

6 files changed

+65
-101
lines changed

6 files changed

+65
-101
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ target/
1919
.cache
2020
*~
2121
mvn_install.log
22+
.factorypath
23+
bin/
24+

.travis.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
1-
language: java
2-
before_install:
3-
- bash dev/travis-before_install.sh
1+
language: generic
2+
3+
services:
4+
- docker
45

56
env:
6-
- HADOOP_PROFILE=default TEST_CODECS=uncompressed,brotli
7-
- HADOOP_PROFILE=default TEST_CODECS=gzip,snappy
7+
global:
8+
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
9+
- IMAGE=parquet-mr
10+
- CACHE_FOLDER=$HOME/docker-images
11+
- CACHE_FILE=${CACHE_FOLDER}/parquet-mr.tgz
12+
matrix:
13+
- TEST_CODECS=uncompressed,brotli
14+
- TEST_CODECS=gzip,snappy
15+
16+
cache:
17+
directories:
18+
- "$HOME/.m2"
19+
- ${CACHE_FOLDER}
20+
21+
before_install:
22+
- if [[ -f ${CACHE_FILE} ]]; then
23+
docker load -i "${CACHE_FILE}";
24+
else
25+
docker build -f dev/Dockerfile -t "${IMAGE}" "${PWD}";
26+
mkdir -p "${CACHE_FOLDER}";
27+
docker save "${IMAGE}" | gzip -c > "${CACHE_FILE}";
28+
fi
29+
30+
install: docker run -v $HOME/.m2:/root/.m2 -v ${PWD}:/parquet-mr -e JAVA_HOME=$JAVA_HOME -e TEST_CODECS=$TEST_CODECS -i -t parquet-mr /bin/bash -c "cd /parquet-mr && mvn install --batch-mode -DskipTests=true -Dmaven.javadoc.skip=true -Dsource.skip=true | pv -fbi 60 > mvn_install.log || (cat mvn_install.log && false)"
31+
32+
script: docker run -v $HOME/.m2:/root/.m2 -v ${PWD}:/parquet-mr -e JAVA_HOME=$JAVA_HOME -e TEST_CODECS=$TEST_CODECS -i -t parquet-mr /bin/bash -c "cd /parquet-mr && mvn verify javadoc:javadoc"
833

9-
install: mvn install --batch-mode -DskipTests=true -Dmaven.javadoc.skip=true -Dsource.skip=true | pv -fbi 60 > mvn_install.log || (cat mvn_install.log && false)
10-
script: mvn verify javadoc:javadoc -P $HADOOP_PROFILE
34+
before_cache:
35+
- rm -Rf $HOME/.m2/repository/org/apache/parquet
36+
- find $HOME/.m2/repository/ -name *SNAPSHOT | xargs rm -Rf

dev/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
###############################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
###############################################################################
18+
19+
FROM thrift:0.12
20+
21+
RUN set -ex; \
22+
apt-get update; \
23+
apt-get install -y \
24+
maven \
25+
openjdk-8-jdk-headless \
26+
openjdk-8-jre-headless \
27+
pv; \
28+
rm -rf /var/lib/apt/lists/*

dev/travis-before_install-master.sh

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

dev/travis-before_install.sh

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

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@
480480
<exclude>**/*.md.vm</exclude>
481481
<exclude>**/.classpath</exclude>
482482
<exclude>**/.project</exclude>
483+
<exclude>**/*.factorypath</exclude>
483484
<exclude>**/.settings/**</exclude>
484485
<exclude>**/build/**</exclude>
485486
<exclude>**/target/**</exclude>

0 commit comments

Comments
 (0)