ORES extension local development guide
Appearance
1. Install mediawiki with docker
Clone MediaWiki repo
git clone ssh://<USERNAME>@gerrit.wikimedia.org:29418/mediawiki/core.git mediawiki
add this in docker-compose.override.yml to use mysql and expose the port to our localhost
services: database: image: mariadb environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 volumes: - ./cache/dbdata:/var/lib/mysql ports: - "3306:3306" volumes: dbdata: driver: local
docker compose up
We run the following command to install and configure mediawiki. We name the database as enwiki otherwise ORES service won’t be able to find a model for a wiki name that doesn’t exist. Alternatively we could point to another service that would have such a wikiname e.g. a local running instance of ores-legacy app.
docker compose exec mediawiki /bin/bash -c '''php maintenance/install.php --server=http://localhost:8080 --scriptpath="/w" --dbuser root --dbserver database --dbname enwiki --lang en --skins=Vector --with-extensions --pass $MY_PASS enwiki $MY_USER'''
2. Install ORES
cd mediawiki/core git clone "https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" skins/Vector git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/ORES" extensions/ORES
Add the following code at the bottom of your LocalSettings.php:
wfLoadSkin( 'Vector' ); wfLoadExtension( 'ORES' );
3. Score existing revisions
Score revisions and populate database tables
docker compose exec mediawiki php extensions/ORES/maintenance/PopulateDatabase.php