MediaWiki-Docker/Extension/WikiLambda

This page instructs you to install Extension:WikiLambda inside MediaWiki-Docker.

Follow the Quickstart instructions at MediaWiki-Docker page. Once MediaWiki is running and available at, then continue with instructions on this page.

All commands should be run in the directory where you installed MediaWiki. All mentioned files are also located there.

Clone the repository and its sub-module
If you plan on using gerrit or authenticating with ssh rather than https, it is recommended you get the code with an SSH key instead. Follow these instructions to do so.

Add our composer dependencies
Extend MediaWiki's composer dependencies to use ours by adding a  file in your   directory with the following: … and then run:

Modify LocalSettings.php
If not already there, add this to the end of.

Check
You can check whether this worked by navigating to, or to   and looking for   in the   dropdown. If they are there, all is well.

Adding the services
To add the orchestrator and executor back-end services, first copy the contents of the  block in WikiLambda's   file to the analogous `services` block in your   file. Replace the  entries in the stanza you just copied with the latest builds from the Docker registry for the orchestrator and the evaluator.

You can automatically test your installation by editing your local copy of  to remove , and running the PHPUnit test suite as described in the MediaWiki install instructions, or by using the following command:  You can manually evaluate a function call by navigating to  ,  selecting a function from the wiki, and choosing your inputs. If successful, the function response will be presented, having traversed the orchestrator and the evaluator to be run in one of the code executors.

You can also visit http://localhost:8080/wiki/Special:ApiSandbox and try out one or more tests as follows:


 * In the  drop-down menu, select
 * Switch from the  to the   section on the left sidebar
 * Click on {} Examples, and select any of the listed examples
 * Click the blue  button
 * In the Results box, look for the word "success".

🎉 Congratulations! 🎉

Having the services with different configuration
If you wish to use the orchestrator or evaluator under a different name or port, or your checkout of MediaWiki is not in a directory called ' ', you must over-ride the  or   configuration values from their defaults in your LocalSettings file.

For example, if you MediaWiki checkout is called ' ', you should add:

Building local versions of the services
If you would instead like to use a local version of the function orchestrator or evaluator, e.g. because you wish to make local development changes and test them, there are three steps:


 * 1) Ensure that you are using version 2.x or above (i.e., not 1.x) of docker-compose.  (If you have 1.x, you will need to upgrade, or, if using Docker Dashboard, you may be able to select a preference for "Use Composer v2".)
 * 2) Install Blubber: https://wikitech.wikimedia.org/wiki/Blubber/Download#Blubber_as_a_(micro)Service
 * 3) Clone the service you wish to alter:
 * 4) (For the orchestrator):
 * 5) (For the evaluator):
 * 6) From the root of the service you wish to alter, run either:
 * 7) * (For the orchestrator):
 * 8) * (For the evaluator):
 * 9) Then update your   file to change the service stanza to point to your new local image, with   or.