GSoC#4: Project and pre-first evaluation period

My project is about adding support to automate the migration process, in particular, after an OS upgrade or hardware change. So, from a set of manual migration instructions, the project aims to narrow it down to `port migrate`.

The project is divided into three phases: getting the information (in our database), removing the (existing) information, restoring the (updated) information. I know, it doesn’t seem to be a really efficient logic but we plan to improve it further as we go.



First Phase: The action `snapshot` aims to replicate the user install commands. The plan was to implement this using database and not files, so it justifies the need to add support for the tables to the entire stack up from cregistry.
  • The snapshot action basically takes a complete copy of all the installed ports and the metadata. Till now,
    • 3 new sqlite tables have been added to the registry’s create and update function and regsitrydb version renewed so that existing installations get them too.
    • snapshot_create in registry2.0/entry.c enables access to the sqlite database from Tcl frontend using registry APIs. It calls cregistry/entry.c reg_snapshot_create internally.
    • reg_snapshot_create creates a snapshot in the snapshots table, calls snapshot_store_ports.
    • snapshot_store_ports stores info on all currently installed ports in the snapshot_ports table (and requested flag)
    • snapshot_store_port_variants stores port variants with the sign in the corresponding table. It depends on getting parsed variants which I have not written yet (reason below).
  • Time spent on figuring out things initially counts as well, right? Only if this does not become an endless excuse.


Talk about Future: Go according to the Timeline mentioned in the proposal. Quickly finish the left outs in this 4-day planned buffer and start with the migrate action. Things seem to be picked up fast compared to the initial weeks. I’m now more aware of where lies what, hopefully.


I was stuck at.. 
  • for a long time, Tcl or C? In what language do I have to write the above three functions, Tcl or C? Believe me, this is not something you ask your mentor or community or perhaps, anyone. Then I started looking at the implementation of existing commands, one by one, took 3 to 4 days, and then one fine morning, I saw the mapping array from command to function. It was there, right at the bottom of entry.c. Yes, if you give this argument to registry::entry, this method will be called. Had a sound sleep that afternoon.
  • for a short time, probably for a day, that there exists something like reg_entry_propget to help you see through dark, to get what you want, just give the key. Should have spent more time going through C files than Tcl ones during community bonding period :/.


I am stuck at ..
  • Only one variant of a port can be active at a time. Makes sense. Running `port install apache2 -preforkmpm +workermpm` and then `port install apache2 +openldap` saves apache2 as two different ports in the registry. So, reg_entry_propget only returns one variant of a port when passed as reg_entry pointer. Now, how do I link the two variants installed (note installed and not active) to the same port in my database? If not, all we are left is with one variant mapped to “each” port, questioning the need for snapshot_port_variants table.
  • Till ^ gets resolved, I won’t be able to write get_variants_parsed function.
  • IMPORTANT: where to add the OS check? I tried starting a discussion on this but never arrived at a decent conclusion.


Still not clear ..
  • where to include the --list for listing snapshots? if with `snapshot` action, then it creates the need for --create which I do not prefer personally. But if with `restore`, then `port restore --list` doesn’t appeal as well. Only if a command existed which lists the choices first and then proceeds so that I could simply copy their design strategy and save myself from confusion every time I decide to do things nicely.
  • limiting the number of snapshots that a user can take?
  • and more to come :).
Screenshot if someone enjoys looking at it, I just like the shutter sound:




I like this one:


Also, I forget, the unreviewed commits are here.




EDIT:
A doubt, so fundamental to my project, that got cleared while writing this post:
  • We’re solving for these two end use cases (correct me if I'm wrong):
    • running simply `migrate` is (snapshot the current installed state + restore).
    • `snapshot` followed by `restore`: restoring back some existing snapshot.
  • Interactive restore could be a solution for --list?

GSoC#3: A 'miss'-communication

This happened in the very first week of the coding period of my GSoC. I had things in mind to talk about but they just remained in my mind forever until I received an email that scared me out of my wits and condemned me for not communicating at all for the last ten days. And it was true. 

Failing your evaluations just because you are not communicating properly is like not accepting help from the rescuers but waiting for God to come to rescue you while you're drowning.

Communication is the key. How much did you think about the project over the last week? How much effort did you put into thinking about your proposal? What does your research say? They need to know and you need to tell. It becomes difficult when it's remote.

Think of it as an office internship in some company. Not communicating at all means you go to the office but do not speak at all or engage with anyone and just watch around. Isn't this when we start calling the person weird and alien? People have fought for the freedom of speech and now, you're just being shy. Stupid!

Know how to sell yourself. Research well before making your points but if it takes time, then throw a mail to let the community know that you ARE researching and have the following updates to share. They don't know if you were staring at a blank screen all the time or even existed for that while. Play on your strengths and work on your weak points.

The community is not interested in the project code or the small fixes you make but in your approach to solving larger problems. The bigger things are more interesting to you and to the organization. What is it that you bring to the table? What would you do to improve the project beside the small fixes? Think about how you would spend your time this summer. 

They are interested both in your technical skill, but also your holistic understanding of the project. Ultimately, they will judge you by the thoughtfulness of your proposal.

GSoC is just another way Google provides you to connect with the people around the world. Review each other's code, your mentor's code each day. Think of it as a score for your personal development. You are not given this opportunity to complete one project and just get done. You failed if that's what you plan to do, even if you pass the official evaluations. You are given a life long opportunity to be a part of a community having members from all around the world and all you did was write five hundred lines of code. Ha!

To quote my mentor, "Communication is the foundation of a team. It is as important as any code you ever write. It is unlikely you will focus on building things only for yourself and success in building with and for others will largely depend on your ability to communicate. Always work at refining your communication skills. They will pay off in many dimensions of your life."

There are absolutely no limits to what someone can do! It's just how badly you want it.

Good luck!