Trove/MoveTroveGuest
< Trove
Revision as of 16:11, 17 July 2014 by Robert Myers (talk | contribs) (→Move tests and add a test runner for the guest)
Contents
Description
Currently the Trove Guest Agent code is contained in the trove module. This blueprint goal is to split the guest agent specific code into another top level module called 'troveguest'. This will eventually be split out completely into another repository, the first step is to refactor the code so it is no longer dependent on trove core.
Justification/Benefits
- Simplify installation of the guest agent on instances.
- Reduce the amount of code that is deployed on instances.
- Lower the memory footprint of the guest agent by not importing unnecessary code from Trove core.
Impacts
- The setup.cfg will need to setup the new module along with trove. See horizon for an example.
- An example setup.cfg for just packaging the guest agent will be added along with a build_guest.py helper script.
- Some in flight reviews will have a difficult rebase. (Cores will also need to be careful to merge them in order to minimize impact)
Configuration
- A new top level olso.cfg for the troveguest will be added. (This should be a small subset of the values in trove.common.cfg)
- The values in trove.common.cfg that are specifically for the guest will be removed.
- It is possible that some configuration values will need to be added or duplicated.
Database
None
Public API
None
Internal API
None
Guest Agent
- The guest agent code will be moved to a top level module in the existing trove repository called 'troveguest'.
- The import statements will be changed from 'trove.guestagent' to 'troveguest'
- Some common code will need to be duplicated within the troveguest so that there are no dependancies on the trove core. (This should hopefully be minimal)
- The code that currently rsync's the code over to instances in development will be changed to just include the 'troveguest' module. (It is possible that another delivery method will be used, however that should probably be done in its own blueprint)
setup.cfg
Add a new package to the [files] section
[files] packages = trove troveguest
new troveguest module =
Move the trove.guest module to troveguest so the layout looks like:
trove/ ... doc/ etc/ tools/ trove/ troveguest/ < --- new module setup.py setup.cfg ...
add new openstack-common.conf
Add file `troveguest/openstack-common.conf ` and add only the modules that the guest needs (this needs to be discoverd)
[DEFAULT] # The list of modules to copy from oslo-incubator module=eventlet_backdoor module=exception module=excutils module=fileutils module=gettextutils module=importutils module=jsonutils module=local module=lockutils module=log module=loopingcall module=pastedeploy module=periodic_task module=processutils module=rpc module=service module=strutils module=testutils module=threadgroup module=timeutils module=utils module=versionutils # The base module to hold the copy of openstack.common base=troveguest
Move tests and add a test runner for the guest
The guestagent tests need to be split out from the trove.tests modules then we to make sure the tests are discovered properly.
Possibly modify tox.ini:
[testenv:cover] basepython = python2.7 commands = {envpython} run_tests.py --group=does_not_exist coverage erase python setup.py testr --coverage coverage run -a run_tests.py coverage run -a troveguest/run_tests.py coverage html coverage report