Giter VIP home page Giter VIP logo

Comments (16)

olaan avatar olaan commented on August 30, 2024

My apologies - there was a typo in my previous comment which I have amended it below.

Also, make sure you include the backslashes () - they are significant - and the addresses should be the actual addresses, so change them when necessary.

In notebook:

CALVIN_GLOBAL_STORAGE_TYPE=\"local\" csruntime --host 192.168.1.36 --name calvin-2

In raspberry:

CALVIN_GLOBAL_STORAGE_TYPE=\"proxy\" CALVIN_GLOBAL_STORAGE_PROXY=\"calvinip://192.168.1.36:5000\" csruntime --host 192.168.1.37 --name calvin-1

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

This works well now. The bad thing is that he does not let me migrate actors between calvin-1 and calvin-2. Apparently it does not recognize as if both ran on the same network.
What I did was in addition to these execution times, lift (without configuring proxi) 1 more in my notebook with the ip she and another in the Raspberry. The result of them was the same, 'Did not receive reply for msg id within 5 seconds'. No matter if calvin-1 and calvin-2 were running.

from calvin-base.

olaan avatar olaan commented on August 30, 2024

I'm not quite sure what the problem is here. Could you give some more details?

What does the application look like, which actor is it you are migrating, and how are you doing the migration? Also, make sure the runtimes have found each other (if you are using the GUI then there should be two items in the drop-down list to the far right (just above the capability list.)

Cheers.

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

Sorry maybe I was not very explicit.
I raise a running time on my Raspberry:
CALVIN_GLOBAL_STORAGE_TYPE="local" csruntime --host 10.0.0.128 --name calvin-1

With the bars (), only when I mention it disappear from the forum text
In my notebook:
CALVIN_GLOBAL_STORAGE_TYPE="proxy"CALVIN_GLOBAL_STORAGE_PROXY="calvinip://10.0.0.128:5001" csruntime --host 10.0.0.126 --name calvin-2

With the bars (), only when I mention it disappear from the forum text

My runtime calvin-1 in my raspberry does not see the calvin-2 runtime of my notebook
image
Therefore I can not migrate actors between them either.
The GUI of my notebook only shows the calvin-1 runtime:
image

At the same time I run on my notebook:
csruntime --host 10.0.0.126 --port 5002 --controlport 5003 --name example-1

In my raspberry:

csruntime --host 10.0.0.126 --port 5002 --controlport 5003 --name example-2

So in these times of execution, in both, these messages('Did not received reply for msg id within 5 seconds') are constantly generated, which do not leave me or show the output of my application, but in their GUI if I can migrate actors between both runtimes

Notebook runtime example-1:
image

Raspberry runtime example-2:
image

The actors can migrate but in the console the error message does not stop printing : 'Did not received reply for msg id within 5 seconds'

Thank you!!!!!

from calvin-base.

olaan avatar olaan commented on August 30, 2024

I do not know you cannot use the standard registry (it seems the runtimes cannot message each other) but hopefully the following should make it possible to allow migration using the proxy-registry.

First, the port used for calvinip is the one entered after --port when starting a runtime, and it defaults to 5000. You have entered 5001 here, and I think this is why the runtimes cannot find each other.

Second, in order to simplify your command lines, add the configuration to your ´calvin.conf`.

On your raspberry, add this to your configuration file:

    "global": {
        "storage_type": "local"
    }

and this to the configuration file on your notebook (the address should be the address of your raspberry - if it changes you need to update it.):

    "global": {
        "storage_type": "proxy",
        "storage_proxy": "calvinip://10.0.0.128:5000"
    }

This way you do not have to enter all this information on the command line every time, and hopefully the runtimes should now find each other.

If you do not have a configuration file, add { and } before and after the above.

Cheers

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

In calvin/examples/ui_in_gui modify my calvin.conf exactly as your indications:

" global " : {
" storage_type " : " local "
}

For my Raspberry, And:

" global " : {
     " storage_type " : " proxy " ,
     " storage_proxy " : " calvinip: //ip-raspberry: 5000 " 
}

For my Notebook.

Then, I executed in cd /home/user/calvin-base-develop/calvin/examples/ui_in_gui :

In Raspberry: csruntime --host Ip-raspberry --port 5000 --controlport 5001 --name calvin-1
In Notebook: csruntime --host Ip-notebook --name calvin-2

Now the message 'Did not received reply for msg id within 5 seconds' does not print. But both execution times still do not meet each other.

from calvin-base.

persquare avatar persquare commented on August 30, 2024

Please make sure you don't actually have the extra whitespace in your config file. What you show above:

" global " : {
     " storage_type " : " proxy " ,
     " storage_proxy " : " calvinip: //ip-raspberry: 5000 " 
}

is not the same as:

"global" : {
     "storage_type" : "proxy",
     "storage_proxy" : "calvinip://ip-raspberry:5000" 
} 

Never add whitespace inside the quotation marks.

Hope that helps.

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

I removed the spaces and both execution times were found as seen in the images below. However, when I try, for example, to migrate a "print" actor from the Raspberry to the Notebook by selecting the actor print and changing the runtime at the bottom of the GUI, the amigration is not performed, since I do not see the print value of the actor print in the runtime console of my Notebook.
1

2

3

4

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

Sorry, I do not know if I express myself correctly. Maybe he did not understand the problem now. And sorry to insist. I just got stuck in this step and I can not advance in my application.

from calvin-base.

persquare avatar persquare commented on August 30, 2024

Sorry for the delay, been offline for a week.

Looking at the terminal window in the 3rd screenshot above, it looks like you started the notebook runtime from the ui_in_gui example directory. The config file in that directory will redirect io.Print to the mock gui output, instead of the terminal you are looking at in the screenshot.

Try restarting your setup as before, but this time start the notebook runtime from the top (calvin-base) directory and examine the printout from the notebook runtime. Somewhere in the list you should find

Capability 'io.stdout' registered with module 'term.StandardOut'

instead of

Capability 'io.stdout' registered with module 'ui.StandardOut'

that you are (probably) seeing right now (can't tell from the screenshot)

If it says 'term.StandardOut' then you should get the output from the migrated actor in the (real) console.

Good luck!

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

Great, that was effectively.
One more question, there is a way for an actor to migrate on his own. Either by the evaluation of an expression. Without having to migrate it myself from the bottom of the GUI?

from calvin-base.

persquare avatar persquare commented on August 30, 2024

Glad to hear you got further!

There are a number of ways to make actors migrate, the preferred way is to use "deployment rules", see
https://github.com/EricssonResearch/calvin-base/wiki/Application-Deployment-Requirement#application-deployment-requirements-in-calvinscripts

It does however require that you create a calvinscript file for your application rather than using the GUI. To get you started, use the "Project-->Show" menu to display the calvinscript you have in the GUI, and copy-paste that into a file. It should look something like:

classicdelay1: std.ClassicDelay(delay=1)
constant2: std.Constant(data="Hola mundo!")
print3: io.Print()

constant2.token > classicdelay1.token
classicdelay1.token > print3.token

An example of using rules:
Let's say that you want the print actor to automatically migrate to your notebook (named calvin-2) when the application starts. If you add the following line to your script:

apply print3 : runtime_name(name="calvin-2")

The whole script should look something like:

classicdelay1: std.ClassicDelay(delay=1)
constant2: std.Constant(data="Hola mundo!")
print3: io.Print()

constant2.token > classicdelay1.token
classicdelay1.token > print3.token

apply print3 : runtime_name(name="calvin-2")

Save the script in file, for example my-app.calvin

Now, once you have started your runtimes (calvin-1 and calvin-2), start you script using the following command:

cscontrol http://Ip-raspberry:5001 deploy my-app.calvin

where you must replace Ip-raspberry with the actual ip-number of your raspberryPi.

Good luck!
/Per

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

Hello!

where should I run "cscontrol http://Ip-raspberry:5001 deploy my-app.calvin", on the notebook or raspberry? And with configuration file?

from calvin-base.

persquare avatar persquare commented on August 30, 2024

Just keep the system (config files) as is (you had a working system, right?).

You can run the above command on either one, it doesn't matter. The address after 'cscontrol' determines which of your runtimes will handle the deployment, but the end result should be the same.

Good luck!

from calvin-base.

Tatiana-runco avatar Tatiana-runco commented on August 30, 2024

@olaan @persquare

I work perfectly! Thank you very much for your help, they always answered my questions and that allowed me to keep moving forward. I was able to finish my final career project. I am very satisfied with Calvin and grateful for his help. THANK YOU!

from calvin-base.

olaan avatar olaan commented on August 30, 2024

You are most welcome!

Thank you and good luck with your future projects.

Cheers

from calvin-base.

Related Issues (20)

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.