<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Srinivas Vaddi on Medium]]></title>
        <description><![CDATA[Stories by Srinivas Vaddi on Medium]]></description>
        <link>https://medium.com/@srinivasvaddi?source=rss-4c1ff53b32f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zC3rNIaMkhyspU58wuSN9g.jpeg</url>
            <title>Stories by Srinivas Vaddi on Medium</title>
            <link>https://medium.com/@srinivasvaddi?source=rss-4c1ff53b32f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:27:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srinivasvaddi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[680. Valid Palindrome II]]></title>
            <link>https://srinivasvaddi.medium.com/680-valid-palindrome-ii-41ef9ac1d24e?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/41ef9ac1d24e</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[solutions]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 16:59:30 GMT</pubDate>
            <atom:updated>2024-04-29T16:59:30.508Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WstOvoJTjbLaPL4C" /></figure><p><strong>You can find this on </strong><a href="https://leetcode.com/problems/valid-palindrome-ii/"><strong>LeetCode here</strong></a><strong> , solution is </strong><a href="https://thetechcruise.notion.site/680-Valid-Palindrome-II-9bead8b762884e9e9aedafc7ae0b73e1"><strong>here</strong></a><strong>, and understand the logic </strong><a href="https://thetechcruise.notion.site/680-Valid-Palindrome-II-9bead8b762884e9e9aedafc7ae0b73e1"><strong>here</strong></a><strong>!</strong></p><h3>Thoughts and Talk</h3><p>Palindromes have stood the test of time as a classic interview question due to their fundamental nature. Although there are various approaches to solving them, the traditional two-pointer method remains the simplest. However, in this current referenced leetcode problem there’s a twist to this problem❗ -it’s not just about determining if a string is a palindrome. The real challenge lies in identifying whether removing one character from the string would transform it into a palindrome.</p><p>This added complexity makes the question intriguing, even if it’s categorized as easy. It requires a keen eye for detail and a thorough understanding of palindrome properties to solve effectively.</p><p>The problem of determining if a string can be transformed into a palindrome by removing at most one character introduces a fascinating twist on a classic problem. This task isn’t just about palindrome detection; it also tests our ability to handle slight modifications in string properties efficiently. It’s a problem that requires not just understanding basic string manipulation but also a deeper insight into decision-making processes in algorithms.</p><h3>Problem Statement</h3><p>We need to determine whether a given string can be rendered a palindrome by deleting at most one character. This problem extends the classic palindrome check by adding the possibility of minor adjustments, presenting an interesting challenge in algorithm design.</p><h3>Hints</h3><ol><li>Utilize two pointers to compare characters from the beginning and end of the string.</li><li>Upon finding non-matching characters, decide whether skipping the current character from the beginning or the end might help.</li><li>Only one such skip is allowed. If skipping doesn’t help, the answer should be false.</li></ol><h3>Approaches Explored</h3><h3>Approach 1: Two-pointer with single skip check</h3><p><strong>Pros</strong>:</p><ul><li>Efficient, since it typically requires scanning the string at most twice.</li><li>Simple to implement using conditional checks to handle the single allowed skip.</li></ul><p><strong>Cons</strong>:</p><h3>Approach 2: Modified two-pointer with state tracking (not so different!)</h3><p>This is the approach reflected in our original code. ouIt uses a breaker variable to handle complex decision points when both characters to the left and right could potentially be skipped to maintain a palindrome.</p><p><em>Originally published at </em><a href="https://www.thetechcruise.com/680-valid-palindrome-ii/">https://www.thetechcruise.com/680-valid-palindrome-ii/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41ef9ac1d24e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open-source, Self-hosting on Raspberry-Pi and the Gizmo -”n8n.io”]]></title>
            <link>https://blog.devgenius.io/open-source-self-hosting-on-raspberry-pi-and-the-gizmo-n8n-io-6cc42e644e1a?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cc42e644e1a</guid>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Mon, 12 Apr 2021 04:24:17 GMT</pubDate>
            <atom:updated>2021-04-12T08:30:02.094Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<p>I once asked a CxO of a Fortune 500 company what were his views about “Open-source”. His answer made me realize that I had a long way to go in every walk of life. He said, “Open-source is like Potluck, everyone wants to be there and enjoy the dishes, but not many want to cook and bring something for others”.</p><p>After more than a year and a half after that, as I experiment with n8n.io, I do realize that he was right. There is a lot of great work happening around the world, especially in the open-source community. But, we might want to ask ourselves are we doing enough to support it? Even if a lot is happening in the world of Open-source, are we giving enough traction to the good that’s happening? And are we all contributing enough towards it? Are we unconditionally embracing open-source and giving a shoulder to the fraternity? Are we unyielding in implementing open standards? And, most important of all, are we helping the open-source project grow? Are we giving enough voice to the good work and jumping to fix the bugs on these products for the larger audience?</p><p>These questions are very relevant for many reasons. To begin with, many great products enjoy a large pool of fandom. While I was working on Apache Airflow, I realized that the community and the ecosystem while still growing, it was already mature enough and that many enterprises have come in sheer support of the product. But, is that enough? Are we all pulling the heavyweight of an open-source project that can benefit the masses of the tech world?</p><p>Certainly, there is no answer to such questions. While about 3.5 years in the software industry might seem too little for any individual to talk about it, a hands-on experience with many era-defining products and technologies gave me exposure to some of the many faces of this industry. There comes but rarely comes a technology so significant that we can vividly see the industry gyrate about it and pace further. By grace, I had the opportunity to work on many such technologies.</p><p>While professionally we might be finding it at ease to move ahead with implementing and experimenting with new tech, self-hosting on a home server throws a different problem to solve. It is because we cannot keep up with maintenance and licensing costs. And if technology is going to be a prerogative of the elite-erudite few, how can we empower everybody? Also, if everyone had to build their own tools from scratch, or if everyone does not have the same failsafe tools used for the enterprises, how can we all be equally equipped for building a better future?</p><p>Just when I was trying to observe these thoughts, I came across a Reddit comment which introduced me to something new. Something that gave me a peep into the future of no-code!</p><p>I have been an Integration Engineer for quite some time now, but, very recently have started working on Dell Boomi. It is undeniably one of the most polished iPaaS solutions probably. There is a well-thought interface, a more structured interface, a granular version control, a keen logging mechanism, and above all, a very well-developed set of connectors and much more. The design principles are more or less timeless ideals realized through years of changes and improvements.</p><p>There are many more qualified engineers and professionals working on Dell Boomi than I am. I have fallen in love with the marvel Dell Boomi is. BUT, Dell Boomi does come at a cost — a cost of licensing. The pricing models are probably a big burden on the small pockets. Just to be clear, there is no comparison between Dell Boomi and the latter part of this article. Boomi is a sneak peek into the future.</p><p>What if I told you, there was a similar product, with a large fanbase and community, bundled a wider range of connector support and all that is free! Yes, such a thing exists, and it is <a href="https://n8n.io/">n8n.io</a>.</p><p>Self-hosting is interesting, but, it is also very tiring, at least for me. Because I use a Raspberry Pi for all my hosting needs, and that I am sort of a beginner here, it is very painstaking to set up things. Some things that are tiring include-</p><ul><li>Maintaining your domain registrar and DNS provider records (even if it is one-time-setup)</li><li>Managing the CDN level settings like Security, Captcha, bot-blocking, etc.</li><li>Router and router-level security</li><li>Devices and network configurations on the intranet</li><li>Raspberry-pi’s and power supply</li><li>OS’es and kernel versions</li><li>Installations and software configurations</li><li>Applications and data-volumes</li><li>Application configurations and backups</li><li>Managing the hosted containers/applications</li></ul><p>The list goes on. There is no shame in admitting the friction on the joyous journey of self-hosting. And yet, regardless of friction we do things anyway.</p><p>Although I was suffering from all these challenges, I did script and automate many tasks. I scheduled Crons and watchdogs to restart and take care of many services I was hosting. I also started some tools like <a href="https://www.portainer.io/">Portainer</a>,<a href="https://nginxproxymanager.com/"> Nginx-Proxy-Manager</a>, and other cool dashboards to manage the many containers and services. But, there was always some friction. There was always a tall wall of uneasiness that loomed between me and my server. And, I could not easily scale it.</p><p>I wanted to be able to automate and control things with more ease, with much greater agility and force. That is when I wanted to be able to find an open-source tool that could get me going fast! Something like Dell-Boomi. Something that could get me going with faster development and implementation. A bridge over the tall wall so that I can trek and slide to the other side, or jump over the tricky tall discomfort.</p><p>One quick thought was to use something like IFTTT, Twilio, or Zapier. These services were amazing. I was stunned by what I could do from outside the network. I was amazed by the number of integrations and features. I quickly jumped to integrate my GhostCMS blog with Medium using Zapier. It was only a few clicks away! As soon as I published something on Ghost, I could see it come up on Medium as a new story and a new tweet for each new post. This was an overwhelming amount of automation for me because it was only a few clicks and no scripting!</p><p>There was no way to be not contented with what anybody can do with Zapier/IFTTT. But, certainly, this still costed a fair bit. Even if the pricing plans were fair, for an enthusiast like me, this cost was still heavy as I continue to experiment with tech. I scraped through the internet and forums, probably through every page that spoke about alternatives to Zapier/IFTTT. In some corner of the internet, in one of the infinite pools of comments, somewhere in between the post archives and tiny fonts, I saw something that changed my entire outlook on self-hosting it is “<a href="https://n8n.io/">n8n</a>”.</p><h4>What is N8N?</h4><p>I will put it in simpler terms, it is not just a workflow automation tool, it is a gizmo, a boon to the automation-freaks, a UI based automation tool that can be extended and probably has no limits on what we can do (except for its licensing and our imagination).</p><p>It has about 200 different and out-of-box integrations. Triggers and connectors make it a suitable and easy choice for the home-server automation I was looking for!</p><p>Some quick features:</p><ul><li>Docker ready!</li><li>has an encrypted credential store</li><li>Import/Export of workflows and credentials are supported</li><li>Basic authentication can be enabled</li><li>Logging and tracking executions</li><li>Support for webhooks!</li><li>Batteries included!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aqBLFlbv2BPvuTar.png" /><figcaption>workflows made with N8N</figcaption></figure><p>Now, the bigger question, is, what can you do with it? Probably anything and everything. Here are a few workflows I have built -</p><ul><li>Ghost CMS to Medium — every article published on GHOST is automatically published on Medium via a cron workflow.</li><li>Ghost to Twitter — A new tweet is sent each time a post is published on Ghost</li><li>Continuous monitoring of ghost blog</li><li>A view counter based on JS</li><li>A backup of n8n configs to Gmail and Gdrive</li></ul><p>While there were many other integrations I made on n8n, the King of the workflows was a Telegram bot! that I integrated with n8n! This changed everything for me. It turned my home theatre into a smart speaker system. A simple telegram chat into an email delivery workflow. And above all, it made my Raspberry-pi into an automation powerhouse!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JYlhU_QCyAH4lC7R.png" /><figcaption>Telegram bot integrated with N8N</figcaption></figure><p>What can my bot do!</p><ul><li>Play a YouTube video on the speakers connected to Raspberry-Pi</li><li>Mail delivery with SendGrid</li><li>Update a blog with just a telegram message</li><li>A URL shortener</li><li>A smart-light control</li><li>A backup system away from the phone!</li><li>Execute Python scripts</li><li>Run shell commands</li><li>A password update with Bitwarden!</li><li>Server uptime and health monitoring</li><li>Send Newsletters (I tried this with a limited audience, and it works)</li></ul><p>All this just in a matter of few hours!</p><p>It is exciting to be able to think of a certain use case and be able to get it working in just a few clicks. What excites me further is how it rightly fits into the space left vacant between Apache Airflow and Dell Boomi, a gap that kept me wondering and pushing for exploration. This solved most of my self-hosting problems.</p><p>This tool is indeed a gizmo, anybody looking for open-source and self-hosted alternatives for Zapier/IFTTT. It is free and ready for experimentation. But, in my view, it is also true that n8n is not all-encompassing from an enterprise perspective because it lacks some of the most fundamental features. Just to name a few -</p><ul><li>Granular version control for each shape and configuration</li><li>Workflow level version control</li><li>Logging and easy monitoring of jobs</li></ul><p>I also noticed some intermittent App freezes when experimenting with multiple web-hooks, but, a container restart was all it needed to be fixed.</p><p>If there are enough supporters ready to adopt a technological marvel like N8N, projects like this can grow. I do know and understand that the license which comes with N8N prohibits commercialization. So, it is not completely open-source in some ways. But, what is it like if a project like this gets enough traction? What if projects like this come together? What if the community embraces the risks, and works on fixing them? What if we can add more robustness to this marvel? What if we can improve on the shortcomings and make N8N a strong alternative for the masses? What if it solves the problems of many others like me who are beginners in self-hosting!</p><p>With solutions like n8n, the future seems more interesting, and more promising. Above all, it is very comforting to be able to join the dots and gaps that are evident!</p><p>In future series, I will be elucidating more on what n8n is, how to deploy and develop with n8n! and the limitless possibilities it brings!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cc42e644e1a" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/open-source-self-hosting-on-raspberry-pi-and-the-gizmo-n8n-io-6cc42e644e1a">Open-source, Self-hosting on Raspberry-Pi and the Gizmo -”n8n.io”</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jujitsu — for a happy life]]></title>
            <link>https://srinivasvaddi.medium.com/jujitsu-for-a-happy-life-25ee73dae0aa?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/25ee73dae0aa</guid>
            <category><![CDATA[russian]]></category>
            <category><![CDATA[standing-up-for-myself]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[poet]]></category>
            <category><![CDATA[philosophy]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Sun, 01 Nov 2020 17:56:36 GMT</pubDate>
            <atom:updated>2020-11-01T18:02:33.424Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jujitsu —</h3><p>For every strong person, there is a special Jujitsu — Yevgeny Yevtushenko</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*AeLY5m1rZRCJ4QNR.jpg" /><figcaption>And from that day on I knew for certain that there is no need to fear the strong. All one needs is to know the method for overcoming them. There is a special jujitsu for every strong man.</figcaption></figure><p>This is a must-read to follow this article— <a href="https://educationalstorehouse.wordpress.com/2013/03/23/a-special-jiu-jitsu-by-yevegeny-yevtushenko/">https://educationalstorehouse.wordpress.com/2013/03/23/a-special-jiu-jitsu-by-yevegeny-yevtushenko/</a></p><p>Life, a question for some, a mystery for many, and a quest for others. But regardless of how we treat it, there is only one certainty in life, and that it goes on.</p><p>While it is true that for many of us that life often feels too abominable, we must have an indomitable testament to live through the ridicule. And how to do it really? This has been a question since the dawn of time. Many great philosophers with time have answered it. Some did it with joy, and some, with the fear of a whip (by whom? Maybe greeks could answer).</p><p>But the most important of recent times was given by “Yevgeny Yevtushenko”.</p><p>Like <a href="https://educationalstorehouse.wordpress.com/2013/03/23/a-special-jiu-jitsu-by-yevegeny-yevtushenko/">Yevgeny Yevtushenko’s </a>antagonist — “Red” we all have something that mocks incessantly — even for writing praiseworthy poems as the one author wrote. It is also true that sometimes “Red” and his knuckle-duster can crush us to the ground and make us bleed, but, we must and must really follow the author here.</p><p>There is all certainty that Red is strong, knuckle-duster stronger and with his lieutenants, he&#39;s only the strongest. But what we must not forget is we are not the mercy of the street, we are the very author of the essay, and hence, we must find a “Jujitsu”. For some, Jujitsu is a book elucidating all detail on martial arts like the one in the story, but, in actuality, it can be anything bolsters our will to continue through the horrors of the night.</p><p>While we can draw motivation from many things, it did happen that I gained the best kind of motivation from a great set of friends and acquaintances filled with vigor. Friends can often be the one deciding factor of who we would be. And, as they say we are often an average of 5 people we are often surrounded by. Having worked consciously on this, it is now my set of friends that are my Jujitsu!</p><p>With that, I continue to cut through the fears in the dreadful days and cheer through the grumbling aches. And if the world wants to bully me into ruins, like Red, I’ve got my Jujitsu! and yes! For every strong man, there is a special Jujitsu!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25ee73dae0aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adventures with Raspberry Pi over a great weekend]]></title>
            <link>https://blog.devgenius.io/adventures-with-raspberry-pi-over-a-great-weekend-dd04d04df7e3?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd04d04df7e3</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[pihole]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Sun, 18 Oct 2020 20:01:28 GMT</pubDate>
            <atom:updated>2020-10-27T12:37:09.659Z</atom:updated>
            <content:encoded><![CDATA[<h4>Alright, it was better as Mark Twain put it. (also an informal study with Pi)</h4><h3>PS: UPDATED for UBUNTU 20.10 - Groovy Gorilla</h3><p>After having received the <a href="https://amzn.to/2IxMweL">4GB version of Raspberry Pi4 </a>right at the moment I was wrapping up my Friday, nothing felt more energizing for the weekend that was dawning.</p><p>Being an enthusiast doesn’t come with obvious ostentatious and gaudy ways to flaunt that tag, it comes, but only with a deep urge to do things — not with an entirely quantifiable objective, but for the sheer pleasure of it! for joy!</p><p>My passion for Home automation goes way back to 2015. When I first saw that an Arduino board with a simple C-program could be used to turn on/off a light totally on another side of the world — it was exhilarating! This new understanding enabled my thinking in many ways!</p><p>I was surely curious, and more certain I wanted to do more of it! But was limited by time, academics, opportunity, and very certainly knowledge. To understand the intricacies of the whole setup wasn’t easy. And the road ahead was murky as well. It was like walking in dark. I was surely not sure enough which direction to proceed further.</p><p>Although “I had given up” at that time — time alone tracks everything. I did give in to the compulsions and needs of the moment, but, very diligently, and very mindfully I continued to strive towards understanding the actual “science” behind these computers.</p><p>I learned about computer architectures — how each bit of data flowing from the set of flipflops or so-called registers danced to the instructions passed on by the processor. How the instruction sets made a lot of difference with each iteration of improvement. And finally how x86 architectures made it to the hall of fame! Then it all started to fall in place — operating systems, computer architectures, pipelining, and more!</p><p>While this was going at its pace, in 2018, I gave another attempt to see if I could do something more! something more than Arduino! And this time very naturally I selected a “Pi” — “Raspberry Pi Zero W”. Even before I could experiment, I very gloriously failed again. This time I was dumbed down by my limitations in understanding of networks. I was again offered two pills by my fate — both the same “give up now”. Having realized that “protecting curiosity” was much more important than getting away with meager results, I resolved to safeguard each bit of my zeal. But being pushed against a wall, with no choice, I took the “give up now” option. Deep down I assured myself, I would give up for now, but will “resume later”.</p><p>As I had mentioned earlier, with time, things fell in place. Eventually, all network protocols started to make sense, and, with effort, I had the delight to experiment with them. I was able to implement them. And having gotten expertise at Kubernetes and Docker, little did I realize I was getting ready for what lies ahead!</p><p>It was this dawn — the dawn where my curiosity was awakening. It was the dawn where my knowledge had taken enough shape in a way I could wield it! and this time there was no yielding to compulsions of situation.</p><p>My endeavors to shield, shelter, and nourish healthy curiosity finally came towards a point of congruence. It was this weekend I finally offered myself another chance to see if I could accomplish something more satisfying for all the perseverance.</p><p>Here, I am listing a few of my experiments and MY observations (of course opinionated by facts )-</p><ul><li>Best Operating System for Raspberry Pi (Desktop Experience) amongst — Raspbian, Ubuntu GNOME, Ubuntu MATE.</li><li>Some useful apps to self-host</li><li>observations and clarities with regards to daily use</li></ul><h3>Best OS for Raspberry Pi (Desktop Environment)</h3><p>Raspberry Pi is not your everyday laptop kind. It is built on top of an ARM — — architecture a clear distinction from an ordinary powerful PC we are otherwise habituated to, which are often based on x86 style. To put it in the simplest terms Raspberry Pi is powerful, but not as much as your everyday PC/Mac’s (by taking into consideration it is 2020). So, IT CANNOT replace a desktop at your home (Unless you are a very light user). IK, that was harsh for a Raspbian fan. While that is very true according to my experience, it is still one of the, if not the best — general-purpose machine for Home automation and other amazing purposes. In my honest opinion, it is the most affordable mini-server anyone can get.</p><p>So, for a Desktop Environment, while it is true that Raspberry PI OS serves the vast majority, there is a very strong alternative out there — Ubuntu. Please note <a href="https://ubuntu.com/blog/ubuntu-20-04-lts-is-certified-for-the-raspberry-pi">Ubuntu is certified for Raspberry PI</a>.</p><p>With Ubuntu 20.10 — Groovy Gorilla edition, there is a special focus on Raspberry pi. It is worth noting that there have been GREAT IMPROVEMENTS. One noticeable improvement was the CPU load. The average CPU consumption AT IDLE STATE is now only at 25% compared to the earlier observation of 60%–70% with Ubuntu 20.04. There also has been a great improvement in RAM consumption as well, and Groovy Gorilla really tries to keep it low with only consuming around and under 1GB of memory.</p><p>This makes the overall experience way smoother, but, still, Ubuntu MATE is considerably smoother than other alternates.</p><p>To summarize — my choice is— <strong>Ubuntu MATE</strong>, but, default GNOME is doing much better with Ubuntu 20.10 compared to earlier 20.04.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFRk96YBDNDOX2-A-IUZsw.png" /><figcaption>CPU consumption on Ubuntu 20.10 Groovy Gorilla EDITION</figcaption></figure><h3>Applications tested with —</h3><p>To have tested the above OS’es I had to choose a certain set of applications, and, as an enthusiast of a special cult, those who enjoy self-hosting and feel empowered by that, I choose the following list —</p><ul><li>Pi-Hole (obviously)</li><li>NextCloud</li><li>an FTP server</li><li>Nginx — with static local webpage</li><li>Portainer</li><li>Gotubecast</li></ul><p>Also, I tried playing Youtube videos in all the above OSs but, I felt it was the best in Ubuntu MATE. Please note, all the aforementioned applications were working fine on all three OS’es, but, with some sluggishness on Ubuntu</p><h3>PiHole</h3><p>After being annoyed by Youtube Ads beyond any possible levels of tolerance, I thought to write a custom Nginx module to block traffic dynamically by use of ML logic, but, I stalled it for some other time, and went ahead with a DNS based approach, and, amongst the many available choices, an obvious one was PiHole. Because my router allowed me to change DHCP settings, I let PiHole manage my DHCP as well.</p><p>After setting a static IP (locally) for my Raspberry Pi, and installing Pihole with one <a href="https://docs.pi-hole.net/main/basic-install/">command</a>, I went over to the setup screen and selected defaults.</p><p>And, added at least a dozen of ad-lists blocking over 2 million lists</p><h3>NextCloud</h3><p>This is yet another amazing self-hosted application that has a Windows/Linux/MAC/WEB/Android client that is very easy to use. In brief, this can turn your Pi+Pendrive into a tiny local cloud storage server and more. I was surprised that it had a wide range of integrations, even with JIRA and GIT!</p><p>Set up was very easy, all it took was just <a href="https://hub.docker.com/_/nextcloud/">a docker command</a> and a volume (ext4 formatted Pendrive) attached to its container. It is really important to get it formatted in ext4.</p><h3>FTP server</h3><p>I tried to see what were the differences between FTP, SFTP, and FTPS, and after inferring that the differences were very huge, I decided to go with a normal FTP server (because I was anyway sure to use NextCloud). But, overall, an FTP server is very much possible. It was more than surprising to see that there wasn’t even one good FTP CLIENT for android on PlayStore or one which was baked into the defaults. Anyway, it works!</p><p><a href="https://www.raspberrypi.org/documentation/remote-access/ftp.md">I followed this tutorial to get it sorted</a>!</p><h3>Nginx</h3><p>For me, PI was my experiment box. It was that machine I would want to serve a tiny website from. With that goal in mind, Nginx was obvious. Installation was yet again a docker command alone. and well, it works!</p><h3>Portainer</h3><p>Having worked upon Nirmata and Kubernetes, I wondered why I never heard of this amazing thing! Portainer is the best app anyone can have on their Raspberry PI — if you want to keep experimenting with various docker apps. It gives a beautiful view of all docker containers installed on the standalone Raspberry PI. While it can do many other things, This ability to manage other containers from this one singular amazing dashboard is very useful! and little more than essential if you have too many containers.</p><p>Portainer can also be started with just one command — <a href="https://www.portainer.io/installation/">a docker run!</a></p><h3>Gotubecast</h3><p>As I had my Pi connected with my TV which I was otherwise using to cast Youtube Videos, now that my PI was running, I had to find ways to let my family members continue using without hindrances. This tiny <a href="https://github.com/cbix/gotubecast">program</a> does that same thing with very little hacks. While the initial set-up is still needed, well, this is a great way!</p><p>This piece of software made my time on Pi worthwhile without disturbing others!</p><h3>Verdict!</h3><p>While two weeks might be too less a time to arrive at a rock-solid conclusion, well, it is not a Ph.D.! It is of-course something done in leisure.</p><p>With the promise and power of Ubuntu and the “elegance” that comes with Ubuntu-MATE, I think that is best for the desktop environment, and, it is also just super awesome for hosting the aforementioned applications.</p><p>Now, although the main aim to buy a Pi would be to use the GPIO pins, I didn’t get a chance yet. I hope that I can get a chance to resume that bit of experimentation soon.</p><p>It is this great mixture of passion, perseverance, knowledge, and most of all, a healthy curiosity — this is the recipe that yields satisfaction! and, with luck, it is surely good enough as a mantra for success as well!</p><p>Overall, Pi is a great deal!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd04d04df7e3" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/adventures-with-raspberry-pi-over-a-great-weekend-dd04d04df7e3">Adventures with Raspberry Pi over a great weekend</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust! a week with awesomeness overloaded!]]></title>
            <link>https://blog.devgenius.io/rust-a-week-with-awesomeness-overloaded-a12c91071485?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a12c91071485</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rustlan]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Sat, 18 Jul 2020 13:02:54 GMT</pubDate>
            <atom:updated>2020-07-19T17:22:30.171Z</atom:updated>
            <content:encoded><![CDATA[<p>The last time I cared about what size my variable was, or, for that matter, what was the “Type” of the data I was trying to store or access — was at least a few years ago, when I was still writing in Java. But, the day I decided to start learning Rust, it all had to change.</p><p>Coming from Python, it is a culture shock, a very unsettling one. A rather very sophisticated emotion that makes anyone uncomfortable to the very core, not because you cannot do it, but because you are not conditioned to doing so. Python is the pinnacle of writing code with NO hindrances in what you write and how you write. There can be more than one way of doing something right. It is a world by itself.</p><p>And to step out of such an amazing “Comfort Zone” is such a horror. It is pretty apt to say, it feels suffocating. But when has learning anything as great as Rust been any easier? Here is my experience with Rust for one full week — it is not easy, but, yes it couldn’t be easier.</p><h3>Top 5 things I loved about Rust -</h3><ul><li><strong>Community </strong>— Foundation of any great language doesn’t just lie with the features it provides, it lies with the people that use it, more so it depends on people who help each other and makes the community a stronger one. I have had many instances where I had dumb doubts, just as anyone else trying to learn a new language would have. I am just attaching one reference below! Officially rust is on Discord!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ElYJM7t-N18PM6XR" /></figure><ul><li><strong>Strong and feature-packed compiler and std library </strong>— The error messages (suggestions as well)compiler shows you — fix the code right on! Compilation couldn’t get easier. The easiest way to help anyone teach something is to point them where they are going wrong, in a very very constructive way. Rust compiler does the same and in a very very empowering way.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmzyN_oiKcxiqEV_HYOnoQ.png" /></figure><ul><li><strong>Ownership and Borrowing</strong> — Although it has only been about a week, I can already feel the amazing power of this unique concept Rust has. It really feels amazing to not have a run time or a GC, a really amazing implementation.</li><li><strong>Great documentation </strong>— If there can be one reason why people understand Rust even a bit — then, it is because of such great documentation. Without which Rust would be just another rusty piece of software lingering around. And, the best part! there are so many examples you can learn from! To add to it, the authors of these docs have been very mindful of various backgrounds people come from, and have put their best effort to make every word as amicable as possible.</li><li><strong>Growing ecosystem — </strong>A vast part of the language, crates and everything else is still in a very nascent stage. This might seem to be a curse at the outset, but, this, in fact in the most modest way is a great blessing. When have we witnessed a miracle happening?</li></ul><h3>Top 3 tricky things with Rust</h3><ul><li>It is not always easy to understand why it is the way it is. A simple try-throw-catch can be as complex as going through a ton of documentation.</li><li>Future of the language is far promising than possible, but, jobs and career opportunities are still a rarety to find right on. Of course, how do we even know what does the future has in store for us?</li><li>A world away from the world, that’s what Rust is. It doesn’t rephrase or reintroduce things differently, it is a totally new world. A world, build right from scratch to the top.</li></ul><p>With that said, I look forward to working furthermore with Rust and implement a great many concepts and writing API’s in Rust!</p><p>A tryst with Rust awaits!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a12c91071485" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/rust-a-week-with-awesomeness-overloaded-a12c91071485">Rust! a week with awesomeness overloaded!</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pebbles of awe]]></title>
            <link>https://medium.com/series/pebbles-of-awe-806635cfa83f?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/806635cfa83f</guid>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Sat, 27 Jun 2020 17:19:14 GMT</pubDate>
            <atom:updated>2020-06-27T17:19:14.660Z</atom:updated>
            <content:encoded><![CDATA[<p>a series of articles started to pen down penchance, a song of experiences through the eyes of a philosopher.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=806635cfa83f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helming my way to Kubernetes!!!]]></title>
            <link>https://srinivasvaddi.medium.com/helming-my-way-to-kubernetes-b676e23d468e?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b676e23d468e</guid>
            <category><![CDATA[helm-chart]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[bitnami]]></category>
            <category><![CDATA[helm]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Sat, 27 Jun 2020 15:50:02 GMT</pubDate>
            <atom:updated>2020-06-27T15:50:02.729Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/731/0*G22zUdoG-fbwAFsg" /></figure><p>The empowerment that can be felt as we see the docker containers spin up, is no less than the might felt after winning a chess game. It is a concoction which cannot be extolled.</p><p>Having worked on Docker for more than two years now, I have perhaps felt far too comfortable at the ease that docker brings to the table. Especially with the Docker networking, Docker volumes and the ability to run anything inside a container has always felt very bolstering. It felt as if I was on the horizons where possibility and impossibility met. Docker made the possibility to run anything very real, and yet, it brought with itself an arduous and seemingly impossible task of managing these containers.</p><p>At one point in time as I advanced to develop a custom portal for “access” to <a href="https://goharbor.io/">Harbor</a>, I found myself typing “ <em>docker run -itd</em>” and “docker build -t” far more than the number of lines of code I was writing. It felt impossible to manage the stateless microservices being run as containers on many many hosts. One fine day, I had a choice, to bake in everything as just one container or yield. But, yield? yield? to Docker? I resolved to step back and look at the bigger picture. It was evident, the time had come. It was now the time for me to set sailing in the direction towards Kubernetes.</p><p>Having been closely allied with THE most cutting edge technologies, and, yet daring not to venture “deep” into Kubernetes was somehow very belittling. Blame it on YAML! or the many many versions of Kubernetes and its many many variants. Maybe it was a problem with many many CRD’s or with the Kubernetes Objects, whatever be it, I was only scratching the surface for far too long. But no more!</p><p>My first deployment on Kubernetes felt bizarre, rather totally a blend of feelings which somehow didn’t sink in, not because of limitations in understanding of the concept, but, largely by the nomenclature involved. Soon, with no less than a few tweaks I was already able to expose a microservice with an Ingress controller. This pushed me to further try other possible “types” of Kubernetes Objects.</p><p>Eventually, as I became more and more familiar with Kubernetes Deployments, Statefulsets and Services — the feeling of being limited and intimidated by terminologies faded away. And I could now write “basic” YAMLS and pave my way to be “Cloud Native”. But as they say <em>“Solutions create new problems”. </em>Now I was no longer typing docker commands in CLI, but, now, I was creating, altering and maintaining YAMLS along with Docker images, Dockerfiles, application/business code and also typing more on CLI.</p><p>This ate away more time than I had previously thought and it tore me apart. On one side I was nearing automation of deployments with one command, and on the other hand, I also had to do all these arduous tasks MYSELF, for this was DevOps. I didn’t fear this challenge. I didn’t complain about the principle, but, rather, I swore to embrace it, however hard it was, I was convinced that I could do every bit of it. Not because I was lacking choices, but because I was/am immensely passionate about the whole.</p><p>As I geared up to write more and more YAMLS and everything, like a blessing, I found our “ <a href="https://helm.sh/">HELM CHARTS</a>”. It was “an Excalibur”, that magical sword I have been really in need of. Now, all I had to do, was to write Helm charts once and be able to alter values anytime! this possibility was truly limitless. But, what was more exciting was that for many many applications which were predominantly in prevalence — HELM charts were already there! all that anyone had to do was just use them!</p><p>As if this was now difficult, <a href="https://bitnami.com/kubernetes/kubeapps">Bitnami’s Kubeapps</a> does it in a click! how futuristic is that! How ecstatic would it feel to see your applications or application dependencies come up in a matter of minutes by just a few clicks and tweaks!</p><p>The levels of abstraction keep getting higher and higher each day, in a very good way! The journey from rock-solid Servers later to Virtualization from there to containerization and now, Kubernetization, overall is a tale that future will sing in all glory. We are all living and witnessing the future being made.</p><p>Thus, I have found myself far into the nativity of Cloud and Cloud-Native Architectures. From eschewing Kubernetes to espousing it, I have helmed my way to the wonderlands of Kubernetes and more! After all, we are the masters of our sails.</p><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/helming-my-way-kubernetes-srinivas-vaddi/?trackingId=I26Swdn%2FRu%2BJclC89jxoHg%3D%3D"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b676e23d468e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pride, Prejudice, Production and Cloud Native Applications]]></title>
            <link>https://srinivasvaddi.medium.com/pride-prejudice-production-and-cloud-native-applications-b568fefd9100?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b568fefd9100</guid>
            <category><![CDATA[it]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[administration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 15:00:43 GMT</pubDate>
            <atom:updated>2020-06-06T07:56:47.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pride, Prejudice, Production and Cloud-Native Applications</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dxoB6FQUI-Nh3hds.jpg" /></figure><p>It was those few minutes of twilight before which the sun would cut through the skies and be fully visible, and having just reached home after a tiring journey(and a stressful fortnight full of work before that), the phone rings!</p><p>This is one such everyday thing you might have heard from “Admins”, but, why do they always appear to be busy? Why do things behave erratically in the Production Environment? Why do they always have to work on weekends?</p><p>Having worked as an Application Administrator(DevOps, ProdOps) for two years, to keep it short — it is not easy.</p><p>What do we do?</p><p>In brief —</p><ul><li>Keeping the services running (or) better put as Keeping the lights on</li><li>Installation, Configuration, Management</li><li>Monitoring</li><li>Troubleshooting and fixing issues</li></ul><p>Additional skill-set required :</p><ul><li>Good knowledge of infra</li><li>Expertise in supported Tech Stack</li><li>A holistic understanding of application being supported</li><li>Scripting</li><li>Agility and critical thinking</li><li>Keeping calm in the most impossible times</li></ul><p>Let’s think of this, its a Sunday morning, you were supposed to wake up to birds chirping, spring breezes kissing your forehead while you stare at the feel of twilight, fresh with great vigour; instead, you wake up at 2 AM in the night to a call where you have your business crashing and teams complaining about the degradation in your systems.</p><p>You wouldn’t be able to figure out if it was another Hiroshima in the DataCenter, or if it was an <a href="https://en.wikipedia.org/wiki/Anak_Krakatoa">Anakrakatoa</a>, but, you would understand that it now is thus on your shoulders to make sure your systems work normally and that business continues to go on perpetually as if everything were normal (thus ensuring that peace prevails).</p><h3>Pride :</h3><h4>- Critical Thinkers and agile problem solvers</h4><p>In operations, you have but a few mins to “find the root cause”.In an ocean full of possible problems you are expected to find the Nemo(RCA). Sounds lunatic? well, we admins are capable of doing it and doing it RIGHT. All this must happen in a matter of moments.</p><p>Having handled and administered utterly critical workflows for almost two full years, in strongest of possible words I can ascertain that it not only is a challenge for a business to get the outage fixed but, it is also a question on your ability to get it sorted ASAP. In those two minutes of initial observations and speculations, you must distil apart the possibilities, known points of failure, the absolute no’s and mere certainties. You must calculate the impact radius and handle the pressure WHILST you continue to identify the root cause and also think on possible fixes.</p><blockquote>In fell clutch of circumstance, my head is bloody but unbowed — every admin ever</blockquote><h4>- Creative thinkers and team makers</h4><p>In many outages, what helps? It is not money, it surely is not always just luck but, it often is your team. If you are a developer you might own responsibility for a certain artefact, but, in operations, it is not an individual that resolves the issue, it is the Ops-Team and hence the responsibility is thus shared, always. Only together we stand a chance against the dreaded mutual enemy — Outage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*ELDgqg7wIUHfZU-Z.jpg" /></figure><p>By nature, outages are unequivocally tricky, exceptionally unique, and incomparably brutal. What makes it more disastrous is the overarching complexity that grows with the system over time. To settle down such unrest, it is impossible to always stick to convention. To go out of the way and fix issues comes but comes with “thine nature” and thus, to thrive in Ops, one must and must be compellingly creative.</p><blockquote>Teams maketh Ops</blockquote><h4>- FIREFIGHTERS and PEACEKEEPERS</h4><p>Multi-Taskers by phenomena, admins are also responsible to ensure the state of systems; And thus a task of arduous automation with humongous abstraction is thrust on every admin, by none but their own selves. This helps in peacekeeping. When peace disrupts in the darkest of the nights and fire spreads over the realms of production, like a superhero, like a ghost from a tomb and a baby from a womb, every admin joins the production bridge. But certainly, not in those cloaks of superheroes, every admin jumps to fight the fire and win over it.</p><h3>Prejudices :</h3><h4>- “It is easy”</h4><p>Even for those who understand the length and breadth of the underlying systems, to an extent it is easy, but, largely, it is quite challenging. Although with cloud, cloud-native applications and cloud-native architectures, the dependency does come down by an exponent, yet not the complexity.</p><h4>-”But, give me the root access and I can do it too”</h4><p>Very accurate, boy, thou art. But, are you ready to take a dip on your productivity? It takes more than root access to get things done right. Installation, configuration, management, setup, directory structure, and access management, server maintenance, network operations, and at least a million more things go into being Ops.</p><blockquote>“With great power comes great responsibility”</blockquote><h4>“It worked in my system”</h4><p>It did? sure, it might have. There is one certainty with production environments. They are like the first element of every group of the periodic table. The first element is always bizarre in its properties and reactions. To a great extent, all this can be solved by containerizing, that being our next point of debate.</p><h4>“I will put it on AWS/GCP/Azure/VMware Cloud”</h4><p>Although there is incomparable ease and smoothness in clouds, it is still a fact that you are only off-boarding a fixed set of operations to the public cloud vendor. This is by far the best “win-win” situation.</p><h4>“War rooms?”</h4><p>Why do we need a war room to troubleshoot problems, is there any science behind it? The answer is yes. War rooms are battlegrounds. The common enemy(OUTAGE/ISSUE) stands tall initially, but, with right coordination between the various teams, all adversities shall be bulldozed.</p><p>Another example of criticality -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*b6lcKI2gw8K2ClxxDB-TeA.jpeg" /></figure><p>versus</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*t73rziBFHPECDWjlcn8Yqw.png" /></figure><h3>Production DevOps, Docker, Kubernetes and CNA!</h3><p>All that we have seen thus far is a foundation for what we are now about to witness. If the IT operations was a cinema, “VIRTUALIZATION” was the first plot, happy times and peace. But, as Yuval Noah Harari says,</p><blockquote>“One of history’s few iron laws is that luxuries tend to become necessities and to spawn new obligations.”</blockquote><p>the architectures, maintenances, dependencies etc. were troubling the protagonist of the show, “DEVELOPER/IT WORLD” and thus, like “Samaritans” admins came for help. But, oh boy, admins were out of weapons by the time it was the interval that moment, that very frame is the advent of Docker.</p><blockquote>Docker changed things, perhaps for ever.</blockquote><p>Kubernetes is the “Aparaajita” thus far in the context of DevOps, a philosophy set ablaze in recent times. Kubernetes is leading the way towards an ideal and sheer near 100% automation.</p><p>All those problems we would face in the administration would vanish, in the container world. Especially with an orchestration tool like Kubernetes, containerization becomes smooth. This also paves a way to a change in the ideology of application development and urges us gently to go stateless.</p><p>Kubernetes also a revolution to the legacy mindset not only from an application standpoint but also from infra, storage and network perspectives.</p><blockquote>But at the laste, as every thing hath ende</blockquote><p>Let us look forward to drill deeper into each of those in the forthcoming chain of stories!</p><p>Please note, this is not just an ode to the admins but is also a reflection of what goes behind the curtains.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b568fefd9100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python-Flask, WSGI, Gunicorn, Docker, Kubernetes — magic soup with Philosophers Stone]]></title>
            <link>https://blog.devgenius.io/python-flask-wsgi-gunicorn-docker-kubernetes-magic-soup-with-philosophers-stone-ca6832cf8886?source=rss-4c1ff53b32f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca6832cf8886</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[gunicorn]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Srinivas Vaddi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2019 10:14:52 GMT</pubDate>
            <atom:updated>2020-07-20T18:55:02.507Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying Flask with gunicorn as Docker Container on Kubernetes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*-P04_IjLZo4yg6Wyx2wkyQ.png" /><figcaption>What are we trying to accomplish</figcaption></figure><p><a href="https://hub.docker.com/repository/docker/imvegeta/excalibur">Here’s your one image WHICH if repo complies to an uniform folder structure, can be used for multiple microservices, of, same/different applications and on ALL environments.</a></p><p>Configuration, dependencies, application names, repo paths, all — pluggable</p><p><a href="https://hub.docker.com/repository/docker/imvegeta/excalibur">The <strong>goal </strong>of this article is to explain how all the aforementioned components fall in-line with each other — in the most jaw dropping way possible.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*nlVHz4i75tqnJiPIT2VkPg.png" /><figcaption><a href="https://hub.docker.com/repository/docker/imvegeta/excalibur">Our Excalibur! End Goal!</a></figcaption></figure><h3>Prerequisites:</h3><figure><img alt="proficiency levels" src="https://cdn-images-1.medium.com/max/187/1*Rq2739ibnSYVNyfWmdfRKg.png" /><figcaption>Prior knowledge needed — (can be 3/5 all across)</figcaption></figure><ul><li>Follow project folder structure and provide configurations as required.</li><li>get your environment ready</li><li>RUN!</li></ul><p><strong>Basic, Background and why </strong>—</p><ul><li>Flask is too much of freedom, paving way to anarchy inside your mind</li><li>For a beginner, taking Flask/Django to Prod is always new, especially if you are coming from JAVA, nah, it aint gonna be easy. You would keep looking for JAR’s, Tomcat servers, what not!</li><li>WSGI and Gunicorn — these words are everywhere, but what do they mean to the fullest?</li><li>Even if i manage to understand all the above, how am I going to deploy it? On a server? Running it as a process? (If you are doing this, please move ahead from these legacy approaches)</li><li>How about Dockerizing it? and then? how can I maintain standard across environments?</li></ul><p><strong>Jargons</strong>:</p><ul><li><a href="http://flask.palletsprojects.com/en/1.1.x/">Flask </a>— a mirco framework in Python, that has set world on fire with its minimalist approach. It is NOT built for production, but, nonetheless, it has very much been the arch rival of django since its inception. <a href="https://realpython.com/flask-by-example-part-1-project-setup/">you can find a sample here!</a></li><li><a href="https://wsgi.readthedocs.io/en/latest/what.html">WSGI</a> — <a href="https://www.python.org/dev/peps/pep-3333/"><em>a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).</em></a><em> More or less, a standard — one that defines how the server side invokes a callable object that is provided by the application side</em></li><li><a href="https://vsupalov.com/what-is-gunicorn/">gunicorn </a>— a WebServer built in Python to according to WSGI standards.</li><li><a href="https://opensource.com/resources/what-docker">Docker </a>— It is a<a href="https://www.slideshare.net/SrinivasVaddi4/cloud-computing-and-docker"> containerization Technology</a>, simply put it is a combination of isolation and control on resource utilization. It is analogical to a VM, but in a very stripped down sense. Ideally, containers are for Stateless application, which do not require assurances of persistence.</li><li><a href="https://kubernetes.io/">Kubernetes </a>— a rather simpler container <strong>Orchestration </strong>tool.</li></ul><p><strong>Solution in brief</strong>:</p><ul><li>Follow a stringent folder structure</li><li>Push all code to repository as per our folder structure</li><li>Use one base image for almost all our requirements.</li><li>Dynamically pass values of to Docker container as environment variable.</li></ul><p>As you skim through this article, you shall be starting to admire how far we have come as an industry, as technology, as DevOps, as CICD, as Cloud Native and most of all, how effortlessly we are running micro-services and on Kubernetes! How did we end up here?</p><p>The idea of this article is not to explain any of the aforementioned things in more detail than to connect these dots and deploy a production grade Flask Micro-service with Gunicorn.</p><p>There always is some standardization required, especially if you are running against time. In my experience, or, in pursuit to figure out how fast I can move ahead from prototyping to production, I have seen that each time I try to resolve an issue, something greater shows up, questioning my very ability.</p><p><em>There is only one solution to all the above, Exploration, Necessity is the mother of all invention.</em></p><h3>What is our folder structure?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*PUhapme2H5LSSjdpeSh25g.png" /></figure><ul><li>hello-world.py — is your API/Flask APP.</li><li>default.cfg — is the configuration file for application</li><li>gunicorn_config.py — Configuration for GUNICORN</li><li>requirements.txt — all application dependencies that use “<strong>pip install </strong>”</li></ul><p>What are the <strong>environment variables </strong>this Image expects?</p><ul><li>git_url — Git url to clone (can include username password, check whatever works)</li><li>git_branch — branch which you want to pull!</li><li>project_name — Name of your project</li><li>port_addr — port on which you want to expose your service outside inside Container , for gunicorn</li><li>pyconf — ABSOLUTE path to your configuration file, if you are loading configuration from any configmap/repo, you may just edit this one variable</li><li>python_app — file inside app folder that you want to run — “dont give xyz.py, just xyz would do!”</li></ul><p><strong>HOW TO RUN </strong>:</p><p>Pass all the aforementioned environment variables to docker run command:</p><blockquote>“docker run -itd -p 5000:5000 -e git_url=<a href="https://github.com/vaddisrinivas/dockergunicornflasktemplate">https://github.com/vaddisrinivas/dockergunicornflasktemplate</a> -e project_name=dockergunicornflasktemplate -e python_app=hello-world -e pyconf=/app/dockergunicornflasktemplate/config/default.cfg -e port_addr=5000 -e git_branch=master imvegeta/excalibu<em>r</em>”</blockquote><p>Now that we have our excalibur running, let us look at what we are accomplishing , the Bigger Picture! #futurescope — Heres what we are going to do in the coming time!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tE-3rGmWpLkWxJK8ZvnkHw.png" /><figcaption>High Level Architecture of usability of this Image, if deployed on Kubernetes. Zero to Hero!</figcaption></figure><p>Extending it to Kubernetes will be the subject of next article!</p><p><a href="https://hub.docker.com/repository/docker/imvegeta/excalibur"><strong>Click here for the Docker Image</strong></a><strong>!</strong></p><p><strong>You can </strong><a href="https://labs.play-with-docker.com/#"><strong>PLAY WITH DOCKER HERE!</strong></a><strong> just use the run command in a new instance created from here!</strong></p><p>Please let me know what you think would be the easier way of doing things! Also do share what you think of this article!</p><p>Thanks for your time readers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca6832cf8886" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/python-flask-wsgi-gunicorn-docker-kubernetes-magic-soup-with-philosophers-stone-ca6832cf8886">Python-Flask, WSGI, Gunicorn, Docker, Kubernetes — magic soup with Philosophers Stone</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>