Giter Site home page Giter Site logo

ericssonresearch / calvin-base Goto Github PK

View Code? Open in Web Editor NEW
282.0 48.0 93.0 10.11 MB

Calvin is an application environment that lets things talk to things, among other things.

License: Apache License 2.0

Python 95.86% HTML 0.72% JavaScript 2.28% Shell 1.08% CSS 0.02% Makefile 0.02% Dockerfile 0.02%
iot actor-model calvin actors ericsson dataflow-programming internet-of-things

calvin-base's People

Contributors

alexandernajafi avatar brunodonassolo avatar corn3liuz avatar fswensson avatar haraldgustafsson avatar jerkeby avatar joakimp avatar jvandalfsen avatar lindskogniklas avatar persquare avatar pskarin avatar pstahl avatar stefanalund avatar tha-robert avatar tomasnilsson 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  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

calvin-base's Issues

Deploying an application based on requirements needed by actors

Have been trying to figure out how to deploy an application based on the requirements (for capabilities) of the actors in the application. From what I have figured out it seems like there is a possibility for distributed deployment of actors using cscontrol with a json script. However, the examples are all based on requirements on the runtime such as the name of the runtime or its owner and not the sort of requirements that maps to its capabilities in terms of running an actor. What I would like to do is to query the runtime for its capabilities and use the results from that query as a rule in the json script. Is this possible in the current develop branch or do you recommend a work around where I keep track of the capabilities manually by making sure to deploy only on the runtimes where the required capabilities are provided.

Thanks in advance!

Replication of components is not working

I tested replication of a component across multiple runtimes as part of en experiment trying to automatically cover an area with sensors. The problem is that a component in this context should be seen as an atomic unit, but the deployer treats it as a "sub-graph".

I've boiled the example down to the following code:

component Filter() token -> token {
    left: std.Identity()
    right: std.Identity()

    .token > left.token
    left.token > right.token
    right.token > .token
}

src : std.CountTimer()
filter : Filter()
collect : flow.Collect()
log : io.Print()

src.integer > filter.token
filter.token > collect.token
collect.token > log.token

apply filter : device_scaling(max=4)

and looking at the actual outcome of the deployment using csweb I get the picture below, where the cross-component-instance connections token > token from left to right are in error, there should only be a connection left.token > right.token in each component instance.
screen shot 2017-08-31 at 15 15 57

Calvin installation errors: modules missing and failed to initialize libdc1394

I have a fresh installation Calvin and try to run the Philips Hue example. But I ran into the following problems. I have similar problems with missing modules in other installation as well. Please suggest how I can fix them.

root@7637100d6eec:/calvin-base/calvin/examples/hue# csruntime --host localhost FlashingStopLight.calvin
2017-07-02 23:09:04,934 INFO 336-calvin.calvin.runtime.north.certificate_authority.certificate_authority: init, _sec_conf=None
2017-07-02 23:09:04,935 INFO 336-calvin.calvin.runtime.north.authentication.authentication: Missing or incomplete security config
2017-07-02 23:09:04,942 INFO 336-calvin.calvin.runtime.north.storage: #### STORAGE TYPE dht ####
2017-07-02 23:09:05,074 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.web.twitter' not available: No module named tweepy
2017-07-02 23:09:05,076 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.opcua.server' not available: No module named opcua
2017-07-02 23:09:05,077 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.kubectl' not available: cannot import name kubectl
2017-07-02 23:09:05,082 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.distance' not available: cannot import name distance
2017-07-02 23:09:05,083 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.rotary_encoder' not available: cannot import name rotary_encoder
libdc1394 error: Failed to initialize libdc1394
2017-07-02 23:09:05,210 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.media.image' not available: No module named PIL
2017-07-02 23:09:05,213 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.opcua.client' not available: No module named opcua
2017-07-02 23:09:05,214 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.rfid' not available: cannot import name rfid
2017-07-02 23:09:05,215 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.environmental' not available: cannot import name environmental
2017-07-02 23:09:05,216 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.media.mediaplayer' not available: No module named PIL
2017-07-02 23:09:05,218 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.charts.chart_handler' not available: cannot import name chart
2017-07-02 23:09:05,218 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.sensors.enclosure' not available: cannot import name enclosure
2017-07-02 23:09:05,220 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.io.gpiohandler' not available: cannot import name gpiopin
2017-07-02 23:09:05,221 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.network.mqtthandler' not available: cannot import name mqtt
2017-07-02 23:09:05,222 INFO 336-calvin.calvin.calvinsys: Module 'calvinsys.media.camerahandler' not available: No module named PIL
2017-07-02 23:09:05,288 INFO 336-calvin.calvin.runtime.north.calvincontrol: Control API trying to listening on: localhost:5001
2017-07-02 23:09:05,534 INFO 336-calvin.calvin.calvinsys.network.httpclienthandler: Started HTTPClientHandler
DEPLOY STATUS 200, OK
Deployed application 93dee86e-cbd9-42f1-9c46-5114bceeac03
2017-07-02 23:09:07,699 INFO 336-calvin.calvin.runtime.north.calvin_node: Quitting node "['calvinip://localhost:5000']"

web3 integration

Hello Everyone!
My team and I are working on getting Calvin to interact with smartcontracts, but this requires the use of web3.py which can only be used on python3.x. As calvin is developed on python 2.x, what is the best way for us to try and integrate?

It feels like a daunting task to rewrite all of the web3 framework to work on python2. My other thought is calling python3 scripts and getting results with the use of:

from subprocess import call
result = call(“python3 python3code.py”)

Is this the best way to go about it or has someone else run into the python versioning issue before and found a more elegant way to resolve this?

Thanks everyone!
Aziel

actortest with no arguments gives a host of strange errors

Running actorstest in e.g. the root of the Calvin project gives a wide range of strange error messages.

Maybe a check to ensure it really is an actor before trying to import/execute the tests? Could check against name of actor and filename for example.

Hierarchical parsing of config files

Something that would be very useful is hierarchical parsing of config files. Consider the following example:

I'm working on an application in some project directory and as part of that project I need to develop a couple of new actors. Since they are not quite ready for the world yet, I'd like to keep them in a separate directory with my application.

Now, my env is setup using a config file in my home dir, but with hierarchical parsing of config files I would be able to augment (i.e. append not overwrite) the actor search paths with my local actor dir by placing a config file in my project directory with the following content:

Global]
actor_paths=["/path/to/this/dir"]

The actorstore would now search for actors in that directory in addition to the standard setup.

error: pyasn1 0.1.9 is installed but pyasn1<0.5.0,>=0.4.1 is required by set(['pyasn1-modules'])

When I type in my console (ubuntu 16.04 lts) "python setup.py install" the file that belongs to the folder that is downloaded from calvin-base (https://github.com/EricssonResearch/calvin-base/tree/develop/extras/install#debian-based-systems-manual-installation) I have the error: pyasn1 0.1.9 is installed but pyasn1 <0.5.0,> = 0.4.1 is required by set (['pyasn1-modules']) . I tried several options but I could not solve it. Does anybody know how I can fix it?

Installation error

Hi,

I'm trying to install Calvin on Ubuntu 12.04 with "python setup.py install" and I receive this error message:

Processing dependencies for calvin==0.5
Searching for mock
Reading http://pypi.python.org/simple/mock/
Best match: mock 2.0.0
Downloading https://pypi.python.org/packages/0c/53/014354fc93c591ccc4abff12c473ad565a2eb24dcd82490fae33dbf2539f/mock-2.0.0.tar.gz#md5=0febfafd14330c9dcaa40de2d82d40ad
Processing mock-2.0.0.tar.gz
Running mock-2.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-DJF7u_/mock-2.0.0/egg-dist-tmp-3zA16c
Checking .pth file support in .
/usr/bin/python -E -c pass
Searching for pbr>=1.3
Reading http://pypi.python.org/simple/pbr/
Best match: pbr 1.10.0
Downloading https://pypi.python.org/packages/c3/2c/63275fab26a0fd8cadafca71a3623e4d0f0ee8ed7124a5bb128853d178a7/pbr-1.10.0.tar.gz#md5=8e4968c587268f030e38329feb9c8f17
Processing pbr-1.10.0.tar.gz
Running pbr-1.10.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-DJF7u_/mock-2.0.0/temp/easy_install-aJPRNW/pbr-1.10.0/egg-dist-tmp-9xQqt5
/usr/local/lib/python2.7/dist-packages/nose-1.3.7-py2.7.egg/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin infi.traceback = infi.traceback:NosePlugin: mock
  RuntimeWarning)

Installed /tmp/easy_install-DJF7u_/mock-2.0.0/pbr-1.10.0-py2.7.egg
/usr/local/lib/python2.7/dist-packages/nose-1.3.7-py2.7.egg/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin infi.traceback = infi.traceback:NosePlugin: mock
  RuntimeWarning)
ERROR:root:Error parsing
Traceback (most recent call last):
  File "/tmp/easy_install-DJF7u_/mock-2.0.0/pbr-1.10.0-py2.7.egg/pbr/core.py", line 111, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
  File "/tmp/easy_install-DJF7u_/mock-2.0.0/pbr-1.10.0-py2.7.egg/pbr/util.py", line 248, in cfg_to_args
    kwargs = setup_cfg_to_setup_kwargs(config, script_args)
  File "/tmp/easy_install-DJF7u_/mock-2.0.0/pbr-1.10.0-py2.7.egg/pbr/util.py", line 431, in setup_cfg_to_setup_kwargs
    if pkg_resources.evaluate_marker('(%s)' % env_marker):
AttributeError: 'module' object has no attribute 'evaluate_marker'
error: Setup script exited with error in setup command: Error parsing /tmp/easy_install-DJF7u_/mock-2.0.0/setup.cfg: AttributeError: 'module' object has no attribute 'evaluate_marker'

BaseException.message used in tests.

As the title says.

/home/travis/build/EricssonResearch/calvin-base/calvin/tests/test_calvin.py:1416: 
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    msg = str(e.message)

Port tests call fixtures directly

As the title says.

_______________ ERROR at setup of test_attach_endpoint_to_inport _______________
    @pytest.fixture
    def inport():
>       return InPort("inport", actor())
E       RemovedInPytest4Warning: Fixture "actor" called directly.
E       Fixtures are not meant to be called directly, are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information.

'Did not received reply for msg id within 5 seconds'

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

#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!

SensorKit examples are not working

Do I need to run the example of SensorKit using sudo?

trigger : std.Trigger(tick=1, data=true)
light: io.Light()
trigger.data > light.on

When I tried to run the light example, without sudo I got the following error messages. With sudo, no response and the LED is not on.

2017-07-15 00:54:13,241 INFO 6941-calvin.calvin.runtime.north.calvincontrol: Control API trying to listening on: localhost:5001
2017-07-15 00:54:14,826 ERROR 6941-calvin.calvin.runtime.north.actormanager: _new
Traceback (most recent call last):
File "/home/pi/calvin-base/calvin/runtime/north/actormanager.py", line 138, in _new
a.init(**args)
File "/home/pi/calvin-base/calvin/actorstore/systemactors/io/Light.py", line 30, in init
self.setup()
File "/home/pi/calvin-base/calvin/actorstore/systemactors/io/Light.py", line 33, in setup
self.light = calvinsys.open(self, "io.light")
File "/home/pi/calvin-base/calvin/actor/actor.py", line 208, in open
return get_calvinsys().open(name, actor, **kwargs)
File "/home/pi/calvin-base/calvin/runtime/north/calvinsys.py", line 70, in open
pymodule = importlib.import_module('calvin.runtime.south.calvinsys.' + capability['path'])
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/pi/calvin-base/calvin/runtime/south/calvinsys/io/gpiopin/raspberry_pi/PIGPIOPin.py", line 19, in
import pigpio
ImportError: No module named pigpio

Also, I tried humidity.calvin with an DHT11. Nothing print out when I used sudo.
pi@raspberrypi:~/calvin-base/calvin/examples/sensor-kit$ sudo csruntime --host localhost -w 0 humidity.calvin

By the way, the pin layout looks wrong. The GND of the sensor is connected at GPIO:21 not an GND pin.

Installing Calvin on OS X El Capitan

There are some problems installing Calvin on the latest OS X El Capitan (version 10.11.1). The requirements for libffi and OpenSSL are not fulfilled by default. Apparently, Apple is dropping support for OpenSSL in El Capitan and moving to their own library. Thus, running pip install -e . according to the wiki install instructions will fail.

A simple fix is to first install Homebrew and install the missing dependancies. With this in place, to get libffi just run:

brew install libffi

and, for OpenSSL,
brew install openssl
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

Problematic simultaneous runtimes

I run 2 runtimes "(test-calvin) tatu @ tatu-notebook: ~ / calvin-base-develop / calvin / examples / ui_in_gui $ csruntime --host 127.0.0.1 --port 5002 --controlport 5003 --name another_runtime" y "(test-calvin) tatu @ tatu-notebook: / etc $ csruntime --host 127.0.0.1 --port 5000 --controlport 5001 --name El-primerot "running in different folders, you can see the route in the screenshots and the error that happens. Someone could help me with this?
1
2

Application with raspberry pi and sensors to send data

Hello
I have the idea of creating an application in Calvin that works with Raspberry pi and this with sensors that sense data and return them to my application.
The question is if someone has actors or a similar application that serves as a guide to be able to do it since I am a beginner in calvin and I am acquiring the theoretical knowledge to do it. Whatever it will be will help me since I'm just starting.

Thank you!

On Windows: ImportError: No module named win32api

While running the example ui_in_gui I got this error

import win32api
ImportError: No module named win32api

It seems the dependency pypiwin32 is needed on Windows and it has to be installed as administrator even if a virtual environment is being used (dll involved.

problem with executing csruntime --host localhost hello.calvin

Hi, I'm trying to execute this code $ csruntime --host localhost hello.calvin in the mini tutorial, but I get this:

2017-09-08 16:51:28,040 ERROR 2286-calvin.calvin.utilities.runtime_credentials: get_domain: error while trying to read domain from Calvin config, err=argument of type 'NoneType' is not iterable
2017-09-08 16:51:28,040 INFO 2286-calvin.calvin.runtime.north.calvincontrol: Control API trying to listening on: localhost:5001
DEPLOY STATUS 200, OK
Deployed application 38835e32-a853-449c-9aeb-1c402e5561c5
2017-09-08 16:51:30,965 INFO 2286-calvin.calvin.runtime.north.calvin_node: All done, exiting
2017-09-08 16:51:30,980 INFO 2286-calvin.calvin.runtime.north.calvin_node: Quitting node "['calvinip://localhost:5000']"

I suppose to get something like this:
Deployed application 922a2096-bfd9-48c8-a5a4-ee900a180ca4
2016-07-11 08:20:34,667 INFO 11202-calvin.Log: Hello, world
2016-07-11 08:20:35,667 INFO 11202-calvin.Log: Hello, world

Any help would be appreciated. Thanks!

Suggested methods for adding non actor functionalities

Hello,
I have a non-actor specific functionality that I use within an actor implementation, i.e. I am trying to use a custom serializer to serialize numpy arrays as JSON (basically a trained model). From the source code I understand that library specific functions can be instantiated within the setup() method in an actor implementation using the following:

self.use("calvinsys.media.image", shorthand="image")  
self.use('calvinsys.native.python-base64', shorthand="base64")  
self.use('calvinsys.charts.chart_handler', shorthand="chart")  

I wanted to know if there was a "right" approach to adding these implementations into the calvin framework. Currently I am able to use it with a simple import statement and having the source code in the same folder as the actor, but I do get the following error:

2017-11-07 12:21:29,568 ERROR 4618-calvin.calvin.actorstore.store: Could not load python module
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/calvin-0.8-py2.7.egg/calvin/actorstore/store.py", line 150, in _load_pymodule
pymodule = imp.load_source(name, path)
File "/home/sai/PycharmProjects/calvin-iotx/applications/winturbine_predictive_maintenance/actors/wt/MVLRPredictor.py", line 4, in
import serialize_sk as sr
ImportError: No module named serialize_sk

Suggestions for csdocs

I am trying to go through various parts of the calvin framework. Some actors require inputs at init. However, the documentation for those is a bit lacking. For example, I understand that std.Constant(data) requires data as input. But, what is 'data'? Can I specify a datafile?

https://github.com/EricssonResearch/calvin-base/blob/master/calvin/actorstore/systemactors/std/Constant.py

"""
Send predetermined data on output. Never ending sequence.
Outputs:
token : Some data
"""
@manage(['data'])
def init(self, data):
self.data = data

Request a enrollment password for a runtime named "org.testexample----testnode1"

//COPIED FROM THE DOCS.
$csmanage ca enrollment_password $DOMAIN_NAME "org.testexample++++testnode1" --dir=$DIR/testdomain

OUTPUT:
usage: csmanage ca [-h] {create,export,signCSR} ...
csmanage ca: error: argument ca_subparser_name: invalid choice: 'enrollment_password' (choose from 'create', 'export', 'signCSR')

Am I doing something wrong? Or the statement in the documentation is invalid?

Draft of stand-alone actorstore

I've pushed a new branch (newstore) as a proof-of-concept how the ActorStore could be made into a completely stand-alone service.
The store is in newstore.py and a small REST service is in store_app.py. To use, start the service using FLASK_APP=store_app.py flask run --port 4999.

  • When requested, the store responds with source and metadata for actors.
  • The actor instantiation is completely different, see actormanager.py.
  • Actor docstrings needs to be changed, see std.Identity, std.CountTimer, and io.Print, to use YAML syntax.
  • Only apps using the above actors can run at present ;)
  • No support for default argument values in actors, need to supply them all.
  • Port property statements are ignored at present.
  • Requirements should probably also move to the actor docstring.

Let me know what you think.

/Per

Deployment fails with Python 3.x

Trying to deploy Calvin as per the instructions in the repository, running
csdeploy calvin/scripts/test1.calvin

but got a syntax error, which on inspection turned out to be a fundamental difference between python 2.x and 3.x, namely print.

My environment was Windows 7, with Python 3.4.0.

When I tried on my ubuntu box though (with Python 2.7.6), it worked

non-pip-managed dependencies

Hi,

There seem to be two (at least in my setup so ubuntu 14.04 lts) dependencies for installing calvin which are not managed by pip, so libffi-dev and libssl-dev. Installation fails (pip install -e .) since corresponding .h are not found. Issue can be fixed easily via apt-get install libffi-dev and libssl-dev.

runtime_credentials: get_domain: error while trying to read domain from Calvin config

In the latest docker image based on the master branch, there is a problem when running the runtime.

root@956baee4941f:/calvin-base# csruntime --host 5000 --controlport 5001 --name rt0 &
[1] 8
root@956baee4941f:/calvin-base# 2017-07-13 12:32:38,728 ERROR 8-calvin.calvin.utilities.runtime_credentials: get_domain: error while trying to read domain from Calvin config
, err=argument of type 'NoneType' is not iterable

pkg_resources.ContextualVersionConflict: (pyasn1 ...

I installed calvin following instructions in https://github.com/EricssonResearch/calvin-base/wiki/Installation, but I get error when I run "csdocs std.Trigger" with either pyasn1 0.1.9 or 0.3.2:

> rpm -qa | grep centos-release
centos-release-7-3.1611.el7.centos.x86_64

> python --version
Python 2.7.5

> pip list --format=columns pyasn1 | grep pyasn1
pyasn1           0.1.9
pyasn1-modules   0.0.11

> csdocs std.Trigger
Traceback (most recent call last):
  File "/home/ns5/.virtualenvs/test-calvin/bin/csdocs", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3049, in <module>
    @_call_aside
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3033, in _call_aside
    f(*args, **kwargs)
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 660, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 863, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.9 (/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages), Requirement.parse('pyasn1==0.3.2'), set(['pyasn1-modules']))

> pip install pyasn1 --upgrade
Collecting pyasn1
  Using cached pyasn1-0.3.2-py2.py3-none-any.whl
Installing collected packages: pyasn1
  Found existing installation: pyasn1 0.1.9
    Uninstalling pyasn1-0.1.9:
      Successfully uninstalled pyasn1-0.1.9
Successfully installed pyasn1-0.3.2

> csdocs std.Trigger
Traceback (most recent call last):
  File "/home/ns5/.virtualenvs/test-calvin/bin/csdocs", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3049, in <module>
    @_call_aside
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3033, in _call_aside
    f(*args, **kwargs)
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 660, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/ns5/.virtualenvs/test-calvin/lib/python2.7/site-packages/pkg_resources/__init__.py", line 858, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyasn1==0.1.9' distribution was not found and is required by calvin

Any help would be appreciated. Thanks!

Unknown actor type

Hi,
after cscontrol http://ip_address:5001 deploy conn_JADE.calvin . I receive
400
u'{"errors": [{"reason": "Unknown actor type: 'connJADE.redeployer_trigger'", "type": "error", "line": 2, "col": 1}], "warnings": [{"reason": "Not validating actor type: 'connJADE.redeployer_trigger'", "type": "warning", "line": 2, "col": 1}]}'
OK
/home/pi/Ist

and in csruntime -n ip_address logs I get:
Generating LALR tables
WARNING: 1 shift/reduce conflict
2019-03-02 00:00:55,223 ERROR 7378-calvin.calvin.runtime.north.control_apis.application_api: Compilation failed
None

My conn_JADE.calvin file is:
deployer : connJADE.Redeployer_IntEEMS_Init()
trigger : connJADE.redeployer_trigger()

trigger.trig > deployer.receive

jade : connJADE.JADE_listener(ip="134.130.169.38",port=6645,NumData=2)
term : flow.Terminator()

jade.data_out1 > term.void

connJADE.zip
connJADE.zip

What is the problem?

Force rpcudp version to 2.0

Currently calvin-base uses kademia which depends on rpcudp but since this dependency is implicit, it uses the latest. The problem is that originally kademia used rpcudp-2.0 (based on twisted with python-2.x) but the current version of rpcudp is 3.0 and it used asyncio (python-3.x).
The suggestion is to put a hard version requirement on rpcudp==2.0 eventhough it's not directly called by Calvin

Migrating TCPClient Actor

I have encountered a problem migrating TCPClient Actors.

I am running the tcp_client.calvin script (found among the sample scripts) on the develop branch and try to migrate the actor which generates the following log entry:

2016-08-04 12:08:50,700 ERROR 15-calvin.calvin.runtime.north.calvincontrol: Migration failed
Traceback (most recent call last):
File "/calvin-base/calvin/runtime/north/calvincontrol.py", line 1159, in handle_actor_migrate
callback=CalvinCB(self.actor_migrate_cb, handle, connection))
File "/calvin-base/calvin/runtime/north/actormanager.py", line 343, in migrate
actor.will_migrate()
File "/calvin-base/calvin/actorstore/systemactors/net/TCPClient.py", line 54, in will_migrate
self.cc.disconnect()
File "/calvin-base/calvin/calvinsys/network/socketclienthandler.py", line 111, in call
return self.f(self.func, _args, *_kwargs)
File "/calvin-base/calvin/calvinsys/network/socketclienthandler.py", line 102, in _call
return func(self._handle, _args, *_kwargs)
File "/calvin-base/calvin/calvinsys/network/socketclienthandler.py", line 75, in disconnect
self._connections[handle]['connection'].stop()
AttributeError: 'TCPClientProtocolFactory' object has no attribute 'stop'

Tracing the error I have noticed that there are a few "TODO"-comments in calvin-base/calvin/runtime/south/plugins/async/twistedimpl/client_connection.py which I believe has to do with how the connection should be closed in twisted. Nonetheless, my question is whether or not this should work and my setup is somehow flawed or if it is a known issue.

Thanks in advance!

Calvin ImageRenderer breaks on OS X Sierra

When running a Calvin script using the ImageRenderer in OS X Sierra the following Errors have been seen:

BUG IN CLIENT OF LIBDISPATCH: _dispatch_main_queue_callback_4CF called from the wrong thread
crashed on child side of fork pre-exec

Metal pipeline state creation failed with error: Error Domain=MTLLibraryErrorDomain Code=3 "Compiler encountered an internal error" UserInfo={NSLocalizedDescription=Compiler encountered an internal error}

Error running script on windows, path delimiter issue

Running the ui_in_gui.calvin example failed due to some path delimiter error

$ csruntime --host localhost ui_in_gui.calvin
Traceback (most recent call last):
  File "C:\Users\eremtas\Documents\Projects\Calvin\venv\Scripts\csruntime-script.py", line 11, in <module>
    load_entry_point('calvin', 'console_scripts', 'csruntime')()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\Tools\csruntime.py", line 368, in main
    set_config_from_args(args)
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\Tools\csruntime.py", line 211, in set_config_from_args
    _conf = calvinconfig.get()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 345, in get
    _config = CalvinConfig()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 76, in __init__
    conf_paths = self.config_paths()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 302, in config_paths
    curr_loc, part = curr_loc.rsplit('/', 1)
ValueError: need more than 1 value to unpack

I fixed it by changing curr_loc, part = curr_loc.rsplit('/', 1) into curr_loc, part = curr_loc.rsplit('\\', 1) but it'd be better to use the os.sep or os.path.dirname and os.path.basename

Deleting Applications doesn't seem to work

I recently tried the example from the deployment section in the wiki. I was then wondering if it is possible to rollback the application without shutting down the runtimes (which would be nice since the DHT wouldn't have to be rebuilt) and stumbled upon the cscontrol applications delete command. I tried it a few times but it seems that, when deleting an application, it doesn't actually stop the application in the runtime, as the actor still continue to exist within the different runtimes, as seen when running cscontrol actor list. I don't know if this is intended but if it is, I don't see how deleting an application is helpful..

calvin_bug

Here a picture to demonstrate this. The application runs on three different nodes and was invoked from port 5001. If I use cscontrol applications list I thus only get an application ID if called from port 5001. If I delete that application the actors on other nodes still continue to run and the application therefor effectively still runs (the counter still gets printed to the stdout of the port holding the Print actor).

Missing dependency

setup.py is missing 'netifaces>=0.10.4' dependency (included in requirements.txt) for release 0.3.0.

Sensor Virtual Weather Not Found

Hello!

I did several tests to see the time of my city in my time of execution. This does not give me an error but it does not generate output either.
let's see: my city is San Juan Argentina
my atributes.json file:
{
    "indexed_public": {
        "address": {
            "city": "San Juan",
            "country": "AR"
        }
    }
}

API key:

  • Your API key is XXXXXXXXXXXXXXXXXXXXXX
  • Within the next couple of hours, it will be activated and ready to use
  • You can later create more API keys on your account page
  • Please, always use your API key in each API call

Endpoint:

  • Please, use the endpoint api.openweathermap.org for your API calls
  • Example of API call:
    api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=XXXXXXXXXXXXXXXXXX

My calvin.conf file:

[removed by olaan]

Then on my console I made:
cd /home/ tatu/calvin-base-develop/calvin/examples/weather/
 csruntime --host localhost localweather.calvin

or execute:

csruntime --host localhost localweather.calvin --attr-file attributes.json

But none of them gives me a result
Result.txt

Actor migration fails

Under certain conditions it is not possible to migrate actors from one runtime to another. Specifically, there is a problem migrating actors with fan-out > 1.

Joakim

run the test scripts receive some error info

When I finished install the Calvin, I run a test scripts, I saw some expected output but also I saw these error information:

D:\calvin-base-master>csdeploy calvin/scripts/test1.calvin
2015-07-22 14:16:23,325 INFO calvin.calvin.runtime.north.calvincontrol: Listening on: localhost:5001
Unhandled Error
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\calvin-0.1-py2.7.egg\calvin\runtime\north\scheduler.py", line 44, in run
async.run_ioloop()
File "C:\Python27\lib\site-packages\calvin-0.1-py2.7.egg\calvin\runtime\south\plugins\async\twistedimpl\async.py", line 38, in run_ioloop
reactor.run()
File "C:\Python27\lib\site-packages\twisted-15.2.1-py2.7-win32.egg\twisted\internet\base.py", line 1194, in run
self.mainLoop()
File "C:\Python27\lib\site-packages\twisted-15.2.1-py2.7-win32.egg\twisted\internet\base.py", line 1203, in mainLoop
self.runUntilCurrent()
--- ---
File "C:\Python27\lib\site-packages\twisted-15.2.1-py2.7-win32.egg\twisted\internet\base.py", line 825, in runUntilCurrent
call.func(_call.args, *_call.kw)
File "C:\Python27\lib\site-packages\calvin-0.1-py2.7.egg\calvin\runtime\north\calvin_node.py", line 149, in start
self.network.start_listeners([self.uri])
File "C:\Python27\lib\site-packages\calvin-0.1-py2.7.egg\calvin\runtime\north\calvin_network.py", line 160, in start_listeners
self.transports[schema].listen(uri)
exceptions.KeyError: 'calvinip'

2015-07-22 14:16:24,010 INFO calvin.StandardOut: StandardOut<54f676c0-f9f5-4716-8226-fef05a2fe64d>: 1
Traceback (most recent call last):
File "c:\python27\scripts\csdeploy-script.py", line 9, in
load_entry_point('calvin==0.1', 'console_scripts', 'csdeploy')()
File "C:\Python27\lib\site-packages\calvin-0.1-py2.7.egg\calvin\Tools\deploy_app.py", line 173, in main
select.select([], [], [], timeout)
select.error: (10022, 'An invalid argument was supplied')
2015-07-22 14:16:24,121 INFO calvin.StandardOut: StandardOut<54f676c0-f9f5-4716-8226-fef05a2fe64d>: 2
2015-07-22 14:16:24,230 INFO calvin.StandardOut: StandardOut<54f676c0-f9f5-4716-8226-fef05a2fe64d>: 3
2015-07-22 14:16:24,339 INFO calvin.StandardOut: StandardOut<54f676c0-f9f5-4716-8226-fef05a2fe64d>: 4

What is the error information 'Unhandled Error' and 'exceptions.KeyError: 'calvinip'' mean? how to remove these error?

Logical operations

Hello,

How does one perform logical operations, such as AND/OR/NOT? I'm assuming that two new components have to be introduced, one for NOT and another one for AND/OR/XOR. But perhaps I'm mistaken and there other ways of accomplishing the same thing without having new components.

In case it helps, in my task, I am writing a flow which starts out as two branches. The last actor of each branch produces either a "true" value or a "false" value. I need to merge the results of these two branches and use it as an input to the "select" port of std.Deselect().

Missing documentation for `context` and `data` actors

csdocs fails to provide documentation for context and data modules and actors.

The problem is that their modules' __init__.py is missing the required documentation string. This bug is triggered if the first module(s) have a missing doc string. Previously, this bug has been been hidden by the charts module that was removed with this release.

We should fix this, and write a test for missing module documentation.

Expose constants defined in calvinsys to Calvin scripts

It would be nice to be able to use constants defined in an object in calvinsys from an Calvin script.

Example:
calvinsys/io/gpio_handler defines the constants PULLUP and PULLDOWN for enabling internal pull up/down resistors, these are then accessible from an Calvin script:

gpio : io.GPIOReader(pull=calvinsys.io.gpio_handler.PULLUP)

Details about Storage class

Hi,

I'm studying the code of calvin and I would like more information about some internal details.
The general idea is extend the calvin's deployment algorithm to consider also dynamic parameters, as CPU, memory or network. I believe you have already discussed this deployment problem, so if you have any thoughts about the subject.

Some questions about the storage mechanism:

In the storage helper functions (calvin/runtime/north/storage.py), the Storage class has 2 data-structures and 2 main functions to edit a value in the storage.
Datastructs:

  • localstore: saves the local view of the database.
  • localstore_sets: saves 2 sets of values to be added/removed from key.

Q1) Why do we need the 2 structures to save the data? I believe there is a raison but I'm missing it.

Q2) It seems to me that the localstore_sets doesn't save all the data. Example, if I call the append(prefix+key="node-xxx", value={"test" : 123}. It will add to localstore_sets[node-xxx][+] = set("test") and not the "123". Is it correct? The question is related to the first one, it is not clear the objective of the 2 structs...

Methods:

  • set: Overwrites a key with new values
  • append: Add values to a key in the database

Q3) How can I just update one of the values inside the key?
For example, in the key: node-xxxx : { "attributes" : ..., "uris": ["calvinip://127.0.0.1:5000"], ... }. If I want just to change the "uris" to a new value, should I use the set method and write all the node-xxxx key again?

For the instant and testing purpose, I'm using the set method and writing a full structure each time.

Best regards,

Bruno Donassolo
R&D Engineer at Orange Labs

Actor not found

Hello,
I am trying to run tutorial/4th.calvin in which is defined a custom actor "erct.Mult".
When I launch it with the following command:

csdeploy calvin/tutorial/4th.calvin

I get the following exception:

2015-06-17 14:50:59,408 ERROR calvin.calvin.csparser.analyzer: Actor "erct.Mult" not found. File "4th.calvin", line 11 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/calvin-0.1-py2.7.egg/calvin/csparser/analyzer.py", line 75, in analyze self.analyze_structure(s, root_namespace, argd) File "/usr/local/lib/python2.7/dist-packages/calvin-0.1-py2.7.egg/calvin/csparser/analyzer.py", line 125, in analyze_structure raise Exception(msg) Exception: Actor "erct.Mult" not found. File "4th.calvin", line 11 2015-06-17 14:50:59,409 ERROR calvin.calvin.Tools.deploy_app: Unknown actor type: 'erct.Mult' [11:0]

How can I solve this problem?

Thanks in advance!

cscontrol connection refused (err:111) distributed environment

I tried to connect to distributed environment using separate JSON file but failed everytime when pass name as attribute which i stored in requirements file.
Neither csruntime nor cscontrol working for me if i try to use json file.
Please guide me how to do that exactly may be i am missing something?

Actions named 'fire' break the scheduler

Using the name 'fire' for an action gives strange results.

2017-05-16 14:12:41,095 ERROR    13136-calvin.calvin.runtime.north.scheduler: unsupported operand type(s) for |=: 'bool' and 'tuple' 
Traceback (most recent call last):                                                                                                   
  File "/home/user/calvin-base/calvin/runtime/north/scheduler.py", line 124, in fire_actors                              
    did_fire |= actor.fire()                                                                                                         

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.