KalyanChakravarthy.net

Thoughts, stories and ideas.

thoughts

Python Deployments Wishlist

Am currently faced with a baffling realisation of the reality that there is no one sane way to deploy python applications.

It's utterly annoying that I cannot just tar a virtual env and use it.
Performing pip install on every deploy is plain ridiculous. Downloading from the internet on every code change with separate virtualenv is a nogo. No RPMs, nope, no way am writing another spec file.

Wishlist:

  • Deployment tooling that allows me to go from zero to production with a new application with no setup.
  • No-downtime between deployments (has to work with a single instance)
  • Philosophy of implementations should make sense whether deploying to one or a 100 servers.
  • Controlled activation of the new version of software i.e. traffic shifting.
  • Stable re-producible environment setup everytime (perhaps with ansible).
  • Cli that lets you bootstrap, build, deploy and control activation of software (nginx or via LB).

Next:
Am starting to hack a prototype with fabric, python and Ansible, which is already proving to be challenging but looks doable.

Bug in my code and Ballet

... of sorts, or more accurately barre.

I use a service called Onefit in the Netherlands which lets me register for group lessons or use a gym in a bunch of places (limit is four times a month). I used it for joining yoga classes sometime back. Apparently its quite popular with locals here and so I have a hard time finding a spot. So like any sensible person, I tried to automate it. I wrote a python script that would run in the background and try to find me a spot when someone cancels their's (and people do cancel as there is a no-show fee). Lo and behold the script alerts me, and I immediately sign up. Now am feeling excited that I am the smartest person around to do such a thing.

The day of the supposed yoga class, am all pumped up to be going back after 2-3 months. I get to the venue on time and tell the person at the reception that I am here for the yoga class. One of the persons sitting there was the instructor, and she thought I was confused, so she mentioned there is no yoga class for another hour. I tell her, no, look and show her the confirmation on my phone (there is a location-based check-in), and she went "yeah no, its a 'Barre' class" which is a Ballet style workout.

Now am visibly shaken, my mind wanders away, slowly, mentally debugging the code that I refactored day earlier, as to what just happened, all the while still blankly looking at that lady. It turns out I applied filters for location type, time but not for the class type. Neither during my testing did I realise that they were offering more variety of classes from the last time I tried months earlier, nor when I was pressing the "book" button. I can at this point see the code and what the error was.

What do I do now?

It is too late. I had to do something, either go forward or back home. One on hand I begin to wonder if will I be charged a cancellation fee? On the other hand, I asked myself, would I have ever tried this by my own volition? The cancellation fee of €10 would be a blow to my ego that thought it could automate itself out to glory.

So, I went in. Yes. It happened.

Boy oh boy, what an experience it was. I was the only guy and a chubby human in the entire class, full of women in shape and active. Halfway through, am sweating, panting, full of feeling that I can collapse any moment. I keep going, and then I could no more and had to take a timeout. And all throughout, everyone was going through the motions of the class without breaking a sweat, like it was some fucking music video. What the hell.

Usually when I play sports, its the next day I feel it. No sooner than the class ended, I could feel my body telling me what a dumb idea that was.

And gents, that's how I ended up trying ballet workout, all due to a bug.
So, remember the lesson kids, test your code :)

PS: Now this made me wonder about something a friend said a long back, during one of our conversations about "anti-search" search engines, which recommend something that you wouldn't usually try, either a thing or a place, a sight or an experience. While I have tried random things in the past, if not for this "bug", don't' think I would have intentionally tried to go check this one out. Serendipity can be a good thing, and I wish this world facilitated more of it.

People

Ever since we are born into this world, our lives begin by being cared by others. We grow to realise, implicitly that people are essential. How could we comprehend any other possibility?

So we try to be friendly, often more than that is necessary or possible to be reciprocated as humans are different. Why do it then? Because it's convenient to think, to have more friends is to share good times with many, thereby meaning more happiness.

The danger of it is letting toxic people in. They will come, eventually. They always do. The trick is to recognise who are the ones causing the sort of drama which leaves you not feeling at the top of the world.

People who cause drama, need to be weeded out, ruthlessly. Those blissfully unaware of the damage it does to those around may perhaps deserve the benefit of a doubt, once. But just once. Life is too short to try to be nice towards those adding misery.

Having fewer friends who are more thoughtful and caring is not only energising, but also adds an immense amount of meaning to life. The value of a meaningful relationship is unmatched against a thousand casual friendships or a hundred one night stands.