Skip to content

Commit

Permalink
Use /pulsar/instances/deps/* instead of /pulsar/lib/* in classpath (
Browse files Browse the repository at this point in the history
#787)

* Use `/pulsar/instances/deps/*` instead of `/pulsar/lib/*` in classpath

* Fix error

* Fix error
  • Loading branch information
jiangpengcheng authored Nov 5, 2024
1 parent df13250 commit 97dd12b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ spec:
java:
jar: pulsar-functions-api-examples.jar
jarLocation: function://public/default/test-java-function
log:
javaLog4JConfigFileType: "yaml"
# to be delete & use admission hook
clusterName: test
autoAck: true
Expand Down
2 changes: 1 addition & 1 deletion controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ func getProcessJavaRuntimeArgs(name, packageName, clusterName, logLevel, details
state *v1alpha1.Stateful,
tlsConfig TLSConfig, authConfig *v1alpha1.AuthConfig,
maxPendingAsyncRequests *int32, logConfigFileName string) []string {
classPath := "/pulsar/instances/java-instance.jar:/pulsar/lib/*"
classPath := "/pulsar/instances/java-instance.jar:/pulsar/instances/deps/*"
javaLogConfigPath := logConfigFileName
if javaLogConfigPath == "" {
javaLogConfigPath = DefaultJavaLogConfigPath
Expand Down
3 changes: 3 additions & 0 deletions images/pulsar-functions-java-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ FROM pulsar-functions-runner-base:latest
COPY --from=pulsar --chown=$UID:$GID /pulsar/instances/java-instance.jar /pulsar/instances/java-instance.jar
COPY --from=pulsar --chown=$UID:$GID /pulsar/instances/deps /pulsar/instances/deps

RUN cp /pulsar/lib/com.fasterxml.jackson.dataformat-jackson-dataformat-yaml-*.jar /pulsar/instances/deps/dataformat-jackson-dataformat-yaml.jar \
&& cp /pulsar/lib/org.yaml-snakeyaml-*.jar /pulsar/instances/deps/org.yaml-snakeyaml.jar

WORKDIR /pulsar

USER $USER
3 changes: 3 additions & 0 deletions images/pulsar-functions-java-runner/pulsarctl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ RUN rm -rf /pulsar/lib/io.vertx-vertx-core-*.jar || true
RUN rm -rf /pulsar/lib/presto || true
RUN rm -rf /pulsar/conf/presto || true

RUN cp /pulsar/lib/com.fasterxml.jackson.dataformat-jackson-dataformat-yaml-*.jar /pulsar/instances/deps/dataformat-jackson-dataformat-yaml.jar \
&& cp /pulsar/lib/org.yaml-snakeyaml-*.jar /pulsar/instances/deps/org.yaml-snakeyaml.jar

ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE
ENV java.io.tmpdir=/pulsar/tmp/

Expand Down

0 comments on commit 97dd12b

Please sign in to comment.