This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 0ea59a927ba [improve][test] Refactor the way way
pulsar-io-debezium-oracle nar file is patched when building the test image
(#24586)
0ea59a927ba is described below
commit 0ea59a927ba2871d705d8ac3a0abe2367a5b44d9
Author: Lari Hotari <[email protected]>
AuthorDate: Wed Jul 30 21:26:12 2025 +0300
[improve][test] Refactor the way way pulsar-io-debezium-oracle nar file is
patched when building the test image (#24586)
(cherry picked from commit b2f277d7900b4b40187bc5a7f5ba2d419ff0886d)
---
.../docker-images/latest-version-image/Dockerfile | 38 ++++++++++++++--------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/tests/docker-images/latest-version-image/Dockerfile
b/tests/docker-images/latest-version-image/Dockerfile
index 521676ac0d4..814cc89bfbf 100644
--- a/tests/docker-images/latest-version-image/Dockerfile
+++ b/tests/docker-images/latest-version-image/Dockerfile
@@ -27,6 +27,29 @@ RUN cd /go/src/github.com/apache/pulsar/pulsar-function-go
&& go install ./...
RUN cd /go/src/github.com/apache/pulsar/pulsar-function-go/pf && go install
RUN cd /go/src/github.com/apache/pulsar/pulsar-function-go/examples && go
install ./...
+
+# patch Oracle Debezium Connector nar file to include Oracle JDBC dependencies
+FROM $PULSAR_ALL_IMAGE as oracle-jdbc-builder
+
+USER root
+WORKDIR /
+
+RUN OJDBC_VERSION="19.3.0.0" && \
+ OJDBC_BASE_URL="https://repo1.maven.org/maven2/com/oracle/ojdbc" && \
+ DEPS_DIR="META-INF/bundled-dependencies" && \
+ OJDBC_ARTIFACTS="ojdbc8 ucp oraclepki osdt_cert osdt_core simplefan
orai18n xdb xmlparserv2" && \
+ cd / && rm -rf "$DEPS_DIR" && mkdir -p "$DEPS_DIR" && \
+ cd "$DEPS_DIR" && \
+ for ojdbc_artifact in $OJDBC_ARTIFACTS; do \
+ ojdbc_jar_file="${ojdbc_artifact}-${OJDBC_VERSION}.jar" && \
+
ojdbc_download_url="${OJDBC_BASE_URL}/${ojdbc_artifact}/${OJDBC_VERSION}/${ojdbc_jar_file}"
&& \
+ echo "Downloading $ojdbc_jar_file from $ojdbc_download_url" && \
+ curl -sSL --retry 5 --retry-delay 1 --retry-max-time 30
"${ojdbc_download_url}" -o "${ojdbc_jar_file}" && \
+ [ -f "${ojdbc_jar_file}" ] || (echo "Failed to download
${ojdbc_jar_file}" && exit 1); \
+ done && \
+ cd / && \
+ jar uvf /pulsar/connectors/pulsar-io-debezium-oracle-*.nar $DEPS_DIR/*.jar
>&2
+
########################################
###### Main image build
########################################
@@ -74,19 +97,8 @@ COPY target/certificate-authority
/pulsar/certificate-authority/
# copy broker plugins
COPY target/plugins/ /pulsar/examples/
-# download Oracle JDBC driver for Oracle Debezium Connector tests
-RUN mkdir -p META-INF/bundled-dependencies
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/ojdbc8/19.3.0.0/ojdbc8-19.3.0.0.jar
-o ojdbc8-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/ucp/19.3.0.0/ucp-19.3.0.0.jar
-o ucp-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/oraclepki/19.3.0.0/oraclepki-19.3.0.0.jar
-o oraclepki-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/osdt_cert/19.3.0.0/osdt_cert-19.3.0.0.jar
-o osdt_cert-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/osdt_core/19.3.0.0/osdt_core-19.3.0.0.jar
-o osdt_core-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/simplefan/19.3.0.0/simplefan-19.3.0.0.jar
-o simplefan-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/orai18n/19.3.0.0/orai18n-19.3.0.0.jar
-o orai18n-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/xdb/19.3.0.0/xdb-19.3.0.0.jar
-o xdb-19.3.0.0.jar
-RUN cd META-INF/bundled-dependencies && curl -sSL
https://search.maven.org/remotecontent?filepath=com/oracle/ojdbc/xmlparserv2/19.3.0.0/xmlparserv2-19.3.0.0.jar
-o xmlparserv2-19.3.0.0.jar
-
-RUN jar uf connectors/pulsar-io-debezium-oracle-*.nar
META-INF/bundled-dependencies/ojdbc8-19.3.0.0.jar
META-INF/bundled-dependencies/ucp-19.3.0.0.jar
META-INF/bundled-dependencies/oraclepki-19.3.0.0.jar
META-INF/bundled-dependencies/osdt_cert-19.3.0.0.jar
META-INF/bundled-dependencies/osdt_core-19.3.0.0.jar
META-INF/bundled-dependencies/simplefan-19.3.0.0.jar
META-INF/bundled-dependencies/orai18n-19.3.0.0.jar
META-INF/bundled-dependencies/xdb-19.3.0.0.jar META-INF/bundled-dependencies/x
[...]
+# Copy patched Oracle Debezium Connector nar file which includes Oracle JDBC
dependencies
+COPY --from=oracle-jdbc-builder
/pulsar/connectors/pulsar-io-debezium-oracle-*.nar /pulsar/connectors/
# Fix permissions for filesystem offloader
RUN mkdir -p pulsar