New GrimoireLab packages! (and how to use them)

We’ve just uploaded to pypi a new collection of GrimoireLab Python packages suitable for direct installation with pip. Please, upgrade your virtual environments!!!

These packages allow for a very easy use of most GrimoireLab tools. For example, assuming you have ElasticSearch and Kibana installed locally (or available as cloud services), producing a fairly complete software development dashboard from scratch for a git project is just a matter of running a few commands.

kibana-dashboard

We can just start by creating and activating a fresh Python3 virtual environment:

% python3 -m venv /tmp/grimoirelab
% source /tmp/grimoirelab/bin/activate
(grimoirelab) %

Now, we install grimoire-elk, the package which provides p2o.py (the standalone tool to retrieve data from repositories, and store it in ElasticSearch) and grimoire-kidash, which provides kidash (the tool to upload dashboards to Kibana).

(grimoirelab) % pip install grimoire-elk
(grimoirelab) % pip install grimoire-kidash

Now, let’s run p2o.py to retrieve data from both the git repository and the GitHub API (issues and pull requests). We will use the Perceval GitHub project as our guinea pig:

(grimoirelab) % p2o.py --enrich --index git_raw --index-enrich git \
  -e http://localhost:9200 --no_inc --debug \
  git https://github.com/grimoirelab/perceval.git
$ (grimoireelk) p2o.py --enrich --index github_raw --index-enrich github \
  -e http://localhost:9200 --no_inc --debug \
  github grimoirelab perceval \
  -t XXX --sleep-for-rate

(being XXX your GitHub API token).

Finally, upload the corresponding dashboards, that you need to download first as JSON documents:

(grimoireelk) $ kidash.py --elastic_url-enrich http://localhost:9200 \
--import /tmp/git-dashboard.json

(grimoireelk) $ kidash.py --elastic_url-enrich http://localhost:9200 \
--import /tmp/git-dashboard.json

(assuming those JSON documents are in /tmp)

See the chapter Creating a simple dashboard in the GrimoireLab Training manual for more details, including how to get the GitHub API key, and where to find the JSON documents for the dashboards.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s