Introducing: indicator-jenkins

For my day job I've been monitoring a jenkins instance (specifically, the public Ubuntu QA jenkins instance) using my web browser. This is obviously suboptimal - I'd like to be able to see the state of the jenkins jobs I'm interested at a glance, without having to open my web browser.

I couldn't find a solution to my problem, so I created one: indicator-jenkins is a panel indicator for your desktop manager of choice. It allows you to select one or more jobs from a jenkins server, and follow the job state without having to open your browser.

The project is hosted on launchpad, and is built daily into my PPA. To install it (I'm assuming you're running Ubuntu):

$ sudo add-apt-repository ppa:thomir/indicator-jenkins
$ sudo apt-get update
$ sudo apt-get install indicator-jenkins

Once it's installed you can launch it in a couple of different ways:

  • From a terminal - jut run indicator-jenkins. If you run it on the terminal you'll get a lot of debugging output (useful if you want to submit a patch, or figure out why it's not working).
  • From the unity dash - open the dash, and search for 'jenkins' - it's probably going to be the first link.

Once it's running you should see the jenkins icon in your panel. To set it up, click the icon to open the settings dialog, enter the URL of the jenkins instance you want to look at, hit the refresh button, and pick the job(s) you want to monitor. Click OK and you're done! It's simpler than it sounds - see for yourself:

Right now it's pretty rough-and-ready - there are many features I'd like to add:
  • Integrate desktop notifications, so you can be alerted when a job state changes.
  • Customise panel icon based on job state (i.e.- show a red icon if any of the monitored jobs are failing).
  • Allow user to customise refresh period.
  • Allow user to monitor jobs from more than one jenkins server.
  • Show more information about a jenkins job. For a start, show stability as well as current status, and maybe in the future show unity test pass/failure rates for projects that have that information.
How it's Made:

The entire application is written in python. We make use of several python modules:
  • The python-appindicator package gives us the ability to create an icon on the menu, and the python gtk2 bindings are used to create the menu and settings dialog.
  • The python 'multiprocessing' module is used to spin up worker processes to fetch the data from jenkins. Initially the application used threads for this, but python's threading support isn't great, and it was taking too long. 
  • The python 'json' module is used to save and load settings.
  • The python-jenkins package is used to communicate with the jenkins server.
This is a great example of python's "batteries included" approach to programming. All you have to do is provide the glue between already-existing python modules.

6 comments:

Jelmer said...

Thanks! That's very useful. The latest builds work well for me.

Thomi Richards said...

Cheers - if you have any problems, ,be sure to grab me on IRC. It's certainly helped me notice failing tests on jenkins, which can only be a good thing...

Anonymous said...

Any way to specify a username / password for Jenkins?

Alex Kowalczyk said...

Does it work with 13.04?

W: Failed to fetch http://ppa.launchpad.net/thomir/indicator-jenkins/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/thomir/indicator-jenkins/ubuntu/dists/raring/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

yayo said...

There is no way to connect if you have authentication in Jenkins server, right?

Thomi Richards said...

yayo: No, currently there's not. I am, however, slowly working on a branch new indicator-jenkins replacement. I plan to support authentication for that as well.

Cheers,

Post a Comment