91 Commits

Author SHA1 Message Date
Mark McLoughlin
e237c86446 Use CONF.import_opt() for nova.config opts
The only reason for importing nova.config now is where one of the
options defined in that file is needed. Rather than importing
nova.config using an import statement, use CONF.import_opt() so
that it is clear which option we actually require.

In future, we will move many options out of nova.config so many
of these import_opt() calls will either go away or cause a module
other than nova.config to be imported.

Change-Id: I0646efddecdf2530903afd50c1f4364cb1d5dce1
2012-11-20 00:04:49 +00:00
Mark McLoughlin
94d87bce21 Remove nova.config.CONF
Modules import nova.config for two reasons right now - firstly, to
reference nova.config.CONF and, secondly, if they use one of the
options defined in nova.config.

Often modules import nova.openstack.common.cfg and nova.config
which is a bit pointless since they could just use cfg.CONF if
they just want to nova.config in order to reference CONF.

Let's just use cfg.CONF everywhere and we can explicitly state
where we actually require options defined in nova.config.

Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
2012-11-20 00:00:21 +00:00
Chris Behrens
e374fb0389 Remove nova.flags imports from bin/*
nova.flags is no longer needed except to load nova config options shared
across multiple daemons.

This removes nova.flags from the bin programs and makes sure that
nova.flags is imported in nova.config for now.

Change-Id: If066ac0070387bee4b41e6a78ad972f7a0955c75
2012-11-15 23:03:04 +00:00
Mark McLoughlin
5749b8deb0 Switch from FLAGS to CONF in bin
Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Id0c59b2dc8002ec89ccbc5e5d7986fb68d3a693d
2012-11-04 21:39:49 +00:00
Mark McLoughlin
efede80046 Move parse_args to nova.config
The flags module will eventually be removed and this is a first step
towards that.

Change-Id: I729b08900e53e2ae6db10633dcff3be59720fa6f
2012-11-04 21:37:39 +00:00
Andrew Bogott
d335457f48 Switch to common logging.
I only just moved logging from nova to common, so behavior should remain the same.

Change-Id: I1d7304ca200f9d024bb7244d25be2f9a670318fb
2012-07-02 15:57:09 -05:00
Johannes Erdfelt
46c1b6eaee Add multi-process support for API services
Implements blueprint multi-process-api-service

This is based on Huang Zhiteng's patch.

This patch adds support for running services as multiple processes. This
is primarily intended to be used with the API service as a way to provide
more concurrency than eventlet can sometimes provide.

A SIGTERM or SIGINT signal will cause the parent process to gracefully
terminate the child processes, allowing them to finish processing the
requests currently being processed. The parent will wait for the
children to finish before exiting.

Change-Id: Ie6d6802626eb42d5e64c4167be363fbf6cea2a1b
2012-06-28 19:57:37 +00:00
James E. Blair
626f64a716 Revert "blueprint <multi-process-api-service>"
This reverts commit e599636d09755f635604f64f17e9f56cac14575e

The nova test runner is leaking processes after this change.

Change-Id: Id74463d53f3b7cd749cba293619abef01499b90d
2012-06-04 22:19:10 -07:00
Zhiteng Huang
e599636d09 blueprint <multi-process-api-service>
Add multiprocess support for API serivces (EC2/OSAPI_Compute/OSAPI_Volume/Metadata).

2012-06-1 v7:
    * Add unittest to cover worker recovery, service termination functionality
    in wsgi.py, fix python 2.6 compatibility issue.
    * Modify generate_uid() to introduce per-process seeds in utils.py to avoid
    collisions.
    * Add worker session to nova.conf.sample.
2012-05-21 v6:
    * Fix 'test_wsgi' unittest error.
2012-04-28 v5:
    * Add SIGINT handler and fix child-parent race condition when Ctrl+C is
    pressed.
2012-03-31 v4:
    * Fixed typo, removed debug code.
2012-03-30 v3:
    * Fixed localization/pep8 error in unittest, add metadata test.
    * nova/wsgi.py:Server: use the greenthread pool created for each process.
    * nova/service.py: remove debug code
2012-03-27 v2:
    * Fixed unittest error.
    * nova/wsgi.py:Server: Use self._logger to do logging in multiprocess mode.
    * nova/wsgi.py:Server: Move self._pool creation into proper place.
    * code style fix.
2012-03-25 v1:
    * Modification to nova/service.py and nova/wsgi.py in order to support
    multiprocess (a.k.a. workers) for various API services.  If multiprocess
    mode is enabled, (i.e. flags 'APINAME_workers' set to positive numbers),
    corresponding API service will run in target number of process(es). There
    is also a master_worker process spawned for managing all workers (handling
    signal/termination).
    * Add unittest for multiprocess API service, also alter testing/runner.py
    to adopt new unittest.

Change-Id: Ia045e595543ddfd192894b2a05801cc4b7ca90cb
2012-06-02 00:34:55 +08:00
Mark McLoughlin
00786bc554 Use cfg's new global CONF object
Implements blueprint cfg-global-object

Replace nova.flags.FLAGS with openstack.common.cfg.CONF.

In future, we can do a s/FLAGS/CONF/ across the codebase.

Change-Id: Ib293873089a5399febd7a3b0410f66e9bef115f1
2012-05-30 21:24:53 +01:00
Ghe Rivero
7e3e9b8e9c Remove old flagfile support.
Implements blueprint remove-old-flagfile

nova-manage can still be used to convert old flagfiles style files
to new .ini files:

$ ./bin/nova-manage  config  convert --help
Usage: nova-manage config convert <args> [options]

Options:
  -h, --help        show this help message and exit
  --infile=<path>   old-style flagfile to convert to config
  --outfile=<path>  path for output file. Writes configto stdout if not
                    specified.

Change-Id: Ib8fbbd858b1db7faef70d7d97955e5042bf378f2
Signed-off-by: Ghe Rivero <ghe@debian.org>
2012-05-10 19:17:34 +02:00
Nachi Ueno
9059902c72 Merged with trunkw 2011-08-19 13:25:49 -07:00
Nachi Ueno
c06bbe9973 Added monkey patching notification code function
w
2011-08-19 12:30:55 -07:00
Vishvananda Ishaya
125a2affec more cleanup of binaries per review 2011-08-18 10:55:39 -07:00
Vishvananda Ishaya
6cdee85905 Make all services use the same launching strategy 2011-08-17 16:25:53 -07:00
Josh Kearney
209bf1ef49 Add a flag to disable ec2 or osapi. 2011-07-08 17:12:14 -05:00
Nikolay Sokolov
6b6fd2fe87 PEP8 passed. 2011-07-06 01:31:04 +04:00
Nikolay Sokolov
c3229ec37f Formatting fix. 2011-07-06 01:09:00 +04:00
Nikolay Sokolov
fde44cdf69 Signal handler cleanup, proper ^C handling. 2011-07-06 00:24:55 +04:00
Nikolay Sokolov
1732c373aa Gracefull shutdown of nova-api. 2011-07-04 23:48:05 +04:00
Josh Kearney
834b1741b4 Use milestone cut. 2011-06-28 17:26:08 -05:00
Brian Lamar
655a783d5a Created Bootstrapper to handle Nova bootstrapping logic. 2011-06-23 21:31:00 -04:00
Mark Washenberger
2059a683e1 run launcher first since it initializes global flags and logging 2011-06-22 23:27:49 -04:00
Brian Lamar
e821b96feb Removed unneeded import. 2011-06-21 00:32:31 -04:00
Brian Lamar
c17c73b3d0 Tests for WSGI/Launcher 2011-06-21 00:21:33 -04:00
Brian Lamar
e849aa7112 Removed logging logic from __init__, added concept of Launcher...no tests for it yet. 2011-06-20 19:32:18 -04:00
Brian Lamar
c178b3ce44 pep8 fixes 2011-06-20 14:54:53 -04:00
Brian Lamar
dd870291a3 Cleanup and addition of tests for WSGI server. 2011-06-20 10:12:43 -04:00
Brian Lamar
927aecb0a3 Introduced Loader concept, for paste decouple. 2011-06-19 20:18:29 -04:00
Brian Lamar
79402ffbae Cleanup of the cleanup. 2011-06-19 18:00:38 -04:00
Brian Lamar
1e047dae71 Further nova-api cleanup. 2011-06-19 16:27:46 -04:00
Brian Lamar
95213244fe Cleaned up nova-api binary and logging a bit. 2011-06-19 14:41:42 -04:00
Brian Lamar
ea64f883b7 Removed debugging, made objectstore tests pass again. 2011-06-19 14:09:09 -04:00
Brian Lamar
843644aed6 General cleanup and refactor of a lot of the API/WSGI service code. 2011-06-18 23:10:41 -04:00
Brian Lamar
6e9a95fe81 disable-msg -> disable 2011-03-18 09:56:05 -04:00
Justin Santa Barbara
a4830f83af Sorted imports correctly 2011-03-08 16:45:20 -08:00
Justin Santa Barbara
e69c802aaf Moved FLAGS.paste_config to its re-usable location 2011-03-07 15:36:04 -08:00
Justin Santa Barbara
be54e37bbd Merged with trunk and fixed conflict. Sigh. 2011-03-07 15:30:58 -08:00
Justin Santa Barbara
8e0fd37ddf Converted tabs to spaces in bin/nova-api 2011-03-07 15:22:59 -08:00
Justin Santa Barbara
f65867673e Merge with trunk, resolve conflicts and refactor 2011-03-07 14:34:02 -08:00
Kevin L. Mitchell
f72366f007 Create --paste_config flag defaulting to api-paste.ini and mv etc/nova-api.conf to match 2011-03-07 19:33:24 +00:00
Vishvananda Ishaya
3368b32338 use default flagfile in nova-api 2011-02-25 12:16:58 -08:00
termie
3115a65f99 add help back to the scripts that don't use service.py 2011-02-23 15:26:52 -08:00
Justin Santa Barbara
fbfc2b2165 Alphabetize imports 2011-02-23 15:17:32 -08:00
Justin Santa Barbara
50e71cef14 Removed unused import & formatting cleanups 2011-02-22 18:59:23 -08:00
Justin Santa Barbara
dd6b9c21d3 Exit with exit code 1 if conf cannot be read 2011-02-22 18:57:04 -08:00
Justin Santa Barbara
e37e7b91a9 Support service-like wait behaviour for API service 2011-02-22 17:58:01 -08:00
Justin Santa Barbara
b6254db80c Refactoring nova-api to be a service, so that we can reuse it in tests 2011-02-22 17:45:38 -08:00
Thierry Carrez
f80d4c859b Merged trunk 2011-02-22 17:16:43 +01:00
Vishvananda Ishaya
f9f9bf52f5 Add flags for listen_port to nova-api. This allows us to listen on one port, but return another port (for a proxy or load balancer) in calls like describe_regions, etc. 2011-02-22 15:34:47 +00:00