klwilson227 opened a new issue #9315:
URL: https://github.com/apache/pulsar/issues/9315


   **Describe the bug**
   When configuring a pod to run as a different users, we found that the 
download files for the kubernetes runtime are placed in pulsarRoot vs. in the 
configured workerConfig:downloadDirectory as we had expected. For kubernetes to 
be able to write the files as other users, these directories should be mounted 
as volumes, however, since the volume cannot be specified for pulsarRoot, you 
cannot move where the download files are located, as suggested by the worker 
configuration. 
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Use kubernetes runtime, create a new functions worker for a java based 
worker, and inspect the functions pod command line to identify the location of 
the Jar files
   
   /pulsar/bin/pulsar-admin --admin-url https://itomdipulsar-proxy:8443 
functions
         download --tenant public --namespace default --name provider 
--destination-file
         **/pulsar**/minio-source-0.0.1-SNAPSHOT.nar && 
SHARD_ID=${POD_NAME##*-} && echo shardId=${SHARD_ID}
         && exec java -cp 
/pulsar/instances/java-instance.jar:/pulsar/instances/deps/*
         -Dpulsar.functions.extra.dependencies.dir=/pulsar/instances/deps 
-Dpulsar.functions.instance.classpath=/pulsar/conf:::/pulsar/lib/*:
         -Dlog4j.configurationFile=kubernetes_instance_log4j2.xml 
-Dpulsar.function.log.dir=logs/functions/public/default/provider
         -Dpulsar.function.log.file=provider-$SHARD_ID -Xmx1073741824 
org.apache.pulsar.functions.instance.JavaInstanceMain
         --jar **/pulsar/**minio-source-0.0.1-SNAPSHOT.nar --instance_id 
$SHARD_ID --function_id
   
   
   **Expected behavior**
   Expected to see the configured download directory prefixing the nar file and 
specified as the location of the sources. 
   
   **Screenshots**
   If applicable, add screenshots to help explain your problem.
   
   **Desktop (please complete the following information):**
    - OS: [e.g. iOS]
   
   **Additional context**
   We tweaked the KubernetesRuntime code to set the:
   this.originalCodeFileName = pulsarRootDir + "/" + originalCodeFileName;
   to
   this.originalCodeFileName = narExtractionDirectory + "/" + 
originalCodeFileName;
   ...
   Although not correct, this allowed us to configure the resulting directory, 
and work around the problem, so that as a custom user ID we have access to 
write the jar file into the mounted /tmp location of the container image. Where 
narExtractionDirectory is set to "/tmp" by default. 
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to