Author: nigelb

  • Standard Chartered Mumbai Marathon 2017

    I’ve been looking forward to running Standard Chartered Mumbai Marathon since May 2015. I took some time in 2015 to train and qualify. I ran 2 marathons before this one and finished both of them in 5h 47 mins. I moved to Mumbai last year, so I trained along the route for the most part as well. SCMM 2017 is the first time I had to DNF a race.

    I planned to train well, but sometimes all the planning in the world won’t help. I had a family emergency in the end of November. I had to be in Kerala until the first week of Jan with my parents. So I went into SCMM with 6 weeks of no training.

    I planned to finish in 5h 45min. It would mean running at a steady 8:11 min/km pace. Managing my pace has never been my forte and I did particularly bad for SCMM. At the 11 km mark, I was ahead of my planned pace by almost 5 mins. This difference was quite steady and consumed my energy. I was on the verge of learning to control my pace after Bengaluru Marathon. The break from training completely ruined it.

    I did get to take pictures on the Sea Link!

    At about the 29 km mark, I cramped up. Both my legs had muscles which were pulsing if I tried to run. I could barely walk. I hobbled about 2 km to take help from the physio at the medical tent. They massaged the pain out of my legs. I could walk again, but running was still too painful. It didn’t help that I was feeling a little dizzy. Not enough that I feared a black out, but I knew I was a bit of the edge.

    The sweep bus was coming along on the other side of the road at this point. I decided that if I was far away from Peddar road when it passed by me, I’d get in the bus. Otherwise, I’d walk the course and make it to the finish line. The bus approached me as I merged onto Dr. Annie Besant Marg and I decided it was best to cut my losses and get on it.

    I have no regrets in giving up. I’m glad I decided to give up when I hit my limits rather than push through and hurt myself. This has made me realize the importance of consistent training and a good base. Over this year, I aim to work up on base. I’ll be racing less and working on training well.

  • Year in Review 2016

    As the memes go, 2016 sucked. Personally, I’m not so sure. It’s been a fun and happening year. I moved yet again, this time to Mumbai. Now, I’ve lived in 2 of 4 metro cities. Two more to go!

    2016 Goals

    Running and Cycling: Not only did I not meet my fairly ambitious goals, I did even worse than last year. Travel, moving cities, family emergencies, and pure laziness played their part here.

    Learn C and JavaScript: Nope, no luck. I’ve barely had the time. I’m refining this goal as finishing “Learning C the Hard Way” book and its exercises.

    Cut down servers: I cut down most of the unwanted servers I was running. I have one more round of cutting down to do and I should just have 1 server.

    Studies: Finished one MOOC course finally. It’s called Learning how to Learn. It’s actually quite a brilliant course and I’d totally recommend it for everyone. I’ve had to unlearn my learning style quite a bit.

    Accounting: Slightly better than last year, but still terrible. Mostly thanks to my life keeping me busy in terms of travel and life events.

    Cooking: I’ve definitely become more confident at trying new things, but still not great at day-to-day cooking. I could do better.

    Android Development: Thanks to lots of changes in my time, I’ve had to cut down things I’m doing simultaneously, so this had to go. As a lesson from this year, I’m taking this off my goals for now.

    Mumbai Skyline by Carol Mitchell

    What did go well?

    • I got married!
    • I’ve stopped freelancing and I’ve started working at Red Hat on Gluster. It’s been the most amazing few months working with some great people.
    • Ran two marathons. Did not hit my timing goals on either attempts, but I’m not too disappointed considering how much my performance went down and how I’ve brought it back up. I traveled to Berlin in Oct and I’m totally jealous of everyone who lives there. The city is such a gorgeous place to run. I learned how to run when I’m traveling!
    • Spoke at a conference after a long time. After speaking at one of the HasGeek Conferences, this it the first time I spoke at any event.
    • Met old friends and made new ones. During the trip to Berlin, I met old ex-colleagues after a long time and I made new ones after our move to Mumbai and during the trip to Berlin.
    • I’ve read more non-fiction this year than in the past. I hope to continue this streak with recommendations from The Farnam Street Blog

    Image credit: Carol Mitchell Mumbai Skyline (license)

  • Writing and Clarity

    I’ve been writing at least 750 words every day for the last 10 days. It’s been a very interesting experience. What I write varies, sometimes I write first drafts for blog posts, sometimes I write plans for work, sometimes I write first drafts for long emails, and every day, I write a small note to myself on how I’m feeling. The last few weeks have been busy and turbulent due to a family emergency. My marathon training plan has been blown away as well. The writing habit has helped me take the stress off. When I’m writing down first drafts for plans, it helps me nail down parts of the plan that I hadn’t thought of. It forces me to build a narrative around what I’m trying to do.

    Fountain Pen and Ink bottle

    Since I started writing every day, I finished writing up a talk I’ve proposed for Pycon Pune. Even if my talk doesn’t get selected, I know I can write a good blog post about it and propose it for other conferences! Oh, and I’m at least publishing one blog post per week 🙂

    Image credi: iKobe! Winsor & Newton Ink (license)

  • Test Automation on CentOS CI with Ansible

    I work on Gluster, which is a distributed file system. Testing a distributed file system needs a distributed setup. We run regressions by faking a distributed setup. We’re planning on using Glusto for real distributed functional testing. Centos CI gives us on-demand physical hardware to run tests. I’ve been working on defining our jobs on Centos CI with Jenkins Job Builder.

    In the past, we created our jobs via the UI and committed the XML to a git repo. This version control is dependent on discipline from the person making the change. The system is not built around discipline. This does not scale well. Every person who wants to add a test needs to have access or work with someone who does have access to add a new job.

    Manufacturing Line

    With Jenkins Job Builder, the configuration is the single source of truth for any given job. As a bonus, this reduces code duplication. With David’s help, I wrote centos-ci-sample, which establishes a better pattern for Centos CI jobs. David pointed me to the post-task publisher, which makes sure that the nodes are returned to the pool even on a failing job. This sample is good, but worked best for jobs that needed just one node.

    We’re starting to setup proper multi-node tests for functional tests with Glusto. I decided to use an Ansible playbook for the setup of the nodes. Our internal QE folks will be re-using this playbook for setup.

    Converting a Jenkins XML to JJB YAMl is fun. It’s best to look at the UI and read the XML to get an idea of what the job does. Then write a YAML which does something close to that. Once you have a YAML, it’s best to convert it to XML and do a diff against the existing job. I use xmllint -c14n to make both XML files standardized. Then I use colordiff to compare the diff. This gives me an idea of what I’ve added/removed. There will always be some changes. JJB assumes some sane defaults.

    Image credit: aldenjewell 1951 Plymouth Assembly Line (license)

  • Migrating Gerrit from H2 to PostgreSQL

    The last 3 months have been busy and challenging. I’ve moved cities and changed jobs. I now work for Red Hat on the Gluster project as a CI/Automation Engineer. After 2 years in Delhi, I’ve moved to Mumbai, right when the monsoons hit. I feel like I haven’t seen the city properly dry ever since we moved. On the plus side, I’ve gotten back into running again. Despite the crazy rains, I see other crazy people like me out running every weekend 🙂

    Gateway of India

    One of the first things I did when I started in May was to make a list of things I thought we need to fix. The first thing I noticed is that we were running quite an old version of Gerrit running on H2. For some reason, it fell over every couple of days. At that point, someone had to login to the server and restart Gerrit.

    The top two potential causes were a large H2 database file and an old version of Gerrit. So I decided to upgrade Gerrit. The first step was to move from H2 to PostgreSQL. I looked up how to convert from H2 all over the internet. Eventually, I decided the best way to go about it is to export to CSV and import the CSV files into PostgreSQL. So here’s a rough idea of how it went about:

    1. Get the list of tables.
    2. Use regular expressions in vim to generate the SQL to export all the tables.
    3. Create the PostgreSQL database and change Gerrit settings.
    4. Initialize Gerrit again so it will create the appropriate tables in PostgreSQL.
    5. Import the CSV files into PostgreSQL.

    Sounds suspiciously easy. Except it’s not. I learned a fun thing about PostgreSQL’s COPY. The HEADER parameter means that the first column is a header and will be ignored. If the order of columns in the CSV file doesn’t match the one in PostgreSQL, it doesn’t do anything about it.

    If your CSV has the following:

    id, email, name 

    And your table has the following:

    id, name, email 

    PostgreSQL doesn’t do the intuitive thing on it’s own.

    You have to explicitly define that. For some reason, I didn’t run into this in staging, perhaps H2 generated a CSV in the right order. My eventual script specified the order when importing.

    NOTE: If you’re upgrading Gerrit, the table names or columns may be different. I recommend generating them on your own based on what’s in your database.