[openstack-dev] [common] moving manager.py and service.py into common
Jay Pipes
jaypipes at gmail.com
Fri Jul 27 15:22:13 UTC 2012
On 07/27/2012 01:56 AM, Mark McLoughlin wrote:
> Hi Angus,
>
> On Fri, 2012-07-27 at 14:19 +1000, Angus Salkeld wrote:
>> Hi
>>
>> If no one else is busy doing $Subject then I'll get busy
>> with it. Both Heat and ceilometer use these (in heat we
>> copied it and ceilometer import it directly).
>>
>> I tried starting ceilometer on Fedora and a receint change
>> to one of them made this impossible. So I thought it's a good
>> time to move them.
>
> Yep, and they're copied into Cinder too. Sounds like a good candidate as
> part of the fight on our lame copying-and-pasting :)
>
> I'd start by thinking about the use cases that are generally
> application.
>
> e.g. looking at manager.py, I see:
>
> 1) loading the DB driver and providing db access via "self.db"
>
> 2) plugin loading
>
> 3) RPC dispatcher
>
> 4) Somewhere to register periodic, recurring jobs
>
> 5) The init_host() hook
>
> 6) Misc bits like 'self.host'
>
> The one to be wary of is the DB stuff, since that requires code which
> isn't already in common.
>
> service.py looks a lot more daunting in terms of making it more general
> - e.g. report_state() is very nova specific.
>
> The way I'd love to see these things done would be for a very basic
> version of this stuff added to common first and then, over time, we pull
> in support for more use cases. Just copying the whole thing piecemeal
> doesn't give us that same opportunity to sit back and think how to make
> it more generally useful so that the likes of glance or keystone can use
> it too.
++
less copy/paste the better.
I'd also love to see standardization around the binding of services to
sockets. In Nova-land, each service has its own nova.conf value -- for
example, there is a host/port pair for each of nova-os-api,
nova-ec2-api, nova-metadata-api, etc: (see [1])
osapi_compute_listen=0.0.0.0
osapi_compute_listen_port=8774
ec2_listen=0.0.0.0
ec2_listen_port=8773
metadata_listen=0.0.0.0
metadata_listen_port=8775
There are also nova.conf options that duplicate the above (not sure if
these even are used any more...):
ec2_host=$my_ip
ec2_port=8773
metadata_host=$my_ip
metadata_port=8775
as well as this pair for the nova-objectstore service:
s3_host=$my_ip
s3_port=3333
In every other core project -- Glance, Swift, Keystone, Cinder and
Quantum -- only the following options are used:
bind_host=0.0.0.0
bind_port=XXXX
and each service has its own paste deploy INI file and configuration
file containing the bind_host/bind_port options for the particular service.
I would love it if Nova could standardize on using bind_host/bind_port
for all of its services that listen on TCP sockets as well. That way, we
can put the get_socket() call that originated in Swift and exists in
Glance as well, into a openstack.common.wsgi module.
Best,
-jay
[1]
http://docs.openstack.org/trunk/openstack-compute/admin/content/compute-options-reference.html
More information about the OpenStack-dev
mailing list