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/12/16 14:18:41 UTC

[GitHub] [pulsar] zymap opened a new pull request #8973: [WIP] Make function supports to use package command

zymap opened a new pull request #8973:
URL: https://github.com/apache/pulsar/pull/8973


   ---
   
   Master Issue: #8676
   
   *Motivation*
   
   We have a new package management service which can manage all
   the packages. We can use that in the Pulsar Function which will
   make the function packages are easier to manage.
   
   *Modifications*
   
   - Support new package type URL
   


----------------------------------------------------------------
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 merged pull request #8973: Make function supports to use package command

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


   


----------------------------------------------------------------
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 #8973: Make function supports to use package command

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



##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
##########
@@ -868,6 +876,39 @@ public void deleteService() throws InterruptedException {
                 userCodeFilePath);
     }
 
+    private List<String> getPackageDownloadCommand(String packageName, String userCodeFilePath) {
+        // add auth plugin and parameters if necessary
+        if (authenticationEnabled && authConfig != null) {
+            if (isNotBlank(authConfig.getClientAuthenticationPlugin())
+                && isNotBlank(authConfig.getClientAuthenticationParameters())
+                && instanceConfig.getFunctionAuthenticationSpec() != null) {
+                return Arrays.asList(
+                    pulsarRootDir + configAdminCLI,
+                    "--auth-plugin",
+                    authConfig.getClientAuthenticationPlugin(),
+                    "--auth-params",
+                    authConfig.getClientAuthenticationParameters(),
+                    "--admin-url",
+                    pulsarAdminUrl,
+                    "packages",
+                    "download",
+                    packageName,
+                    "--path",
+                    userCodeFilePath);
+            }
+        }
+
+        return Arrays.asList(

Review comment:
       Don't we need authentication and authorization plugin for downloading the packages?




----------------------------------------------------------------
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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on a change in pull request #8973: Make function supports to use package command

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



##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
##########
@@ -868,6 +876,39 @@ public void deleteService() throws InterruptedException {
                 userCodeFilePath);
     }
 
+    private List<String> getPackageDownloadCommand(String packageName, String userCodeFilePath) {
+        // add auth plugin and parameters if necessary
+        if (authenticationEnabled && authConfig != null) {
+            if (isNotBlank(authConfig.getClientAuthenticationPlugin())
+                && isNotBlank(authConfig.getClientAuthenticationParameters())
+                && instanceConfig.getFunctionAuthenticationSpec() != null) {
+                return Arrays.asList(
+                    pulsarRootDir + configAdminCLI,
+                    "--auth-plugin",
+                    authConfig.getClientAuthenticationPlugin(),
+                    "--auth-params",
+                    authConfig.getClientAuthenticationParameters(),
+                    "--admin-url",
+                    pulsarAdminUrl,
+                    "packages",
+                    "download",
+                    packageName,
+                    "--path",
+                    userCodeFilePath);
+            }
+        }
+
+        return Arrays.asList(

Review comment:
       Yes. We need. Already add auth plugin at line 879.




----------------------------------------------------------------
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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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] zymap commented on pull request #8973: Make function supports to use package command

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


   /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