From 8995b349a716d37a699593a20c946b3f143573ad Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Thu, 16 Apr 2015 12:03:27 -0700 Subject: [PATCH] Status utility now support different vhosts per cell. Minor tweaks also include: - shoebox handler now wraps notification with region/cell info - pip_freeze_versions.txt is updated after each ./build and copied into the VENV directory for inclusion in tarball. Change-Id: Ibe4027770b859ea7878c9f0952fccf94fb496c43 --- ansible/roles/stv3-workers/templates/yagi.conf.j2 | 5 ++++- bin/stv3_status.py | 9 +++++---- build.sh | 4 ++++ etc/status.yaml | 12 ++++++------ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ansible/roles/stv3-workers/templates/yagi.conf.j2 b/ansible/roles/stv3-workers/templates/yagi.conf.j2 index d303d49..0b3c243 100644 --- a/ansible/roles/stv3-workers/templates/yagi.conf.j2 +++ b/ansible/roles/stv3-workers/templates/yagi.conf.j2 @@ -58,4 +58,7 @@ working_directory=/etc/stv3/{{item.cell}}/events destination_folder=/etc/stv3/tarballs filename_template=%Y%m%d-[[TIMESTAMP]]-region-{{item.cell}}-stv3-[[CRC]].json roll_manager=shoebox.roll_manager:WritingJSONRollManager -roll_size_mb=1000 +roll_size_mb=30 +wrap_payload_with_region=True +wrap_region=region +wrap_cell={{ item.cell }} diff --git a/bin/stv3_status.py b/bin/stv3_status.py index 4a43947..1632cca 100644 --- a/bin/stv3_status.py +++ b/bin/stv3_status.py @@ -69,7 +69,6 @@ worker_hostnames = config['worker_hostnames'] rabbit_hostnames = config['rabbit_hostnames'] api_hostnames = config['api_hostnames'] port = int(config.get('ssh_port', 22)) -vhost = config.get('vhost', '/') lines = config.get('tail_lines', '100') queue_prefixes = config.get('queue_prefixes', ['monitor']) num_pipeline_workers = config.get('num_pipeline_workers', 2) @@ -122,9 +121,11 @@ for api in api_hostnames: o.write(ret[1]) prefixes = '|'.join(queue_prefixes) -for rabbit in rabbit_hostnames: - print "--- RabbitMQ: %s vhost: %s" % (rabbit, vhost) - ret = ssh(rabbit, ["sudo rabbitmqctl list_queues -p %s | grep -E '%s'" % +for rabbit_conf in rabbit_hostnames: + host = rabbit_conf['host'] + vhost = rabbit_conf.get('vhost', '/') + print "--- RabbitMQ: %s vhost: %s" % (host, vhost) + ret = ssh(host, ["sudo rabbitmqctl list_queues -p %s | grep -E '%s'" % (vhost, prefixes)], username, password, port) for r in ret: diff --git a/build.sh b/build.sh index 9efe26b..6f742ad 100755 --- a/build.sh +++ b/build.sh @@ -110,6 +110,10 @@ fi # Hack(sandy): remove msgpack that conflicts with carrot pip uninstall -y msgpack-python +pip freeze > pip_freeze_versions.txt + +cp pip_freeze_versions.txt $VENV_DIR + (cat yagi.conf.$PIPELINE_ENGINE ; cat yagi.conf.common ) > yagi.conf if [ $PIPELINE_ENGINE == "winchester" ] diff --git a/etc/status.yaml b/etc/status.yaml index a4babdd..6149087 100644 --- a/etc/status.yaml +++ b/etc/status.yaml @@ -15,13 +15,13 @@ worker_hostnames: - worker1.example.com - worker2.example.com -# Which vhost is your rabbit using? -vhost: nova - rabbit_hostnames: - - rabbit.global.example.com - - rabbit.cell1.example.com - - rabbit.cell2.example.com + - host: rabbit.global.example.com + vhost: / + - host: rabbit.cell1.example.com + vhost: / + - host: rabbit.cell2.example.com + vhost: / # However you have your OpenStack service configured. # Could be multiple queues to watch.