Objective
- Someone with basic coding experience gets a MW install in less than 3 steps and under 5 minutes.
- Someone with little to no prior setup, gets a MW install in less than 5 steps and under 15 minutes.
Background
For new MediaWiki contributors who have some prior experience with software, the experience should feel like:
- clone repo
- start server
For people with no recent software dev experience and/or with pristine workstations, the more honest description would be:
- Install git, php, composer
- Linux: apt-get install git php composer
- Mac: Install Homebrew, then brew install php composer (git is pre-installed).
- git clone mediawiki/core mediawiki, git clone mediawiki/skins/Vector mediawiki/skins/Vector
- start server
The key realization here is that php comes with a built-in web server, and has for many years. We actually used to run WMF CI this way for several years. All you need to get a working web server is php -S localhost:4000 in a directory and you're up. By avoiding Apache you remove the knowledge and hassle with configuring a general web server on your laptop and "adding" your MediaWiki site to it (and potentially conflicting with other things), as well as the way it can feel intimidating to keep that service running correctly. Useful skills to acquire after you've been developing software for a few years, but close to zero value during your first year and mainly serves to get in the way and distract things.
The other part is that MediaWiki supports sqlite, so no MySQL needed. This is, perhaps surprisingly, actually how the current iteration of mediawiki-docker runs as well. That's probably half the benefit of using a container-based dev env, but we don't even tap into that potential today. In any event, all that to say, MediaWiki has first-class and documented support for sqlite , is continuously tested with this on every patch, and has been for over a decade.
Lastly, by not involving Docker, we reap several benefits:
- Time: It easily takes up to hour to initially get all the containers and image layers downloaded.
- Complexity: downloading, installing, configuring a global deamon. And managing it every day to keep it running correctly.
- Complexity: none of our Docker images support ARM processors.
- Complexity: you sometimes have to "enter" the container to run certain commands, but then leave the container to run other commands.
- Performance: Especially on Mac or Windows, the containers run in one or two layers of emulation and thus aren't particularly fast. It's not very different from the Vagrant days, except with Vagrant we didn't pretend it was a "fast" container instead of a full VM. We've just hidden the VM inside Docker Desktop now.
- Principle value: for most people the simplest solution would involve installing Docker Desktop, which is proprietary software that promotes a freemium/premium subscription based service.
The "time" factor alone disqualifies MediaWiki-Docker from a homework-free solution in which you can get someone with basic coding experience to have a MW install in less than 3 steps in under 5 minutes.
How
In a nut shell:
- php maintenance/install.php …options
- php -S localhost:8080
The first one is currently preset in composer.json already as composer mw-install:sqlite. The second as composer serve.
Prior art at https://wikitech.wikimedia.org/wiki/Performance/Fresnel#Quick_MediaWiki.
Scope
- Verify the above is accessible.
- Evaluate whether potential conflicts with an existing LocalSettings.php is a likely hurdle. If so, write a patch to make use of MW_CONFIG_FILE to e.g. give it LocalSettings.quick.php instead and fix install.php to write to this instead the default location.
- Document this somewhere and test-drive it during the virtual wmf-staff hackathon later this year.