From 9dd48cf4c8dd8bd0024b31c4a023ed667e7a3274 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 4 Jan 2017 17:20:31 +0000 Subject: [PATCH] [placement] Add a bit about extraction plans to placement_dev While we've not made any immediate plans to do the extraction we should avoid adding complexity that would make it harder later, so this new section discusses the plan to eventually extract, and the structures that either help or hinder this. Change-Id: Ia3e95e4b85aa768b8f94d4a99963c7ec719b8a13 --- doc/source/placement_dev.rst | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/doc/source/placement_dev.rst b/doc/source/placement_dev.rst index d8926b7d1d08..da7bcdf3b9fd 100644 --- a/doc/source/placement_dev.rst +++ b/doc/source/placement_dev.rst @@ -318,7 +318,40 @@ example in devstack. See `gabbi-run`_ to get started. Futures ======= -.. TODO(cdent) extraction to own thing plans +Since before it was created there has been a long term goal for the placement +service to be extracted to its own repository and operate as its own +independent service. There are many reasons for this, but two main ones are: + +* Multiple projects, not just nova, will eventually need to manage resource + providers using the placement API. +* A separate service helps to maintain and preserve a strong contract between + the placement service and the consumers of the service. + +To lessen the pain of the eventual extraction of placement the service has been +developed in a way to limit dependency on the rest of the nova codebase and be +self-contained: + +* Most code is in `nova/api/openstack/placement` except for oslo versioned + object code in `nova/objects/resource_provider.py`. +* Database query code is kept within the objects. +* The methods on the objects are not remotable, as the only intended caller is + the placement API code. + +There are some exceptions to the self-contained rule (which will have to be +addressed if the extraction ever happens): + +* Exceptions unique to the placement API are still within the `nova.exceptions` + package. +* Code related to a resource class cache is within the `nova.db` package. +* Database models, migrations and tables use the nova api database. +* The nova `FaultWrapper` middleware is being used. +* `nova.i18n` package provides the ``_`` and related functions. +* `nova.conf` is used for configuration. +* Unit and functional tests depend on fixtures and other functionality in base + classes provided by nova. + +When creating new code for the placement service, please be aware of the plan +for an eventual extraction and avoid creating unnecessary interdependencies. .. _WSGI: https://www.python.org/dev/peps/pep-3333/ .. _versioned objects: http://docs.openstack.org/developer/oslo.versionedobjects/