No Mind

It's the mind that makes you miss the shot

Archive for the ‘FOSS’ Category

March 17th, 2012 by Vivek Khurana

First Eucalyptus meetup – Delhi (17-March-2012)

  Spent yesterday evening with awesome group of Eucalyptus enthusiasts in Delhi. Those few brave souls which manged to defy the Delhi traffic and still managed to make it to the lush green IIT Delhi campus.

  The day started with Deependra Singh Shekhawat, who works with Eucalyptus as Support Engineer, dropping in at my office around noon time. After feasting over pizza’s and breads we started out for the venue along with Himanshu Anand.

 By the time we reached venue it was all set except, the room we were allocated was locked. After sorting out some confusions we got access to the class room and it turned out, the room was three times bigger than what we had asked for. But at the same time, the room was equipped with a projector and all other facilities.

 Just when we were about to start, it turned out that Deependra’s macbook had a DVI port and the projector supported only VGA. To add to this, we had no DVI to VGA converters. But things cant go wrong technology wise, when you are with a bunch of techies. We quickly connected another laptop to to the projector and connected Deependra’s laptop to first laptop over remote desktop.
  Hence we were set to start. We started with introduction and experiences of audience members with cloud computing. It turned out during introductions that Abhishek Gupta, one of the co-host of the event and a student of third year Computer Science and Engineering at IIT Delhi, has written a cloud controller as an academic project and IIT Delhi is running a cloud setup based on that controller as an experiment in one of the labs.

 After Abhishek finished his introduction to his academic project, Deepnedra started with his presentation on Eucalyptus. In the meantime, we were joined by Tarun Dua, one of the co-founders of E2Enetworks.com . The presentation from Deepndra was good and it turned more into brainstorming and discussions than a normal presentation. The discussions were so engaging that I forgot to click pictures :)

 The presentation was filled with cross questions from audience and lots of inquiries about the features of eucalyptus. Broadly these are the features that audience was interested in

  • Billing module so that one can charge or atleast calculate the usage of the resources.
  • Integration with SAN. Though Eucalyptus supports SAN integration, it is limited to specific SAN devices. We would like to see support for more SAN protocols such as AOE, FCoE, iSCSI and FCP.
  • Support for Hyper V
  • Support for more programming languages for writing plugins in Eucalyptus, specially perl.

 We also discussed few of the security scenarios generic to clouds such as bot-nets, DDoS attack, attacks by exploiting vulnerabilities and cloud outages. Thoug we had no conclusive answers to these. But was still worth discussing.

  The most interesting discussion we had was on SAAS definition in cloud environment. This is where the whole audience was split in two groups. One group claiming that SAAS is when you can configure and customize software to your need, while everyone shares the same codebase V/S if you are running any software in cloud, it is software as a service. The discussion was inconclusive and we moved on to other items in the presentation.

 Overall this meetup helped everyone by deepening the knowledge of eucalyptus as well as eucalyptus deployments. Specially the part where Deependra explained few use cases of organizing CLC, cluster controllers and node controllers.

 I also learned few new things about Eucalyptus from this meetup. I was not aware of VM-islotation , which allows you to run separate VM on a separate VLAN and the VM’s cannot talk to each other when they are separated by VLANs. Also learned that Eucalyptus doesnt support VTP, though I am not yet sure if this support has to go in Eucalyptus stack or in networking gear’s firmware.

Post meetup, we landed up in a restaurant and ordered Brownie-Truffle cake with “Eucalyputs 3.0″ written on it. The cake was delicious and everyone had no options except for licking fingers. That is because, firstly it was awesome and secondly I had already signaled the the staff not to serve spoons ;) . The dinner was good with a goofup where a guy mistakenly ordered 4 times the quantity of breads required and we ended up with this basket of breads, which we could not finish…

Know it has been a long post, so I will leave you guys with link to handful of pics fromat he meetup. Did not click much as I was busy with discussions.

Pics: First Eucalyptus meetup -Delhi

One question still remains unanswered though. Why is amazon innovating in cloud space and we are not ?

July 22nd, 2011 by Vivek Khurana

Introducing Krivah

For past some time I have been working on numerous “Enterprise” application. What I noticed that most of them have same bunch of problems. In majority of cases you have some data and bunch of rules to be applied on the data. When I explored this a bit I came to a list of features that I will like to have in a business management framework. Here is the initial list I came up

– Define data easily. By “easily” I mean that a Business user should be able to define data (preferably visually) or modify existing data.
– Pull data from various sources and define a collective business object.
– Define rules with a drag and drop interface.
– Define workflows.
– Define presentation of data.
– Package bunch of features as components and mix components to create applications (SCA)
– Allow individual applications to be stored on separate nodes (hardware) so that you can scale individual applications depending on demand.At the same time whole application should be available to user in a single interface, seamlessly.
– Reporting
– Incremental development of applications and components.

Since I had some free time today, I decided to start writing a framework which meets above requirements. The framework is called Krivah and is based on clojure. The code repo is available at https://github.com/vivekkhurana/krivah . Please note, at the time of writing this post, Krivah is pre-pre-alpha!. The code is for developers only. (not for faint hearted! :) )
Right now nothing special is working. Just a basic entity framework for defining entities. Current code supports only NoSQL and is based on MongoDB. But support for other database is coming soon.

Why Clojure
Clojure is a dialect of lisp that runs in JVM or .Net CLR. Lisp is a language that I find most suitable for business applications. The ability to treat code as data is a blessing for defining business rules. One can use older program source code and pass it to new function, making wrapping functions and extending functions a breeze.

What Krivah is not?
Krivah is not a generic framework. It is focused on business applications and workflow based applications to be precise. So you cannot expect to see Krivah used to build a social networking site. But expect things like inventory management, production planning etc.
To cut down on speculations, I am not trying to build SAP or anything similar. I dont think, this framework will be used by anyone beyond SME.

What is in the name?
Krivah (pronounced Kree-waah) is formed by joining two Sanskrit words Kree meaning work and Vaha meaning flow. Since one of the main focus on this framework will be business workflow, joining Kree and Vaha will mean workflow. :)

Why announcement in pre-pre-alpha ?

Its Friday night here in India and I have whole weekend. I think by Monday morning I should be able to finish couple of task and by sometime mid-next week have something usable by end-user. Since the project is going to be open source, the sooner you release the project, the better it is. :)

So stay tuned for more updates… :)

November 15th, 2010 by Vivek Khurana

Revisioning in custom drupal module

Today I was faced a problem with revision handling in Drupal. I was developing a custom module which had some data stored in separate DB table.  The second requirement was to be able to do revisioning on the additional data.  All was fine till I got stuck in one place. When you revert to an older revision, Drupal invokes ‘update’ op for nodeapi. In both cases, revision revert as well as ‘update’, ‘presave’ op is also called. My requirement was to be able to pull the data for the previous version and store it as new version. But the question is how do I come to know if the ‘presave’ is called for new node, a node being edited or a revision being reverted ?

After some debugging I found, that when ‘presave’ op for nodeapi is called for node revert,  the $node object has vid for the version to be reverted to and when the node is being updated, the vid is the latest vid. So, fetching the current vid of the $node in ‘presave’ op and comparing it with the vid of the $node passed to presave operation, solved the problem. If the vid of the$node passed is same as the vid in the node table, then it is an update, else it is a node revert.

What about new node creation ? Well in case of new node creation the vid for $node is not set. :)

Here is the code snippet explaining the above logic


function mymodule_nodeapi(&$node, $op, $arg = 0){
  switch($op){
   case 'presave':
    if($node->vid){
      //node vid is set, means a this is edit or revision revert.
      $sql = 'select vid from {node} where nid=%d';
      $vid_db = db_fetch_array(db_query($sql,$node->vid));
      if($node->vid == $vid_db['vid']){
        //Execute edit logic.
      }else{
        //Execute revision revert logic.
      }
    }
  }
}

January 21st, 2009 by Vivek Khurana

Playing with dejavu

So spend last night messing around with dejavu orm. While I was chatting with dejavu team over IRC and pointing bugs, fumanchu was busy fixing them asap. We had 3 revisions of dejavu in one hour and one new ticket.  It turned out that geniusql can not handle NULL in mysql timestamp type. Mysql’s timestamp is a badly designed data type, from the manual, “TIMESTAMP columns are NOT NULL by default, cannot contain NULL values, and assigning NULL assigns the current timestamp. However, a TIMESTAMP column can be allowed to contain NULL by declaring it with the NULL attribute”.  Now that’s a horrible way to design a datatype. To support both NULL and NOT NULL, some modifications are required in the geniusql and a ticket has been filed for the same.

So dejavu 2.0 is becoming stable day by day… Enjoy…

December 17th, 2008 by Vivek Khurana

Saturday code jam details

So we seem to be all set for saturday code jam on 20th Dec. 2008. What you need to join the code jam

  1. You should have a laptop with python installed.
  2. You should know some python programming (read “hello world”)
  3. You should be ready to work on completely new software.
  4. You should be willing to opensource your code.
  5. If you are proficient with python, come with cherrypy, dejavu, simplejson and jquery installed.
  6. If you dont know python but know databases, still you can join, we will need good db guys.
  7. You should know how to use git.
  8. You should be willing to code without internet, though python manual will be available.

So see you at code jam..

December 16th, 2008 by Vivek Khurana

Saturday code jam

Inspired by foss.in workouts, I am arranging a small hack session in my office this Saturday, 20th Dec 2008.  We plan to hack some core features for stipend platform to get the basic application running. Already 3 people have confirmed and I have space left for 3 more. Sorry cant accommodate more than 6 people due to space restriction.

Oh yes… we are trying this hack session without wifi… Lets see how far we go… and if you are interested ping me… hurry…

December 15th, 2008 by Vivek Khurana

Dejavu

Recently I started playing with dejavu ORM by Robert Brewer. For first time I found a python ORM which can be a  replacement for my over used data layer. Dejavu allows you to interface with more than one data source and this is a blessing when you are building application that have to fetch data from legacy or proprietary database along with  SQL based database(s).

Dejavu has done lot of things correctly in the design itself. Dejavu uses data mapper architecture, which creates loose coupling between the database and in-memory objects. This separation is achieved with help of a data mapper for translating in-memory objects to database tables. As in-memory objects do not have any responsibility of database operations, the domain layer can focus on one thing that it is meant for ‘domain logic’. As in-memory objects talk to database through a data mapper, they can talk to more than one data mapper and connect to multiple data source, plus the data source need not be a database. It can be anything for which a data mapper exists, thus allowing you to build business objects which can be composed of multiple data sources.

Normally organizations have multiple data sources and applications have to either replicate data or create multiple access layers to accommodate every data source. In such scenarios the loose coupling in dejavu is nothing short of a blessing. With an ORM capable of connecting to multiple data sources, you can expect reduction in development time and number of bugs.

Second good feature of dejavu are the triggers, behaviours that fire when value is changed. It is not uncommon for developers to write logic in the code which is fired on value change, for example update the value of A by 10 if the value of B is more than 20. We do this by writing tons of if-else statements, which becomes  hard to maintain as the code size grows. With dejavu, you can delegate the responsibility to ORM, resulting in easy to maintain code.

I also liked the way dejavu has separated the deployment from development. The official guide comes with a neat example of the config file to explain the deployment. No more complicated XML syntax when all I want to specify is  the database driver and connection string…

I can continue praising dejavu but I think I have done enough.. I think its time now to search the shortcomings of dejavu as by now I am not been able to find any. I am going to play with dejavu more and post about shortcomings as I come across, along with few examples of how to use dejavu…