Page MenuHomePhabricator

Support PHP 7 in CI infra
Closed, ResolvedPublic

Description

This task is about having PHP 7 be installed and usable on CI instances.

I sent the following email to the ops list yesterday:

Hi,

MediaWiki supports PHP 7, but we currently don't have any CI support for
it, which has led to developers accidentally introducing regressions in
the past. In CI, we currently use OS packages to use different versions
of PHP, so for 5.3 we use precise, 5.5 on trusty, 5.6 on jessie, etc.
Since PHP7 isn't available for any OS that labs currently supports, I've
researched the following options:

1. Support Ubuntu Xenial (16.04) in labs, which comes with PHP 7. But
since we're switching to Debian, this might not be preferred. And it
would require extra support from the Labs team.
2. Use a tool like phpenv[1] to manage multiple PHP versions for us. But
most of these tools are abandoned by their authors, and would result in
us basically maintaining them ourselves.
3. Use a custom ppa/repo like [2][3], which has co-installable PHP5.5,
5.6, and 7 packages, so we could use jessie for everything. They are
maintained by one of the maintainers of the Debian PHP package.
4. Build/package PHP manually ourselves.

I'm prefer #3 as it would require less maintenance from the CI team and
would integrate into our current setup without much work. But I'd like
to hear from others in case there is anything I've missed and make sure
there are no issues/concerns with using an external repository.

[1] https://github.com/phpenv/phpenv
[2] https://packages.sury.org/php/
[3] https://launchpad.net/~ondrej/+archive/ubuntu/php/

Thanks,
-- Kunal

Responses also preferred option #3, so I will work on implementing that. First on a jessie permanent slave for ease of debugging/testing, and then transition it to nodepool.

Event Timeline

Legoktm created this task.Sep 6 2016, 10:43 PM

Change 308918 had a related patch set uploaded (by Legoktm):
contint: Add PHP 7 packages from packages.sury.org

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

@Legoktm hi, how would we manage to support php 5.6, and 7 on Jessie, or are we going to use php 7 instead of php 5.6?

Change 308918 merged by Alexandros Kosiaris:
contint: Add PHP 7 packages from packages.sury.org

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

Mentioned in SAL [2016-09-07T10:55:13Z] <hashar> integration: dropped PHP7 cherry pick from puppet master. https://gerrit.wikimedia.org/r/#/c/308918/ has been merged. Pushing it to the fleet of permanent Jessie slaves. T144872

Change 308955 had a related patch set uploaded (by Hashar):
contint: prefer our bin/php alternative

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

Mentioned in SAL [2016-09-07T11:03:09Z] <hashar> integration: cherry pick https://gerrit.wikimedia.org/r/#/c/308955/ "contint: prefer our bin/php alternative" T144872

hashar triaged this task as Normal priority.Sep 7 2016, 11:04 AM

Change 308955 merged by Alexandros Kosiaris:
contint: prefer our bin/php alternative

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

Mentioned in SAL [2016-09-07T11:53:57Z] <hashar> Force refreshing Nodepool jessie snapshot to get PHP7 included T144872

Change 308960 had a related patch set uploaded (by Hashar):
dib: include contint::packages::apt

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

Change 308960 merged by jenkins-bot:
dib: include contint::packages::apt

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

Mentioned in SAL [2016-09-07T13:13:51Z] <hashar> Image ci-jessie-wikimedia-1473253681 in wmflabs-eqiad is ready , has php7 packages. T144872

hashar added a comment.Sep 7 2016, 1:13 PM

I had to a few other puppet tweak in integration/config to get the surly apt repo to be updated before the PHP7 package resources get realized. The Jessie Nodepool snapshots should be up-to-date now.

hashar closed this task as Resolved.Sep 7 2016, 1:30 PM
hashar added a comment.Sep 7 2016, 1:59 PM

The /usr/bin/php is wrong when provisioning images. The alternatives::install for php was run before the php7 packages which in turn overrides it. Had to rebuild a fresh image to workaround the initialization order issue.

@Legoktm hi, how would we manage to support php 5.6, and 7 on Jessie, or are we going to use php 7 instead of php 5.6?

5.6 is already included with jessie :)

We do want to get 5.5 on jessie though, I'll file a separate task for that.

Paladox removed a subscriber: gerritbot.

Change 313213 had a related patch set uploaded (by Paladox):
Add php7 pipeline for zuul

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

Change 313213 abandoned by Paladox:
Add php7 pipeline for zuul

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