@@ -6,12 +6,10 @@ FROM stackable/image/hadoop AS hadoop-builder
6
6
FROM stackable/image/java-devel AS hbase-builder
7
7
8
8
ARG PRODUCT
9
- ARG HBASE_THIRDPARTY
10
9
ARG HBASE_OPERATOR_TOOLS
11
10
ARG ASYNC_PROFILER
12
11
ARG PHOENIX
13
12
ARG HBASE_PROFILE
14
- ARG JMX_EXPORTER
15
13
ARG HADOOP
16
14
ARG TARGETARCH
17
15
ARG TARGETOS
@@ -28,7 +26,6 @@ WORKDIR /stackable
28
26
29
27
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches/patchable.toml /stackable/src/hbase/stackable/patches/patchable.toml
30
28
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches/${PRODUCT} /stackable/src/hbase/stackable/patches/${PRODUCT}
31
- COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/jmx/config${JMX_EXPORTER} /stackable/jmx
32
29
33
30
# Cache mounts are owned by root by default
34
31
# We need to explicitly give the uid to use
@@ -49,8 +46,25 @@ cd "$(/stackable/patchable --images-repo-root=src checkout hbase ${PRODUCT})"
49
46
50
47
# The release scripts of HBase also run the build twice (three times in fact, once again to build the site which we skip here).
51
48
# I chose to replicate that exact behavior for consistency so please don't merge the two mvn runs into one unless you really know what you're doing!
52
- mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} clean install -DskipTests
53
- mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} install assembly:single -DskipTests -Dcheckstyle.skip=true -Prelease
49
+ # Cannot skip building tests here because the assembly plugin needs a shell script from the test directory.
50
+ mvn \
51
+ --batch-mode \
52
+ --no-transfer-progress \
53
+ -Dhadoop.profile=3.0 \
54
+ -Dhadoop-three.version=${HADOOP} \
55
+ -DskipTests \
56
+ clean install
57
+
58
+ mvn \
59
+ --batch-mode \
60
+ --no-transfer-progress \
61
+ -Dhadoop.profile=3.0 \
62
+ -Dhadoop-three.version=${HADOOP} \
63
+ -DskipTests \
64
+ -Dcheckstyle.skip=true \
65
+ -Prelease \
66
+ install assembly:single
67
+
54
68
tar -xzf hbase-assembly/target/hbase-${PRODUCT}-bin.tar.gz -C /stackable/
55
69
mv hbase-assembly/target/bom.json /stackable/hbase-${PRODUCT}/hbase-${PRODUCT}.cdx.json
56
70
@@ -59,15 +73,6 @@ mv hbase-assembly/target/bom.json /stackable/hbase-${PRODUCT}/hbase-${PRODUCT}.c
59
73
60
74
ln -s "/stackable/hbase-${PRODUCT}" /stackable/hbase
61
75
62
- # ##
63
- # ## JMX Prometheus Exporter/Agent
64
- # ##
65
- if [[ -n "${JMX_EXPORTER}" ]] ; then
66
- curl --fail "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" -o "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar"
67
- chmod +x "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar"
68
- ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar
69
- fi
70
-
71
76
# ##
72
77
# ## Async Profiler
73
78
# ##
93
98
94
99
FROM stackable/image/java-devel AS opa-authorizer-builder
95
100
101
+ ARG PRODUCT
96
102
ARG OPA_AUTHORIZER
97
103
ARG DELETE_CACHES
98
104
ARG STACKABLE_USER_UID
99
105
100
106
USER ${STACKABLE_USER_UID}
101
107
WORKDIR /stackable
102
108
103
- RUN --mount=type=cache,id=maven-opa,uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
109
+ # Use the product version as cache id "maven-opa-${PRODUCT}" to avoid the "rm -rf" problem described above.
110
+ # Using the OPA_AUTHORIZER arg is not unique if the same version is used for multiple products.
111
+ RUN --mount=type=cache,id=maven-opa-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
104
112
# ##
105
113
# ## OPA Authorizer (only for 2.6 upwards)
106
114
# ##
@@ -109,9 +117,10 @@ if [[ -n "$OPA_AUTHORIZER" ]]; then
109
117
mvn \
110
118
--batch-mode \
111
119
--no-transfer-progress \
112
- package \
113
120
-DskipTests \
114
- -fhbase-opa-authorizer
121
+ -Dmaven.test.skip=true \
122
+ -fhbase-opa-authorizer \
123
+ package
115
124
else
116
125
# Create a dummy jar to avoid errors when copying it the final image
117
126
mkdir -p hbase-opa-authorizer/target
@@ -155,16 +164,13 @@ WORKDIR /stackable
155
164
RUN --mount=type=cache,id=maven-hbase-operator-tools-${HBASE_OPERATOR_TOOLS},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
156
165
cd "$(/stackable/patchable --images-repo-root=src checkout hbase-operator-tools ${HBASE_OPERATOR_TOOLS})"
157
166
158
- # Remove the Git repo because `git-commit-id-maven-plugin` tries to get the latest commit if a Git repo is present,
159
- # which fails due to a problem with worktrees, see https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/215
160
- rm .git
161
-
162
167
mvn \
163
168
--batch-mode \
164
169
--no-transfer-progress \
165
170
-Dhbase.version=${PRODUCT} \
166
171
-Dhbase-thirdparty.version=${HBASE_THIRDPARTY} \
167
172
-DskipTests \
173
+ -Dmaven.test.skip=true \
168
174
package assembly:single
169
175
170
176
# We need the "*" here as the directory won't be the same as the final tar file for SNAPSHOTs which we currently have to use for 2.6
@@ -208,6 +214,11 @@ USER ${STACKABLE_USER_UID}
208
214
WORKDIR /stackable
209
215
210
216
COPY --from=hadoop-builder --chown=${STACKABLE_USER_UID}:0 \
217
+ # The artifact name of the AWS bundle has changed between Haddop 3.3.6 and 3.4.1
218
+ # from aws-java-sdk-bundle-*.jar to bundle-*.jar.
219
+ # See: https://hadoop.apache.org/docs/stable/hadoop-aws/tools/hadoop-aws/aws_sdk_upgrade.html
220
+ # So we try to copy both and if one of them doesn't exist buildx will just ignore it :)
221
+ /stackable/hadoop/share/hadoop/tools/lib/bundle-*.jar \
211
222
/stackable/hadoop/share/hadoop/tools/lib/aws-java-sdk-bundle-*.jar \
212
223
/stackable/hadoop/share/hadoop/tools/lib/hadoop-aws-${HADOOP}.jar \
213
224
/stackable/hadoop/share/hadoop/tools/lib/
@@ -248,7 +259,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 hbase/phoenix/stackable/patches/${PHOENIX}
248
259
USER ${STACKABLE_USER_UID}
249
260
WORKDIR /stackable
250
261
251
- RUN --mount=type=cache,id=maven-phoenix-${PHOENIX},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
262
+ RUN --mount=type=cache,id=maven-phoenix-${PHOENIX}-${PRODUCT} ,uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
252
263
cd "$(/stackable/patchable --images-repo-root=src checkout phoenix ${PHOENIX})"
253
264
254
265
# The Maven command can be found inside of the scripts in the create-release folder (release-util.sh as of Phoenix 5.2.0)
@@ -260,6 +271,7 @@ mvn \
260
271
-Dhbase.profile=${HBASE_PROFILE} \
261
272
-Dhadoop.version=${HADOOP} \
262
273
-DskipTests \
274
+ -Dmaven.test.skip=true \
263
275
-Dcheckstyle.skip=true \
264
276
clean \
265
277
package
@@ -324,7 +336,6 @@ LABEL io.k8s.display-name="${NAME}"
324
336
325
337
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/hbase-${PRODUCT} /stackable/hbase-${PRODUCT}/
326
338
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/async-profiler /stackable/async-profiler/
327
- COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/jmx /stackable/jmx/
328
339
329
340
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools-builder /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS} /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}/
330
341
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools-builder /stackable/bin/hbck2 /stackable/bin/hbck2
@@ -378,7 +389,6 @@ chmod g=u "/stackable/hbase/lib/phoenix-server-hbase-${HBASE_PROFILE}.jar"
378
389
# fix missing permissions
379
390
chmod g=u /stackable/async-profiler
380
391
chmod g=u /stackable/bin
381
- chmod g=u /stackable/jmx
382
392
chmod g=u /stackable/phoenix
383
393
# the whole directory tree /stackable/hadoop/share/hadoop/tools/lib/ must be adapted
384
394
find /stackable/hadoop -type d -exec chmod g=u {} +
0 commit comments