Page MenuHomePhabricator

Upgrade Toolforge grid engine PHP to 7.2 using packages from thirdparty/php72
Closed, ResolvedPublic

Description

We have a PHP 7.2 Docker container for Toolforge Kubernetes (T188318), MediaWiki-Vagrant is using PHP 7.2, and plans are in motion for the production wiki's to use PHP 7.2 (T176370). We should try to keep up with grid engine as well.

Event Timeline

bd808 created this task.Jan 13 2019, 11:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 13 2019, 11:03 PM
Bstorm claimed this task.Jan 18 2019, 4:14 PM

Looks like the prod repo is missing:
php-mcrypt
php-xdebug

Ahh, that's because mcrypt is deprecated in 7.1. xdebug might still be a thing, though...

xdebug is not in the upstream repo either. If we want that, we may have to build it ourselves and put it in the tools repo or something, then?

bd808 added a comment.Jan 18 2019, 5:30 PM

xdebug is not in the upstream repo either. If we want that, we may have to build it ourselves and put it in the tools repo or something, then?

FYI https://tools.wmflabs.org/apt-browser/stretch-wikimedia/thirdparty/php72/ is a nice human readable view of all the binary packages in the component.

bd808 added a comment.Jan 18 2019, 5:33 PM

The mix of php7.2-* and php-* naming is "fun".

Change 485221 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: upgrade the stretch grid to PHP 7.2

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

I totally missed the xdebug package! Thanks

Added that to the patch. Now it's only missing a deprecated package, which I'm more ok with.

Change 485221 merged by Bstorm:
[operations/puppet@production] toolforge: upgrade the stretch grid to PHP 7.2

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

The stretch grid nodes now have both php7.0 and php7.2 installed. It is possible this may cause future confusion when adding new nodes, but it looks good for now.

I could uninstall php7 libraries where they exist on the bastion at least to prevent issues.

In fact, I think it better to strip them from the environment and add them deliberately if there is a reason to. I'll do that.

bd808 added a comment.Jan 18 2019, 9:09 PM
$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20170718/redis.so (/usr/lib/php/20170718/redis.so: undefined symbol: igbinary_serialize), /usr/lib/php/20170718/redis.so.so (/usr/lib/php/20170718/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.13-1+0~20181207100540.13+stretch~1.gbpf57305 (cli) (built: Dec  7 2018 10:05:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.13-1+0~20181207100540.13+stretch~1.gbpf57305, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

This may be a package that is set to ensure=>present that actually needs to be force upgraded to pick up a newer version from the php7.2 repo. We had to explicitly install php-igbinary MediaWiki-Vagrant to work around the same error.

bd808 added a comment.EditedJan 18 2019, 9:10 PM

Manual on tools-sgebastion-06:

$ dpkg-installed |grep redis
libredis-perl        2:1.9910-1
php-redis            4.1.1-1+0~20180819152012.3+stretch~1.gbpd95942
python-redis         2.10.5-2
$ dpkg-installed |grep igbinary
php-igbinary         2.0.1-1
$ sudo apt-get install php-redis php-igbinary
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-redis is already the newest version (4.1.1-1+0~20180819152012.3+stretch~1.gbpd95942).
The following packages will be upgraded:
  php-igbinary
1 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
Need to get 101 kB of archives.
After this operation, 573 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.wikimedia.org/wikimedia stretch-wikimedia/thirdparty/php72 amd64 php-igbinary amd64 2.0.7-1+0~20180819151949.3+stretch~1.gbpd43851 [101 kB]
Fetched 101 kB in 0s (0 B/s)
(Reading database ... 300597 files and directories currently installed.)
Preparing to unpack .../php-igbinary_2.0.7-1+0~20180819151949.3+stretch~1.gbpd43851_amd64.deb ...
Unpacking php-igbinary (2.0.7-1+0~20180819151949.3+stretch~1.gbpd43851) over (2.0.1-1) ...
Setting up php-igbinary (2.0.7-1+0~20180819151949.3+stretch~1.gbpd43851) ...
$ php -v
PHP 7.2.13-1+0~20181207100540.13+stretch~1.gbpf57305 (cli) (built: Dec  7 2018 10:05:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.13-1+0~20181207100540.13+stretch~1.gbpf57305, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

Force update of the php-igbinary package seems to be the fix.

Mentioned in SAL (#wikimedia-cloud) [2019-01-18T21:22:12Z] <bd808> Forcing php-igbinary update via clush for T213666

bd808 added a comment.Jan 18 2019, 9:23 PM

Mentioned in SAL (#wikimedia-cloud) [2019-01-18T21:22:12Z] <bd808> Forcing php-igbinary update via clush for T213666

$ clush -w @all -b '/usr/bin/dpkg -s php-igbinary &>/dev/null && sudo apt-get update -qq && sudo /usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" php-igbinary'

A few need a reinstall, which I'm going to do, but phpunit re-installs 7.0. There's no phpunit in the thirdparty repo, and the stretch version is old and unsupported by the upstream.

bd808 added a comment.Jan 18 2019, 9:27 PM

I think we can remove phpunit as a system package and let folks install with Composer for their projects. We should document that as a change on https://wikitech.wikimedia.org/wiki/News/Toolforge_Trusty_deprecation.

Change 485338 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: remove phpunit from the stretch grid

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

Change 485338 merged by Bstorm:
[operations/puppet@production] toolforge: remove phpunit from the stretch grid

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

Change 485343 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: update the version of php-cgi to 7.2 as well

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

Change 485343 merged by Bstorm:
[operations/puppet@production] toolforge: update the version of php-cgi to 7.2 as well

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

Bstorm closed this task as Resolved.Jan 19 2019, 1:11 AM

PHP 7.0 has been properly replaced at this point, I think, with 7.2 in the new grid.