Skip to content

boolean parameters for pulsar-admin has 0 arity  #388

Closed

Description

@jiangpengcheng

see https://jcommander.org/#_boolean

so generated download command will be failed and complain below error when passing --tls-allow-insecure true|false or --tls-enable-hostname-verification true|false:

Was passed main parameter 'true' but no main parameter was defined in your arg class

Activity

  1. added this to the 2022-06 v0.3.0 milestone on Jun 10, 2022
  2. jiangpengcheng commented on Jun 17, 2022

    @jiangpengcheng
    MemberAuthor

    sub-issues:

    1. create and publish a pulsar-admin ready-to-use toolkit image, maybe we can try with https://github.com/streamnative/pulsarctl to minimize the image size?
    2. pr to use init containers to download function
    3. add a new CI task to cover cases which specified JarLocation/PyLocation/GoLocation
  3. armangurkan commented on Jun 20, 2022

    @armangurkan

    Function-mesh: v0.1.10
    shardId=0 Using function root classloader: sun.misc.Launcher$AppClassLoader@7d4991ad Using function instance classloader: java.net.URLClassLoader@4554617c Starting function instance... Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.pulsar.functions.instance.JavaInstanceMain.main(JavaInstanceMain.java:99) Caused by: com.beust.jcommander.ParameterException: Was passed main parameter '100' but no main parameter was defined in your arg class at com.beust.jcommander.JCommander.initMainParameterValue(JCommander.java:954) at com.beust.jcommander.JCommander.parseValues(JCommander.java:755) at com.beust.jcommander.JCommander.parse(JCommander.java:356) at com.beust.jcommander.JCommander.parse(JCommander.java:335) at org.apache.pulsar.functions.runtime.JavaInstanceStarter.start(JavaInstanceStarter.java:149) ... 5 more Stream closed EOF for my-namespace/function-name-dev-g2cvedgeclientmessage-function-0 (pulsar-function)

    Hello I am getting the same issue on an integer value, I beleive parameter is --max_buffered_tuples.
    I appreciate the guidance, thanks in advance....

  4. jiangpengcheng commented on Jun 21, 2022

    @jiangpengcheng
    MemberAuthor

    @armangurkan could you share your YAML? it looks like some environment is missing

  5. armangurkan commented on Jun 21, 2022

    @armangurkan
    apiVersion: compute.functionmesh.io/v1alpha1
    kind: FunctionMesh
    metadata:
      name: fm-{{ .Release.Namespace }}
    spec:
      functions:
        - name: {{ "NAME1" | lower }}
          image: "repo/ns/name:{{ ( index .Values.helm.parameters 1 ).value | replace "\"" "" }}"
          tenant: "public"
          namespace: "ns"
          className: "com.ourcompany.functionservice.pulsar_functions.NAME1"
          autoAck: false
          replicas: 1
          maxReplicas: 10
          maxPendingAsyncRequests: 1000
          forwardSourceMessageProperty: true
          resources: &resources
            limits:
              cpu: 4
              memory: 2147483648
            requests:
              cpu: 2
              memory: 1073741824
          output:
            producerConf:
              maxPendingMessages: 100
              maxPendingMessagesAcrossPartitions: 1000
          input:
            topics:
              - persistent://public/ns/new
            typeClassName: "[B"
          funcConfig:
            "ConfigResponseTopic": "persistent://public/ns/"
          pulsar: &pulsar
            pulsarConfig: "mesh-config-{{ .Release.Namespace }}"
            tlsSecret: "mesh-config-tlssecret-{{ .Release.Namespace }}"
            authSecret: "mesh-config-authsecret-{{ .Release.Namespace }}"
          java: &java
            extraDependenciesDir: connectors/
            jar: /pulsar/pulsar-functions-1.0.0.nar
            jarLocation: "" # leave empty since we will not download package from Pulsar Packages
          clusterName: pulsar-ob-{{ .Release.Namespace }}
          pod: &pod
            volumes:
              - name: clientconf
                configMap:
                  name: pulsar-ob-{{ .Release.Namespace }}-functions-worker-clientconf-configfile
                  defaultMode: 0493
              - name: broker-certs
                secret:
                  secretName: pulsar-ob-{{ .Release.Namespace }}-tls-broker
                  items:
                    - key: tls.key
                      path: tls.key
                    - key: tls.crt
                      path: tls.crt
              - name: ca
                secret:
                  secretName: pulsar-ob-{{ .Release.Namespace }}-ca-tls
                  items:
                    - key: ca.crt
                      path: ca.crt
              - name: admin
                secret:
                  secretName: pulsar-ob-{{ .Release.Namespace }}-client-admin
                  items:
                    - key: tls.key
                      path: tls.key
                    - key: tls.crt
                      path: tls.crt
              - name: proxy-ca
                secret:
                  secretName: pulsar-ob-{{ .Release.Namespace }}-tls-proxy
                  items:
                    - key: ca.crt
                      path: ca.crt
          volumeMounts: &volumeMounts
            - name: clientconf
              mountPath: /etc/pulsar/clientconf
            - name: broker-certs
              mountPath: /etc/pulsar/broker-certs
            - name: ca
              mountPath: /etc/pulsar/ca
            - name: admin
              mountPath: /etc/pulsar/admin
            - name: proxy-ca
              mountPath: /etc/pulsar/proxy-ca

    @jiangpengcheng thank you for the response...
    By the way I also deployed the sample function that is referred in your documentation, that also is doing the same thing for boolean values.

  6. jiangpengcheng commented on Jun 21, 2022

    @jiangpengcheng
    MemberAuthor

    @armangurkan you're welcome

    the command argument is assembled as below(you can check the whole command by describing the generated pod)

    	args := []string{
    		"--instance_id",
    		"${" + EnvShardID + "}",
    		"--function_id",
    		fmt.Sprintf("${%s}-%s", EnvShardID, uid),
    		"--function_version",
    		"0",
    		"--function_details",
    		"'" + details + "'", //in json format
    		"--pulsar_serviceurl",
    		"$brokerServiceURL",
    		"--max_buffered_tuples",
    		"100", // TODO
    		"--port",
    		strconv.Itoa(int(GRPCPort.ContainerPort)),
    		"--metrics_port",
    		strconv.Itoa(int(MetricsPort.ContainerPort)),
    		"--expected_healthcheck_interval",
    		"-1", // TurnOff BuiltIn HealthCheck to avoid instance exit
    		"--cluster_name",
    		clusterName,
    	}

    so based on your error, I guess $brokerServiceURL is empty, and the program takes --max_buffered_tuples as an value for --pulsar_serviceurl, and treats 100 as a parameter

  7. armangurkan commented on Jun 21, 2022

    @armangurkan

    @armangurkan you're welcome

    the command argument is assembled as below(you can check the whole command by describing the generated pod)

    	args := []string{
    		"--instance_id",
    		"${" + EnvShardID + "}",
    		"--function_id",
    		fmt.Sprintf("${%s}-%s", EnvShardID, uid),
    		"--function_version",
    		"0",
    		"--function_details",
    		"'" + details + "'", //in json format
    		"--pulsar_serviceurl",
    		"$brokerServiceURL",
    		"--max_buffered_tuples",
    		"100", // TODO
    		"--port",
    		strconv.Itoa(int(GRPCPort.ContainerPort)),
    		"--metrics_port",
    		strconv.Itoa(int(MetricsPort.ContainerPort)),
    		"--expected_healthcheck_interval",
    		"-1", // TurnOff BuiltIn HealthCheck to avoid instance exit
    		"--cluster_name",
    		clusterName,
    	}

    so based on your error, I guess $brokerServiceURL is empty, and the program takes --max_buffered_tuples as an value for --pulsar_serviceurl, and treats 100 as a parameter
    @jiangpengcheng thank for your response,

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: mesh-config-pulsar-ob-{{ .Release.Namespace }}
    data:
      brokerServiceUrl: pulsar+ssl://pulsar-ob-{{ .Release.Namespace }}-proxy:6651/
      webServiceUrl: https://pulsar-ob-{{ .Release.Namespace }}-proxy:443/

    image
    The configmap and the image that has the part of the command argument is above, actually the brokerServiceUrl is defined.

  8. jiangpengcheng commented on Jun 22, 2022

    @jiangpengcheng
    MemberAuthor

    then I have no idea now, could you try with the latest function-mesh? maybe there are some bugs in v0.1.10

  9. freeznet commented on Jun 22, 2022

    @freeznet
    Member

    @armangurkan would you mind sharing the export YAML of the POD? thanks.

  10. freeznet commented on Aug 17, 2022

    @freeznet
    Member

    already resolved by #414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions