Client-server functionality for the SimPhoNy framework.
This packages provides a proxy engine which can be used to launch a wrapper on a remote host. This proxy wrapper follows the interface of ABCModelingEngine abstract class.
Simphony-network is hosted on github: https://github.com/simphony/simphony-network
- simphony-common >= 0.1.1
- gevent >= 1.0
- pyzmq >= 13.1.0
- msgpack-python >= 0.4.6
- msgpack-numpy >= 0.3.6
- zerorpc >= 0.5.1
- Fabric >= 1.10.2
- blinker >= 1.3
Note
pyzmq package will try to find a local libzmq library or otherwise will try to compile it as an extension. In this case proper build tools should be available on local machine, including a C compiler.
Note
msgpack-python should have been compiled with C extensions, otherwise the client-server communication will not work. After installation one should be able to import the following module:
from msgpack import _packer, _unpacker
if the following import fails, the msgpack-python should be reinstalled after installing cython: https://pypi.python.org/pypi/Cython/.
The package requires python 2.7.x, and aforementioned dependencies. These dependencies are listed inside requirements.txt file which should be installed first:
# Clone the repository git clone https://github.com/simphony/simphony-network.git # Install required dependencies pip install -r requirements.txt
The next step is straight forward and is based on setuptools:
# build and install python setup.py install
or:
# build for in-place development python setup.py develop
After installation a new module called proxy will be added to the simphony.engine entry point. This module contains a proxy wrapper which accepts an instance of ABCModelingEngine and a host name as input parameters and proxies the wrappers methods to point to a wrapper which is running remotely on the provided host.
# Import the proxy wrapper from simphony.engine.proxy import ProxyEngine
# Create a proxy around an existing wrapper proxy = ProxyEngine(wrapper, host='pc-115')
# Access proxy methods proxy.run()
Note
ProxyEngine only supports ABCModelingEngine API and a few custom ones which will be explained. Any changes which are applied to wrapper parameter after initializing the proxy will not be respected.
To run the full test-suite run:
python -m unittest discover
- simphony_network -- holds the package's implementation