Page MenuHomePhabricator

Migrate WMF production from PHP 7.4 to PHP 8.1
Closed, ResolvedPublic

Description

T271736: Migrate WMF production from PHP 7.2 to PHP 7.4 | T360995: Migrate Wikimedia production from PHP 8.1 to PHP 8.3

This is scheduled after T290536: Serve production traffic via Kubernetes, kept out of dependency tree for readability.

The next target for WMF production after PHP 7.4, is PHP 8.1. This will incorporate:

  • Assurance that this should work
    • CI configured to require PHP 8.1 to pass for all production code
      • Making CI passing and enforced ("voting") for MediaWiki core on PHP 8.0 and PHP 8.1.
      • Making CI passing wmf-deployed MediaWiki extensions and skins on PHP 8.0 and PHP 8.1.
    • Other tooling changes as needed
  • Preparation of Wikimedia production
  • Pre-launch testing
    • Benchmarks for different workloads and different clusters (non blocking) T383805 T321709
    • Add an option to WikimediaDebug to select which version is used. T372605
    • Add ability to do consistent client-side ramp-up via a PHP_ENGINE cookie. T377987
    • Add request routing for PHP_ENGINE cookie. T377042
  • MediaWiki production migration T383845
    • cookie-based traffic (mw-(web|api-ext)-next svc)
      • mw-web
      • mw-api-ext
    • cookie-less external traffic, and non-user facing traffic (via -migration releases)
      • mw-web
      • mw-api-ext
      • mw-api-int
      • mw-parsoid
      • mw-jobrunner
    • Everything else
      • Snapshot hosts ("dumps")
      • mw-videoscaler
      • mw-script
      • mw-wikifunctions
      • mw-cron
  • Migrate remaining cronjobs to mw-cron T341555
  • Decommission support for PHP 7.4 from production
  • Drop PHP 7.4 and 8.0 testing from CI, if not otherwise needed for release branches, and any relevant documentation

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
ResolvedJdforrester-WMF
ResolvedReedy
ResolvedKrinkle
Resolvedtstarling
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
Resolved larissagaulia
ResolvedJMeybohm
ResolvedNone
DuplicateNone
ResolvedNone
ResolvedScott_French
Resolveddduvall
ResolvedScott_French
ResolvedFeature bd808
ResolvedScott_French
ResolvedScott_French
ResolvedKrinkle
ResolvedMSantos
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Noting also that getting the k8s stuff done was done before this in attempt to make future upgrades easier..

I’m not sure we’re immediately start going to go to 8.3 or similar when we’re done with the 8.1 upgrade, but it should result in a much shorter timeline going forward

jijiki changed the task status from Stalled to In Progress.Jan 24 2025, 2:18 PM
jijiki updated the task description. (Show Details)

Change #1129343 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Upgrade snapshot hosts to PHP version 8.1 - except snapshot1016

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

Change #1129343 merged by Btullis:

[operations/puppet@production] Upgrade snapshot hosts to PHP version 8.1 - except snapshot1016

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

I am rolling out PHP version 8.1 to all snapshot hosts except snapshot1016. They should all start the 20250320 dump using the new version.
https://gerrit.wikimedia.org/r/1129343 applies cleanly.

We are still working on T352650: WE 5.4 KR - Hypothesis 5.4.4 - Q3 FY24/25 - Migrate current-generation dumps to run on kubernetes to migrate them to Kubernetes and Airflow, but for now they are still using the Debian packages.

7 of the 8 snapshot servers are now running PHP 8.1 for dumps.

btullis@cumin1002:~$ sudo cumin A:snapshot 'php --version'
8 hosts will be targeted:
snapshot[1010-1017].eqiad.wmnet
OK to proceed on 8 hosts? Enter the number of affected hosts to confirm or "q" to quit: 8
===== NODE GROUP =====                                                                                                                                                                                             
(1) snapshot1016.eqiad.wmnet                                                                                                                                                                                       
----- OUTPUT of 'php --version' -----                                                                                                                                                                              
PHP 7.4.33 (cli) (built: Apr 18 2024 14:41:42) ( NTS )                                                                                                                                                             
Copyright (c) The PHP Group                                                                                                                                                                                        
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
===== NODE GROUP =====                                                                                                                                                                                             
(7) snapshot[1010-1015,1017].eqiad.wmnet                                                                                                                                                                           
----- OUTPUT of 'php --version' -----                                                                                                                                                                              
PHP 8.1.31 (cli) (built: Feb 25 2025 14:52:55) (NTS)                                                                                                                                                               
Copyright (c) The PHP Group                                                                                                                                                                                        
Zend Engine v4.1.31, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.31, Copyright (c), by Zend Technologies
================                                                                                                                                                                                                   
PASS |█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100% (8/8) [00:00<00:00, 18.49hosts/s]
FAIL |                                                                                                                                                                             |   0% (0/8) [00:00<?, ?hosts/s]
100.0% (8/8) success ratio (>= 100.0% threshold) for command: 'php --version'.
100.0% (8/8) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.

I had to upgrade libpcre2-8-0 manually after installation, due to T387276: PHP on Beta cluster fails due to mismatching PCRE - This wouldn't have been a problem if we had reimaged, but the upgrade didn't automaticaly install the newly pinned libpcre2-8-0 package.

We will follow up with snapshot1016 as soon as it is practicable.

Change #1132568 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Upgrade PHP on the misc dumps worker - snapshot1016

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

Change #1132568 merged by Btullis:

[operations/puppet@production] Upgrade PHP on the misc dumps worker - snapshot1016

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

All snapshot hosts have now been upgraded to PHP 8.1.

Change #1132584 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Update the PHP version in the other dumps configuration file

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

Change #1132584 merged by Btullis:

[operations/puppet@production] Update the PHP version in the other dumps configuration file

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

Following up on discussion out of band about remaining hosts that install PHP 7.4, here using php7.4-common [0] as a representative package:

Ignoring hosts that install "stock" debian packages (rather than our custom builds in component/icu67 or component/php74) for use cases unrelated to running MediaWiki code, we see:

  • mwdebug1001 and mwdebug2001: These are the remaining two mwdebug hosts that have not yet been reimaged to 8.1 (in progress).
  • mwmaint1002 and mwmaint2002: These hosts will remain on PHP 7.4 until they are ready for turndown, as periodic maintenance jobs and one-off maintenance scripts move to k8s (in progress).
  • deploy1003 and deploy2002: These hosts have 7.4 installed to support running maintenance scripts. Scap's use of maintenance scripts has been containerized and already migrated to 8.1. Users who might run one-off maintenance scripts on these hosts - rather than mwmaint hosts - will similarly onboard to k8s via the mwscript-k8s tool.
  • cloudweb1003.wikimedia.org, cloudweb1004.wikimedia.org, cloudweb2002-dev.wikimedia.org: This appears to be leftovers from the migration of wikitech to k8s. Specifically, these hosts still have apache2 and php7.4-fpm installed, however the apache2 configuration relevant to serving wikitech is disabled. Similarly, although /srv/mediawiki exists on these hosts, it has clearly not been touched since October 2024. I'll follow up on what the plan is for cleaning these up (edit: this is most likely T371378: Cleanup: Wikitech code leftovers).

[0] https://debmonitor.wikimedia.org/packages/php7.4-common

Looks like we've ticked most the boxes and resolved most the subtasks. Might be able to mark this one resolved soon :)

jijiki updated the task description. (Show Details)