Giter Club home page Giter Club logo

dapr-wasm's People

Contributors

2019zhou avatar alabulei1 avatar chenyukang avatar juntao avatar katopz avatar kenvifire avatar marviniter avatar tpmccallum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dapr-wasm's Issues

Error: error getting topics from app - unexpected end of JSON input - error occurred while beginning pubsub messages

Hi,

I am performing the grayscale tutorial example i.e. make run-api-rs the following error is occurring.

ERRO[0000] error getting topics from app: unexpected end of JSON input  app_id=image-api-rs instance=wasm-oci-demo scope=dapr.runtime type=log ver=1.4.2
ERRO[0000] error occurred while beginning pubsub messages: error getting topics from app: unexpected end of JSON input  app_id=image-api-rs instance=wasm-oci-demo scope=dapr.runtime type=log ver=1.4.2
INFO[0000] dapr initialized. Status: Running. Init Elapsed 9.416037000000001ms  app_id=image-api-rs instance=wasm-oci-demo scope=dapr.runtime type=log ver=1.4.2

The following video (which starts just as the error occurs) demonstrates the above error in action.

https://youtu.be/A5EhO7cNTCw?t=392

It seems that dapr list is displaying the correct output (in terms of apps, ports etc.)

wasmedge@wasm-oci-demo:~$ dapr list
  APP ID        HTTP PORT  GRPC PORT  APP PORT  COMMAND               AGE  CREATED              PID     
  go-web-port   3500       40659      8080      ./web-port            36s  2021-10-05 02:38.25  334410  
  image-api-rs  3502       34493      9004      ./target/debug/im...  23s  2021-10-05 02:38.38  334530  
  image-api-go  3501       40639      9003      ./image-api-go        9s   2021-10-05 02:38.52  334658 

Is it possible that the grayscale needs to be added to the config i.e. https://github.com/second-state/dapr-wasm/blob/main/config/conf.json

Any suggestions would be greatly appreciated.

Thanks
Tim

Image formats

The grayscale service only supports the GIF and PNG formats. But the classify service only supports the JPG format. Can we make them consistent?

Perhaps supports JPGs by default in both services? Thanks.

GitHub Pages

I have configured GitHub Pages to serve from the main branch's root directory. So, our static web page is now available here:

https://second-state.github.io/dapr-wasm/web/

We do not actually need a GitHub Action for this. As soon as we update the main branch, it will be automatically deployed.

We could, however, to use GitHub Actions to copy just the /web folder to another branch (e.g., gh-pages) and then deploy the gh-pages branch as the web site's root.

Create WasmEdge HTTP server sidecars

We would like to create two sidecars that are just wasmedge or wasmedge-tensorflow-lite. Instead of using GO or Rust to implement HTTP servers and then bootstrap wasmedge, we would just run those wasmedge-based server apps in sidecars.

Sidecar #1: implement the grayscale function in Rust.

https://github.com/second-state/wasmedge_wasi_socket/tree/main/examples/http_server

Sidecar #2: implement the tensorflow function in JS

https://github.com/second-state/wasmedge-quickjs#http-request

https://github.com/second-state/wasmedge-quickjs#tensorflow

https://www.secondstate.io/articles/embed-javascript-in-rust/

After that, modify the web port to show all 4 sidecar apps.

[error] jpeg is invalid.

when i run the image-api-go upload hotdog.jpeg,but return == APP == [xxx] [error] jpeg is invalid.

make run-api-wasi-socket-rs error with Mismatched function type

make run-api-wasi-socket-rs error log:

== APP == [2021-12-29 11:44:31.136] [error] instantiation failed: incompatible import type, Code: 0x61
== APP == [2021-12-29 11:44:31.136] [error]     Mismatched function type. Expected: FuncType {params{i32 , i32 , i32} returns{i32}} , Got: FuncType {params{i32 , i32} returns{i32}}
== APP == [2021-12-29 11:44:31.136] [error]     When linking module: "wasi_snapshot_preview1" , function name: "sock_accept"
== APP == [2021-12-29 11:44:31.136] [error]     At AST node: import description
== APP == [2021-12-29 11:44:31.136] [error]     At AST node: import section
== APP == [2021-12-29 11:44:31.136] [error]     At AST node: module

Create a customized WasmEdge for dapr

The WasmEdge GO SDK allows developers to register host functions to the runtime, and create a customized version of WasmEdge that includes the host functions.

We should add Dapr GO SDK functions into a customized version of WasmEdge.

We should then create Rust APIs for those Dapr host functions so that WasmEdge app developers can use them.

It seems that memory leak occurs when image-api-go is called.

I replace the web-port imageHandler func with the following code, to make it easier to observe(making more requests on one click). The memory usage of image-api-go is keeping growing when click classify.

type mock struct {}

func (m *mock)WriteHeader(statusCode int) {
}

func (m *mock)Header() http.Header {
	return nil
}
func (m *mock)Write(b []byte) (int, error) {
	return len(b), nil
}

func imageHandler(w http.ResponseWriter, r *http.Request) {
	println("imageHandler ....")
	body, err := ioutil.ReadAll(r.Body)

	if err != nil {
		println("error: ", err.Error())
		panic(err)
	}
	api := r.Header.Get("api")
	if api == "go" {
		daprClientSend(body, w)
		for i:=0;i<10;i++ {
			go func() {
				for i:=0;i<10;i++ {
					daprClientSend(body, &mock{})
				}
			}()
		}
	} else {
		httpClientSend(body, w)
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.