Skip to content

roysmith/dyk-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tools for wikipedia Did You Know

Resources

License

Stars

Watchers

Forks

Packages

No packages published