From d64e9dff546c07578f09d0aae3825790a54d7c06 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 20 Jun 2010 15:08:25 -0700 Subject: [PATCH 1/6] update spacing --- docs/getting.started.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/getting.started.rst b/docs/getting.started.rst index 9d7808a2..63e43590 100644 --- a/docs/getting.started.rst +++ b/docs/getting.started.rst @@ -1,12 +1,12 @@ .. Copyright [2010] [Anso Labs, LLC] - + 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. @@ -67,19 +67,19 @@ Installation # ON THE CLOUD CONTROLLER apt-get install -y rabbitmq-server dnsmasq nginx # build redis from 2.0.0-rc1 source - # setup ldap (slap.sh as root will remove ldap and reinstall it) - NOVA_PATH/nova/auth/slap.sh + # setup ldap (slap.sh as root will remove ldap and reinstall it) + NOVA_PATH/nova/auth/slap.sh /etc/init.d/rabbitmq-server start # ON VOLUME NODE: - apt-get install -y vblade-persist + apt-get install -y vblade-persist # ON THE COMPUTE NODE: apt-get install -y kpartx kvm # optional packages - apt-get install -y euca2ools - + apt-get install -y euca2ools + Configuration --------------- @@ -90,10 +90,10 @@ ON CLOUD CONTROLLER :: iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination $IP:8773 - iptables --table nat --append POSTROUTING --out-interface $PUBLICIFACE -j MASQUERADE + iptables --table nat --append POSTROUTING --out-interface $PUBLICIFACE -j MASQUERADE -* Configure NginX proxy (/etc/nginx/sites-enabled/default) +* Configure NginX proxy (/etc/nginx/sites-enabled/default) :: @@ -137,8 +137,8 @@ Launch servers Launch nova components -* api_worker -* s3_worker -* node_worker -* storage_worker +* nova-api +* nova-compute +* nova-objectstore +* nova-volume From 2f441159778189815d291a2586d0442ac5a0b305 Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Fri, 16 Jul 2010 10:03:22 -0500 Subject: [PATCH 2/6] Adds a flag to redirect STDERR when running run_tests.py. Defaults to a truncate-on-write logfile named run_tests.err.log. Adds ignore rule for generated errlog file. --- .bzrignore | 1 + run_tests.py | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 .bzrignore diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 00000000..93fc868a --- /dev/null +++ b/.bzrignore @@ -0,0 +1 @@ +run_tests.err.log diff --git a/run_tests.py b/run_tests.py index bd1587d4..53d4d7eb 100644 --- a/run_tests.py +++ b/run_tests.py @@ -39,6 +39,7 @@ Due to our use of multiprocessing it we frequently get some ignorable """ import __main__ +import os import sys from nova import vendor @@ -66,6 +67,9 @@ FLAGS = flags.FLAGS flags.DEFINE_bool('flush_db', True, 'Flush the database before running fake tests') +flags.DEFINE_string('tests_stderr', 'run_tests.err.log', + 'Path to where to pipe STDERR during test runs. Default = "run_tests.err.log"') + if __name__ == '__main__': OptionsClass = twistd.WrapTwistedOptions(trial_script.Options) config = OptionsClass() @@ -85,6 +89,11 @@ if __name__ == '__main__': else: from nova.tests.real_flags import * + # Establish redirect for STDERR + sys.stderr.flush() + err = open(FLAGS.tests_stderr, 'w+', 0) + os.dup2(err.fileno(), sys.stderr.fileno()) + if len(argv) == 1 and len(config['tests']) == 0: # If no tests were specified run the ones imported in this file # NOTE(termie): "tests" is not a flag, just some Trial related stuff From 070410f4650f818b3893b0677bbedd0ad8cf8035 Mon Sep 17 00:00:00 2001 From: Joshua McKenty Date: Fri, 16 Jul 2010 14:02:37 -0700 Subject: [PATCH 3/6] Ack messages during call so rabbit leaks less. --- nova/rpc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/rpc.py b/nova/rpc.py index 72a84b7f..99e820ff 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -197,7 +197,10 @@ def call(topic, msg): conn = Connection.instance() d = defer.Deferred() consumer = DirectConsumer(connection=conn, msg_id=msg_id) - consumer.register_callback(lambda data, message: d.callback(data)) + def deferred_receive(data, message): + message.ack() + d.callback(data) + consumer.register_callback(deferred_receive) injected = consumer.attach_to_tornado() # clean up after the injected listened and return x From b2321fa4eda77e89935ad871cb3692a6a11d8196 Mon Sep 17 00:00:00 2001 From: Joshua McKenty Date: Fri, 16 Jul 2010 14:07:57 -0700 Subject: [PATCH 4/6] Makin the queues non-durable by default --- nova/rpc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nova/rpc.py b/nova/rpc.py index 99e820ff..c6ebb116 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -112,6 +112,7 @@ class TopicConsumer(Consumer): self.queue = topic self.routing_key = topic self.exchange = FLAGS.control_exchange + self.durable = False super(TopicConsumer, self).__init__(connection=connection) @@ -238,7 +239,8 @@ def send_message(topic, message, wait=True): exchange=msg_id, auto_delete=True, exchange_type="direct", - routing_key=msg_id) + routing_key=msg_id, + durable=False) consumer.register_callback(generic_response) publisher = messaging.Publisher(connection=Connection.instance(), From 6564e2e0cb9bc0b12d559bb46af5ba0f89bfb1f9 Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Sat, 17 Jul 2010 23:00:53 -0700 Subject: [PATCH 5/6] Replace nova-objectstore with a twistd style wrapper. Add a get_application method to objectstore handler. --- bin/nova-objectstore | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/bin/nova-objectstore b/bin/nova-objectstore index 7876864c..5ac911f0 100755 --- a/bin/nova-objectstore +++ b/bin/nova-objectstore @@ -18,35 +18,32 @@ # under the License. """ - Tornado daemon for nova objectstore. Supports S3 API. + Twisted daemon for nova objectstore. Supports S3 API. """ import logging -from nova import vendor -from tornado import httpserver -from tornado import ioloop - from nova import flags -from nova import server from nova import utils -from nova.auth import users +from nova import twistd from nova.objectstore import handler FLAGS = flags.FLAGS -def main(argv): +def main(): # FIXME: if this log statement isn't here, no logging # appears from other files and app won't start daemonized logging.debug('Started HTTP server on %s' % (FLAGS.s3_internal_port)) - app = handler.Application(users.UserManager()) - server = httpserver.HTTPServer(app) - server.listen(FLAGS.s3_internal_port) - ioloop.IOLoop.instance().start() - + app = handler.get_application() + print app + return app +# NOTE(soren): Stolen from nova-compute if __name__ == '__main__': + twistd.serve(__file__) + +if __name__ == '__builtin__': utils.default_flagfile() - server.serve('nova-objectstore', main) + application = main() From 7b2c942697348c0e7278b84c0019b137e70ec35e Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Sat, 17 Jul 2010 23:04:46 -0700 Subject: [PATCH 6/6] Remove s3_internal_port setting. Objectstore should be able to handle the beatings now. As such, nginx is no longer needed, so it's removed from the dependencies and the configuration files are removed. --- bin/nova-objectstore | 2 +- debian/control | 2 +- debian/nova-objectstore.install | 1 - debian/nova-objectstore.links | 1 - debian/nova-objectstore.nginx.conf | 17 ----------------- nova/flags.py | 1 - 6 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 debian/nova-objectstore.links delete mode 100644 debian/nova-objectstore.nginx.conf diff --git a/bin/nova-objectstore b/bin/nova-objectstore index 5ac911f0..9385fd29 100755 --- a/bin/nova-objectstore +++ b/bin/nova-objectstore @@ -35,7 +35,7 @@ FLAGS = flags.FLAGS def main(): # FIXME: if this log statement isn't here, no logging # appears from other files and app won't start daemonized - logging.debug('Started HTTP server on %s' % (FLAGS.s3_internal_port)) + logging.debug('Started HTTP server on %s' % (FLAGS.s3_port)) app = handler.get_application() print app return app diff --git a/debian/control b/debian/control index 17414bb7..a6d12f36 100644 --- a/debian/control +++ b/debian/control @@ -91,7 +91,7 @@ Description: Nova Cloud Computing - API frontend Package: nova-objectstore Architecture: all -Depends: nova-common (= ${binary:Version}), nginx, ${python:Depends}, ${misc:Depends} +Depends: nova-common (= ${binary:Version}), ${python:Depends}, ${misc:Depends} Description: Nova Cloud Computing - object store Nova is a cloud computing fabric controller (the main part of an IaaS system) built to match the popular AWS EC2 and S3 APIs. It is written in diff --git a/debian/nova-objectstore.install b/debian/nova-objectstore.install index 3ed93ff3..c5b3d997 100644 --- a/debian/nova-objectstore.install +++ b/debian/nova-objectstore.install @@ -1,3 +1,2 @@ bin/nova-objectstore usr/bin debian/nova-objectstore.conf etc/nova -debian/nova-objectstore.nginx.conf etc/nginx/sites-available diff --git a/debian/nova-objectstore.links b/debian/nova-objectstore.links deleted file mode 100644 index 38e33948..00000000 --- a/debian/nova-objectstore.links +++ /dev/null @@ -1 +0,0 @@ -/etc/nginx/sites-available/nova-objectstore.nginx.conf /etc/nginx/sites-enabled/nova-objectstore.nginx.conf diff --git a/debian/nova-objectstore.nginx.conf b/debian/nova-objectstore.nginx.conf deleted file mode 100644 index b6342415..00000000 --- a/debian/nova-objectstore.nginx.conf +++ /dev/null @@ -1,17 +0,0 @@ -server { - listen 3333 default; - server_name localhost; - client_max_body_size 10m; - - access_log /var/log/nginx/localhost.access.log; - - location ~ /_images/.+ { - root /var/lib/nova/images; - rewrite ^/_images/(.*)$ /$1 break; - } - - location / { - proxy_pass http://localhost:3334/; - } -} - diff --git a/nova/flags.py b/nova/flags.py index 22e00a44..ae8bf98f 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -37,7 +37,6 @@ DEFINE_bool = DEFINE_bool # http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#39 DEFINE_integer('s3_port', 3333, 's3 port') -DEFINE_integer('s3_internal_port', 3334, 's3 port') DEFINE_string('s3_host', '127.0.0.1', 's3 host') #DEFINE_string('cloud_topic', 'cloud', 'the topic clouds listen on') DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on')