Openshift: first look.

\n\n
\n\n

A few days ago i started using the Ghost blog engine over OpenShift. So, here are my pretty general impressions about OpenShift.

\n\n

My first impressions

\n\n

OpenShift is the Redhat approach for PaaS. It is conceptually closer to an Application delivery-only environment.

\n\n

OpenShift offers virtual machine containers called gears in which you can run anything that do you want following a specification format called cartridge. They take cares of routing the HTTP requests to your gear associating a private/public domain name . If you already specified to use more than one gear then HAProxy load balancing will be enabled between your gears, you cannot alter this proxy configuration.

\n\n

A weird thing that inmediatly caught my attention is why all the PaaS providers are creating their own marketing names to wrap the same concepts: containers and recipes. Maybe is better to use a common set of words instead of create new ones. just saying.

\n\n

Update: Appears that some people is already making some efforts to unify and standarize PaaS Standards

\n\n

The web interface provided by OpenShift appears to be pretty enough for just use predefined cartridges. The only feature that would be desirable is when you click on 'Create Application' sometimes it takes forever and the UI appears to be frozen. Maybe would be better to have a background task and notify to the user when the application is ready.

\n\n

OpenShift also provides a command line interface for run all the commands needed to setup your account and deploy a new application. You just need to install the rhc gem from your system command line. In general terms the cli interface appears to be robust, well documented and colored!, all my tests for basic usage worked perfectly.

\n\n

OpenShift provides you a private git repository for push your application's code changes and by default a new git push will trigger a new deployment. For the ghost cartridge that i am using sometimes the re-deploy hooks don't worked and i have to execute rhc app stop and rhc app start manually and this started becoming a nightmare when you want to do automated deployments.

\n\n

OpenShift is not oriented for long running code, in fact is fully oriented for web applications, that means that all your gears will need to provide a valid web-integration API. For python web applications you must provide a WSGI interface.

\n\n

Some of the first things i tried was to integrate a Varnish cache in the top my 'gears' using this recipe , this recipe appears to be very enough for a non scaled application because you can add the instance ip address manually, but will not work properly for auto-scaled applications. Maybe is a good area to start contributing to.

\n\n

Redhat provides by default support for python-2.6 and python-2.7 also there is a good python 3 support community effort i have not tried it yet, but appears to be a good work in progress.

\n\n

If you already completed the initial setup create a python enabled application is pretty simple

\n\n
$ rhc app create FoobarApp python-2.7 \n
\n\n

After a quick while you can get your applications details:

\n\n
$ rhc show-app --app FoobarApp \n
\n\n

The important output to look at is the Git URL:

\n\n
Git URL: ssh://xxx@foobarapp-xxxxx.rhcloud.com/~/git/FoobarApp.git/  \n
\n\n

For a basic wsgi application you need to create a wsgi/ directory , inside this directory you will need to create an application.py, a good example application could be:

\n\n
from flask import Flask  \napp = Flask(__name__)\n\n@app.route("/")\ndef hello():  \n    return "Hello World!"\n\nif __name__ == "__main__":  \n    app.run()\n
\n\n

Then push your changes to your repo and the python container will be restarted and your application will be ready on http://foobarapp-xxxxx.rhcloud.com/.

\n\n

Preliminar conclusion

\n\n

OpenShift platform is pretty developer friendly and is oriented to quickly get up and running a web application, also they offer auto scaling services for your application in a few clicks, balancing your http requests between all your available gears.

\n\n

All the initial setup is pretty quick and works almost perfectly for python applications. The cli interface works seamlessly and the web interface has a nice look and feel.

\n\n

However i found some annoying issues on the web interface, sometimes it gets stuck forever asking for changes on the gear state. the most worrisome problem with the service is that sometimes you can get HTTP 503 errors without any know cause.

\n\n

Sometimes i experienced outages on my deployed applications without any application related reason, they just becomes into an 'unavailable' state.
\nPerhaps will be nice to get better platform logs for auditing and debugging purposes also to provide better reports to the OpenShift support team.

\n\n

Because OpenShift is backed by Redhat appears that the Documentation is a pretty key part of platform's future success.

\n\n

In general terms as a developer i felt pretty confortable with OpenShift and although I can notice that is still inmature, I think without doubt this will become the choice of many developers to deploy and scale applications in the cloud easily.

\n\n

Good job Redhat !

\n\n

In the near future I will continue writing more articles on OpenShift.


Jorge Niedbalski

Dev and Ops , and might be the opposite.


View or Post Comments