Openshift: first look.
My first impressions\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.
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:
recipes. Maybe is better to use a common set of words instead of create new ones. just saying.
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.
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.
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.
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.
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
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
After a quick while you can get your applications details:\n\n
$ rhc show-app --app FoobarApp \n
The important output to look at is the Git URL:\n\n
Git URL: ssh://firstname.lastname@example.org/~/git/FoobarApp.git/ \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:
from flask import Flask \napp = Flask(__name__)\n\email@example.com("/")\ndef hello(): \n return "Hello World!"\n\nif __name__ == "__main__": \n app.run()\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
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
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.
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.
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.
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.