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

Difference between revisions of "Spicerack"

From Wikitech-static
Jump to navigation Jump to search
imported>Jobo
imported>Volans
m (fix obsolete hostname)
Line 8: Line 8:


=== Test newly released Spicerack features ===
=== Test newly released Spicerack features ===
In order to test changes included in a new Spicerack release, upgrade the <code>spicerack</code> package on a single host (usually <code>cumin2001</code>) and then within a Python shell (<code>sudo -i python3</code>) run:<syntaxhighlight lang="python3">
In order to test changes included in a new Spicerack release, upgrade the <code>spicerack</code> package on a single host (usually <code>cumin2002</code>) and then within a Python shell (<code>sudo -i python3</code>) run:<syntaxhighlight lang="python3">
import logging
import logging
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG)

Revision as of 08:41, 21 September 2021

Spicerack is a Python library to orchestrate tasks in the Wikimedia Foundation production environment. It comes with an easy API and a cookbook entry point script that allows to write simple Cookbooks to automate and orchestrate tasks.


See the Spicerack documentation.

Test newly released Spicerack features

In order to test changes included in a new Spicerack release, upgrade the spicerack package on a single host (usually cumin2002) and then within a Python shell (sudo -i python3) run:

import logging
logging.basicConfig(level=logging.DEBUG)
from spicerack import Spicerack
s = Spicerack(verbose=True, dry_run=True)  # An instance of Spicerack with dry-run set to True
# ATTENTION: sreal will make read-write changes to the infrastructure!!!
sreal = Spicerack(verbose=True, dry_run=False)  # An instance of Spicerack with dry-run set to False

At this point s and sreal are two instances of Spicerack like the ones passed to the Spicerack/Cookbooks with the dry-run mode set to True and False respectively.