Page MenuHomePhabricator

Switch cronjobs on maintenance hosts to PHP7
Open, NormalPublic

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:

  • Separate production maintenance scripts from wikitech ones**
  • 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
  • Some cronjobs are shared with wikitech, which has not been switched to PHP7. To avoid blocking this task we can keep production and wikitech maint jobs separate T222900

Related to: T219135:

Related Objects

Event Timeline

Jdforrester-WMF triaged this task as Normal priority.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 23 2018, 5:34 PM
Vvjjkkii renamed this task from Run all jobs on PHP7 to rfcaaaaaaa.
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
TerraCodes lowered the priority of this task from High to Normal.Jul 2 2018, 4:45 PM
TerraCodes added a subscriber: Aklapper.
Krinkle added subscribers: Shizhao, Krinkle.

@Shizhao This is a tracking task for migrating the WMF JobQueue jobrunner infrastructure to PHP 7. The PHP7.0-support project is for tracking known problems with code that does not support PHP 7 correctly.

It is possible that as part of the migration, we may encounter incompatibilities. Those will be created as sub tasks and tagged with PHP7.0-support, but this migration is not itself a compatibility problem, and will also work unrelated to compatibility, such as server upgrades and configuration changes.

Krinkle renamed this task from Run all jobs on PHP7 to Use PHP7 for RPC requests on jobrunner web servers.Sep 22 2018, 11:28 PM
Krinkle added a project: WMF-JobQueue.
Krinkle renamed this task from Use PHP7 for RPC requests on jobrunner web servers to Use PHP7 for web requests on jobrunner servers.

@Jdforrester-WMF Can you confirm that this task is about cron jobs, as opposed to JobQueue jobs? Based on the sub tasks, I think I misinterpreted the title.

@Jdforrester-WMF Can you confirm that this task is about cron jobs, as opposed to JobQueue jobs? Based on the sub tasks, I think I misinterpreted the title.

This was initially meant for cron, manual maintenance, and jobqueue jobs (i.e., everything that's not a WebRequest or the dumps), but happy for this to be re-purposed to whatever helps.

Krinkle renamed this task from Use PHP7 for web requests on jobrunner servers to Switch cronjobs on maintenance hosts to PHP7.Oct 5 2018, 6:25 AM

Thanks. I'll purpose it for maintenance hosts (CLI maintenance scripts from cron).

For job runners, we use the same configuration as regular MW servers, and are actually invoked over HTTP as internal POST requests, so they'll be transitioned at the same time as other web servers. We'll probably do it by cluster of web servers (web, api, jobrunner, videoscaler), but we don't need a separate task for that.

Krinkle added subscribers: Joe, Dzahn.

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
Krinkle updated the task description. (Show Details)Mar 26 2019, 4:35 PM
Krinkle added a project: Services.
Krinkle moved this task from Acknowledged to Backlog on the Operations board.
Krinkle added a subscriber: jijiki.
jijiki added a subscriber: cloud-services-team.

Adding cloud services team in the loop

Adding cloud services team in the loop

labweb1001/1002 should be wikitech. Do you need any other concrete info?

@aborrero I though that this is related to T218615, that's why I added you all :)

jijiki updated the task description. (Show Details)Mar 27 2019, 6:13 PM
jijiki updated the task description. (Show Details)Apr 3 2019, 6:50 PM
jijiki updated the task description. (Show Details)Apr 3 2019, 6:55 PM
jijiki moved this task from Backlog/Radar to In Progress on the User-jijiki board.Apr 4 2019, 9:14 PM
jijiki updated the task description. (Show Details)May 15 2019, 7:13 PM