Page MenuHomePhabricator

Support PHP 7.2 webservices on Toolforge Kubernetes cluster
Closed, ResolvedPublic

Description

PHP 7.2 was released in November of 2017.

There is an "official" docker image for PHP 7.2 (as well as 7.1, etc.) that is maintained by the Docker community:
https://hub.docker.com/_/php/

See also: T195689: Support PHP 7.x webservices on Toolforge

Related Objects

Event Timeline

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

Change 449033 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/docker-images/toollabs-images@master] [WIP] Add php72 base and web images

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

Legoktm renamed this task from Add Support for PHP 7.2 to Toolforge to Support PHP 7.2 webservices on Toolforge.Jul 29 2018, 6:55 PM

Change 449033 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] Add php72 base and web images

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

Change 452353 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/software/tools-webservice@master] Add support for php7.2 image/backend

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

Change 452353 merged by jenkins-bot:
[operations/software/tools-webservice@master] Add support for php7.2 image/backend

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

tools.wmde-access@tools-bastion-03:~$ webservice --backend=kubernetes php7.2 start
Starting webservice....

https://tools.wmflabs.org/wmde-access/ now works :) Thanks!

It's still very much alpha quality for now, there's still some stuff missing. I hope to send out an announcement calling for beta testers later this week.

Great to see this moving forward ( so quickly \o/ ) - I just tried it on one of our existing tools ( that we also need to upgrade ). Three things:

1st mbstring:

You are missing a required extension to PHP that MediaWiki requires to run. Please install:

    mbstring (more information)

2nd update:
When php7.2 is only available via the webservice how can I run the maintanace script that requires php7x on CLI?

3rd composer:

our requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php >=5.6.99 but your PHP version (5.5.9) does not satisfy that requirement.
  Problem 2
    - Installation request for mediawiki/mediawiki-codesniffer 21.0.0 -> satisfiable by mediawiki/mediawiki-codesniffer[v21.0.0].
    - mediawiki/mediawiki-codesniffer v21.0.0 requires php >= 5.6.99 -> your PHP version (5.5.9) does not satisfy that requirement.

@WMDE-Fisch for 2 and 3 you can probably use webservice --backend=kubernetes php7.2 shell? That’s what this guide recommends for Python tools, at least.

Change 452755 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/docker-images/toollabs-images@master] php72: Install php7.2-mbstring

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

Change 452755 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] php72: Install php7.2-mbstring

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

Great to see this moving forward ( so quickly \o/ ) - I just tried it on one of our existing tools ( that we also need to upgrade ). Three things:

1st mbstring:

Added. You'll need to run webservice restart for it to show up.

When php7.2 is only available via the webservice how can I run the maintanace script that requires php7x on CLI?

Exactly what @Lucas_Werkmeister_WMDE said - you should use the shell interactive pod to get a PHP 7.2 CLI. It also has composer installed.

And thank you for testing :-)

@WMDE-Fisch for 2 and 3 you can probably use webservice --backend=kubernetes php7.2 shell? That’s what this guide recommends for Python tools, at least.

Cool, that works. Thank you. - Only when running composer to update all the stuff I got several of these:

Failed to download wikimedia/html-formatter from dist: The zip extension and unzip command are both missing, skipping.

It went through anyways ( I think by downloading it unzipped from source or something?) and the wiki is up and running:

https://tools.wmflabs.org/wmde-editconflict-test/core/index.php?title=Spezial:Version \o/

Yep, looks like the zip extension is missing. For completeness:

--- 56.txt	2018-08-15 12:29:22.815823579 -0700
+++ 72.txt	2018-08-15 12:29:48.039927871 -0700
@@ -1,16 +1,11 @@
 [PHP Modules]
-apc
 apcu
-bcmath
-bz2
 calendar
 Core
 ctype
 curl
 date
-dba
 dom
-ereg
 exif
 fileinfo
 filter
@@ -19,14 +14,10 @@
 gettext
 hash
 iconv
-imagick
 intl
 json
 libxml
 mbstring
-mcrypt
-mhash
-mysql
 mysqli
 mysqlnd
 openssl
@@ -40,13 +31,12 @@
 Phar
 posix
 readline
-redis
 Reflection
 session
 shmop
 SimpleXML
-soap
 sockets
+sodium
 SPL
 sqlite3
 standard
@@ -60,7 +50,6 @@
 xmlwriter
 xsl
 Zend OPcache
-zip
 zlib
 
 [Zend Modules]

Change 453064 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/docker-images/toollabs-images@master] php72: Add more missing extensions that php5.6 had

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

Change 453064 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] php72: Add more missing extensions that php5.6 had

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

Tested composer, works fine with the unzip binary:

tools.phpinfo@interactive:~$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing wikimedia/timestamp (v1.0.0): Downloading (100%)         
Writing lock file
Generating autoload files

Also https://tools.wmflabs.org/phpinfo/

Is the Redis extension able to be enabled now that T200666 is resolved? Or is there more to it? (I'm happy to help, if someone points me in the right direction.)

Is the Redis extension able to be enabled now that T200666 is resolved? Or is there more to it? (I'm happy to help, if someone points me in the right direction.)

Sorry, not yet, still a missing dependency that I didn't realize earlier :/ see T202704: Add a few more PHP 7.2 packages for Toolforge in thirdparty/php72.

Change 455083 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/docker-images/toollabs-images@master] php72: Pin thirdparty/php72 higher than stretch

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

Change 455084 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[operations/docker-images/toollabs-images@master] php72: Enable imagick, update missing extension reasons

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

Change 455083 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] php72: Pin thirdparty/php72 higher than stretch

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

Change 455084 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] php72: Enable apc, apcu, imagick, & redis

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

Is the Redis extension able to be enabled now that T200666 is resolved? Or is there more to it? (I'm happy to help, if someone points me in the right direction.)

Sorry, not yet, still a missing dependency that I didn't realize earlier :/ see T202704: Add a few more PHP 7.2 packages for Toolforge in thirdparty/php72.

Scratch that, Moritz was faster than I expected, so the packages are available, and I just updated the docker containers. https://tools.wmflabs.org/phpinfo/ shows redis :)

@Samwilson give it a spin and let me know how it goes? If you already have a running webservice, you'll need to restart it to pick up the updated image AIUI.

Is it possible to send mail from the php7.2 container? (I'm getting "/usr/sbin/exim: No such file or directory" and there doesn't seem to be any obvious other mail agent to use.)

Is it possible to send mail from the php7.2 container? (I'm getting "/usr/sbin/exim: No such file or directory" and there doesn't seem to be any obvious other mail agent to use.)

Is it possible to send mail in the 5.6 container? If so, then I'll look into why it's not working in 7.2. But if it's not possible in 5.6, then can you file it as a separate ticket?

bd808 renamed this task from Support PHP 7.2 webservices on Toolforge to Support PHP 7.2 webservices on Toolforge Kubernetes cluster.Jan 13 2019, 11:12 PM

Change 496564 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[operations/software/tools-webservice@master] kubernetes: Set php7.2 as the default type

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

bd808 added a subscriber: bd808.

Both 7.2 and 7.3 are available in Kubernetes. 7.2 is available on the job grid.