Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
/ simphony-network Public archive

Client-server functionality for SimPhoNy framework.

Notifications You must be signed in to change notification settings

simphony/simphony-network

Repository files navigation

simphony-network

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.

https://travis-ci.org/simphony/simphony-network.svg?branch=master

Repository

Simphony-network is hosted on github: https://github.com/simphony/simphony-network

Requirements

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.

Installation

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

How to Use

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.

Testing

To run the full test-suite run:

python -m unittest discover

Directory structure

  • simphony_network -- holds the package's implementation

About

Client-server functionality for SimPhoNy framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages