solo-io / wasm

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

wasme import capability #191

Closed salrashid123 closed 4 years ago

salrashid123 commented 4 years ago

Is there anyway to import an compiled wasm similar to docker import?

I'v already setup and build the filter using the istio git repo direct (ref)

git clone --single-branch --branch  release-1.7 https://github.com/istio/envoy.git
bazel build examples/wasm:envoy_filter_http_wasm_example.wasm

i'd like to import the generated envoy_filter_http_wasm_example.wasm into wasme so that i can push to wasmhub and then use the CRD to deploy to a cluster

thanks

yuval-k commented 4 years ago

there is. you can use:

wasme build precompiled ...

this builds an image from a precompiled (.wasm) module

salrashid123 commented 4 years ago

thanks, that worked. I've got a different issue with deployment to istio 1.7.2 but i'll dig into it or file an issue


$ cat runtime-config.json 
{"type":"envoy_proxy","abiVersions":[],"config":{"rootIds":["my_root_id"]}}

wasme build precompiled /tmp/envoy_filter_http_wasm_example.wasm --tag webassemblyhub.io/salrashid123/add-header:latest --config runtime-config.json
wasme push webassemblyhub.io/salrashid123/add-header:latest

$ wasme deploy istio webassemblyhub.io/salrashid123/add-header:latest   --id=myfilter    --namespace=default   \
   --config '{"name": "plugin configuration","value": "some value"}'   --labels app=httpbin,version=v1
INFO[0000] cache namespace already exists                cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
INFO[0000] cache configmap already exists                cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
INFO[0000] cache service account already exists          cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
INFO[0000] cache role created                            cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
INFO[0000] cache rolebinding created                     cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
INFO[0000] cache daemonset updated                       cache=wasme-cache.wasme image="quay.io/solo-io/wasme:0.0.20"
WARN[0004] no ABI Version found for image, skipping ABI version check  image="webassemblyhub.io/salrashid123/add-header:latest"
INFO[0005] added image to cache config...                cache="{wasme-cache wasme}" image="webassemblyhub.io/salrashid123/add-header:latest"
INFO[0005] waiting for event with timeout 1m0s          
WARN[0006] event err: expected 3 image-ready events for image webassemblyhub.io/salrashid123/add-header:latest, only found 0 
...
...
WARN[0064] event err: expected 3 image-ready events for image webassemblyhub.io/salrashid123/add-header:latest, only found 102 
Error: adding image to cache: waiting for cache to publish event for image: timed out after 1m0s (last err: expected 3 image-ready events for image webassemblyhub.io/salrashid123/add-header:latest, only found 102)