pyfarm.agent

Core module containing code to run PyFarm's agent.


License
Apache-2.0
Install
pip install pyfarm.agent==0.7.0-dev0

Documentation

PyFarm Agent

build status (agent) (posix) build status (agent) (windows) coverage

Core module containing code to run PyFarm's agent. This will allow a remote host to:

  • Inform the master about itself
  • Request, receive and execute work via job types
  • Track and control individual processes
  • Measure and limit system resource usage

Python Version Support

This library supports Python 2.6 and Python 2.7 only for the moment. Coding practices have been geared towards supporting Python 3 when the underlying library, Twisted, is ported to Python 3.

Documentation

The documentation for this this library is hosted on Read The Docs. It's generated directly from this library using sphinx (setup may vary depending on platform):

virtualenv env
. env/bin/activate
pip install sphinx nose
pip install -e . --egg
make -C docs html

Testing

All commits and pull requests are tested on Linux, Mac OS X and Windows. Tests for Linux and Mac OS X are run using Travis while Windows testing is performed on Appveyor. Code coverage analysis is also provided by Coveralls for Linux and Mac OS X.

The tests can can also run locally using Twisted's trial. Some tests will require access to external services such as httpbin.org, NTP, DNS and other network services.

Below are some examples for executing the tests locally. These are fairly minimal however and may not work in all cases. For more complete examples, checkout the configuration files used to run the tests on Travis and Appveyor:

Linux and Mac OS X:

virtualenv env
. env/bin/activate
pip install -e . --egg
trial tests

Windows:

virtualenv env
env\Scripts\activate
%VIRTUALE_ENV%\Scripts\pip.exe install wheel
%VIRTUALE_ENV%\Scripts\pip.exe install -e . --egg
%VIRTUALE_ENV%\Scripts\python.exe %VIRTUALE_ENV%\Scripts\trial.py tests

Note

On Windows, if the tests fail to locate one of the agent's modules be sure you don't have another package for PyFarm installed in your system site-packages directory.

You may also have to run trial a little differently. See appveyor.yml for an example.