Restructure the repo for consistency
Signed-off-by: Michael Winters <fedora@mwinters.net>
This commit is contained in:
parent
a6066940f1
commit
f5d515f8e0
168 changed files with 480 additions and 439 deletions
141
modules/sysadmin_sops/pages/datanommer.adoc
Normal file
141
modules/sysadmin_sops/pages/datanommer.adoc
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
= datanommer SOP
|
||||
|
||||
Consume fedora messaging activity and stuff it in a postgresql db.
|
||||
|
||||
== Contact Information
|
||||
|
||||
Owner::
|
||||
Fedora Infrastructure Team
|
||||
Contact::
|
||||
#fedora-apps, #fedora-admin, #fedora-noc
|
||||
Servers::
|
||||
openshift apps
|
||||
Purpose::
|
||||
Save fedora messaging bus activity
|
||||
|
||||
== Description
|
||||
|
||||
datanommer is a set of three modules:
|
||||
|
||||
python-datanommer-models::
|
||||
Schema definition and API for storing new items and querying existing
|
||||
items
|
||||
python-datanommer-consumer::
|
||||
A plugin for the fedora messaging that actively listens to the bus and
|
||||
stores events.
|
||||
datanommer-commands::
|
||||
A set of CLI tools for querying the DB.
|
||||
|
||||
datanommer serves as a backend for future web services like
|
||||
datagrepper.
|
||||
|
||||
Source: https://github.com/fedora-infra/datanommer/
|
||||
|
||||
== Database server
|
||||
|
||||
datanommer has a dedicated timescaledb database server. This server stores
|
||||
all the messages send on the message bus. Currently that is db-datanommer02 in
|
||||
production and db-datanommer01.stg in staging.
|
||||
|
||||
== datanommer and datagrepper
|
||||
|
||||
The datanommer and datagrepper serices are run in openshift.
|
||||
|
||||
datanommer just listens to the message bus and inserts messages into the database.
|
||||
datagrepper provides a api into searching the database.
|
||||
|
||||
== database dump
|
||||
|
||||
The information in the fedora messaging bus is public and a dump of the contents
|
||||
of the database are available for download:
|
||||
|
||||
https://infrastructure.fedoraproject.org/infra/db-dumps/datanommer2.dump.xz
|
||||
|
||||
note that this db is very large uncompressed.
|
||||
|
||||
== CLI tools
|
||||
|
||||
Dump the db into a file as json:
|
||||
|
||||
....
|
||||
$ datanommer-dump > datanommer-dump.json
|
||||
....
|
||||
|
||||
When was the last bodhi message?:
|
||||
|
||||
....
|
||||
$ # It was 678 seconds ago
|
||||
$ datanommer-latest --category bodhi --timesince
|
||||
[678]
|
||||
....
|
||||
|
||||
When was the last bodhi message in more readable terms?:
|
||||
|
||||
....
|
||||
$ # It was 12 minutes and 43 seconds ago
|
||||
$ datanommer-latest --category bodhi --timesince --human
|
||||
[0:12:43.087949]
|
||||
....
|
||||
|
||||
What was that last bodhi message?:
|
||||
|
||||
....
|
||||
$ datanommer-latest --category bodhi
|
||||
[{"bodhi": {
|
||||
"topic": "org.fedoraproject.stg.bodhi.update.comment",
|
||||
"msg": {
|
||||
"comment": {
|
||||
"group": null,
|
||||
"author": "ralph",
|
||||
"text": "Testing for latest datanommer.",
|
||||
"karma": 0,
|
||||
"anonymous": false,
|
||||
"timestamp": 1360349639.0,
|
||||
"update_title": "xmonad-0.10-10.fc17"
|
||||
},
|
||||
"agent": "ralph"
|
||||
},
|
||||
}}]
|
||||
....
|
||||
|
||||
Show me stats on datanommer messages by topic:
|
||||
|
||||
....
|
||||
$ datanommer-stats --topic
|
||||
org.fedoraproject.stg.fas.group.member.remove has 10 entries
|
||||
org.fedoraproject.stg.logger.log has 76 entries
|
||||
org.fedoraproject.stg.bodhi.update.comment has 5 entries
|
||||
org.fedoraproject.stg.busmon.colorized-messages has 10 entries
|
||||
org.fedoraproject.stg.fas.user.update has 10 entries
|
||||
org.fedoraproject.stg.wiki.article.edit has 106 entries
|
||||
org.fedoraproject.stg.fas.user.create has 3 entries
|
||||
org.fedoraproject.stg.bodhitest.testing has 4 entries
|
||||
org.fedoraproject.stg.fedoratagger.tag.create has 9 entries
|
||||
org.fedoraproject.stg.fedoratagger.user.rank.update has 5 entries
|
||||
org.fedoraproject.stg.wiki.upload.complete has 1 entries
|
||||
org.fedoraproject.stg.fas.group.member.sponsor has 6 entries
|
||||
org.fedoraproject.stg.fedoratagger.tag.update has 1 entries
|
||||
org.fedoraproject.stg.fas.group.member.apply has 17 entries
|
||||
org.fedoraproject.stg.__main__.testing has 1 entries
|
||||
....
|
||||
|
||||
== Upgrading the DB Schema
|
||||
|
||||
datanommer uses "python-alembic" to manage its schema. When developers
|
||||
want to add new columns or features, these should/must be tracked in
|
||||
alembic and shipped with the RPM.
|
||||
|
||||
In order to run upgrades on our stg/prod dbs:
|
||||
|
||||
[arabic]
|
||||
. ssh to busgateway01\{.stg}
|
||||
. `cd /usr/share/datanommer.models/`
|
||||
. Run:
|
||||
+
|
||||
....
|
||||
$ alembic upgrade +1
|
||||
....
|
||||
|
||||
____
|
||||
Over and over again until the db is fully upgraded.
|
||||
____
|
||||
Loading…
Add table
Add a link
Reference in a new issue