Skip to content

Commit 827bb7c

Browse files
authored
fix(spark): do not install maven from archive.apache.org (#1178)
* fix(spark): do not install maven from archive.apache.org * remove cd * add renovate snippet * bump maven version
1 parent ec5ce01 commit 827bb7c

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

spark-k8s/Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ ARG JMX_EXPORTER
135135
ARG TARGETARCH
136136
ARG TINI
137137
ARG STACKABLE_USER_UID
138+
# Find the latest version here: https://github.com/apache/maven
139+
# renovate: datasource=github-tags packageName=apache/maven
140+
ARG MAVEN_VERSION="3.9.10"
138141

139142
WORKDIR /stackable/spark-${PRODUCT}
140143

@@ -146,17 +149,25 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=spark-source-builder \
146149
# Compiling the tests takes a lot of time, so we skip them
147150
# -Dmaven.test.skip=true skips both the compilation and execution of tests
148151
# -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 \
152+
RUN <<EOF
153+
# We download the Maven binary from our own repository because:
154+
#
155+
# 1. Cannot use the UBI maven version because it's too old:
156+
# 134.0 [ERROR] Detected Maven Version: 3.6.3 is not in the allowed range [3.8.8,)
157+
# 2. Cannot allow Spark to download its own version of Maven from archive.apache.org because the connection is not reliable.
158+
curl "https://repo.stackable.tech/repository/packages/maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" | tar -xzC /tmp
159+
160+
export MAVEN_OPTS="-Xss64m -Xmx2g -XX:ReservedCodeCacheSize=1g"
161+
162+
./dev/make-distribution.sh \
163+
--mvn /tmp/apache-maven-${MAVEN_VERSION}/bin/mvn \
154164
-Dhadoop.version="$HADOOP" \
155165
-Dmaven.test.skip=true \
156166
-DskipTests \
157167
-P'hadoop-3' -Pkubernetes -Phive -Phive-thriftserver \
158168
--no-transfer-progress \
159169
--batch-mode
170+
EOF
160171

161172
# <<< Build spark
162173

0 commit comments

Comments
 (0)