Closed Tatiana-runco closed 5 years ago
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
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.
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.
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 Therefore I can not migrate actors between them either. The GUI of my notebook only shows the calvin-1 runtime:
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:
Raspberry runtime example-2:
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!!!!!
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
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.
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.
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.
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.
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!
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?
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
Hello!
where should I run "cscontrol http://Ip-raspberry:5001 deploy my-app.calvin", on the notebook or raspberry? And with configuration file?
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!
@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!
You are most welcome!
Thank you and good luck with your future projects.
Cheers
Hello For quite some time now I have had a problem with my execution times. I run on my notebook a running time csruntime --host 192.168.1.41 --name calvin-notebook and another one on my Raspberry (both connected to the same Wi-Fi network) csruntime --host 192.168.1.35 --name calvin- raspberry. Clarification: I do not execute other times of execution, only them. But no matter what I always do on both consoles (notebook and raspberry) messages are printed repeatedly and unfinished: 'Did not receive reply for msg id within 5 seconds'.
Discussing with @olaan , he told me to do the following
"Use the proxy registry by starting the execution times in this way:
In your notebook:
CALVIN_STORAGE_TYPE=\"local\" csruntime --host 192.168.1.41 --name calvin-2 In the raspberry:
CALVIN_STORAGE_TYPE=\"proxy\" CALVIN_STORAGE_PROXY=\"calvinip://192.168.1.41:5000\" csruntime --host 192.168.1.35 --name calvin-1
https://github.com/EricssonResearch/calvin-base/issues/102
In this case I can see both execution times in the GUI of each one and I can migrate actors between both. However, the message 'Did not receive reply for msg id within 5 seconds' does not stop printing on both consoles. error-notebook.txt
error-raspberry.txt
It should be noted that the ip changed to 192.168.1.36 (notebook) and 192.168.1.37 (Raspberry)
Can someone please help me with this? Thank you!