Difference between revisions of "Spicerack/Cookbooks"

From Wikitech-static
Jump to navigation Jump to search
m (BryanDavis moved page Cookbooks to Spicerack/Cookbooks: Psuedo namespace; Redir page may need to become a disambig at some point due to the generality of this term)
(== Also see == * runbook)
Line 22: Line 22:
   $ cookbook -c config.yaml -l
   $ cookbook -c config.yaml -l

== Also see ==
* [[runbook]]

Revision as of 19:16, 17 April 2019


See the Cookbooks API section of the Spicerack documentation.

Creating your local environment


  • tox


  • Clone the required repositories from Gerrit under ~/wmf/gerrit for simplicity
 $ git clone ssh://$GERRIT_USER@gerrit.wikimedia.org:29418/operations/software/spicerack
 $ git clone ssh://$GERRIT_USER@gerrit.wikimedia.org:29418/operations/cookbooks
  • Change to the spicerack directory and run tox. It will create the proper virtualenv for us with all the dependencies required .
 $ tox -e py3N-unit  # where N is the minor version of Python installed in the system
  • Note: We could just run 'tox' at this point, it will be just a bit slower because it will run all the tests with all the compatible python versions that are installed in the system and configured in the tox.ini file to run the tests
  • There should be a .tox/py3N-tests/ directory with the virtualenv created, we can source the activate script
 $ source .tox/py3N-tests/bin/activate
  • Create a configuration file for spicerack called config.yaml
 cookbooks_base_dir: /home/$USER/wmf/gerrit/cookbooks
 logs_base_dir:  /home/$USER/wmf/gerrit/spicerack/logs
  • The cookbook entry point script should be available, and you should be able to see the list of available cookbooks
 $ cookbook -c config.yaml -l

Also see