You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/09/25 10:01:30 UTC

[GitHub] [pulsar] vaihtovirta opened a new pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

vaihtovirta opened a new pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132


   ### Motivation
   
   Currently, pulsar functions written in Golang have no access to the content of the user-config parameter from admin CLI.
   That's the simplest way to pass custom configuration into a go function right now because neither secretsMap nor Kubernetes runtime is available for Golang functions yet.
   
   **Note**: For the `secretsMap` parameter, the same technique can be used, but this has to be addressed in a separate PR.
   
   ### Modifications
   
   - Added `String GoInstanceConfig#userConfig` attribute
   - Propagated user-config parameter in `RuntimeUtils.getGoInstanceCmd`
   - Exposed userConfig in `pulsar-function-go` and made it available in the `FunctionContext`
   - Add unit tests for the affected code 
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
     - Added unit tests for `RuntimeUtils.getGoInstanceCmd` in `pulsar-functions`
     - Added unit tests for `instanceConf` and `FunctionContext` in `pulsar-function-go`
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes)
      - Run `go mod tidy` in `pulsar-function-go`.
     - The public API: (no)
      
     - The schema: (yes)
      - New attribute in GoInstanceConfig.java
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - Anything that affects deployment: (don't know)
   
   ### Documentation
   The respective documentation has to be updated: [User Config#Go](https://github.com/apache/pulsar/blame/master/site2/docs/functions-develop.md#L574)
   
   **Question**: Does it have to be done in the scope of current PR? 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699929586


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-701957323


   @sijie Addressed both comments.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699895535


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699685713


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on a change in pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#discussion_r498001964



##########
File path: pulsar-function-go/pf/instanceConf.go
##########
@@ -72,8 +73,8 @@ func newInstanceConf() *instanceConf {
 				SubscriptionType: pb.SubscriptionType(cfg.SubscriptionType),
 				InputSpecs: map[string]*pb.ConsumerSpec{
 					cfg.SourceSpecTopic: {
-						SchemaType:     cfg.SourceSchemaType,
-						IsRegexPattern: cfg.IsRegexPatternSubscription,
+						SchemaType:     "",
+						IsRegexPattern: false,

Review comment:
       Why do you change this to `false`?

##########
File path: pulsar-function-go/pf/instanceConf.go
##########
@@ -72,8 +73,8 @@ func newInstanceConf() *instanceConf {
 				SubscriptionType: pb.SubscriptionType(cfg.SubscriptionType),
 				InputSpecs: map[string]*pb.ConsumerSpec{
 					cfg.SourceSpecTopic: {
-						SchemaType:     cfg.SourceSchemaType,
-						IsRegexPattern: cfg.IsRegexPatternSubscription,
+						SchemaType:     "",

Review comment:
       Why do you change the `SchemaType` to an empty string? 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-702026859






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699685713


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699479153


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699660310


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699510095


   /pulsarbot run-failure-checks
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699621149


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699847766


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699499793


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie merged pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-701990394


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699499793


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699872793






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699510095


   /pulsarbot run-failure-checks
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699847766


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699479153


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on a change in pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on a change in pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#discussion_r498041892



##########
File path: pulsar-function-go/pf/instanceConf.go
##########
@@ -72,8 +73,8 @@ func newInstanceConf() *instanceConf {
 				SubscriptionType: pb.SubscriptionType(cfg.SubscriptionType),
 				InputSpecs: map[string]*pb.ConsumerSpec{
 					cfg.SourceSpecTopic: {
-						SchemaType:     cfg.SourceSchemaType,
-						IsRegexPattern: cfg.IsRegexPatternSubscription,
+						SchemaType:     "",

Review comment:
       Good catch, I might've overlooked after some testing.
   I'll revert that.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699512888






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699929586


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699512888


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-739633131


   depends by #8268


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699872793


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta removed a comment on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta removed a comment on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-699660310


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] vaihtovirta commented on pull request #8132: [component/functions|component/go] Propagate user-config parameter into instances of Golang pulsar functions

Posted by GitBox <gi...@apache.org>.
vaihtovirta commented on pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132#issuecomment-702026859


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org