Page MenuHomePhabricator

Install ORES extension on idwiki
Closed, ResolvedPublic5 Estimated Story Points

Description

In T374077: [SPIKE] Investigate how to install ORES in idwiki [8HRS] we investigated the steps to install ORES on idwiki.

Now we need to actually install it.

Steps to install ORES extension on idwiki:
Databases:

  • Create the ores_model and ores_classification tables.

The standard way is to use https://github.com/wikimedia/mediawiki-extensions-WikimediaMaintenance/blob/master/createExtensionTables.php, but it's not added there so we should add it.
See https://wikitech.wikimedia.org/wiki/Creating_new_tables#Deployment

mwscript-k8s --comment="T382171" -- extensions/WikimediaMaintenance/createExtensionTables.php --wiki=idwiki ores

Extension:

  • Update any i18n system messages:

If we want to add revertrisk we would also need the i18n id.json file in the extension repo updated with the appropriate labels. (Done in this patch)

Config:

  • Add idwiki to the list of wikis in the wgOresUiEnabled config variable.

Define the models that are going to be used for id wiki by adding an idwiki entry in the wgOresModels var.
Here we should make sure we disable the models that are enabled by default (damaging and goodfaith) and define the models explicitly that we want to use.
Backfill

  • Run backfill job
mwscript-k8s --comment="T382171" -- extensions/ORES/maintenance/PopulateDatabase.php --wiki=idwiki
  • Enable filters in the UI (switch the wgOresUiEnabled config variable in ext-ORES.php file in wmf-config to true)

Event Timeline

isarantopoulos renamed this task from Install ORES on idwiki to Install ORES extension on idwiki.May 9 2025, 10:26 AM

Change #1144526 had a related patch set uploaded (by Ilias Sarantopoulos; author: Ilias Sarantopoulos):

[operations/mediawiki-config@master] ores-extension: enable rrrla model in idwiki

https://gerrit.wikimedia.org/r/1144526

It looks like we're missing the following i18n messages for idwiki:

  • ores-rcfilters-revertrisklanguageagnostic-title
  • ores-rcfilters-revertrisklanguageagnostic-whats-this-header
  • ores-rcfilters-revertrisklanguageagnostic-whats-this-body
  • ores-rcfilters-revertrisklanguageagnostic-conflicts-logactions
  • ores-rcfilters-revertrisklanguageagnostic-revertrisk-desc
  • ores-name

I have translated the above i18n messages on translatewiki using either Google suggested messages or MinT. I also cross checked with the results from https://translate.wmcloud.org/
Here is the list of messages for the ores extension in Indonesian

I've run the maintenance script to create the tables

mwscript-k8s --comment="T382171" -- extensions/WikimediaMaintenance/createExtensionTables.php --wiki=idwiki ores
⏳ Starting extensions/WikimediaMaintenance/createExtensionTables.php on Kubernetes as job mw-script.eqiad.dzd1t1lc ...
🚀 Job is running. For streaming logs, run:
K8S_CLUSTER=eqiad KUBECONFIG=/etc/kubernetes/mw-script-eqiad.config kubectl logs

Looking at the logs of the job everything seems to be fine

kubectl logs mw-script.eqiad.dzd1t1lc-xbw86 mediawiki-dzd1t1lc-app
Creating ores tables...
  sourcing tables-generated.sql
  done!

checking on quarry.wmcloud.org I see that the table isn't there

DESCRIBE ores_classification;

Table 'idwiki_p.ores_classification' doesn't exist

But if I try to rerun the script I get a failure that the table already exists. Perhaps there is some kind of delay while syncing but I didn't find anything related to this in Wikitech.

I've run the maintenance script to create the tables

mwscript-k8s --comment="T382171" -- extensions/WikimediaMaintenance/createExtensionTables.php --wiki=idwiki ores
⏳ Starting extensions/WikimediaMaintenance/createExtensionTables.php on Kubernetes as job mw-script.eqiad.dzd1t1lc ...
🚀 Job is running. For streaming logs, run:
K8S_CLUSTER=eqiad KUBECONFIG=/etc/kubernetes/mw-script-eqiad.config kubectl logs

Looking at the logs of the job everything seems to be fine

kubectl logs mw-script.eqiad.dzd1t1lc-xbw86 mediawiki-dzd1t1lc-app
Creating ores tables...
  sourcing tables-generated.sql
  done!

checking on quarry.wmcloud.org I see that the table isn't there

DESCRIBE ores_classification;

Table 'idwiki_p.ores_classification' doesn't exist

But if I try to rerun the script I get a failure that the table already exists. Perhaps there is some kind of delay while syncing but I didn't find anything related to this in Wikitech.

tagging @Ladsgroup

Cookbook cookbooks.sre.wikireplicas.update-views run by taavi: Started updating wiki replica views

Cookbook cookbooks.sre.wikireplicas.update-views started by taavi completed:

  • an-redacteddb1001.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1017.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1018.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1019.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1020.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1013.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1014.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1015.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'
  • clouddb1016.eqiad.wmnet (PASS)
    • Ran Puppet agent
    • Ran 'maintain-views --replace-all --auto-depool --databases idwiki'

checking on quarry.wmcloud.org I see that the table isn't there

Quarry is operating off of a set of heavily redacted replicas of the live databases. There is a script that the cloud-services-team needs to run for added tables, manually until T393388 happens. I've done so for idwiki now.

checking on quarry.wmcloud.org I see that the table isn't there

Quarry is operating off of a set of heavily redacted replicas of the live databases. There is a script that the cloud-services-team needs to run for added tables, manually until T393388 happens. I've done so for idwiki now.

Indeed. This might be useful if you want to check something in production: https://www.mediawiki.org/wiki/User:ASarabadani_(WMF)/Database_for_developers_toolkit/How-to/Make_queries_against_production

Thank you both!
@taavi Thanks for running the script! Does this script need to run after adding new tables or does it run periodically anyway so the replicas will eventually be synced? If it is required, can we run it ourselves? I'm asking because we plan to rollout the ORES extension to ~20 wikis.

Thank you both!
@taavi Thanks for running the script! Does this script need to run after adding new tables or does it run periodically anyway so the replicas will eventually be synced? If it is required, can we run it ourselves? I'm asking because we plan to rollout the ORES extension to ~20 wikis.

We need to run it for them, but it has an option to run it on all dbs and we can run it once. It would be noop in any other wiki.

We need to run it for them

@Ladsgroup sorry I'm confused :D. Can I run this?
Otherwise we can make sure to create the tables for all wikis that are going to be part of this rollout and then request from someone to run the script.

We need to run it for them

@Ladsgroup sorry I'm confused :D. Can I run this?
Otherwise we can make sure to create the tables for all wikis that are going to be part of this rollout and then request from someone to run the script.

Only SREs have access to run the maintain-view changes. So you can't do it but on who "should" do it, it's not really clear in general. We are talking about it in T382607: Decision request - Who runs wikireplicas cookbooks but regardless, it's a simple cookbook. I can run it for ores stuff. Don't worry about it.

Thanks for clearing that up! <3

@Ladsgroup just letting you know that we plan on running the backfill job today after we deploy configuration. Any issues with us running this today?

Change #1144526 merged by jenkins-bot:

[operations/mediawiki-config@master] ores-extension: enable ores extention for rrla without the UI

https://gerrit.wikimedia.org/r/1144526

Mentioned in SAL (#wikimedia-operations) [2025-05-22T13:04:59Z] <isaranto@deploy1003> Started scap sync-world: Backport for [[gerrit:1144526|ores-extension: enable ores extention for rrla without the UI (T382171)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-22T13:07:01Z] <isaranto@deploy1003> isaranto: Backport for [[gerrit:1144526|ores-extension: enable ores extention for rrla without the UI (T382171)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-05-22T13:17:16Z] <isaranto@deploy1003> Finished scap sync-world: Backport for [[gerrit:1144526|ores-extension: enable ores extention for rrla without the UI (T382171)]] (duration: 12m 17s)

@Ladsgroup just letting you know that we plan on running the backfill job today after we deploy configuration. Any issues with us running this today?

That should be fine.

Change #1149407 had a related patch set uploaded (by Ilias Sarantopoulos; author: Ilias Sarantopoulos):

[operations/mediawiki-config@master] ores-extension: enable ores extention UI in idwiki

https://gerrit.wikimedia.org/r/1149407

We have deployed the extension on id.wikipedia.org 🎉 Congrats everyone!
It is now listed in the Special:Version page. @Kgraessle we couldn't find it during the deployment because it had been rename to "Machine Learning Platform" on that page.

We did notice an inconsistency that needs further investigation while running the backfill job. Not all recentchanges were scored. This needs further investigation as it is not straightforward to tell why. They are expected to be less because some requests will fail (because the revision or the parent revision doesn't exist anymore). We discussed that we need to update the backfill script to have counters and output a message when it finishes that prints the following: total requests made, successful, failed.

# recentchanges table entries : 491720
# ores_classification entries: 4777

We have scheduled to enable the UI in the UTC afternoon backport window on Monday the 26th https://schedule-deployment.toolforge.org/window/1748264400

I will update the parent task with more details and the next steps for the other wikis.

We have deployed the extension on id.wikipedia.org 🎉 Congrats everyone!
It is now listed in the Special:Version page. @Kgraessle we couldn't find it during the deployment because it had been rename to "Machine Learning Platform" on that page.

We did notice an inconsistency that needs further investigation while running the backfill job. Not all recentchanges were scored. This needs further investigation as it is not straightforward to tell why. They are expected to be less because some requests will fail (because the revision or the parent revision doesn't exist anymore). We discussed that we need to update the backfill script to have counters and output a message when it finishes that prints the following: total requests made, successful, failed.

# Recentchanges table entries : 491720
# Ores_classfication entries: 4777

We have scheduled to enable the UI in the UTC afternoon backport window on Monday the 26th https://schedule-deployment.toolforge.org/window/1748264400

I will update the parent task with more details and the next steps for the other wikis.

Thanks for this write-up!
I have checked the ores_classification table and we're now up to 9380 records.

Change #1149407 merged by jenkins-bot:

[operations/mediawiki-config@master] ores-extension: enable ores extention UI in idwiki

https://gerrit.wikimedia.org/r/1149407

Mentioned in SAL (#wikimedia-operations) [2025-05-26T13:08:17Z] <gkyziridis@deploy1003> Started scap sync-world: Backport for [[gerrit:1149407|ores-extension: enable ores extention UI in idwiki (T382171)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-26T13:22:15Z] <gkyziridis@deploy1003> isaranto, gkyziridis: Backport for [[gerrit:1149407|ores-extension: enable ores extention UI in idwiki (T382171)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Change #1151276 had a related patch set uploaded (by Ilias Sarantopoulos; author: Ilias Sarantopoulos):

[operations/mediawiki-config@master] Revert^2 "ores-extension: enable ores extention UI in idwiki"

https://gerrit.wikimedia.org/r/1151276

Change #1151276 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert^2 "ores-extension: enable ores extention UI in idwiki"

https://gerrit.wikimedia.org/r/1151276

Mentioned in SAL (#wikimedia-operations) [2025-05-28T07:05:08Z] <isaranto@deploy1003> Started scap sync-world: Backport for [[gerrit:1151276|Revert^2 "ores-extension: enable ores extention UI in idwiki" (T382171)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-28T07:07:19Z] <isaranto@deploy1003> isaranto: Backport for [[gerrit:1151276|Revert^2 "ores-extension: enable ores extention UI in idwiki" (T382171)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-05-28T07:24:28Z] <isaranto@deploy1003> Finished scap sync-world: Backport for [[gerrit:1151276|Revert^2 "ores-extension: enable ores extention UI in idwiki" (T382171)]] (duration: 19m 19s)