Author: ngpestelos

  • On Active Deployment

    I’ve watched the Kuby talk at Railsconf, and I have some opinions on Active Deployment. The talk attempts to provide a standard way of deploying Ruby on Rails using a cloud platform (Kubernetes). The talk also mentioned Capistrano and its still-relevant role in the community.

    This left me with a question: if you plan to deploy a Rails application to production in 2022, are you now forced to use Kubernetes?

    Over the years, I’ve been deploying Ruby on Rails applications on different types of infrastructure: virtual servers, managed platforms-as-a-service, and lately, Kubernetes clusters. Each type has its own strengths and weaknesses.

    I think one way to help decide is how much resources in terms of skill, time, and money you can afford to spend on not just bringing up infrastructure but also sustaining its operation over time.

    The talk mentioned several disadvantages of using Capistrano to deploy; one still needs to set up the software dependencies before successfully deploying a Rails application. I think this upfront cost is a valid trade-off in exchange for possibly cheaper operating costs (running a single server to run the whole stack versus provisioning multiple servers and running Kubernetes on top).

    I’ve had two reasons to use Kubernetes in deploying a Rails application: (1) multitenancy, where multiple instances of the same application will be deployed, and (2) adopting a container-based delivery pipeline, which eliminates a whole class of problems (e.g., dependencies) in exchange for a different set of problems.

    I wish that we keep our opinions on Active Deployment open. Not everyone needs a Kubernetes cluster to deploy, and there’s still value in keeping Capistrano around. There’s always a hosted platform, such as Heroku (and similar offerings), to ease the deployment burden for a price.

  • Sustainable Rails application development

    These are some of my notes on David Copeland’s interview on September 2022.

    Pragmatic Programmers (PragProg) hosted an interview with David Copeland, author of Sustainable Web Development with Ruby on Rails. I bought the early edition of this book two years ago and found the lessons there to be valuable. The interview differentiates sustainability from scalability (a common theme used to evaluate a web development framework).

    Sustainability refers to the ease of which changes to the application can be made over time. The book assumes that the application needs to survive over several iterations, which may span more than one year. In order to keep development sustainable, the application needs to be structured to allow for changes to be done easily, despite changes to the people working on them and the environment that it runs on.

    Part of what makes an application easy to change is having tests to ensure that any code that was built before stays working. This assumes that the application has already settled on its primary purpose.

    Adopting ease of change to promote sustainability also puts less focus on predicting future needs. The author advocates to only build software for today’s needs. However, certain decisions require some forward thinking (e.g., database structure and API endpoints) because these types of changes are much harder to roll back once released.

    David also mentioned the role of models in safeguarding the database’s integrity. Having a collection of models act as a gatekeeper to the database prevents untoward data incidents (e.g., missing customer data). Losing or damaging data is far worse than losing the application, as the database tends to survive the application that uses it.

  • Quick road trip to Bulacan

    I’m amazed that the new Skyway extension has made traveling to adjacent provinces much faster. It took us 45 minutes yesterday to get to Bulacan from Manila. The return trip was slightly longer, partly due to the volume of vehicles returning to the capital. No traffic jams along the Skyway on a Sunday afternoon.

    You’ll need to tap your RFID card (EasyTrip) when passing through some of the toll gates, so please don’t forget to bring these RFID cards with you.

  • git Broke After macOS 12.6 Update

    I couldn’t run any git command after updating my machine to macOS 12.6.

    I found a fix in an old StackOverflow post:

    sudo xcode-select --switch /Library/Developer/CommandLineTools/
  • Old lady with a bleeding hand

    The doorbell rang while we were about to sleep. At first, I thought it was my mother-in-law dropping by after work, but in the door’s peephole, I saw our neighbor with her left hand bleeding.

    According to our neighbor, her index finger was caught in a door, which pulled her fingernail off. With blood dripping on our doorstep, we immediately took her in, and my wife (a doctor) dressed her wound. After giving first aid, my wife took her to the nearest hospital, where she was given proper treatment.

    The old lady has been living alone since her husband died almost two years ago. The lockdowns prevented her from being with her husband on his final days.

  • Claiming a driver’s license from LTO East Avenue in 2021 (tubos)

    Tubos in Filipino means “to claim”, but somehow it felt like “to pay a ransom”.

    After a traffic violation last week, I had 72 hours to claim my driver’s license from the main Land Transportation Office at East Avenue, Quezon City.

    Last Tuesday, I took my ticket and rode a Grab instead of bringing my car. This was a good decision because available parking is difficult to find in a government office. The ticket acts as a temporary driver’s license up to a certain time period.

    I arrived at LTO East Avenue at 1:00pm and at the gate, the security guard asked about the purpose of my visit. I told him it was for “tubos”. He then told the Grab driver to drop me off the back of the complex (LETAS Building where they process all the traffic violations).

    Inside the building there were two queues: (1) for waiting for the violations to be “encoded” and (2) for waiting for the invoice to be paid out (which includes a summary of the traffic violation and a breakdown of fees). Waiting for (1) took about an hour, but (2) and eventually payment was done within 15 minutes. Bring cash. The waiting area is airconditioned so people in line were napping or using their smartphones.

    Outside the LETAS building (right in front) is a chapel and next to it is the cashier’s office where there is a short line for payment. I find the chapel to be an odd addition to a government office, separation of church and state and all (this is the Philippines so that is merely a suggestion).

    In the LTO complex there were a lot of signs warning people not to deal with fixers (these are people who claim to expedite your paperwork). I did not have to deal with fixers while I was there.

    Left the complex at 2:30pm and walked out to take another Grab home.

  • Crowds and getting the first vaccine done

    I woke up at 2:00am yesterday to line up for my first COVID-19 vaccine shot. The whole process took 7 hours spent mostly waiting in line on a dark street corner with close to a thousand other people.

    I arrived at the vaccination site at 2:30am and found the line has already turned a corner from the entrance. This meant at least 100 people have lined up earlier (I found out I was the 221st person in line). I’ve put myself at the last line and a few minutes after, two more people went behind me. Then another two people. Within two hours, the line doubled in size.

    People have new ways of killing time while in line. Most of us brought our phones to read social media (which is normal behavior these days). Some were playing games and others were catching up on their streaming shows. Those who lined up with companions spent the time the old-fashioned way by talking endlessly. This pandemic can keep Filipinos separate but it cannot keep them from talking to each other about anything under the sun. Some were complaining about the line while others were making fun of our situation.

    We, as a people, have also made the new health protocols as a practice of theater. Social distancing was only observed after the local government officials stepped in and checked before someone else took pictures of the said line. Everyone kept their masks on while in line (which was good enough for me), but the face shield (a thin plastic sheet covering your face and was required outside of residence) proved to be too inconvenient and most people wore them over their heads. I personally found the use of face shield to be symbol of this precaution theater (low cost and questionable value-add).

    The vaccination site started to open their doors at 6:30 that morning, most of us who were in line for several hours have the same sleepy look on our faces. Some have started to check their documents. We only needed an ID and a QR code. True enough for people subjected to more than usual red tape all our lives, some brought more proof than required. The vaccination staff (doctors and nurses) arrived shortly and began to settle in.

    Crowd control in the vaccination site was well-organized and there were enough personnel to direct the people where to line up next and keep our distance from one another. Not much talking, just point and check. Finally they let us go upstairs where the chairs are setup and where the staff were waiting for us. The line was processed in batches of 12 people, avoiding crowding at the vaccination stations. There were three stations: one for identity verification (using the QR code earlier), another for the vaccine administration (which was done by two staff members), and an observation area just in case there were side-effects right after the dose. A staff member reminded us of our next dose one month after.

    I eventually finished at 9:30, seven hours after I stood in line. To celebrate, I immediately lined up to buy food at the nearest Jollibee.

  • What do I care about?

    “Never attempt to write about what you don’t care about.” – Gerald Weinberg

    The things I care about:

    My overall health and sanity. I will not be able to provide for my family without taking care of the basics: eat well, sleep well, and put the body to its paces.

    My family. It’s an entirely different life once we decided to build a family. A hidden capacity has been unlocked and also with less tolerance for BS and a greater sense of urgency. I now have to consider the family’s interests in my decisions.

    My colleagues and the work that I produce with them. When working with a team, I had to consider our complementary skills and where we can best contribute to our goals. As an individual contributor, I do not like doing half-measures. Granted corners will inevitably be cut, I aim to do the best possible work with the constraints given.

    My friends who I have managed to keep for so long. Some of the friends we’ve made remember a different version of myself, as if their working copy needs rebasing.

    In some ways I would like to be able to influence the things I care about. While I’m still able, I would like them to stay important.

  • The Battle of Helm’s Deep

    I’m currently migrating a production Kubernetes cluster from Helm v2 to v3.

    Helm v2 has been long deprecated. We’ve been using Helm to install our services for almost 4 years, but Helm v2 has been deprecated since last year and everyone seems to have moved to Helm v3.

    Helm v3 no longer depends on a server-side daemon called Tiller, which coordinates the installation of Kubernetes resources from a chart’s template.

    This is a problem not unique to myself

    Props to the Helm team for creating a helpful migration video. This has eased a lot of my worry of breaking not just one, but multiple services running in our production cluster. I was able to go through the tutorial and was able to migrate one Redis release. I could leave still use Helm v2 in our deployments, which is highly appreciated.

    See also

  • Philsys registration fail

    Can’t register using Safari or Chrome: