-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
44 lines (34 loc) · 1.38 KB
/
README
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
Initial toolforge setup:
verify you have a $HOME/replica.my.cnf file
mkdir -p $HOME/www/python
cd $HOME/www/python
git clone https://github.com/roysmith/dyk-tools.git src
webservice --backend=kubernetes python3.11 shell
(on the k8s host)
cd $HOME/www/python
python3 -m venv venv
. venv/bin/activate
cd src
pip install .
Create an empty config file:
touch $HOME/.pywikibot/user-config.py file
chmod u+x $HOME/.pywikibot
Running a local test server (the on-line docs may be incorrect on this):
cd src
flask --debug run
Running toolforge cronjob:
toolforge-jobs run dykbot-cron --command /data/project/dyk-tools/www/python/src/dykbot.bash --image tf-python39 --schedule "43 * * * *"
Building a wheel:
python -m build
To install:
locally: git commit, git push
on bastion: git pull
on krb host: pip install -e .
Connecting to the toolforge SQL database from a local development machine:
1) Set up a port tunnel with something like:
ssh -t dev.toolforge.org -L 3306:tools.db.svc.wikimedia.cloud:3306
2) Connect through the tunnel:
mysql --defaults-file=replica.my.cnf --host=127.0.0.1 --port=3306
Note that --host=localhost does NOT work. On my machine, it results in:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Not clear what's going on there, but just use 127.0.0.1 and it works.