Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-4456

Cloudevent extension name too long

XMLWordPrintable

    • False
    • False
    • Undefined
    • Hide

      To reproduce the bug on openshift:
      clone the sample
      ```sh
      git clone https://github.com/mouachan/kogito-knative-bug.git
      ```
      install from Operator hub

      • kogito operator
      • serveless (knative serving and eventing)
        deploy the broker
        ```sh
        oc create -f - <<EOF
        apiVersion: eventing.knative.dev/v1
        kind: broker
        metadata:
        name: default
        EOF
        ```
        get the url of the broker

      ```sh
      oc get broker
      NAME URL AGE READY REASON
      default http://broker-ingress.knative-eventing.svc.cluster.local/kogito-knative-bug/default 59m True
      ```

      deploy cloudevent-display knative service to catch cloudevents (use your own broker url)
      ```sh
      oc create -f - <<EOF

      apiVersion: serving.knative.dev/v1
      kind: Service
      metadata:
      name: cloudevent-display
      spec:
      template:
      spec:
      containers:

           env:

      deploy the trigger
      ```sh
      oc create -f - <<EOF
      apiVersion: eventing.knative.dev/v1
      kind: Trigger
      metadata:
      name: display-all-events-trigger
      spec:
      broker: default
      subscriber:
      ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: cloudevent-display
      EOF
      ```
      deploy the kogito infra
      ```sh
      oc create -f - <<EOF
      apiVersion: app.kiegroup.org/v1beta1
      kind: KogitoInfra
      metadata:
      name: kogito-knative-infra
      spec:
      resource:
      apiVersion: eventing.knative.dev/v1
      kind: Broker
      name: default
      EOF
      ```
      build the model
      ```sh
      cd model
      mvn clean install
      ```
      create kogito service eligibility
      ```sh
      oc create -f - <<EOF
      apiVersion: app.kiegroup.org/v1beta1
      kind: KogitoBuild
      metadata:
      name: eligibility
      spec:
      type: Binary

      apiVersion: app.kiegroup.org/v1beta1
      kind: KogitoRuntime
      metadata:
      annotations:
      org.kie.kogito/managed-by: Kogito Operator
      org.kie.kogito/operator-crd: KogitoRuntime
      prometheus.io/path: /metrics
      prometheus.io/port: "8080"
      prometheus.io/scheme: http
      prometheus.io/scrape: "true"
      labels:
      app: eligibility
      eligibility: process
      name: eligibility
      spec:
      serviceLabels:
      app: eligibility
      infra:

      • kogito-knative-infra
        EOF
        ```
        build and deploy kogito service
        ```sh
        cd ../eligibility
        mvn clean package -DskipTests=true
        oc start-build eligibility --from-dir=target
        ```

      call the eligibility service
      ```sh
      curl -X POST \ 19:24:37
      -H "content-type: application/json" \
      -H "ce-specversion: 1.0" \
      -H "ce-source: /from/localhost" \
      -H "ce-type: eligibilityapplication" \
      -H "ce-id: 12346" \
      -d "{\"age\":3,\"amount\":50000,\"bilan\":

      {\"gg\":5,\"ga\":2,\"hp\":1,\"hq\":2,\"dl\":50,\"ee\":2,\"siren\":\"423646512\",\"variables\":[]}

      ,\"ca\":200000,\"eligible\":false,\"msg\":\"string\",\"nbEmployees\":10,\"notation\":{\"decoupageSectoriel\":0,\"note\":\"string\",\"orientation\":\"string\",\"score\":0,\"typeAiguillage\":\"string\"},\"publicSupport\":true,\"siren\":\"423646512\",\"typeProjet\":\"IRD\"}" \
      http://eligibility-kogito-knative-bug.apps.cluster-389f.389f.example.opentlc.com
      ```

      log the cloudevent-display service
      ```sh
      oc logs -l serving.knative.dev/service=cloudevent-display -c user-container --tail=-1 19:32:27
      K_SINK env : http://broker-ingress.kogito-knative-bug.svc.cluster.local/kogito-knative-bug/default
      Server started on port 8080
      Error while decoding the event: io.cloudevents.rw.CloudEventRWException: Invalid extensions name: kogitoprocessinstanceid
      ```

      Show
      To reproduce the bug on openshift: clone the sample ```sh git clone https://github.com/mouachan/kogito-knative-bug.git ``` install from Operator hub kogito operator serveless (knative serving and eventing) deploy the broker ```sh oc create -f - <<EOF apiVersion: eventing.knative.dev/v1 kind: broker metadata: name: default EOF ``` get the url of the broker ```sh oc get broker NAME URL AGE READY REASON default http://broker-ingress.knative-eventing.svc.cluster.local/kogito-knative-bug/default 59m True ``` deploy cloudevent-display knative service to catch cloudevents (use your own broker url) ```sh oc create -f - <<EOF apiVersion: serving.knative.dev/v1 kind: Service metadata: name: cloudevent-display spec: template: spec: containers:      env: name: K_SINK value: >- http://broker-ingress.knative-eventing.svc.cluster.local/kogito-knative-bug/default image: registry.hub.docker.com/mouachani/cloudevent-display EOF ``` deploy the trigger ```sh oc create -f - <<EOF apiVersion: eventing.knative.dev/v1 kind: Trigger metadata: name: display-all-events-trigger spec: broker: default subscriber: ref: apiVersion: serving.knative.dev/v1 kind: Service name: cloudevent-display EOF ``` deploy the kogito infra ```sh oc create -f - <<EOF apiVersion: app.kiegroup.org/v1beta1 kind: KogitoInfra metadata: name: kogito-knative-infra spec: resource: apiVersion: eventing.knative.dev/v1 kind: Broker name: default EOF ``` build the model ```sh cd model mvn clean install ``` create kogito service eligibility ```sh oc create -f - <<EOF apiVersion: app.kiegroup.org/v1beta1 kind: KogitoBuild metadata: name: eligibility spec: type: Binary — apiVersion: app.kiegroup.org/v1beta1 kind: KogitoRuntime metadata: annotations: org.kie.kogito/managed-by: Kogito Operator org.kie.kogito/operator-crd: KogitoRuntime prometheus.io/path: /metrics prometheus.io/port: "8080" prometheus.io/scheme: http prometheus.io/scrape: "true" labels: app: eligibility eligibility: process name: eligibility spec: serviceLabels: app: eligibility infra: kogito-knative-infra EOF ``` build and deploy kogito service ```sh cd ../eligibility mvn clean package -DskipTests=true oc start-build eligibility --from-dir=target ``` call the eligibility service ```sh curl -X POST \ 19:24:37 -H "content-type: application/json" \ -H "ce-specversion: 1.0" \ -H "ce-source: /from/localhost" \ -H "ce-type: eligibilityapplication" \ -H "ce-id: 12346" \ -d "{\"age\":3,\"amount\":50000,\"bilan\": {\"gg\":5,\"ga\":2,\"hp\":1,\"hq\":2,\"dl\":50,\"ee\":2,\"siren\":\"423646512\",\"variables\":[]} ,\"ca\":200000,\"eligible\":false,\"msg\":\"string\",\"nbEmployees\":10,\"notation\":{\"decoupageSectoriel\":0,\"note\":\"string\",\"orientation\":\"string\",\"score\":0,\"typeAiguillage\":\"string\"},\"publicSupport\":true,\"siren\":\"423646512\",\"typeProjet\":\"IRD\"}" \ http://eligibility-kogito-knative-bug.apps.cluster-389f.389f.example.opentlc.com ``` log the cloudevent-display service ```sh oc logs -l serving.knative.dev/service=cloudevent-display -c user-container --tail=-1 19:32:27 K_SINK env : http://broker-ingress.kogito-knative-bug.svc.cluster.local/kogito-knative-bug/default Server started on port 8080 Error while decoding the event: io.cloudevents.rw.CloudEventRWException: Invalid extensions name: kogitoprocessinstanceid ```
    • ---
    • ---
    • 2021 Week 07-09 (from Feb 15), 2021 Week 10-12 (from Mar 8), 2021 Week 13-15 (from Mar 29)

      The following error is raised when we try to chain multiple kogito service 
      Error while decoding the event: io.cloudevents.rw.CloudEventRWException: Invalid extensions name: kogitoprocessinstanceid
       
      The extension name is more than 20 characters long
       

              rhn-support-zanini Ricardo Zanini
              mouachan@redhat.com Mourad Ouachani
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: