My Experiments with Pi (Part 1 of N)

NOTE: This is not a review of the raspberry pi 4. This is simply a blog about my experiments with the raspberry pi 4.

The It Looks So Cool Phase

Raspberry Pi 4
Pi 4
I was able to get my hands on a raspberry pi 4 4GB in August 2019. To be very honest I had no intention of getting the raspberry pi 4. I was actually looking for a good password manager, when I discovered Bitwarden. It's not like I didn't already know about it, in fact I had actually tried to host it on the free tier of Google App Engine, and didn't like the performance that much then. Besides I had to jump through a lot of hoops to get it to work as intended. After going through the tasks of setting up the instance, the network, the forwarding and scripts, it worked, but there was a constant fear that it could crash any time, or maybe blow the free limits and shutdown for good. It was cool and it worked but I have always found some joy in running stuff on premise on real hardware that you can see rather than some server instance in a data center somewhere. Cloud has its place but for small applications or more private stuff I would always prefer self hosting them and boards like Raspberry Pi's shine in such scenarios. Around that time I changed cities and incidentally the Raspberry Pi 4 was launched, with a 4GB RAM variant. The board came with 4x Cortex A72 cores meaning it was much more powerful than the 3B+ it was replacing and much more power efficient. Plus the 4GB of RAM was cherry on the icing. It looked good on paper and for the price (~INR5k) it was a good alternative against going for a paid instance on app engine. Plus it could possibly do a lot of things, besides just hosting Bitwarden. And so I made the plunge.

Setting up the Pi
Setting up the Pi

When I brought the Pi 4 my dad refused to believe that this credit card sized computer would even work for my applications, let alone run "other things" in parallel. However, when the board arrived he was stunned as to how small it was and the things it could do with a "Good OS". When I showed him the raspbian interface running a complete office suite, a browser and other programming focused applications, he wanted one for his office. More on this "Good OS" later. Before I write anything further, this goes without saying, I don't have a HDMI based monitor / TV. I was planning on doing everything on it without a display. Basically a headless setup. Most of you would argue that a Pi Zero W would've been a much better option instead, but I wanted "MORE POWER!!!". So there I was, without a display, with a basic idea in mind what I wanted to do and loads of time (which I feel was a bad idea).

The Raspbian Phase (Part 1 of N)

Like most other people I first installed raspbian, the RPi's first party OS. The process was quite simple, I was able to SSH into it just fine, and even managed to set up a VNC server, to show it to people that it really works and isn't just some board that you can program using the command line. Plus having the GUI via VNC was cool, just in case I was too tired to use the command line and wanted to use the GUI for any stupid reason. Later I realized, having a proper GUI / Window manager actually helps and can even save in some painful situations. Damn you windows for making me dependent on GUI and windows. For the first few weeks, the rpi 4 felt really cool and I even "natively" set up Pi-Hole on my network to block ads and trackers. It was fun, but I wanted to do more things with the pi. When I found the Pi's biggest flaw back then, even though the chipset supports ARM v8 (basically 64bit instructions), by default it runs raspbian in ARM v7 (32 bits). My disappointment was immeasurable and my day was ruined.

However around that time a 64bit BETA kernel was released, and like all beta things it was broken in a lot of places. However, it felt good as it was a step in the right direction. And even though I still believe the rpi 4 felt rushed a lot, it was at least a step in the right direction and eventually it would be in a good shape. Again I would emphasize on eventually. Around that time, there still was no proper 64 bit installation, though few really really good ones (Gentoo, Manjaro, Ubuntu MATE) did exist. A lot of respect to those devs who worked on those OSes. Ubuntu Server 18.04 support existed but it was unofficial and it too had some bugs.

The Containerize Everything Phase

Containers
Containers
Around this time I was actually learning CI / CD pipelines, Jenkins and the "stuff". An after effect of this was that I finally "understood" Docker. I have known about Docker for over 4 years now and have used it as well. But I never really understood how to tame it. Again this came as a solution of continuously keeping Nvidia drivers updated in Ubuntu and the ill effects it has on packages like Steam, Cuda, TensorFlow and the whole GPU accelerated gang. All the parties are correct in their own right and now the situation is all messed up. Without going into much details and not going off track much, docker is a great solution for problems one faces due to these things and helped me a lot getting my computer vision pipeline into place. Having finally understood how to tame the beast of Docker, I was in love with it and wanted Docker on pretty much "everything". If I could, I would reprogram my microwave to use Docker. Clearly, I had gone crazy and later managed to containerize all the applications I had on my raspberry pi. Namely the pihole and a custom image classifier / organizer thingy I built. Later on I managed to loose that project to some unfortunate circumstances as well, but that's a discussion for another time. Anyways with most things I needed containerized, I felt I really needed that 64-bit power, which led me to my next phase.

The I Need A 64-bit OS Phase (Part 1 of N)

Around this time Ubuntu Server did go official and released 18.04 LTS and well as 19.10 builds for the pi 4. However, to get them to work on a headless setup was a pain and setting up the network and rest was painful. On top of that my device would run pretty warm despite being actively cooled by a fan. Gentoo was nice, in fact by far the best among them, but I was not comfortable overall the way things worked on it. Same goes for the Arch based Manjaro, I could not wrap my head around the way things updated there and the overall working of the OS. In no ways are they bad projects, its just that a person like me who has worked with Debian based distros (Ubuntu, Kali, Linux Mint, Elementary)  all their life found it difficult to adapt. Despite all this, I wanted that "MORE POWER!!!" from a 64-bit OS and made the plunge when Ubuntu 20.04 launched in April 2020. Over 6 months after I got my hands on it. Most of you would say that I needed only docker to get to work on the thing and all these are nothing but excuses, I agree. But still it was fun.

The article has gotten quite lengthy at this point and I would like to split up the article here. In the next one I would go with my experience with Ubuntu 20.04, Linux kernel 5.x and other painful things.

Comments

Popular posts from this blog

My Experiments with Pi (Part 2 of N)

Program of the Week 02 - Unique Element