Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chris Andre
    @ChristopherAndre
    Also, I am trying to run sbt test from the CLI and am getting java.lang.OutOfMemoryError: Metaspace messages: is it normal?
    Marcel Lanz
    @marcellanz
    Welcome @ChristopherAndre :-)
    regarding "gRPC interface for 3rd party languages" what are you interested about?
    Chris Andre
    @ChristopherAndre
    In a nutshell, how do I create an interface for another language? Looks like there is a whole protocol around that but am not sure where to find the most up-to-date documentation around it
    Also, has anyone thought of doing a presentation on it (I mean apart from the youtube vids on cloudstate.io)?
    Marcel Lanz
    @marcellanz

    Thats correct. Cloudstate User Support Libraries do implement the Cloudstate Protocol defined through protocol buffers.
    You can find information about it here, where you can find the protobuf files.
    https://github.com/cloudstateio/cloudstate/tree/master/protocols
    and also here in more general terms
    https://cloudstate.io/docs/developer/language-support/index.html

    There is also a Starter Repository for Python currently at
    https://github.com/marcellanz/cloudstate_python-support/tree/feature/python-support
    which explains the first steps to get started, with python in this case.

    Marcel Lanz
    @marcellanz

    ... to get started I recommend to read the README.md of the project:
    https://github.com/cloudstateio/cloudstate/blob/master/README.md

    and especially this section, which describes the expected behaviour: https://github.com/cloudstateio/cloudstate/blob/master/README.md#common-intermediate-representation

    then the protobuf files itself, as they describe what the (gRPC) services are expected to do and also which messages exist. Then, reading the existing implementations can help to understand semantics of the protocol.

    to support an implementation effort, there is a TCK that runs a "shopping cart" example and validates an implementation. As far asI know, there is no tutorial yet.
    When it comes to a "tutorial" I'd say, the Starter Repo for Python explains how to get started and even provides a starter implementation.
    Chris Andre
    @ChristopherAndre
    Awesome! Thanks!
    Marcel Lanz
    @marcellanz
    You are most welcome @ChristopherAndre.
    Chris Andre
    @ChristopherAndre
    @marcellanz I took a look at what you sent me and I have to admit the folder organization is not clear to me. Can you please confirm my understanding?
    • the content of example, as the name indicates, seems to be the protobuf base for the shopping-cart TCK validation.
    • the content of frontend seems to be used for JSON communication (probably with front-end apps... thus the name).
    • the content of protocol is the base of the gRPC server used for interacting with the proxy.
    • the content of proxy seems to be the gRPC interface exposed by the proxy to communicate with its clients.
    Viktor Klang (√)
    @viktorklang
    @ChristopherAndre example => is for implementing the example application, which is also used by the TCK for third-party language (and proxy implementation) validation
    frontend is what is used by developers of services when they define their proto interfaces
    protocol is the protocol between the proxy and what we call a Language Support, i.e. a bridge library which speaks with the proxy and exposes a native API for some programming language
    proxy contains the protocols which the proxy itself speaks with the outside world.
    Chris Andre
    @ChristopherAndre
    πŸ‘Thanks for the explanations, @viktorklang
    Chris Andre
    @ChristopherAndre
    Created a PR to add this precious piece of info to the doc: cloudstateio/cloudstate#157
    Jonathan Nagy
    @nagytech

    @ChristopherAndre I've done a csharp implementation recently which I've kind of done. (ie. I haven't actually touched the TCK, and I've had to muck around with a lot of gRPC and Protobuf internals to make it work). While I've tried to stay very close to the Scala/Java APIs, I've had to adapt some things idiopathically. So, not saying it's the perfect example of how to implement another language, but it might help you see something that was done in a bit of isolation.

    @marcellanz I didn't notice there was a starter kit for Python, that really helps - especially the TCK integration. I might have a crack at using it, then it would help me for using TCK on csharp. Thanks!

    Chris Andre
    @ChristopherAndre
    @nagytech Is https://github.com/nagytech/cloudstate-csharp your c# implementation you're talking about? If so, I'll take a look shortly.
    Jonathan Nagy
    @nagytech
    Ah, yes. Sorry - I completely forgot to link it. :)
    Viktor Klang (√)
    @viktorklang
    Thanks @ChristopherAndre!
    domschoen
    @domschoen
    I'm trying to run a second entity on my minikube but It cannot be scheduled du to 1 Insufficient cpu. I don't understand the source of this limitation. Could you help me ?
    Jonathan Nagy
    @nagytech
    @domschoen I had a similar issue, but it was a memory limitation. From my recollection, I think I solved it by increasing the total memory of the Minikube instance to 16GB (which required creating a new one).
    Viktor Klang (√)
    @viktorklang
    "mini"-kube
    domschoen
    @domschoen
    @nagytech You're right. thanks. In fact, I increased the memory to 16GB but I had also to increase the cpu from 2 to 6 (and that cpu increase was effective only if increase the memory). Anyway that's the the command I used now to start my minikube: minikube start --vm-driver=hyperkit --memory 16384 --cpus 6
    Viktor Klang (√)
    @viktorklang
    Hey all, I just opened a draft PR with a new take on the Eventing feature, which will allow to configure any endpoint to also store its replies in a topic of choice, so HTTP and gRPC requests could also trigger other endpoints to execute if they listen to the output topic of that endpoint. https://github.com/cloudstateio/cloudstate/pull/158/files
    domschoen
    @domschoen

    I'm trying the forward and first I create a reference on the service I would like to forward to like this:

    ServiceCallRef<Ssm.SessionSetup> sessionCreationRef =
        ctx.serviceCallFactory()
            .lookup("com.example.ssm.SSM", "CreateSession", Ssm.SessionSetup.class);

    but there is something wrong with the service name (first argument of the lookup above) because I got this error in the user-container log:

    java.util.NoSuchElementException: No service named com.example.ssm.SSM is being handled by this stateful service

    However the name looks like the right one as it is the one returned by grpc describe:

    grpcurl -plaintext 192.168.64.33:31894 describe
    com.example.ssm.SSM is a service:
    service SSM {
      rpc CreateSession ( .com.example.ssm.SessionSetup ) returns ( .com.example.ssm.SessionResponse ) {
    ...

    I did something wrong ? What could be the reason of this error ?

    Adriano Santos
    @sleipnir
    @viktorklang Cool, any doc or example of how to use? (end user view)
    Viktor Klang (√)
    @viktorklang
    Contributors' Call now!!
    domschoen
    @domschoen
    The lookup works if I lookup for my entity. In fact the CloudState object is created in the main but is not shared between entities. May be in standalone we don't have a proxy (?) so we cannot have more than one entity ?
    domschoen
    @domschoen
    OK it works if my 2 entities are in the same user function.
    domschoen
    @domschoen

    Regarding the forward, documentation says:

    It is the responsibility of the forwarded action to return a reply that matches the type of the original command handler

    but if I try to return something in my original command handler, I have an error: Both a reply was returned, and a forward message was sent, choose one or the other

    Is any way to return something in a command handler doing a forward ?

    Viktor Klang (√)
    @viktorklang
    @domschoen What would it mean?
    Jonathan Nagy
    @nagytech

    @domschoen I was working with this the other day and there are a few things that I found.

    1) As you found, forwarding only happens within the same user function. I think this limitation is meant to stress the importance that cross-domain operations should be event driven.

    2) You can't both reply AND forward. As the documentation states, you need to have the terminal command handler do the reply on behalf of the first command handler. And, that reply must match the type of the original handler.

    domschoen
    @domschoen
    @nagytech So for point 2), you noticed like me, that we cannot do what the documentation says. right ?
    Viktor Klang (√)
    @viktorklang

    I just merged this PR: cloudstateio/cloudstate#158

    Next steps is to add a reusable test suite so we can add more EventingSupport implementations down the line.

    Jonathan Nagy
    @nagytech
    @domschoen not sure what you mean. When I get home I’ll dig up the code that worked for me.
    Chris Andre
    @ChristopherAndre
    Almost the week-end (and available bandwidth to work on Cloudstate)!!!
    party
    Adriano Santos
    @sleipnir
    @ChristopherAndre Cool :)
    domschoen
    @domschoen

    About the forward, at the end, it works like a charm with only one limitation: forwarding only happens within the same user function.

    Let me give you what I did to finally get the return value in the original action: However the command handler method doing the forward in your entity return void:

    @CommandHandler
    public void createSessionWithDevice(..., CommandContext ctx) {
        ...
        ctx.forward(call);
    }

    in your protobuf, the command has a return type which is the same as the action you forward to:

    service Device {
        rpc CreateSessionWithDevice(SessionSetupWithDevice) returns (com.example.ssm.SessionResponse) {

    that's it !

    kerr
    @hepin1989
    how does cloudState related with https://statefun.io/overview/index.html?
    Viktor Klang (√)
    @viktorklang
    @hepin1989 What do you mean? Looking at: https://statefun.io/roadmap.html#non-jvm-languages-polyglot-functions it would seem like Cloudstate already offers what is currently in the future for Statefun.
    kerr
    @hepin1989
    That true, @viktorklang I mean statefun seems lacking far behind...
    Marcel Lanz
    @marcellanz
    @viktorklang I'm not participating at the contributors call today. No input from me this week.
    Viktor Klang (√)
    @viktorklang
    @marcellanz No worries! Looking forward to talking next time then :)
    Contributors' Call is in 15 minutes!
    Chris Andre
    @ChristopherAndre
    Thanks again for the explanations, @viktorklang !
    And sorry for running like I did!
    Viktor Klang (√)
    @viktorklang
    No worries, @ChristopherAndreβ€”glad having you on the call! :-)
    Chris Andre
    @ChristopherAndre
    And please let me know if you find the glossary I was talking about!
    Viktor Klang (√)
    @viktorklang
    :+1: