Page MenuHomePhabricator

Install PHP7 on scandium
Closed, ResolvedPublic

Description

In order to do ongoing rigorous testing of the ported PHP code, we are building facilities into Parsoid that let us splice in PHP transformations in place of JS transformations in the Parsoid pipeline. So, this hybrid pipeline will run JS and PHP code as part of parsing a page. This lets us get early and regular feedback on ported code by using the Parsoid/JS code as a environment mocking wrapper around the constantly growing ported PHP code.

https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/483212 is the first work in progress patch for this.

Since the PHP and JS code live side by side in the Parsoid repository, the only blockers to doing this (once the patches are ready and merged) would be:
(a) availability of PHP7 on scandium
(b) installation of PHP dependencies: This could possibly be done similar to node_modules in the Parsoid deploy repository .... but we need to figure out whether we end up any binary dependencies which would make this harder.

This task is for discussing and work in the first piece -- installing PHP7 on scandium. This would require puppetization work.

Once we resolve that this is a good approach and figure out how (b) would work, we can tag ops and proceed with this.

Details

Related Gerrit Patches:
operations/puppet : productionparsoid::testing: use profile::mediawiki::php to get PHP 7.2
operations/puppet : productionparsoid::testing: install PHP 7.2
operations/puppet : productionparsoid::testing: install PHP7

Event Timeline

ssastry created this task.Jan 10 2019, 10:43 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 10 2019, 10:43 PM
ssastry triaged this task as Medium priority.Jan 10 2019, 10:43 PM
ssastry moved this task from Backlog to Deployment on the Parsoid-PHP board.Jan 10 2019, 10:45 PM
Dzahn added a comment.EditedJan 10 2019, 11:01 PM

Hi @ssastry We already have ticket T201366 to setup scandium as the replacement for ruthenium. That includes a jessie to stretch upgrade which means PHP7.0, 7.1 or 7.2 could be installed.

Hi @ssastry We already have ticket T201366 to setup scandium as the replacement for ruthenium. That includes a jessie to stretch upgrade which means PHP7.0, 7.1 or 7.2 could be installed.

Great! Do you have a sense about how long before T201366 might get resolved?

Dzahn added a comment.Jan 11 2019, 7:58 PM

@ssastry I am working on it today. There has been some progress since uprightdiff is now installed -> T201366#4873912 . Will look at the remaining issues and let you know more soon.

ssastry renamed this task from Install PHP7 on ruthenium to Install PHP7 on scandium.Mar 7 2019, 7:50 PM
ssastry updated the task description. (Show Details)

Hi @ssastry We already have ticket T201366 to setup scandium as the replacement for ruthenium. That includes a jessie to stretch upgrade which means PHP7.0, 7.1 or 7.2 could be installed.

Now that scandium is operational, can you install PHP7 on scandium?

Dzahn claimed this task.Mar 21 2019, 11:53 AM

Change 498089 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid::testing: install PHP7

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

Change 498089 merged by Dzahn:
[operations/puppet@production] parsoid::testing: install PHP7

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

Dzahn added a comment.EditedMar 21 2019, 1:55 PM

Now that scandium is operational, can you install PHP7 on scandium?

Sorry for the delay. PHP 7 has been installed with the change above.

[scandium:~] $ dpkg -l | grep php
ii  libapache2-mod-php7.0                7.0.33-0+deb9u3                   amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                                  1:7.0+49                          all          server-side, HTML-embedded scripting language (default)
ii  php-common                           1:49                              all          Common files for PHP packages
ii  php7.0                               7.0.33-0+deb9u3                   all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.0-cli                           7.0.33-0+deb9u3                   amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                        7.0.33-0+deb9u3                   amd64        documentation, examples and common module for PHP
ii  php7.0-json                          7.0.33-0+deb9u3                   amd64        JSON module for PHP
ii  php7.0-opcache                       7.0.33-0+deb9u3                   amd64        Zend OpCache module for PHP
ii  php7.0-readline                      7.0.33-0+deb9u3                   amd64        readline module for PHP

Boldly claiming this resolves the ticket. Please reopen if you needed something more specific. The packages above are what installing "php" pulls in on stretch by default.

Dzahn closed this task as Resolved.Mar 21 2019, 1:55 PM

Oh 7.0? Isn't production on PHP 7.1 / 7.2?

Oh 7.0? Isn't production on PHP 7.1 / 7.2?

T216102#4954452 says production is on 7.2. What is involved in getting the same version on scandium? Parsoid/PHP is targeting 7.2 currently and won't run on 7.0.

Dzahn added a comment.Mar 21 2019, 2:17 PM

@ssastry app servers like mwdebug have 7.0 and 7.2 but looking at a prod parsoid server like wtp1025 there is also 7.0 there. It should match wtp servers, right?

Dzahn added a comment.Mar 21 2019, 2:19 PM
(23) wtp[1025-1042,1044-1048].eqiad.wmnet                                                               
----- OUTPUT of 'dpkg -l | grep php | grep common' -----                                                
ii  php-common                     1:49                           all          Common files for PHP packages                                                                                                    
ii  php7.0-common                  7.0.33-0+deb9u3                amd64        documentation, examples and common module for PHP
Dzahn added a subscriber: Joe.Mar 21 2019, 2:24 PM

@Joe Shouldn't i match the version on the wtp servers? But that would be conflicting with T216102#4954452 .
@ssastry I will prepare a patch to add 7.2 and add reviewers to clear it up.

Dzahn reopened this task as Open.Mar 21 2019, 2:26 PM

Change 498104 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid::testing: install PHP 7.2

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

@ssastry app servers like mwdebug have 7.0 and 7.2 but looking at a prod parsoid server like wtp1025 there is also 7.0 there. It should match wtp servers, right?

Do wtp servers have the default php version because we don't run php code there? But, Parsoid is targeting PHP 7.2 so any servers that will run Parsoid/PHP will need 7.2 as well. This conversation is timely because we have a syncup with SRE coming up next week. :-)

Joe added a comment.Mar 22 2019, 6:31 AM

So first of all, why do wtp servers have php installed even? They should not, and they don't.

And since this is for testing php-parsoid it needs to match what's on the application servers, so php 7.2

Given how our puppet code (and our packages) are organized, I suggest you first remove by hand the php 7.0 packages, then install php 7.2 packages in their place.

So first of all, why do wtp servers have php installed even? They should not, and they don't.

They do actually, scap pulls in php-cli.

Change 498104 merged by Dzahn:
[operations/puppet@production] parsoid::testing: install PHP 7.2

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

So first of all, why do wtp servers have php installed even? They should not, and they don't.

See above, i checked with cumin and they all did. As Moritz said scap pulls them in it looks.

And since this is for testing php-parsoid it needs to match what's on the application servers, so php 7.2

Gotcha, thanks! i merged the change above which uses code like appservers, using the php module. There is 7.2 on scandium now.

Given how our puppet code (and our packages) are organized, I suggest you first remove by hand the php 7.0 packages, then install php 7.2 packages in their place.

Done. I did apt-get remove --purge php* and apt autoremove and then let puppet reinstall 7.2

Parsoid is targeting PHP 7.2 so any servers that will run Parsoid/PHP will need 7.2 as well.

root@scandium:~# dpkg -l | grep php
ii  php-common                           2:69+0~20190215163918.14+stretch~1.gbpfa617b+wmf1     all          Common files for PHP packages
ii  php7.2-cli                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1 amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                        7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1 amd64        documentation, examples and common module for PHP
ii  php7.2-json                          7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1 amd64        JSON module for PHP
ii  php7.2-opcache                       7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1 amd64        Zend OpCache module for PHP
ii  php7.2-readline                      7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1 amd64        readline module for PHP

Does this work for you?

Change 498383 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid::testing: use profile::mediawiki::php to get PHP 7.2

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

Change 498383 merged by Dzahn:
[operations/puppet@production] parsoid::testing: use profile::mediawiki::php to get PHP 7.2

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

Dzahn closed this task as Resolved.Mar 22 2019, 2:37 PM

@ssastry Changed it one more time to use profile::mediawiki::php to setup PHP 7.2 and configure all the extensions just like on appservers. This should be identical to prod now. Claiming this should be resolved for real now.

[scandium:~] $ dpkg -l | grep php
ii  php-apcu                             5.1.17+4.0.11-1+0~20190217111312.9+stretch~1.gbp192528+wmf1 amd64        APC User Cache for PHP
ii  php-common                           2:69+0~20190215163918.14+stretch~1.gbpfa617b+wmf1           all          Common files for PHP packages
ii  php-excimer                          0.1.0~git20181204.9f02079-2~wmf2                            amd64        PHP extension that provides a non-static, non-global profiler
ii  php-geoip                            1.1.1-1~wmf3+php72                                          amd64        GeoIP module for PHP
ii  php-igbinary                         2.0.8-1+0~20190218104323.8+stretch~1.gbpb6c89+wmf1          amd64        igbinary PHP serializer
ii  php-luasandbox                       3.0.3-1~bpo9+2~wmf+php72                                    amd64        PHP extension that provides a sandboxed Lua environment
ii  php-memcached                        3.0.1+2.2.0-1~wmf2                                          amd64        memcached extension module for PHP, uses libmemcached
ii  php-mongodb                          1.5.3-2~wmf2                                                amd64        MongoDB driver for PHP
ii  php-msgpack                          2.0.2+0.5.7-1~wmf3+php72                                    amd64        PHP extension for interfacing with MessagePack
ii  php-redis                            4.2.0-1+0~20190222131115.11+stretch~1.gbpf8a642+wmf1        amd64        PHP extension for interfacing with Redis
ii  php-tideways-xhprof                  5.0.0~beta3-3                                               amd64        Tideways Xhprof extension
ii  php-wikidiff2                        1.7.3-1~bpo9+1~wmf2+php72                                   amd64        external diff engine for mediawiki
ii  php7.2-bcmath                        7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        Bcmath module for PHP
ii  php7.2-bz2                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        bzip2 module for PHP
ii  php7.2-cli                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                        7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        documentation, examples and common module for PHP
ii  php7.2-curl                          7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        CURL module for PHP
ii  php7.2-dba                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        DBA module for PHP
ii  php7.2-fpm                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-gd                            7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        GD module for PHP
ii  php7.2-gmp                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        GMP module for PHP
ii  php7.2-intl                          7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        Internationalisation module for PHP
ii  php7.2-json                          7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        JSON module for PHP
ii  php7.2-mbstring                      7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        MBSTRING module for PHP
ii  php7.2-mysql                         7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        MySQL module for PHP
ii  php7.2-opcache                       7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        Zend OpCache module for PHP
ii  php7.2-readline                      7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        readline module for PHP
ii  php7.2-xml                           7.2.16-1+0~20190307202415.17+stretch~1.gbpa7be82+wmf1       amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP

Thanks! :-)