You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@predictionio.apache.org by do...@apache.org on 2018/08/31 23:55:29 UTC
predictionio git commit: Retry archive if downloading from mirror fail
Repository: predictionio
Updated Branches:
refs/heads/feature/PIO-61 fe7e01e9e -> 7b966aafa
Retry archive if downloading from mirror fail
Project: http://git-wip-us.apache.org/repos/asf/predictionio/repo
Commit: http://git-wip-us.apache.org/repos/asf/predictionio/commit/7b966aaf
Tree: http://git-wip-us.apache.org/repos/asf/predictionio/tree/7b966aaf
Diff: http://git-wip-us.apache.org/repos/asf/predictionio/diff/7b966aaf
Branch: refs/heads/feature/PIO-61
Commit: 7b966aafa0eeff59b0def1f583ba9411b9f66093
Parents: fe7e01e
Author: Donald Szeto <do...@apache.org>
Authored: Fri Aug 31 16:55:10 2018 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Fri Aug 31 16:55:10 2018 -0700
----------------------------------------------------------------------
conf/pio-vendors.sh | 12 ++----------
tests/build_docker.sh | 7 +++++--
2 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/predictionio/blob/7b966aaf/conf/pio-vendors.sh
----------------------------------------------------------------------
diff --git a/conf/pio-vendors.sh b/conf/pio-vendors.sh
index 052d84c..162372f 100644
--- a/conf/pio-vendors.sh
+++ b/conf/pio-vendors.sh
@@ -19,11 +19,6 @@
# IMPORTANT: PIO_*_VERSION for dependencies must be set before envoking this script.
# `source conf/set_build_profile.sh $BUILD_PROFILE` to get the proper versions
-# Figure out current script's location
-THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-. $THIS_SCRIPT_DIR/../bin/semver.sh
-
if [ -z "$PIO_SCALA_VERSION" ]; then
PIO_SCALA_VERSION="2.11.8"
fi
@@ -56,11 +51,8 @@ PGSQL_DOWNLOAD=https://jdbc.postgresql.org/download/${PGSQL_JAR}
HADOOP_MAJOR=`echo $PIO_HADOOP_VERSION | awk -F. '{print $1 "." $2}'`
SPARK_DIR=spark-${PIO_SPARK_VERSION}-bin-hadoop${HADOOP_MAJOR}
SPARK_ARCHIVE=${SPARK_DIR}.tgz
-if semverGT $PIO_SPARK_VERSION "2.1.2"; then
- SPARK_DOWNLOAD=https://www.apache.org/dyn/closer.lua\?action=download\&filename=spark/spark-${PIO_SPARK_VERSION}/${SPARK_ARCHIVE}
-else
- SPARK_DOWNLOAD=https://archive.apache.org/dist/spark/spark-${PIO_SPARK_VERSION}/${SPARK_ARCHIVE}
-fi
+SPARK_DOWNLOAD_MIRROR=https://www.apache.org/dyn/closer.lua\?action=download\&filename=spark/spark-${PIO_SPARK_VERSION}/${SPARK_ARCHIVE}
+SPARK_DOWNLOAD_ARCHIVE=https://archive.apache.org/dist/spark/spark-${PIO_SPARK_VERSION}/${SPARK_ARCHIVE}
# ELASTICSEARCH_DOWNLOAD
# 5.x https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${PIO_ELASTICSEARCH_VERSION}.tar.gz
# 1.x https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${PIO_ELASTICSEARCH_VERSION}.tar.gz
http://git-wip-us.apache.org/repos/asf/predictionio/blob/7b966aaf/tests/build_docker.sh
----------------------------------------------------------------------
diff --git a/tests/build_docker.sh b/tests/build_docker.sh
index 2c27719..2c6f8f8 100755
--- a/tests/build_docker.sh
+++ b/tests/build_docker.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -ex
+#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -28,7 +28,10 @@ if [ ! -f $DIR/docker-files/${PGSQL_JAR} ]; then
mv ${PGSQL_JAR} $DIR/docker-files/
fi
if [ ! -f $DIR/docker-files/${SPARK_ARCHIVE} ]; then
- wget -O $SPARK_ARCHIVE $SPARK_DOWNLOAD
+ curl -fLo $SPARK_ARCHIVE $SPARK_DOWNLOAD_MIRROR
+ if [[ $? -ne 0 ]]; then
+ curl -fLo $SPARK_ARCHIVE $SPARK_DOWNLOAD_ARCHIVE
+ fi
mv $SPARK_ARCHIVE $DIR/docker-files/
fi