This is a brief followup to placement container playground, wherein I've been using sticking placement into a container with the smallest footprint as a way of exploring the issues involved with extracting placement from nova.
I have two series that experiment with changes that could reduce the footprint:
But it turns out that neither of these are enough when integrating them into the container.
A newly revealed challenge is that when importing nova.conf (to
access the global oslo_config) all the configuration is imported, leading to
lots of things needing to import their own requirements. So, for example,
conf/key_manager.py imports
castellan.
Placement doesn't need that.
Then, importing the db_api imports the cells_rpcapi, which eventually
leads to nova/objects/fields.py being imported, which wants
cursive.
cells_rpcapi also imports the network_model which eventually leads to
nova.utils, which wants os_service_types.
Placement doesn't need that either.
Placement only uses the db_api module to create a context manager
that provides a database session. It's possible to isolate this code.
A WIP now exists to Isolate the placement database
config.
With that in place we hit the next roadblock: The database
model/schema files are in the nova.db package and __init__.py in
there does this: from nova.db.api import *. Which means the
cells_rpcapi stuff mentioned still gets imported. Argh!
It might be an option to move the model files into a different place.
Changing the nova/db/__init__.py would lead to changes in many other
files, but might be worth it as importing any code in nova/db will
trigger the code in __init__.py
There will probably be a -3 followup to this, with more steps forwards and more steps back.