This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new b825ee3a9c0 [improve][test] Refactor the way way 
pulsar-io-debezium-oracle nar file is patched when building the test image 
(#24586)
b825ee3a9c0 is described below

commit b825ee3a9c0057f1d20ca657a00e6ce3a01c6e52
Author: Lari Hotari <lhot...@users.noreply.github.com>
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 074f411b952..316f499083d 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
 ########################################
@@ -77,19 +100,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

Reply via email to