Sunday, September 1, 2013

OpenShift and JBoss

After trying and failing to port a complex system written in C# into Python (mainly due to the time constraints) I find myself again at the mercy of Java, albeit at a rather advanced level.

In this article, I will give a small introduction as to how to get your environment configured for the development tasks. 

Objective

A game-server written in C#.NET must be ported into a 'hostable' application. I will not start with my usual, hippie-ranting about how C# should be banished from the face of the earth for just being not free and open-sourced (discounting Mono of course!), but I should mention that if you are using C# for a server application, your options are limited on the Cloud ! With this in mind, I wanted to exploit the free-tiers of a Platform-as-a-Service for a 'Custom' program rather than a web-site.

Technologies Used

OpenShift

The Platform-as-a-Service I have used is OpenShift. I chose this due to many advantages including but not limited to the ease of deployment, wide range of supported technologies , good community support as well as a substantial free-tier.  Adding a special note about the wide-range-of-technologies, at the worst case if you don't find something useful in the offered 'cartridges', you can start-up a DIY (Do-it-yourself) Cartridge and begin with a fresh Red-hat Linux Installation and use SSH to get your freak on! I tried it out with installing Python (along with pip) and included several modules for the purpose and turns out it works like a charm. I have yet to try and install a command-line torrent client (I doubt it will work). But I have managed to overcome one of the commonly faced difficulties due to servers that do not support range-retrieval of large files. All in all, OpenShift is an interesting platform to be used in app deployment.

But of course there are some drawbacks. One of them being- the confusing load-balancing , DMZ and proxy mechanisms. This is one of the reasons that I am being forced into working with websockets (may or may not work! I'll leave that for later!!). This takes away the simplicity that you can have in a simple client-server app with bidirectional data-transfer. I have yet to conclude whether it was worthy a trade-off!

JBOSS

JBoss is, simply put, an Application Server written in Java. Without claiming to be much of an expert on the subject, I'll just encourage you to google for it. Our interests lie with the fact that it is one of the best supported Cartridges in OpenShift.

For instance, you can download an Eclipse Plugin and deploy your application in the remote server from end to end (if you are lucky). However, there are some common issues with authentication and credential validation of OpenShift accounts in  the Eclipse Plugin for OpenShift+JBOSS support. You can skim through the forums and discussions only to be let down. But despair not! Because we have the JBOSS Development Studio by RedHat.

Deployment


The JBOSS development studio is based on the eclipse SDK so it's not a completely novel experience for a nOOb. You just have to
1. Code in the IDE
2. Commit to the local repo
3. Push to the remote origin
4. Witness the Magic!

I will add more details on the installation and setting up as I have time (that was the idea behind the article). Meanwhile, feel free to ask for any clarification if you can't wait for the next edit!