A Django site.
November 19, 2008
» Continuous Integration System Roundup

Continuous Integration Systems are one of the most important tools for agile software development. They automate the process of building and testing. A lot of people seem to have realized their importance and there are quite a few products in this arena. I already used Hudson and CruiseControl, but for OpenMRS we need to find one which is best suited to our needs. So I started out about 3 weeks back to create this roundup of continuous integration servers. This should be a useful roundup for any project with similar requirements.

Why does OpenMRS need a Continuous Integration System?

Any software development effort needs to take care that regression doesn’t happen with new code changes. Often a change in the API/module core results in breaking of modules dependent on an earlier method. A Continuous Integration System will rebuild OpenMRS after a change is committed and provide information on how that change is affecting related code.

OpenMRS would also benefit from an easy to understand UI that Continuous Integration Systems provide for number of failing tests. The number of passing or failing Unit Tests will indicate the quality of a build and help implementers/testers realize the stability of a build. We can also set some goals on how many test methods we need to write before an API method can be finalized or deprecated.

The work done in different branches and modules can be monitored and looked at easily by the community.

Building of OpenMRS Installer using NBI can be automated and new users can directly test with the latest build of OpenMRS using the cross-platform installer.

Thus to summarize, a continuous integration system will bring better release quality, more transparency, quicker bug finding and fixing, simplicity and TDD frame-of-mind.

Disadvantages for OpenMRS in using Continuous Integration System

  • Additional Load on Servers
  • Not every developer is motivated to write unit tests ;-)

Features that OpenMRS needs (Not exhaustive)

  1. Easy to monitor tests and easy to understand dashboard
  2. Support for SVN and Ant
  3. Dependency integration
  4. Email/RSS/IRC notifications when a build fails or bad code is committed
  5. Warning flags when a committed code doesn’t follow coding rules (naming, newline format,etc.)
  6. Allow code committers to modify build and test parameters from the GUI
  7. Optimal Performance
  8. Price & Open-source development

Comparison of Continuous Integration Systems:

  CruiseControl Continuum TeamCity Bamboo Hudson
Monitoring UI Dashboard introduced since v2.7 is not intuitive Dashboard only shows tests Advanced UI & dashboard. Advanced UI, Detailed reporting out-of-the-box, Intuitive Simple Dashboard, Plugins enhance reporting, Intuitive, somewhat detailed
SCM Support All Support SVN
Dependency Integration Scripts need to be written for each new dependency. Tracking different versions of dependency jars is very complex Easy for Maven2.0+ projects, but not so easy for other types of projects Dependency can be managed easily. Advanced UI for dependency management Dependency management is easy and intuitive. Different versions of same library not automated. Creating test/build plans allows dependency of different versions Dependency management is easy to configure. file fingerprinting simplifies identification of different versions. Automatically can detect and build project dependencies
Email/RSS/IRC Emails. Plugins - RSS, blog, IM with Jabber Email, IRC, IM with Jabber, MSN Email, Jabber, RSS, external HTML widget Emails, RSS, IM Notification using Jabber or OpenFire Plugin – Emails, RSS, IRC, Jabber, Google Calender, Twitter
Code Quality and Patterns Not very easy to define Could not find a way Can be defined with plugin for IntelliJ IDEA Managed through test plans. Manual test plans have to be created Plugin provides UI. Test plans can be created manually out-of-the-box
Security and User Management Easy to configure with different roles Roles can be easily defined Roles can be easily defined Simplistic UI for user build plan management. Easy integration with JIRA Easy to configure roles for users
Performance Fast Fast Somewhat slower in comparison, but includes a lot of features Fast in build and integration. Slightly slower in reports. Includes lots of features that may not be used. Distributed builds with slaves speeds up performance Comparatively lightweight out-of-the-box, but requires plugins. Distributed builds with slaves speeds up performance
Pricing Free & OpenSource. Paid version called Cruise available. Free & OpenSource Professional version is free, but enterprise is paid Free for opensource projects Free & OpenSource

September 3, 2008
» A Look At Free/OpenSource Cross-Platform Installers

Software Distribution is an essential part of Software Development and can sometimes be the first impression that can make or break the user's opinion about a software. We, as software programmers forget the importance of easy distribution and easy installation of software that we develop. We do not understand the problems that a new computer user or a non-programmer may face. And I experienced this first hand about 2 weeks back, when a physician friend of mine heard that I was working on OpenMRS.

I was lucky enough to work on OpenMRS this summer and learnt a lot more about Medical Informatics during this period than I expected. Hearing this, my friend openrmswanted to install OpenMRS at his clinic which already used Tally (hehe... isn't that innovative??) for storing patient records, observations and prescriptions. He practices at Kolkata, visits different hospitals and sometimes the patients he attended at a hospital come to his clinic. When I told him that OpenMRS was a webapp, he got all excited and I narrated him all the features that OpenMRS could provide and help him manage his patients better through the web, only if he could host OpenMRS from his clinic. I'll skip the other interesting parts and his extra-terrestrial expressions ;-), since we are actually talking about software distribution.

So then came the day when I was about to leave office and he was in his clinic trying to install OpenMRS. It was Independence Day and the clinic was closed but he was excited to experience the new-age medical informatics :-)) When I first got his call he had downloaded the Windows Installer. I was pretty sure it was for an older version and hence told him to instead download the OpenMRS Appliance, which is a VM Image that can be run from one of the virtual machine softwares. Yaw Anokwa made this wonderful Virtual Image with Ubuntu + All Necessary Stuff (tomcat, mysql, demo data) and OpenMRS running. You just have to have VirtualBox or VMPlayer or VmWare Workstation and load the VMimage and wait for Ubuntu to start. It is simple, fast and safe to play with... But for novice users, I just realized it wasn't easy enough. My friend installed VirtualBox and loaded the image. It booted fine, but the network wasn't working and OpenMRS webapp could not be reached from the Windows host. After being on call for close to an hour, we just couldn't make the networking work!! I advised him to install VMPlayer instead and run the image. This time everything ran fine, but some changes had to be made in the Norton 360 Firewall. He kept complaining that Windows XP was punishably slow and then I realized that his 512Mb wasn't enough to virtualize :-( ... So we were back to where it all started!! The Windows Installer that OpenMRS distributes is based on Bitrock. He first tried the OpenMRS 1.1 Installer, but it is an older version that hasn't been upgraded for a year or so... Everything installed fine and he was happy to use it, but it didn't have the features I talked about that were added in newer releases of OpenMRS. I walked him through the manual installation and finally we managed to get OpenMRS up-and-running at 2am in the morning and he having spent about 8hrs on it. Last week when I asked him, he still wasn't using OpenMRS for his clinic and hospital. May be the first experience made him bitter!!

With that episode in my mind, I pledged him that within the next month or so I'll give him and easy to install setup and he'll be happy using OpenMRS. And that's when began my chase to find an easy to use, cross-platform installer framework. OpenMRS has lots of implementations on different platforms (Windows, Linux and Mac) and hence I wanted the installer to be cross-platform. At my office, we generally use Windows Installer or NSIS for making installers. But those are only for Windows. These 2 frameworks are so simple and extensible to use that I was thinking if there was something similar and cross-platform, I could make an OpenMRS Installer in an hour. But sadly, that wasn't the case... I tried a variety of installer frameworks, but couldn't find any of them as simple as NSIS or Windows Installer (msi). The following are the installer frameworks I tried working on:

Installer Framework Short Description Problems
1.) Antigen Antigen (Ant Installer Generator) is a tool to take an Ant build script, combine it with a GUI and wrap it up as an executable jar file. Its primary purpose is to create powerful graphical installers from Ant scripts. Couldn't get it to execute ant-calls at lots of places. Didn't work in openSuSE 11.0 due to some incomplete ant configurations. Hasn't been updated in a long time
2.) IzPack IzPack-generated installers require Java. They are simple, efficient and fast to use. Simple executable deployment is best done through IzPack. Isn't very powerful. Good for simple image deployment, but isn't highly configurable and powerful.
3.) OpenInstaller A newer cross-platform installer framework that is completely customizable and written in Java. Glassfish uses this installer framework. Not much documentation. Complex to implement and doesn't look native on all platforms
4.) Netbeans Installer (nbi) A completely customizable and powerful installer framework. Configuration Logic is written in Java and can be used to do anything and everything that Java programs can do. Old documentation. Requires some effort to get up and running with all the scripts.

So finally, I decided to work on using the Netbeans Installer. Netbeans Installer already has components like Tomcat, MySQL, Glassfish, OpenESB and their deployment scripts. And I thought it will simplify my effort... Dmitry Lipin of Sun Microsystems, the lead developer of the NBI team has been of great help over the past weeks and has helped a lot in explaining about nbi... While I was building the installer, 2 other colleagues of mine got interested in OpenMRS and have helped build some parts and want to contribute to OpenMRS code in a larger way!!

I have successfully been able to build an Installer/Uninstaller that can deploy Tomcat/Glassfish, MySQL and the OpenMRS web application on Windows, Linux, OSX, Solaris. The demo data set, JRE/JDK and starting the respective servers are yet to be completed.

Update: The OpenMRS Windows Installer based on Bitrock has been upgraded to install the latest version of OpenMRS. Is it useful for the OpenMRS community to have a cross-platform installer?? Or do the Windows guys only need an Installer ??

June 27, 2008
» Barcode Fun With OpenMRS

The Registration Module is supposed to generate Barcode images that will be printed on stickers and given to patients on their ID cards. This will help easier logo  identification of patients and quicker patient registration. For this purpose, we use the “Patient Identifier” to create barcodes. The “Patient Identifier” is hopefully unique and will help create bug-free barcodes.

Barcodes have a lot of different standards like Code39, Code128, UPC-A, UPC-E etc. Each of these standards were designed for a specific industry and application. And the Registration Module should support different standards so that it can be easy for the implementers of OpenMRS to choose any standard that they want. Thus, began my journey to find a way to generate customizable and easy barcodes.

Having just finished with the commit for the barcode generation in my registration module, I am extremely happy to say that Barcode Generation through the Registration Module is very easy. Still have to implement a print dialog box, but then the way to generate barcode is done through a pre-built servlet... I used an open-source barcode library called Barcode4j, which can generate barcodes in a variety of standards as well as image formats.

Barcode4j is an excellent library and after comparing about 15 different barcode libraries, I found it to be the most easy-to-use and extensible. Barcode4j already provides a Java Servlet which needs to be passed different parameters and it generates the barcode image “just-like-that”. The only thing I had to do was create a mapping for the servlet in the modules “config.xml”.

And that was it... Those nice black lines were shown on screen beside the patient search results. Now I needed to see if the barcodes are accurate and working. I took a printout of the image and scanned it through the barcode scanner. Hurray!! It worked!! And thus I realized that the servlet was accurately creating barcodes. Now moving onto creating a nice AJAX print dialog and probably some useful UI for creating identity cards.

June 23, 2008
» Review: openSuSE 11.0

On the 19th of June 2008, openSuSE 11.0 was released and I was very excited about the new release because my experience with openSuSE 10.3 has been very good and I have been following the development of openSuSE 11.0 closely. In the meantime, I have tried Ubuntu 8.04, Kubuntu, Fedora 9, openSolaris 2008.05, but somehow I’ve been coming back to openSuSE 10.3 because of some or the other nagging problem with the other distros...

Download

I downloaded openSuSE 11.0 the moment it was released and I have to say that the release was very professionally co-ordinated. There were launch events all around the globe where people received their openSUSE 11.0 DVDs and with the counter running all the time, everyone knew when to get their download managers ready. The mirrors were fast and the torrents seemed to have enough seeders. I finished the 4.3GB DVD iso by 20th morning (IST) in just about 4hrs time. There is also a single Live CD KDE iso, GNOME iso as well as a MiniCD (71 MB) for Network installation...

Installation: Image-based Deployment and Sleek

The openSuSE site has a nice installation guide with screenshots and it doesn’t make sense for me to go through the same thing again. But two things are special in openSuSE 11.0 that are worth mention. The first is that they have a gorgeous installation GUI, the best looking installation for any operating system ever!! Its easy to install and intuitive. The second the use of image deployment for the installation of GNOME. This really speeds up the installation if you are just using the basic GNOME-based setup. I generally prefer KDE, but for the test I installed the GNOME and it was fast... really really fast! I was shown the GNOME desktop with all the preferred software installed in straight 15 minutes. That’s faster than any other distro that I’ve ever installed. It was an amazing experience to see such a fast installation!

SuSE11-ImageDeploy

Like previous version, openSuSE 11.0 comes with a variety of useful non-opensource software like flashplayer, java 1.6.0_u6, fonts, Adobe reader 8, etc. Along with these I also installed Jdk6 update 10 (the awesome new Java Plugin), Mono, Netbeans 6.1, GlassFish for my OpenMRS performance test... KDE 4.0 is also there as a separate choice of GUI when installing along with KDE 3.5.9, GNOME 2.22. Since I have never been able to stably run KDE 4.0 and have always switched back to KDE 3.5, I thought I’d try KDE 4.0 in openSUSE 11.0

SuSE11-KDE4

I was pleasantly surprised that KDE 4.0 “just worked”. I had my first KDE 4.0 crash after 1.5 hrs of use whereas earlier it was before 20 min that the SigEnv or Segmentation Fault would throw up. I still didn’t want any crashes and hence I’m back to using KDE 3.5.9. But KDE 4 is really coming good!

As soon as I finished installing, everyone at home wanted me to record the Euro 2008 matches and soon I needed VLC to be installed. I went to videolan.org/vlc and clicked on the SuSE link... and I was greeted with a 1-Click Install button.

SuSE11-VLC-1Click

This was one of the really awesome openSUSE things that was first brought in openSUSE 10.3 and has been improved in openSuSE 11.0. I clicked on it and the installation was finished really quickly.

Improved Installation with YaST

That’s when I realized the most important update to openSuSE 11.0 which is the improved speed of YaST. No other distro has such an easy administration tool where nearly everything can be administered. And in openSuSE 11.0 everything in the YaST module just works. RPM installation is fast and adding community repositories is easy. I am a big fan of apt-get in Ubuntu, but openSUSE 11.0 software installation is just as easy now...

SuSE11-CommunityRepo2 SuSE11-CommunityRepo1

Every piece of hardware worked

I have lots of hardware, old and new on which I often install and test different distros, Windows, OSx86 etc. openSuSE worked with every bit of hardware that was thrown at it out of the box. Every distro struggled with the UMTS 3G card on a laptop, but surprisingly openSuSE 11.0 made it work. Few other distros had trouble with the legacy Nvidia Quadro GoGL card on another laptop, but openSuSE 11.0 worked... Old printers, USB devices, Firewire everything worked. Even the Barcode Reader with PS2-USB converter worked on the USB port which wouldn’t work on Ubuntu 8.04 or other newer distros.

The only change was that on my desktop Intel DG965RY board the surround sound wasn’t working. I followed the Audio Troubleshooting doc, added the model=dell-3stack and all my speakers started trumpeting!

Compiz-Fusion and the Bling

Last time I was not happy with the stability of Compiz-Fusion on openSuSE 10.3. For Ubuntu 8.04, Compiz-Fusion worked well and so I knew it was something to do with the new kernel module driver on my system. With openSuSE 11.0, Compiz-Fusion works perfectly and is able to show all its features. A nice little configuration screen helps manage the amount of effects that you wish to enable. I personally don’t enable effects, but its a good show-off to make people standup and appreciate open-source beauty.

SuSE11-Compiz SuSE11-Sphere

Other features and improvements

  • Linux kernel 2.6.25
  • glibc 2.8
  • GCC 4.3
  • 200 other new features

Conclusion

You can’t miss the ease of use and the sleek looks that openSuSE 11.0 brings to the desktop. Its the perfect distro for a new user coming to linux. For the old pros, openSUSE 11.0 is fast and brings in ease of administration and software installation. Novell support is pretty good for big organizations that can buy a boxed product from them. Xen is my favorite for virtualization and it has good integration and management in YaST. But the strength and momentum of openSUSE is definitely in the desktop space. Earlier, openSuSE lacked the community backing that Ubuntu has generated in a short timespan, but with new initiatives and better responses at openSuSE forums, the openSuSE community and grown leaps and bounds. openSuSE 11.0 has grown from strength to strength and is one of the best ways to give competition to Windows on the desktop!

Other screenshots

gnome-desktop The GNOME Desktop KDE-desktop The KDE Desktop
Cube-atlantis Compiz-Fusion Cube Atlantis Plugin Animation-burn Compiz-Fusion Burn Animation

April 25, 2008
» Summer With OpenMRS... & that Life is not FREE

I haven't blogged for a few days and I haven't been able to follow the tech news and follow-up on emails. But today, I feel a bit relaxed and probably have something to share. I haven't talked about myself on this blog, but today may be a little bit of philosophy and personal adventure will come through this post.

I had applied to the Google Summer of Code 2008 for a summer job and I will be working with OpenMRS. To all my students, now you have to believe I'm a student... and Moksh guys/gals I'm still your "MEAN" software architect ;-). Just that along with my services at Moksh, I'll also be contributing code to open-source, and consider this post to be an introduction to OpenMRS...

OpenMRS is a free, open-source, Medical Records System targeted towards developing countries and mainly implemented in HIV/AIDS health-care. You can read the Overview of OpenMRS and I think the OpenMRS community has already done a decent job at its own introduction. Instead, I will talk to you why I'm contributing to OpenMRS.

I realized pretty early in my life that "Humans fear death". Although death is the only sure thing about life, we often forget its quintessential for life. But probably its the fear for suffering that's more deathly than death itself. I wanted to be a doctor after I passed out of high-school, just for the sake of treating people and making them realize the beauty of life. I dropped out to prepare for the State Medical entrance exams and it was in this year of self-turmoil that I learnt from a spiritual guru that we can change lives only through what we loved in life. I realized then, that I've loved computers and programming all my life and that my karma couldn't have been more appropriate to hug my love for computers as tightly as I could. In the following years, I learnt new paradigms of programming, new languages and better ways to write code. I'm still learning and pray to God that the learning never ends...

With the same love, I hope to contribute code to OpenMRS, in a pursuit that it helps change lives. My summer job is to make a "General Registration Module" and you can read the details here. My mentor for this project is Brian McKown and hopefully I'll follow his guidelines and be useful to the OpenMRS community. And along with the fun of contributing, Google pays me $4500 + certificate + Google swag for the 3-months (i.e. if I complete the project successfully) and $500 to my mentor.

I don't think the project I'm doing at OpenMRS is a life-changing contribution by itself, but I hope its a beginning. If we all do our minuscule contribution to a social cause, it can really change lives. We have taken life and what life has given us so lightly that we don't respect it. Our skills may be completely different, but its the desire that can help. Although OpenMRS is FREE, life is not FREE. Give back something to the world, which has given you the skills.

I will be regularly writing about my OpenMRS Module and OpenMRS in general. Please look into the project, contribute and offer advice to me on the project.