You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Wikifunctions/Beta Cluster: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Ori
No edit summary
imported>Ori
(Docs on debugging failed units)
Line 30: Line 30:
|}
|}


== Running MediaWiki maintenance scripts ==
===Debugging===
The function-* services log to Logstash (see [[#Debug logs]] below for details).
 
The units are configured to automatically restart on failure. If [https://openstack-browser.toolforge.org/server/deployment-docker-wikifunctions01.deployment-prep.eqiad1.wikimedia.cloud deployment-docker-wikifunctions01] is up but one or both of the services are down, they are probably crash-looping. To debug, SSH into the machine and run:
 
<syntaxhighlight lang="sh">
# Check service status:
$ sudo systemctl status mediawiki-services-function-orchestrator
 
# Get additional logs:
$ sudo journalctl --unit=mediawiki-services-function-orchestrator
</syntaxhighlight>
 
Replace 'orchestrator' with 'evaluator' for debugging the function-evaluator.
==Running MediaWiki maintenance scripts==
To run maintenance scripts, you need to SSH into the Beta Cluster deployment host (currently <code>deployment-deploy03.deployment-prep.eqiad1.wikimedia.cloud</code>). See [[Help:Accessing Cloud VPS instances]] for access instructions.
To run maintenance scripts, you need to SSH into the Beta Cluster deployment host (currently <code>deployment-deploy03.deployment-prep.eqiad1.wikimedia.cloud</code>). See [[Help:Accessing Cloud VPS instances]] for access instructions.


Once you've logged in, you need to wrap invocations of maintenance scripts with <code>mwscript</code>, specifying <code>--wiki=wikifunctionswiki</code> to ensure the code runs in the context of Wikifunctions.  
Once you've logged in, you need to wrap invocations of maintenance scripts with <code>mwscript</code>, specifying <code>--wiki=wikifunctionswiki</code> to ensure the code runs in the context of Wikifunctions.  


For example:
For example:  


:<code>mwscript extensions/WikiLambda/maintenance/reloadBuiltinData.php --wiki=wikifunctionswiki</code>
:<code>mwscript extensions/WikiLambda/maintenance/reloadBuiltinData.php --wiki=wikifunctionswiki</code>


* To '''run raw SQL''' against the database (don't), run: <code>mwscript maintenance/sql.php --wiki=wikifunctionswiki</code>
*To '''run raw SQL''' against the database (don't), run: <code>mwscript maintenance/sql.php --wiki=wikifunctionswiki</code>


* To '''run code''' in an interactive MediaWiki PHP REPL, run: <code>mwscript maintenance/shell.php --wiki=wikifunctionswiki</code>
*To '''run code''' in an interactive MediaWiki PHP REPL, run: <code>mwscript maintenance/shell.php --wiki=wikifunctionswiki</code>


If you do anything potentially destructive, remember to log it to the [[Release Engineering/SAL|RelEng server action log]] via <code>!log <var>message</var></code> in {{irc|wikimedia-releng}}.
If you do anything potentially destructive, remember to log it to the [[Release Engineering/SAL|RelEng server action log]] via <code>!log <var>message</var></code> in {{irc|wikimedia-releng}}.

Revision as of 17:42, 19 July 2022

The Beta Cluster houses a functional test instance of Wikifunctions and associated services, with all software components running at HEAD.

The URL for Wikifunctions wiki is https://wikifunctions.beta.wmflabs.org/

function-orchestrator and function-evaluator

The function-{orchestrator,evaluator} services run under Docker, on the deployment-docker-wikifunctions01 cloud instance.

You need to be a member of the deployment-prep project to access the instance via SSH, and a project admin to change the instance configuration.

Both services are exposed via a web proxy. The evaluator is exposed to facilitate testing.

Service Public address Internal address
Orchestrator wikifunctions-orchestrator-beta.wmflabs.org:443 deployment-docker-wikifunctions01:6254
Evaluator wikifunctions-evaluator-beta.wmflabs.org:443 deployment-docker-wikifunctions01:6927

Debugging

The function-* services log to Logstash (see #Debug logs below for details).

The units are configured to automatically restart on failure. If deployment-docker-wikifunctions01 is up but one or both of the services are down, they are probably crash-looping. To debug, SSH into the machine and run:

# Check service status:
$ sudo systemctl status mediawiki-services-function-orchestrator

# Get additional logs:
$ sudo journalctl --unit=mediawiki-services-function-orchestrator

Replace 'orchestrator' with 'evaluator' for debugging the function-evaluator.

Running MediaWiki maintenance scripts

To run maintenance scripts, you need to SSH into the Beta Cluster deployment host (currently deployment-deploy03.deployment-prep.eqiad1.wikimedia.cloud). See Help:Accessing Cloud VPS instances for access instructions.

Once you've logged in, you need to wrap invocations of maintenance scripts with mwscript, specifying --wiki=wikifunctionswiki to ensure the code runs in the context of Wikifunctions.

For example:

mwscript extensions/WikiLambda/maintenance/reloadBuiltinData.php --wiki=wikifunctionswiki
  • To run raw SQL against the database (don't), run: mwscript maintenance/sql.php --wiki=wikifunctionswiki
  • To run code in an interactive MediaWiki PHP REPL, run: mwscript maintenance/shell.php --wiki=wikifunctionswiki

If you do anything potentially destructive, remember to log it to the RelEng server action log via !log message in #wikimedia-releng connect.

Debug logs

Logs from both MediaWiki and the function-* services are shipped to Logstash. See Logstash § Beta Cluster Logstash for access instructions.