This directory contains the following utilities.
redo: a wrapper around Ansible and Gradle commands, for which examples are given below,
citool: allows for command line monitoring of Jenkins and Travis CI builds.
The script is called
redo because for most development, one will want to “redo” the compilation and deployment.
redo setup prereq
redo couchdb initdb
redo props tests
To do a fresh build and deploy all with one line for a first time run
redo setup prereq couchdb initdb deploy tests as each of these is executed sequentially.
Individual components such as the
controller may be rebuilt and redeployed as well.
redo controller -b.
redo controller -x.
redo controller -d.
redo controller -bxdwhich is the default.
Additional arguments may be passed to underlying shell commands for Gradle and Ansible using
-a. For example, the following is handy to run a subset of all tests from the command line.
redo tests -a '--tests package.name.TestClass.evenMethodName'
Some components are dynamically generated. This is supported by a generic component name which specifies a regex. The
runtime:([\w]+) is one such component, useful for rebuilding action runtime images.
redo --dir /path/to/openwhisk-runtime-nodejs runtime:nodejs6action
This script allows for monitoring of ongoing Jenkins and Travis builds. The script assumes by default that the monitored job is a Travis CI build hosted here
https://api.travis-ci.org/. To change the Travis (or Jenkins) host URL, use
citool monitor N
citool monitor -p N
citool -o monitor N
citool monitor N.iwhere 1 <= i <= matrix builds.
To monitor a Jenkins build
B with job number
N on host
citool -u https://jenkins.host:port -b B monitor N
The script also allows for gathering controller and invoker log artifacts from a Jenkins build job. For example, to retrieve logs for a deployment with 1 controller and 1 invoker for build
B with job number
N on host
https://jenkins.host:port with the artifacts are stored in
whisk/logs relative to the job URL:
citool -u https://jenkins.host:port -b B cat whisk/logs N
It is sometimes convenient to save the logs locally (via
citool -o ...) to avoid fetching them repeatedly if one wishes to inspect the logs and extract a specific transaction. Logs statements may be sorted according to their timestamps using
cat -s. Additionally to grep for a specific expression, use
citool -o -u https://jenkins.host:port -b B cat -s -g "tid_123" whisk/logs N
The logs are saved to
./B-build.log and can be reprocessed using
citool -i -b B cat -s -g "tid_124" whisk/logs N
OpenWhisk builds on CI setups have Gradle Build Scan integrated. Each build on Travis pushes scan reports to Gradle Scan Community Hosted Server. To see the scan report you need to check the Travis build logs for lines like below
Publishing build scan... https://gradle.com/s/reldo4qqlg3ka
The url above is the scan report url and is unique per build
If you encounter an error
ImportError: No module named pkg_resources while running
redo, try the workaround below or see these instructions for upgrading
pip install --upgrade setuptools