Skip to content

Commit e2c02b0

Browse files
committed
fix: add generated protobuf classes to the image
1 parent 500441a commit e2c02b0

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

spark-k8s/hbase-connectors/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ ARG PRODUCT_VERSION
5454
ARG RELEASE_VERSION
5555
ARG HADOOP_VERSION
5656
ARG HBASE_VERSION
57+
ARG HBASE_THIRDPARTY_VERSION
58+
ARG PROTOBUF_VERSION
59+
ARG PROTOBUF_PLUGIN_VERSION
5760
ARG STACKABLE_USER_UID
5861

5962
# Patch the hbase-connectors source code
@@ -107,12 +110,18 @@ mvn \
107110
--define scala.binary.version="${SCALA_BINARY_VERSION}" \
108111
--define hadoop-three.version="${HADOOP_VERSION}" \
109112
--define hbase.version="${HBASE_VERSION}" \
113+
--define hbase-thirdparty.version="${HBASE_THIRDPARTY_VERSION}" \
114+
--define external.protobuf.version="${PROTOBUF_VERSION}" \
115+
--define protobuf.plugin.version="${PROTOBUF_PLUGIN_VERSION}" \
110116
--define skipTests \
111117
--define maven.test.skip=true \
112118
clean package
113119

114120

115121
cp "$(pwd)/hbase-spark/target/hbase-spark-${NEW_VERSION}.jar" /stackable/spark/jars/hbase-spark-${NEW_VERSION}.jar
122+
# The hbase-spark JAR is a plain module JAR and does not bundle its
123+
# dependencies. The generated protobuf classes live here.
124+
cp "$(pwd)/hbase-spark-protocol-shaded/target/hbase-spark-protocol-shaded-${NEW_VERSION}.jar" /stackable/spark/jars/hbase-spark-protocol-shaded-${NEW_VERSION}.jar
116125

117126
chmod g=u /stackable/hbase-connector-${NEW_VERSION}-src.tar.gz .
118127
EOF

spark-k8s/hbase-connectors/boil-config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ spark-version = "3.5.8"
66
# TODO: Bump to 3.4.3. Note that this causes compilation errors that need to be fixed.
77
hadoop-version = "3.4.2"
88
hbase-version = "2.6.6"
9+
# The following three must match the hbase-thirdparty (and its bundled protobuf)
10+
# shipped by the hbase-shaded-client in the final Spark image. That client comes
11+
# from the `hbase` local-image in spark-k8s/boil-config.toml (currently 2.6.4),
12+
# whose hbase-thirdparty is 4.1.12 -> protobuf 4.31.1. Keep these in sync if the
13+
# Spark image's HBASE_VERSION changes.
14+
hbase-thirdparty-version = "4.1.12"
15+
protobuf-version = "4.31.1"
16+
protobuf-plugin-version = "0.6.1"

0 commit comments

Comments
 (0)