forked from mzmcbride/database-reports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
48 lines (39 loc) · 1.6 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Deployment
==========
To deploy the current HEAD at GitHub, run as yourself with
ssh permissions for Toolserver and Tools:
$ ssh yarrow.toolserver.org sudo -u dbreps bash <<EOF &&
cd ~dbreps/src/database-reports &&
git pull --rebase &&
python setup.py install --user --install-scripts ~dbreps/bin &&
crontab crontab.yarrow
EOF
ssh submit.toolserver.org sudo -u dbreps cronie \~dbreps/src/database-reports/cronietab.submit &&
ssh tools-login.wmflabs.org sudo -iu local-dbreps bash <<EOF &&
cd ~/src/database-reports &&
git pull --rebase &&
python setup.py install --user --install-scripts ~/bin &&
crontab crontab.tools
EOF
echo Successfully deployed dbreps to yarrow, submit and tools-login.
Caution: This does not install the required modules per
README (MySQLdb, oursql, python-Levenshtein and wikitools),
nor does it signal an error if they are not installed.
User databases
==============
Some reports store information about the last run in tables in user
databases. They can be safely purged and excluded from backup, but
their structures must always exist.
To (re-)create these, run as user dbreps:
$ USERDB=p_dbreps
$ sql -u enwiki_p <<EOF
DROP TABLE IF EXISTS $USERDB.bullshit_reviewed_page_titles;
CREATE TABLE $USERDB.bullshit_reviewed_page_titles
(page_id int(8) unsigned PRIMARY KEY,
lastreviewed TIMESTAMP NOT NULL);
DROP TABLE IF EXISTS $USERDB.potenshblps4_skipped_pages;
CREATE TABLE $USERDB.potenshblps4_skipped_pages
(page_title VARCHAR(255) COLLATE utf8_bin PRIMARY KEY);
LOAD DATA LOCAL INFILE 'data/enwiki/potenshblps4/skipped_pages.txt'
INTO TABLE $USERDB.potenshblps4_skipped_pages (page_title);
EOF