]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: run as an external fastcgi server to match dho
authorJosh Durgin <josh.durgin@dreamhost.com>
Sat, 3 Sep 2011 00:58:19 +0000 (17:58 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Sat, 3 Sep 2011 00:58:19 +0000 (17:58 -0700)
teuthology/ceph.conf
teuthology/task/apache.conf
teuthology/task/rgw.py

index ebdd4c94bca4906e43c1d7b1e99598b2bb34b628..4d991c4aa8f07540dec4ba99e0ac96852ebcb632 100644 (file)
@@ -30,6 +30,8 @@
 
 [client]
         keyring = /tmp/cephtest/data/client.$id.keyring
+        rgw socket path = /tmp/cephtest/apache/tmp/fastcgi_sock/rgw_sock
+        rgw cache enabled = true
 
 [client.admin]
         keyring = /tmp/cephtest/ceph.keyring
index 2ba44ed20fabb6f21f997aa96b3b071fc9797a9c..fd8dd42cdadf45bb4ba7dec09631a5d412e75b10 100644 (file)
@@ -12,8 +12,7 @@ CustomLog /tmp/cephtest/archive/apache/access.log combined
 PidFile /tmp/cephtest/apache/tmp/apache.pid
 DocumentRoot /tmp/cephtest/apache/htdocs
 FastCgiIPCDir /tmp/cephtest/apache/tmp/fastcgi_sock
-FastCgiWrapper /tmp/cephtest/apache/htdocs/rgw.fcgi
-FastCgiServer /tmp/cephtest/binary/usr/local/bin/radosgw -user ubuntu -group ubuntu
+FastCgiExternalServer /tmp/cephtest/apache/htdocs/rgw.fcgi -socket rgw_sock
 RewriteEngine On
 
 RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /rgw.fcgi?page=$1&params=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
index e2c911f97159d5fc84e818564ffe7dd85fd86b6d..feec7d6b503834c011e21b57555ff9a95178c000 100644 (file)
@@ -91,6 +91,43 @@ exec /tmp/cephtest/binary/usr/local/bin/radosgw -c /tmp/cephtest/ceph.conf
                 )
 
 
+@contextlib.contextmanager
+def start_rgw(ctx, config):
+    log.info('Starting rgw...')
+    rgws = {}
+    for client in config:
+        (remote,) = ctx.cluster.only(client).remotes.iterkeys()
+        proc = remote.run(
+            args=[
+                'LD_LIBRARY_PATH=/tmp/cephtest/binary/usr/local/lib',
+                '/tmp/cephtest/enable-coredump',
+                '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
+                '/tmp/cephtest/archive/coverage',
+                '/tmp/cephtest/daemon-helper',
+                'term',
+                '/tmp/cephtest/binary/usr/local/bin/radosgw',
+                '-c', '/tmp/cephtest/ceph.conf',
+                '/tmp/cephtest/apache/apache.conf',
+                run.Raw('>'),
+                '/tmp/cephtest/archive/log/rgw.log',
+                run.Raw('2>&1'),
+                ],
+            logger=log.getChild(client),
+            stdin=run.PIPE,
+            wait=False,
+            )
+        rgws[client] = proc
+
+    try:
+        yield
+    finally:
+        log.info('Stopping rgw...')
+        for client, proc in rgws.iteritems():
+            proc.stdin.close()
+
+        run.wait(rgws.itervalues())
+
+
 @contextlib.contextmanager
 def start_apache(ctx, config):
     log.info('Starting apache...')
@@ -157,6 +194,7 @@ def task(ctx, config):
     with contextutil.nested(
         lambda: create_dirs(ctx=ctx, config=config),
         lambda: ship_config(ctx=ctx, config=config),
+        lambda: start_rgw(ctx=ctx, config=config),
         lambda: start_apache(ctx=ctx, config=config),
         ):
         yield