Page MenuHomePhabricator

Use PHP7 to run maintenance scripts
Closed, DuplicatePublic

Description

We need to move all maintenance scripts to use PHP 7.2 instead of HHVM.

This can be done by simply prepending PHP=php7.2 to all the invokations of mwscript etc in the maintenance scripts.

What needs to be done in detail:

  • Pick a few scripts to migrate first, notify the owners, migrate
  • Migrate the wikidata dispatcher
  • Migrate all other scripts by setting php7.2 as the preferred debian alternative
  • Revert all the modifications to the scripts above as we don't need to force

Event Timeline

Change 498845 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] mediawiki::maintenance: run tor_exit cron with PHP 7.2

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

Change 498845 merged by Dzahn:
[operations/puppet@production] mediawiki::maintenance: run tor_exit cron with PHP 7.2

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

@Joe I tried with the first one above and it was fine in production, mwmaint1002, but then i noticed cron spam from labweb1001/1002.

/usr/local/bin/mwscript: line 25: php7.2: command not found

So apparently the crons run on these hosts and we have to setup php7.2 on them.

ok, not all of them, just this:

[labweb1001:~] $ sudo crontab -u www-data -l
# HEADER: This file was autogenerated at 2019-03-25 13:48:37 +0000 by puppet
..
# Puppet Name: run-jobs
* * * * * /usr/local/bin/mwscript maintenance/runJobs.php --wiki=labswiki > /dev/null 2>&1
# Puppet Name: tor_exit_node_update
*/20 * * * * PHP=php7.2 /usr/local/bin/mwscript extensions/TorBlock/maintenance/loadExitNodes.php --wiki=labswiki --force > /dev/null

Duplicate of T195392?

Yes. Just not sure how to merge them best. Unfortunately Phabricator still does not actually do that and only closes one of them without actually merging content and updates.

Duplicate of T195392?

Yes. Just not sure how to merge them best. Unfortunately Phabricator still does not actually do that and only closes one of them without actually merging content and updates.

It has a built in method for marking a task as duplicate. It merges projects and subscribers, it links the duplicate from tab under the task description, and adds a note in the activity timeline that a merge occurred.

It is customary to import any other meta data manually (e.g. sub/parent tasks, maybe a few comments by quoting them). I don't think there can be a technical way to resolve in a way that would be useful to humans as they are effectively conflicting sets of data (does any issue tracking system do that?). I imagine merging comments into one sequence would be rather confusing.