Skip to content

Commit c89cc26

Browse files
committed
fix(spark): do not install maven from archive.apache.org
1 parent 3431707 commit c89cc26

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

spark-k8s/Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ ARG JMX_EXPORTER
135135
ARG TARGETARCH
136136
ARG TINI
137137
ARG STACKABLE_USER_UID
138+
ARG MAVEN_VERSION="3.9.8"
138139

139140
WORKDIR /stackable/spark-${PRODUCT}
140141

@@ -146,17 +147,26 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-source-builder \
146147
# Compiling the tests takes a lot of time, so we skip them
147148
# -Dmaven.test.skip=true skips both the compilation and execution of tests
148149
# -DskipTests skips only the execution
149-
#
150-
# This will download it's own version of maven because the UBI version is too old:
151-
# 134.0 [ERROR] Detected Maven Version: 3.6.3 is not in the allowed range [3.8.8,)
152-
RUN export MAVEN_OPTS="-Xss64m -Xmx2g -XX:ReservedCodeCacheSize=1g" \
153-
&& ./dev/make-distribution.sh \
150+
RUN <<EOF
151+
# We download the Maven binary from our own repository because:
152+
#
153+
# 1. Cannot use the UBI maven version because it's too old:
154+
# 134.0 [ERROR] Detected Maven Version: 3.6.3 is not in the allowed range [3.8.8,)
155+
# 2. Cannot allow Spark to download its own version of Maven from archive.apache.org because the connection is not reliable.
156+
cd /tmp
157+
curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC .
158+
159+
export MAVEN_OPTS="-Xss64m -Xmx2g -XX:ReservedCodeCacheSize=1g"
160+
161+
./dev/make-distribution.sh \
162+
--mvn /tmp/apache-maven-${MAVEN_VERSION}/bin/mvn \
154163
-Dhadoop.version="$HADOOP" \
155164
-Dmaven.test.skip=true \
156165
-DskipTests \
157166
-P'hadoop-3' -Pkubernetes -Phive -Phive-thriftserver \
158167
--no-transfer-progress \
159168
--batch-mode
169+
EOF
160170

161171
# <<< Build spark
162172

0 commit comments

Comments
 (0)