wasmCloud/examples

tiny example not working out for me - not sure why.

gedw99 opened this issue · 6 comments

Hey

Just trying out the tiny example.

please let me knwo what i screwed up:

REPO_NAME=examples

BIN_RUNNER_NAME=wash

print:
	clear
	@echo '$(BIN_RUNNER_NAME):         $(shell which wash)'

dep-git:
	# https://github.com/wasmCloud/examples
	git clone git@github.com:wasmCloud/examples.git
	@echo $(REPO_NAME) >> .gitignore

dep-brew:
	# https://github.com/wasmcloud/wash
	brew tap wasmcloud/wasmcloud
	brew install wasmcloud wash

wash-up:
	# https://wasmcloud.dev/overview/installation/
	wash up
	# uses /Users/apple/.wash
	# starts nats server on  127.0.0.1:4222
	# starts dashboard at: http://localhost:4000

export WASMCLOUD_CLUSTER_SEED=SCACMULU34W5XBQCLELIWRUAATABTKOAHQJIXEBBMONZOQKF7W6R7WHOO4
build:
	@echo 'WASMCLOUD_CLUSTER_SEED:          $(WASMCLOUD_CLUSTER_SEED)'
	cd $(REPO_NAME)/actor/kvcounter-tinygo && $(MAKE) provider
	cd $(REPO_NAME)/actor/kvcounter-tinygo && $(MAKE) link

run:
	# push the signed wasm to your OCI registry
	cd $(REPO_NAME)/actor/kvcounter-tinygo && $(MAKE) push
	# start the actor
	cd $(REPO_NAME)/actor/kvcounter-tinygo && $(MAKE) start


	
	

wash up:

make wash-up 
🏃 Running in interactive mode, your host is running at http://localhost:4000
🚪 Press `CTRL+c` at any time to exit
11:05:26.268 [info] Wrote "./host_config.json"
11:05:26.270 [info] Wrote "/Users/apple/.wash/host_config.json"
11:05:26.270 [info] Connecting to control interface NATS without authentication
11:05:26.270 [info] Connecting to lattice rpc NATS without authentication
11:05:26.271 [info] Host NCMCPMSED4DEV5DCYOLP7ABZSR72FOVIJICSL3MI2FLOJEBAZFDXPQQ5 (rough-hamster-9447) started.
11:05:26.272 [info] Valid cluster signers: CC34SNGG4X3RBU7NHQN2RHODUAIXP7QGSWTY7VS43VHFVLEH2W5ZYVMU
11:05:26.272 [warning] WARNING. You are using an ad hoc generated cluster seed.
For any other host or CLI tool to communicate with this host,
you MUST copy the following seed key and use it as the value
of the WASMCLOUD_CLUSTER_SEED environment variable:

SCACMULU34W5XBQCLELIWRUAATABTKOAHQJIXEBBMONZOQKF7W6R7WHOO4

You must also ensure the following cluster signer is in the list of valid
signers for any new host you start:

CC34SNGG4X3RBU7NHQN2RHODUAIXP7QGSWTY7VS43VHFVLEH2W5ZYVMU


11:05:26.293 [info] Started wasmCloud OTP Host Runtime
11:05:26.306 [info] Running WasmcloudHostWeb.Endpoint with cowboy 2.9.0 at 0.0.0.0:4000 (http)
11:05:26.315 [info] Access WasmcloudHostWeb.Endpoint at http://localhost:4000
11:05:26.395 [info] Lattice cache stream created or verified as existing (0 consumers).
11:05:26.395 [info] Attempting to create ephemeral consumer (cache loader)
11:05:26.396 [info] Created ephemeral consumer for lattice cache loader
11:05:28.831 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Tue, 29 Nov 2022 17:25:53 GMT.
11:05:30.404 [info] Tzdata has updated the release from 2021e to 2022g
11:05:41.689 request_id=FzADte8NAcinqhQAAAAB [info] GET /
11:05:41.724 request_id=FzADte8NAcinqhQAAAAB [info] Sent 200 in 35ms
11:05:42.599 [info] CONNECTED TO Phoenix.LiveView.Socket in 48µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "IBc1NDgSNRohIBpHKRkbXlsfcDECfxohaCGVJxmlThJrQCv87HGxWGoh", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}
11:05:59.101 request_id=FzADufzqJFcocLEAAADB [info] GET /metrics
11:05:59.107 request_id=FzADufzqJFcocLEAAADB [info] Sent 200 in 5ms
11:05:59.594 [info] CONNECTED TO Phoenix.LiveView.Socket in 32µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "HjEYBBUGHT43GBZfIgkUMBYCDmQTTAxk_ejfglEHBPFjZSyVzU9-Fty-", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}
11:06:00.214 request_id=FzADuj81Vr8q4MEAAAEB [info] GET /
11:06:00.216 request_id=FzADuj81Vr8q4MEAAAEB [info] Sent 200 in 2ms
11:06:00.525 [info] CONNECTED TO Phoenix.LiveView.Socket in 38µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "KxgRCTwsAAYlGmVFCjIcIj0kYzxmTkF9jLckNFXpPR5prhqDQsTu3v44", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}
11:06:23.647 request_id=FzADv7P8TLXulcUAAAGB [info] GET /metrics
11:06:23.651 request_id=FzADv7P8TLXulcUAAAGB [info] Sent 200 in 3ms
11:06:23.980 [info] CONNECTED TO Phoenix.LiveView.Socket in 35µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "BTwLOgQLMU8fHx0ATQUVOR0BWQEndUILDhyXvai9jWM55_x_qVnHrM7B", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}
11:06:33.895 request_id=FzADwhbHwL-slb8AAABi [info] GET /
11:06:33.897 request_id=FzADwhbHwL-slb8AAABi [info] Sent 200 in 1ms
11:06:34.191 [info] CONNECTED TO Phoenix.LiveView.Socket in 32µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "KgQ6EUtaDzQNJAZYCCA0MjQ4cisbfgN5kPHs90WBxlVmpzYTXoEbNFv0", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}
11:11:32.532 [info] Starting executable capability provider at  '/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/wasmcloudcache/VAG3QITQQ2ODAOWB5TTQSDJ53XK3SHBEIFNK4AYJ5RKAX2UNSCAPHA5M/1646188953/wasmcloud_httpserver_default'
Starting capability provider VAG3QITQQ2ODAOWB5TTQSDJ53XK3SHBEIFNK4AYJ5RKAX2UNSCAPHA5M instance 237d2344-0c92-4211-ab67-483d717402c7 with nats url 127.0.0.1:4222
11:12:45.356 request_id=FzAEGJOTO8NXOgkAAAJh [info] GET /
11:12:45.358 request_id=FzAEGJOTO8NXOgkAAAJh [info] Sent 200 in 2ms
11:12:45.880 [info] CONNECTED TO Phoenix.LiveView.Socket in 209µs
  Transport: :websocket
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "KTkFDBw9NB4fCmcMDywbBQUiBCxnbQwnhmwnnWlhjB79wvvciu3e2Uyn", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app-b30c30308bb8d054f4ebf7e99d3451a2.css?vsn=d", "1" => "http://localhost:4000/assets/app-8aff8950ba1f64d0c655a939a12ab094.js?vsn=d"}, "vsn" => "2.0.0"}

build:

make build
WASMCLOUD_CLUSTER_SEED:          SCACMULU34W5XBQCLELIWRUAATABTKOAHQJIXEBBMONZOQKF7W6R7WHOO4
cd examples/actor/kvcounter-tinygo && /Applications/Xcode.app/Contents/Developer/usr/bin/make provider
wash ctl start provider wasmcloud.azurecr.io/httpserver:0.15.0

No suitable hosts found for provider wasmcloud.azurecr.io/httpserver:0.15.0

run:

make run
# push the signed wasm to your OCI registry
cd examples/actor/kvcounter-tinygo && /Applications/Xcode.app/Contents/Developer/usr/bin/make push
wash claims sign build/kvcounter_tinygo.wasm --destination build/kvcounter_tinygo_s.wasm --name kvcounter-tinygo --http_server --keyvalue -v 0.1.0

Wasm Element error: Unknown opcode 252
make[1]: *** [build/kvcounter_tinygo_s.wasm] Error 1
make: *** [run] Error 2

The unknown opcode error comes from tinygo producing a webassembly binary that has a newer binary format than the host expects.

I can't tell from the logs (I'm on a phone atm), but which version of wash are you running? We fixed this issue in a transitive dependency recently.

tinygo version
tinygo version 0.26.0 darwin/amd64 (using go version go1.19.4 and LLVM version 14.0.0)

wash --version
wash 0.13.0

At this time, you will need to use <=TinyGo 0.23.0 and go.1.18.8 for actor development. Those are the most recent versions of things I have gotten everything to work with.

If you are in Slack, here is a thread where I test all the versions

https://wasmcloud.slack.com/archives/C02LZ3L0X4H/p1668105687175139

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!