jerrypeng commented on a change in pull request #4174: [go function] support
localrun and cluster mode for go function
URL: https://github.com/apache/pulsar/pull/4174#discussion_r280012176
##########
File path:
pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
##########
@@ -89,31 +91,180 @@
if (StringUtils.isNotEmpty(extraDependenciesDir)) {
args.add("PYTHONPATH=${PYTHONPATH}:" + extraDependenciesDir);
}
+ } else if (instanceConfig.getFunctionDetails().getRuntime() ==
Function.FunctionDetails.Runtime.GO) {
+ //no-op
}
return args;
}
+ /**
+ *
+ * Different from python and java function, Go function uploads a complete
executable file(including:
+ * instance file + user code file). Its parameter list is provided to the
broker in the form of a yaml file,
+ * the advantage of this approach is that backward compatibility is
guaranteed.
Review comment:
> Once it is shipped, it is hard to change and we have to support it.
I am ok with passing the GO instance the contents of the instance config. I
am just not convinced to method we pass those contents should be a file. We
can also pass the contents of the instance config as command line arguments.
Why can't we just do that? Whether we ignore fields in a yaml file or key-value
command line arguments, its kind of the same for purposes of BC. However if we
can just start the GO instance just with command line arguments and have no
config file dependency, it will already work with K8s runtime.
If we eventually decide to use the config file approach after discussing in
#4176, then lets refactor all the runtimes to support this and deprecate using
command line arguments. I don't see a point to doing this one offshoot of
supporting passing in a config file to an instance just for GO right now.
----------------------------------------------------------------
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]
With regards,
Apache Git Services