cloudstateio / cloudstate

Distributed State Management for Serverless
https://cloudstate.io
Apache License 2.0
762 stars 97 forks source link

Implement a way to run the proxy and test against it #318

Open jedahu opened 4 years ago

jedahu commented 4 years ago

Splitting out an implementation task from #150, which is about documentation.

Currently, there's no simple way to run the proxy locally, which means there's no way to run a stateful service locally and talk to it using its gRPC interface.

Of course, you can run minikube or something like that locally, but for development, you may want to run your function with a debugger, for example, so you want to run it on your host machine, not in a container.

-- @jroper

justinhj commented 4 years ago

Personally I've been using Docker to test local services. The following commands in separate terminals brings up the shopping cart.

docker run -it --rm --network mynetwork --name cloudstate -p 9000:9000 cloudstateio/cloudstate-proxy-dev-mode -Dcloudstate.proxy.user-function-port=8080 -Dcloudstate.proxy.user-function-interface=shopping-cart
docker run -it --rm --name shopping-cart --network mynetwork justinhj/shopping-cart

I then used Gatling with a grpc plugin to do load and integration testing, but this could easily use akka grpc instead. I also used grpcurl to manually test streaming functions since Gatling's grpc support does not support that yet.