diff options
| author | Andy Smith <code@term.ie> | 2010-12-16 20:59:22 +0000 |
|---|---|---|
| committer | Tarmac <> | 2010-12-16 20:59:22 +0000 |
| commit | d67b9f7b8b1fb7d73ad08a04c6ee2d98fc9037d8 (patch) | |
| tree | 0634b59dcc7559f3dc97616a055a360acf1c4602 /bin | |
| parent | edff8090714f11305d6dbc091a96eece20f0d1a1 (diff) | |
| parent | e306d236e3cf91c00a36940e277ad2d105b055a1 (diff) | |
This branch removes most of the dependencies on twisted and moves towards the plan described by https://blueprints.launchpad.net/nova/+spec/unified-service-architecture
Tests are currently passing besides objectstore which is being skipped because it is heavily reliant on our twisted pieces, and I can run everything using the nova.sh
Additionally this adds nova-combined that covers everythign except for nova-objectstore, to test it what I've usually done is run nova.sh as usual
$ sudo ./eventlet_merge/contrib/nova.sh run ignored eventlet_merge
and then quit all the services except for nova-objectstore and then in one of the screens do
$ ./eventlet_merge/bin/nova-combined
And then run whatever manual testing you normally run.
Once objectstore has been deprecated and removed nova-combined can be expected to run the whole nova stack in a single process for testing and dev.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-api | 20 | ||||
| -rwxr-xr-x | bin/nova-combined | 65 | ||||
| -rwxr-xr-x | bin/nova-compute | 15 | ||||
| -rwxr-xr-x | bin/nova-network | 15 | ||||
| -rwxr-xr-x | bin/nova-scheduler | 15 | ||||
| -rwxr-xr-x | bin/nova-volume | 15 |
6 files changed, 97 insertions, 48 deletions
diff --git a/bin/nova-api b/bin/nova-api index 2ae6a099a..1c671201e 100755 --- a/bin/nova-api +++ b/bin/nova-api @@ -17,9 +17,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" -Nova API daemon. -""" + +"""Starter script for Nova API.""" import gettext import os @@ -35,9 +34,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): gettext.install('nova', unicode=1) +from nova import api from nova import flags from nova import utils -from nova import server +from nova import wsgi + FLAGS = flags.FLAGS flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port') @@ -46,15 +47,10 @@ flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port') flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host') -def main(_args): - from nova import api - from nova import wsgi +if __name__ == '__main__': + utils.default_flagfile() + FLAGS(sys.argv) server = wsgi.Server() server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host) server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host) server.wait() - - -if __name__ == '__main__': - utils.default_flagfile() - server.serve('nova-api', main) diff --git a/bin/nova-combined b/bin/nova-combined new file mode 100755 index 000000000..c6a04f7e9 --- /dev/null +++ b/bin/nova-combined @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Combined starter script for Nova services.""" + +import eventlet +eventlet.monkey_patch() + +import os +import sys + +# If ../nova/__init__.py exists, add ../ to Python search path, so that +# it will override what happens to be installed in /usr/(local/)lib/python... +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): + sys.path.insert(0, possible_topdir) + +from nova import api +from nova import flags +from nova import service +from nova import utils +from nova import wsgi + + +FLAGS = flags.FLAGS +flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port') +flags.DEFINE_string('osapi_host', '0.0.0.0', 'OpenStack API host') +flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port') +flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host') + + +if __name__ == '__main__': + utils.default_flagfile() + FLAGS(sys.argv) + + compute = service.Service.create(binary='nova-compute') + network = service.Service.create(binary='nova-network') + volume = service.Service.create(binary='nova-volume') + scheduler = service.Service.create(binary='nova-scheduler') + #objectstore = service.Service.create(binary='nova-objectstore') + + service.serve(compute, network, volume, scheduler) + + server = wsgi.Server() + server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host) + server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host) + server.wait() diff --git a/bin/nova-compute b/bin/nova-compute index f57b68584..d2d352da2 100755 --- a/bin/nova-compute +++ b/bin/nova-compute @@ -17,9 +17,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" - Twistd daemon for the nova compute nodes. -""" +"""Starter script for Nova Compute.""" + +import eventlet +eventlet.monkey_patch() import gettext import os @@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): gettext.install('nova', unicode=1) from nova import service -from nova import twistd from nova import utils - if __name__ == '__main__': utils.default_flagfile() - twistd.serve(__file__) - -if __name__ == '__builtin__': - application = service.Service.create() # pylint: disable=C0103 + service.serve() + service.wait() diff --git a/bin/nova-network b/bin/nova-network index 86d04c723..0143846a7 100755 --- a/bin/nova-network +++ b/bin/nova-network @@ -17,9 +17,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" - Twistd daemon for the nova network nodes. -""" +"""Starter script for Nova Network.""" + +import eventlet +eventlet.monkey_patch() import gettext import os @@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): gettext.install('nova', unicode=1) from nova import service -from nova import twistd from nova import utils - if __name__ == '__main__': utils.default_flagfile() - twistd.serve(__file__) - -if __name__ == '__builtin__': - application = service.Service.create() # pylint: disable-msg=C0103 + service.serve() + service.wait() diff --git a/bin/nova-scheduler b/bin/nova-scheduler index 41e1937c1..f4c0eaed6 100755 --- a/bin/nova-scheduler +++ b/bin/nova-scheduler @@ -17,9 +17,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" - Twistd daemon for the nova scheduler nodes. -""" +"""Starter script for Nova Scheduler.""" + +import eventlet +eventlet.monkey_patch() import gettext import os @@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): gettext.install('nova', unicode=1) from nova import service -from nova import twistd from nova import utils - if __name__ == '__main__': utils.default_flagfile() - twistd.serve(__file__) - -if __name__ == '__builtin__': - application = service.Service.create() + service.serve() + service.wait() diff --git a/bin/nova-volume b/bin/nova-volume index 4f2e96268..ad3ddc405 100755 --- a/bin/nova-volume +++ b/bin/nova-volume @@ -17,9 +17,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" - Twistd daemon for the nova volume nodes. -""" +"""Starter script for Nova Volume.""" + +import eventlet +eventlet.monkey_patch() import gettext import os @@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): gettext.install('nova', unicode=1) from nova import service -from nova import twistd from nova import utils - if __name__ == '__main__': utils.default_flagfile() - twistd.serve(__file__) - -if __name__ == '__builtin__': - application = service.Service.create() # pylint: disable-msg=C0103 + service.serve() + service.wait() |
