solo-io / wasm

Web Assembly tools and SDKs for extending cloud-native infrastructure
Apache License 2.0
305 stars 39 forks source link

Istio 1.6 version did not work #162

Closed szheng3 closed 4 years ago

szheng3 commented 4 years ago

I used wasme release version 26 but it did not work for the Istio filter my command is this one

$ wasme init ./filter2 --platform istio --platform-version 1.6.x   
$ kubectl apply -f https://github.com/solo-io/wasme/releases/latest/download/wasme-default.yaml
$ kubectl apply -f https://github.com/solo-io/wasme/releases/latest/download/wasme.io_v1_crds.yaml
$  wasme build assemblyscript -t webassemblyhub.io/szheng3/add-header:v0.2 .
$  wasme push webassemblyhub.io/szheng3/add-header:v0.2

and used this yaml

apiVersion: wasme.io/v1
kind: FilterDeployment
metadata:
  name: filter-test
  namespace: resume-dev
spec:
  deployment:
    istio:
      kind: Deployment
      labels:
        app: web-resume-backend
  filter:
    image: webassemblyhub.io/szheng3/add-header:v0.2

The filter did not work

szheng3 commented 4 years ago
apiVersion: wasme.io/v1
kind: FilterDeployment
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"wasme.io/v1","kind":"FilterDeployment","metadata":{"annotations":{},"name":"filter-test","namespace":"resume-dev"},"spec":{"deployment":{"istio":{"kind":"Deployment"}},"filter":{"image":"webassemblyhub.io/szheng3/add-header:v0.2"}}}
  creationTimestamp: "2020-08-24T18:45:13Z"
  generation: 9
  name: filter-test
  namespace: resume-dev
  resourceVersion: "97351702"
  selfLink: /apis/wasme.io/v1/namespaces/resume-dev/filterdeployments/filter-test
  uid: 8772f819-9e67-4caf-93c6-59beb2e60ce4
spec:
  deployment:
    istio:
      kind: Deployment
  filter:
    image: webassemblyhub.io/szheng3/add-header:v0.2
status:
  observedGeneration: "8"
  workloads: {}

I did not see success in the workloads.

yuval-k commented 4 years ago

it's hard to tell what is going on without logs from the wasme operator and the istio sidecar. Please provide additional logs so we can have more to go on

emayssat commented 4 years ago

Same problem here with latest wasme (with istio 1.6 option). I am using the cpp programming language. with image istio/proxyv2:1.6.0 and istio/proxyv2:1.6.8

Logs:

sidecar_1 | [2020-08-27 06:21:03.791][1][info][config] [external/envoy/source/server/configuration_impl.cc:129] loading stats sink configuration sidecar_1 | [2020-08-27 06:21:03.800][1][debug][wasm] [bazel-out/k8-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_vm_base/extensions/common/wasm/wasm_vm_base.h:38] WasmVm created envoy.wasm.runtime.v8 now active sidecar_1 | [2020-08-27 06:21:03.800][1][debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:187] Base Wasm created 3 now active sidecar_1 | [2020-08-27 06:21:03.839][1][debug][wasm] [external/envoy/source/extensions/common/wasm/context.cc:1104] wasm log envoy.filters.http.wasm singleton-fetchdoc : [singleton-fetchdoc.cc:93]::onStart() >>> sidecar_1 | [2020-08-27 06:21:03.839][1][debug][wasm] [external/envoy/source/extensions/common/wasm/context.cc:1104] wasm log envoy.filters.http.wasm singleton-fetchdoc : [singleton-fetchdoc.cc:94]::onStart() <<< sidecar_1 | [2020-08-27 06:21:03.841][1][debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:357] ~Wasm 2 remaining active sidecar_1 | [2020-08-27 06:21:03.850][1][debug][wasm] [bazel-out/k8-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_vm_base/extensions/common/wasm/wasm_vm_base.h:42] ~WasmVm envoy.wasm.runtime.v8 2 remaining active sidecar_1 | [2020-08-27 06:21:03.851][1][critical][main] [external/envoy/source/server/server.cc:98] error initializing configuration '/etc/envoy/envoy.yaml': Function: proxy_on_configure failed: Uncaught RuntimeError: function signature mismatch gateway_1 | [2020-08-27 06:21:03.851][1][warning][misc] [bazel-out/k8-opt/bin/external/envoy/source/extensions/common/_virtual_includes/utility_lib/extensions/common/utility.h:66] Using deprecated extension name 'envoy.router' for 'envoy.filters.http.router'. This name will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history for details. sidecar_1 | [2020-08-27 06:21:03.852][1][debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:357] ~Wasm 1 remaining active sidecar_1 | [2020-08-27 06:21:03.852][1][debug][wasm] [bazel-out/k8-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_vm_base/extensions/common/wasm/wasm_vm_base.h:42] ~WasmVm envoy.wasm.runtime.v8 1 remaining active sidecar_1 | [2020-08-27 06:21:03.854][1][info][main] [external/envoy/source/server/server.cc:640] exiting sidecar_1 | [2020-08-27 06:21:03.855][1][debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:357] ~Wasm 0 remaining active sidecar_1 | [2020-08-27 06:21:03.856][1][debug][wasm] [bazel-out/k8-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_vm_base/extensions/common/wasm/wasm_vm_base.h:42] ~WasmVm envoy.wasm.runtime.v8 0 remaining active sidecar_1 | Function: proxy_on_configure failed: Uncaught RuntimeError: function signature mismatch

Note that I am using my filters built on 1.5 But the template code from wasme between 1.5 and 1.6 is exactly the same. Seems too me that the ABI as slightly changed between 1.5 and 1.6 and that this is not reflected in the template code.

Sodman commented 4 years ago

We have e2e tests that run a "created for 1.5" filter against Istio 1.6.6 deploying via operator without issues. I also just tried out both Istio 1.6.7 and 1.6.8 with the boilerplate c++ header example generated in wasme 0.0.26, using the wasme deploy cli and it worked ok too. It doesn't look like the on_configure method signature has changed from 1.5->1.6 so I'm not sure how that's appearing in your logs.

Do you want to try my filter in your environment and see if that works? This is just an instance of the example c++ filter I created with wasme 0.0.26. I deployed it against the example "bookinfo" Istio app.

wasme deploy istio webassemblyhub.io/sodman/istio-cpp-wasme-26:v0.1 --id=myfilter --namespace bookinfo --config="{'name':'test', 'value': 'value'}"
Sodman commented 4 years ago

Closing this issue as stale, let me know if you're still seeing issues and we can re-open.