CanastaWiki / Canasta

MediaWiki Docker image for Canasta, an all-in-one MediaWiki stack for easy deployment and management of enterprise-ready MediaWiki on production environments.
https://www.canasta.wiki
MIT License
38 stars 28 forks source link

Updated to use debian 12.4 and PHP 8.2 #347

Closed cicalese closed 10 months ago

cicalese commented 10 months ago

This PR updates debian from 11.7 to 12.4 and PHP from 7.4 to 8.2.

It is currently premature to merge this, since it will likely break support for Semantic MediaWiki and possibly other extensions.

Note that the change from using environment variables to using literals in _sources/configs/php-fpm-www.conf was necessary to prevent errors for some reason. It isn't clear why environment variables no longer work or whether something else was going on.

jeffw16 commented 10 months ago

I imagine changing to Debian 12.4 in and of itself does not break SMW. But I'm guessing the upgrade to PHP 8.2 was necessary for other reasons. Is PHP 7.4 not supported on Debian?

cicalese commented 10 months ago

I imagine changing to Debian 12.4 in and of itself does not break SMW. But I'm guessing the upgrade to PHP 8.2 was necessary for other reasons. Is PHP 7.4 not supported on Debian?

Agreed that the change in debian is unlikely to break SMW. PHP 8.2 is the only supported PHP on debian 12.4 without adding other repos. And, PHP 7.4 has been end of life with no security fixes for over a year. In fact, PHP 8.0 is also end of life, and PHP 8.1 is only getting security fixes.

I'm curious why the Docker build and push job was run, failing (appropriately) when it attempted to push the container. Isn't it premature to push the container? Maybe I don't understand what that is supposed to be doing.

tosfos commented 10 months ago

Thanks for this update! My understanding is that PHP 8.2 has only experimental support in MediaWiki 1.39.

jeffw16 commented 10 months ago

The CI/CD pipeline creates a build for every push (provided no weird edge case occurs) for testing purposes. The failure is most likely because @cicalese does not have push permissions for the Canasta GHCR.

cicalese commented 10 months ago

I'm going to create another pull request with PHP 8.1 support. There are several possible approaches. I could add a repo to pull PHP 8.1 from to an image build from debian:12.4, as this patch is. Or I could build on php:8.1, which also builds on debian:12.4. Or even php:8.1-apache. Note that mediawiki:1.39 (the official MediaWiki image on dockerhub) is built on php:8.1-apache. It could simplify the configuration considerably to build on one of those images. Is there a reason they are not used?

yaronkoren commented 10 months ago

If you're asking why we went with PHP 7 and not PHP 8 for the 1.39 version of Canasta - I don't think it was ever really discussed, but I think there was a general sense that the extensions were not uniformly ready for the jump. (Which apparently is still the case now!) But I would think it's pretty much guaranteed that the next major release of Canasta will include PHP 8, ideally the same exact version that the main MediaWiki image will use.

cicalese commented 10 months ago

Actually, I was asking why the image was built on debian:X, rather than php:X or php:X-apache (or mediawiki:1.39 even, but I think that's a slightly different discussion).

yaronkoren commented 10 months ago

Oh.🤦That I don't know! If there's an image like php:X-apache that includes PHP, Debian and Apache, that does seem like it would simplify things quite a bit. My guess is that just no one thought of doing that.

cicalese commented 10 months ago

OK, cool. I'll try a patch built on php:8.1-apache.

jeffw16 commented 10 months ago

Oh wait, I do know the reason behind this! The WMF runs MediaWiki production on Debian, so we wanted to keep everything on Debian. Plus, we're already locked into using Aptitude instead of Yum. The thought in 2022 was, we would rather have fine-grained control over which OS, PHP, and web server we use in case we want to jump ship to using something different in the future.

cicalese commented 10 months ago

But php:8.1-apache is built on debian, so that would satisfy that constraint.

jeffw16 commented 10 months ago

That's awesome to hear! Is there any risk they might switch to another OS in the future?

cicalese commented 10 months ago

Highly unlikely.

yaronkoren commented 10 months ago

Closing this, since we're probably going to upgrade to PHP 8.1 instead, and probably in a different way from how this PR does it. The new issue for this change is #352.