Skip to content

Apache DataFusion SQL Query Engine

ARROW-8432: [CI] Don't depend on a single apache mirror for dependencies

Krisztián Szűcs4819b1960ee8
diff --git a/ci/docker/conda-python-hdfs.dockerfile b/ci/docker/conda-python-hdfs.dockerfile
index 7c3a0a0266..d19879fe79 100644
--- a/ci/docker/conda-python-hdfs.dockerfile
+++ b/ci/docker/conda-python-hdfs.dockerfile
@@ -33,7 +33,10 @@ ARG hdfs=2.9.2
ENV HADOOP_HOME=/opt/hadoop-${hdfs} \
HADOOP_OPTS=-Djava.library.path=/opt/hadoop-${hdfs}/lib/native \
PATH=$PATH:/opt/hadoop-${hdfs}/bin:/opt/hadoop-${hdfs}/sbin
-RUN wget -q -O - "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=hadoop/common/hadoop-${hdfs}/hadoop-${hdfs}.tar.gz" | tar -xzf - -C /opt
+COPY ci/scripts/util_download_apache.sh /arrow/ci/scripts/
+RUN /arrow/ci/scripts/util_download_apache.sh \
+ "hadoop/common/hadoop-${hdfs}/hadoop-${hdfs}.tar.gz" /opt
+
COPY ci/etc/hdfs-site.xml $HADOOP_HOME/etc/hadoop/
# build cpp with tests
diff --git a/ci/docker/linux-apt-docs.dockerfile b/ci/docker/linux-apt-docs.dockerfile
index d0e23cbb73..55ce2b87cd 100644
--- a/ci/docker/linux-apt-docs.dockerfile
+++ b/ci/docker/linux-apt-docs.dockerfile
@@ -33,6 +33,7 @@ RUN apt-get update -y && \
apt-get install -y \
autoconf-archive \
automake \
+ curl \
doxygen \
gobject-introspection \
gtk-doc-tools \
@@ -54,8 +55,11 @@ RUN apt-get update -y && \
ENV JAVA_HOME=/usr/lib/jvm/java-${jdk}-openjdk-amd64
ARG maven=3.5.4
-RUN wget -q -O - "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=maven/maven-3/${maven}/binaries/apache-maven-${maven}-bin.tar.gz" | tar -xzf - -C /opt
+COPY ci/scripts/util_download_apache.sh /arrow/ci/scripts/
+RUN /arrow/ci/scripts/util_download_apache.sh \
+ "maven/maven-3/${maven}/binaries/apache-maven-${maven}-bin.tar.gz" /opt
ENV PATH=/opt/apache-maven-${maven}/bin:$PATH
+RUN mvn -version
ARG node=11
RUN wget -q -O - https://deb.nodesource.com/setup_${node}.x | bash - && \
diff --git a/ci/scripts/util_download_apache.sh b/ci/scripts/util_download_apache.sh
new file mode 100755
index 0000000000..688939663a
--- /dev/null
+++ b/ci/scripts/util_download_apache.sh
@@ -0,0 +1,53 @@
+#!/bin/bash -x
+# 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.
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <apache tarball path> <target directory>"
+ exit 1
+fi
+
+tarball_path=$1
+target_dir=$2
+
+APACHE_MIRRORS=(
+ "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename="
+ "https://downloads.apache.org"
+ "https://apache.claz.org"
+ "https://apache.cs.utah.edu"
+ "https://apache.mirrors.lucidnetworks.net"
+ "https://apache.osuosl.org"
+ "https://ftp.wayne.edu/apache"
+ "https://mirror.olnevhost.net/pub/apache"
+ "https://mirrors.gigenet.com/apache"
+ "https://mirrors.koehn.com/apache"
+ "https://mirrors.ocf.berkeley.edu/apache"
+ "https://mirrors.sonic.net/apache"
+ "https://us.mirrors.quenda.co/apache"
+)
+
+mkdir -p "${target_dir}"
+
+for mirror in ${APACHE_MIRRORS[*]}
+do
+ curl -SL "${mirror}/${tarball_path}" | tar -xzf - -C "${target_dir}"
+ if [ $? == 0 ]; then
+ exit 0
+ fi
+done
+
+exit 1
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 153574d66c..80274b48ba 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -2121,7 +2121,7 @@ tasks:
params:
env:
PYTHON: 3.7
- HDFS: master
+ HDFS: 2.9.2
build:
- conda-cpp
- conda-python