<?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"><channel><title><![CDATA[Manas Sivakumar's Dev Blog]]></title><description><![CDATA[Manas Sivakumar's Dev Blog]]></description><link>https://searidges.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 10:45:10 GMT</lastBuildDate><atom:link href="https://searidges.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[First Time Presenter: OSS Mumbai 2026]]></title><description><![CDATA[This was the very first time I was an active participant in a big tech conference. I have been to KuberTenes Bangalore and gRPC Bangalore but this time it…]]></description><link>https://searidges.hashnode.dev/first-time-presenter-oss-mumbai-2026</link><guid isPermaLink="true">https://searidges.hashnode.dev/first-time-presenter-oss-mumbai-2026</guid><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Mon, 29 Jun 2026 14:46:24 GMT</pubDate><content:encoded><![CDATA[<p>This was the very first time I was an active participant in a big tech conference. I have been to KuberTenes Bangalore and gRPC Bangalore but this time it felt I feel more "responsible".</p>
<p>The conference was nothing short of amazing, I met Linux Trovalds and a bunch of other Linux Maintainers. I had a quick but valuable side corridor talk with Ram Iyengar about his opinion of different CNCF sandbox projects.</p>
<h1>Poster</h1>
<img src="https://cdn.hashnode.com/uploads/covers/641d9e4fecc310467c8fef18/beea68a6-8995-43d8-a0ca-69d477ffceca.png" alt="" style="display:block;margin:0 auto" />]]></content:encoded></item><item><title><![CDATA[LFX Mentorship: Integration Tests for OpenCost Enterprise Readiness Part (2 / 2)]]></title><description><![CDATA[There are three important variables in the equation. One is the running time of that resource, and the second is the resource in terms of a measurable unit…]]></description><link>https://searidges.hashnode.dev/lfx-mentorship-integration-tests-for-opencost-enterprise-readiness-part-2-2</link><guid isPermaLink="true">https://searidges.hashnode.dev/lfx-mentorship-integration-tests-for-opencost-enterprise-readiness-part-2-2</guid><category><![CDATA[Integration Testing]]></category><category><![CDATA[debugging]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Mon, 01 Sep 2025 19:59:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1756756627758/306cf3e4-a941-4b2d-a138-f3261866ee49.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-the-general-idea-behind-cost">The General Idea behind Cost</h1>
<p>There are three important variables in the equation. One is the running time of that resource, and the second is the resource in terms of a measurable unit value. I faced issues tackling the first one; more about it later.</p>
<ul>
<li><p>The resource is the maximum of the requested value and the used value at any given instance.</p>
</li>
<li><p>Run Time is the total running of for that resource, including idle times in some cases.</p>
</li>
<li><p>Resource Type: either a Container, Pod, or Namespace. Costs are generally calculated on a Container level and aggregated to a Pod or a namespace level.</p>
</li>
</ul>
<p>Here is a general outlook on cost calculation for RAM Usage (I like this one because this test flakes a lot even today)</p>
<pre><code class="lang-go"><span class="hljs-keyword">for</span> _, promResponseItem := <span class="hljs-keyword">range</span> promResponse.Data.Result {
                <span class="hljs-keyword">if</span> promResponseItem.Metric.Container == <span class="hljs-string">""</span> {
                    <span class="hljs-keyword">continue</span>
                }
                <span class="hljs-comment">// Get containerRunTime by getting the pod's (parent object) runtime.</span>
                pod, ok := podMap[promResponseItem.Metric.Pod]
                <span class="hljs-keyword">if</span> !ok {
                    <span class="hljs-keyword">continue</span>
                }

                containerRunTime := pod.Window.RunTime()

                ramUsageAvgPod, ok := ramUsageAvgNamespaceMap[promResponseItem.Metric.Namespace]
                <span class="hljs-keyword">if</span> !ok {
                    ramUsageAvgNamespaceMap[promResponseItem.Metric.Namespace] = &amp;RAMUsageAvgAggregate{
                        PrometheusUsageAvg: promResponseItem.Value.Value * containerRunTime,
                        AllocationUsageAvg: <span class="hljs-number">0.0</span>,
                        Window: &amp;api.Window{
                            Start: pod.Window.Start,
                            End:   pod.Window.End,
                        },
                    }
                    <span class="hljs-keyword">continue</span>
                }
                ramUsageAvgPod.PrometheusUsageAvg += promResponseItem.Value.Value * containerRunTime
                ramUsageAvgPod.Window = api.ExpandTimeRange(ramUsageAvgPod.Window, pod.Window)
            }

            <span class="hljs-comment">// windowRunTime := queryEnd.Sub(queryStart).Minutes()</span>
            <span class="hljs-keyword">for</span> _, ramUsageAvgProm := <span class="hljs-keyword">range</span> ramUsageAvgNamespaceMap {
                ramUsageAvgProm.PrometheusUsageAvg = ramUsageAvgProm.PrometheusUsageAvg / ramUsageAvgProm.Window.RunTime()
            }
</code></pre>
<h2 id="heading-running-times-is-not-simple">Running Times is not simple</h2>
<p>While you make decisions around cost, you might be tempted to visualize a dashboard with only long-running namespaces. It is definitely a valid assumption to start with.</p>
<p>I started to feel the grunt of my ignorance later for the following reasons:</p>
<ol>
<li><p>How do you handle Pod UIDs?</p>
</li>
<li><p>How do you handle short-lived namespaces?</p>
</li>
</ol>
<p>POD UIDs are tricky; while OpenCost does not support PodUIDs, it does provision separate logical calls for calculating UID costs. Pod UIDs are generally of two types: either the Pod is a replica, or the Pod crashed and it restarted.</p>
<p>We introduced a chaos monkey later into the mentorship because my RAM tests started to fail. Turns out shorter-lived namespaces, which were created whenever a new GitHub Action was running, cannot be treated in the same way as long-running ones. To understand and protect our tests, we decided to kill pods randomly to reproduce short-lived pods.</p>
<h2 id="heading-interesting-challenges-i-crossed">Interesting Challenges I Crossed</h2>
<p>Prometheus Queries run in a particular interval period. If the run time of the pod is proportional to the windowSize, cost calculations can end up flaky</p>
<h3 id="heading-prom-30-changes">Prom 3.0 Changes</h3>
<p>OpenCost does a couple of extra manipulations to account for the n+1 response values.</p>
<pre><code class="lang-go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(pds *PrometheusMetricsQuerier)</span> <span class="hljs-title">durationStringFor</span><span class="hljs-params">(start, end time.Time, minsPerResolution <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">string</span></span> {
    dur := end.Sub(start)

    <span class="hljs-comment">// If using a version of Prometheus where the resolution needs duration offset,</span>
    <span class="hljs-comment">// we need to apply that here.</span>
    <span class="hljs-comment">//</span>
    <span class="hljs-comment">// E.g. avg(node_total_hourly_cost{}) by (node, provider_id)[60m:5m] with</span>
    <span class="hljs-comment">// time=01:00:00 will return, for a node running the entire time, 12</span>
    <span class="hljs-comment">// timestamps where the first is 00:05:00 and the last is 01:00:00.</span>
    <span class="hljs-comment">// However, OpenCost expects for there to be 13 timestamps where the first</span>
    <span class="hljs-comment">// begins at 00:00:00. To achieve this, we must modify our query to</span>
    <span class="hljs-comment">// avg(node_total_hourly_cost{}) by (node, provider_id)[65m:5m]</span>
    <span class="hljs-keyword">if</span> pds.promConfig.IsOffsetResolution {
        <span class="hljs-comment">// increase the query time by the resolution</span>
        dur = dur + (time.Duration(minsPerResolution) * time.Minute)
    }

    <span class="hljs-keyword">return</span> timeutil.DurationString(dur)
}
</code></pre>
<pre><code class="lang-go"><span class="hljs-comment">// DurationString converts a duration to a Prometheus-compatible string in</span>
<span class="hljs-comment">// terms of days, hours, minutes, or seconds.</span>
<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">DurationString</span><span class="hljs-params">(duration time.Duration)</span> <span class="hljs-title">string</span></span> {
    <span class="hljs-keyword">const</span> (
        SecsPerMin    = <span class="hljs-number">60.0</span>
        SecsPerHour   = <span class="hljs-number">3600.0</span>
        SecsPerDay    = <span class="hljs-number">86400.0</span>
        MinsPerHour   = <span class="hljs-number">60.0</span>
        MinsPerDay    = <span class="hljs-number">1440.0</span>
        HoursPerDay   = <span class="hljs-number">24.0</span>
        HoursPerMonth = <span class="hljs-number">730.0</span>
        DaysPerMonth  = <span class="hljs-number">30.42</span>
        Day           = time.Hour * <span class="hljs-number">24.0</span>
        Week          = Day * <span class="hljs-number">7.0</span>
    )

    durSecs := <span class="hljs-keyword">int64</span>(duration.Seconds())

    durStr := <span class="hljs-string">""</span>
    <span class="hljs-keyword">if</span> durSecs &gt; <span class="hljs-number">0</span> {
        <span class="hljs-keyword">if</span> durSecs%SecsPerDay == <span class="hljs-number">0</span> {
            <span class="hljs-comment">// convert to days</span>
            durStr = fmt.Sprintf(<span class="hljs-string">"%dd"</span>, durSecs/SecsPerDay)
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> durSecs%SecsPerHour == <span class="hljs-number">0</span> {
            <span class="hljs-comment">// convert to hours</span>
            durStr = fmt.Sprintf(<span class="hljs-string">"%dh"</span>, durSecs/SecsPerHour)
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> durSecs%SecsPerMin == <span class="hljs-number">0</span> {
            <span class="hljs-comment">// convert to mins</span>
            durStr = fmt.Sprintf(<span class="hljs-string">"%dm"</span>, durSecs/SecsPerMin)
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> durSecs &gt; <span class="hljs-number">0</span> {
            <span class="hljs-comment">// default to secs, as long as duration is positive</span>
            durStr = fmt.Sprintf(<span class="hljs-string">"%ds"</span>, durSecs)
        }
    }

    <span class="hljs-keyword">return</span> durStr
}
</code></pre>
<pre><code class="lang-go"><span class="hljs-comment">// Adjust Window Size for a 24h window</span>
unit := time.Hour
duration := <span class="hljs-number">24</span> * unit
now := time.Now().UTC()
adjusted := now.Add(<span class="hljs-number">1</span> * unit)
end := adjusted.Truncate(unit)
start := end.Add(-duration)
</code></pre>
<p>This was one of the hardest ideas I struggled with throughout the mentorship. I needed to adjust the window account for the extra value because a 24-hour window to the opencost API is not the same 24h window to Prometheus.  </p>
<p>Since the pod runtime was quiet small, differences that woudn’t affect long running pods can affect my calculations here.</p>
<h2 id="heading-unmarshalling-json">Unmarshalling JSoN</h2>
<p>I’m proud of this one. It was hard to design structs for non-JSON confirming API responses. To tackle this, you need to implement a custom unmarshalling function that runs on part of the response, translates to a byte object, and maps the desired values to your structs.</p>
<h2 id="heading-debugging">Debugging</h2>
<p>I was suggested to set up an OpenCost Dev environment to cross-verify the log messages that read the OpenCost windows and Prometheus windows. I was able to figure things out with old-fashioned print statements. But here are two general themes I picked up while spending time stuck on the problem</p>
<ul>
<li><p>Ensure code runs - try to get the code to run without throwing syntax issues.</p>
</li>
<li><p>Fix the breaking objects one by one, which will help you make observations steadily. You don’t have to fix everything immediately; you can put one object under the microscope and fix that. Turns out, most of the time, it is a domino effect, and other tests will also start to pass.</p>
</li>
</ul>
<h1 id="heading-ia"> </h1>
<p>What’s Next</p>
<p>I’ll be posting my updates on the GitHub Plugin.</p>
]]></content:encoded></item><item><title><![CDATA[LFX Mentorship: Integration Tests for OpenCost Enterprise Readiness Part (1 / 2)]]></title><description><![CDATA[I came across the OpenCost project after watching KubeCon 2024 YouTube upload. How bizarre was that? I was not aware that they had a mentorship opportunity…]]></description><link>https://searidges.hashnode.dev/integration-tests-for-opencost-enterprise-readiness-part-1-2</link><guid isPermaLink="true">https://searidges.hashnode.dev/integration-tests-for-opencost-enterprise-readiness-part-1-2</guid><category><![CDATA[#OpenCsot]]></category><category><![CDATA[CNCF]]></category><category><![CDATA[LFX Mentorship]]></category><category><![CDATA[Go Language]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Mon, 01 Sep 2025 19:54:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1756754471323/53c4de51-895f-4684-b9e2-5a8867de3685.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-cosmic-karma">Cosmic Karma?</h1>
<p>I came across the OpenCost project after watching KubeCon 2024 YouTube upload. How bizarre was that? I was not aware that they had a mentorship opportunity this summer. I have always wanted to participate in the Linux Foundation Mentorship Program. This is not the first time I've heard of the mentorship; I was aware of it since 2023, but I couldn’t devote the necessary time in relation to my skill level to actually secure a mentorship.</p>
<p>This is the most work I have done, and it far exceeds the amount of code I pushed compared to my stint with Google Summer of Code 2022 and Code for GovTech 2023. For me, getting into this program was breaking into the CNCF space with an open toll-free highway. I couldn’t capitalize on my previous open-source commitments, but I wanted to be sure I made a career trajectory out of it this time.</p>
<h1 id="heading-pending-work-from-the-mentorship">Pending Work from the Mentorship</h1>
<p>Write a Chaos Monkey Test for the OpenCost Development Stack. Complete my GitHub Plugins Extension for OpenCost that I haven’t really touched for a while, and a new cost exporter for cloud costs.</p>
<p>I definitely feel I slacked a bit. Historically, I have been more accused of speed over quality. I was conscious not to repeat that, and as a result, I may have sacrificed some deliverables.</p>
<p>I lacked time-bounding and multitasking my tasks; I wasn’t as fast at grasping as I had hoped to be. I was slightly averse to context switching and creating mind spaces.</p>
<p>I was tempted to use AI to write GO code and zap through the program, but I chose not to, deliberately to gain confidence in writing any Go program all by myself without AI.</p>
<h1 id="heading-further-reading">Further Reading</h1>
<p>In the next section, I will cover some of the unique coding challenges I faced during the mentorship and what I learnt from it.</p>
<p><a target="_blank" href="https://hashnode.com/post/cmf1jmcc0000302lcgkbkdsmt">Part 2: My Development Struggles</a></p>
]]></content:encoded></item><item><title><![CDATA[Impartial Combinatorics in a Bowling Puzzle]]></title><description><![CDATA[I came across a game theory problem where one has to find whether the game can be won, given a starting position. There are some constraints:]]></description><link>https://searidges.hashnode.dev/impartial-combinatorics-in-a-bowling-puzzle</link><guid isPermaLink="true">https://searidges.hashnode.dev/impartial-combinatorics-in-a-bowling-puzzle</guid><category><![CDATA[#impartialcombinatorics]]></category><category><![CDATA[Game Theory]]></category><category><![CDATA[Recursion]]></category><category><![CDATA[puzzle]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Sat, 07 Jun 2025 11:37:34 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-puzzle">Puzzle</h2>
<p>I came across a game theory problem <a target="_blank" href="https://www.hackerrank.com/challenges/bowling-pins/problem">https://www.hackerrank.com/challenges/bowling-pins/problem</a> where one has to find whether the game can be won, given a starting position. There are some constraints:</p>
<ul>
<li><p>Both players will play optimally</p>
</li>
<li><p>The game cannot end in a draw</p>
</li>
<li><p>There are finite moves to be played</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1749291553801/1f38ace9-e427-4fd6-8582-1095ec41595e.png" alt class="image--center mx-auto" /></p>
<p>This is a bowling setup; at every turn, each player can either knock down one pin or two adjacent pins.</p>
<h2 id="heading-min-max-analysis">Min-Max Analysis</h2>
<p>By looking at the problem, I thought of a brute force solution to compute the gametree for all possible moves and then evaluate from the leaf node to the starting position. This is an exponential solution and did not run within the time limits. If the number of pins is <em>N,</em> then the time complexity is:</p>
<p>$$O(2^N)$$</p><p>I implemented a couple of optimizations, including pre-computing the Game-Tree up to 5 pieces on the board, memoization of the boards, and evaluating the mirror configuration of the board as the same. None of this helps.</p>
<h2 id="heading-found-a-pattern-for-slightly-modified-rules-irrelevant-to-the-problem">Found a pattern for slightly modified rules; Irrelevant to the problem</h2>
<p>I considered the following rule change: given a continuous chain of pins and the constraint that you can knock pin/s on the edge, who would win?</p>
<p>Let’s compute the series:</p>
<p>$$f(0) = 0$$</p><p>$$f(1) = 1 $$</p><p> $$f(2) = 1 $$</p>
<p> $$f(3) = 2$$</p>
<p>We see a pattern from here: for the starting player to win, the game must end in an odd number of moves. <em>F(n)</em> can be followed by <em>F(n-1)</em> or <em>F(n-2),</em> depending on the number of pins knocked. This would mean that for every <em>F(3n),</em> the game would end in a loss for the starting player if both players play optimally.</p>
<h2 id="heading-sprague-grundy-algorithm">Sprague-Grundy Algorithm</h2>
<p>I found this amazing playlist on Grundy Numbers applied on Chess - <a target="_blank" href="https://www.youtube.com/playlist?list=PLj6WGJe-RmYZ-yHrobuCZVjaKHpXTxZOJ">https://www.youtube.com/playlist?list=PLj6WGJe-RmYZ-yHrobuCZVjaKHpXTxZOJ</a></p>
<p>We can use Bouton’s theorem to rephrase the problem as a nim pile. A group of consecutive pins is a single nim pile, and once the sequence is broken, they become <em>independent</em> nim piles.  </p>
<p>All we have to see is if the nimsum of the pile is not zero, and for that, we must evaluate the Grundy number of each pile, which can be done recursively or bottom to top.</p>
<p>The approach is similar to chess with the King piece only, where we compute the Grundy numbers starting from the terminal positions, which would have a value of 0.</p>
<h2 id="heading-solution">Solution</h2>
<p>This is the top submission, and it is elegant and simple.</p>
<pre><code class="lang-cpp"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;cmath&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;cstdio&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;vector&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;set&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;algorithm&gt;</span></span>
<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;

<span class="hljs-keyword">const</span> <span class="hljs-keyword">int</span> Maxn = <span class="hljs-number">305</span>;

<span class="hljs-keyword">int</span> nim[Maxn];
<span class="hljs-keyword">int</span> t;
<span class="hljs-keyword">int</span> n;
<span class="hljs-keyword">char</span> str[Maxn];

<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">1</span>; i &lt; Maxn; i++) {
        <span class="hljs-built_in">set</span> &lt;<span class="hljs-keyword">int</span>&gt; S;
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt; i; j++)
            S.insert(nim[j] ^ nim[i - <span class="hljs-number">1</span> - j]);
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j + <span class="hljs-number">1</span> &lt; i; j++)
            S.insert(nim[j] ^ nim[i - <span class="hljs-number">2</span> - j]);
        <span class="hljs-keyword">while</span> (S.find(nim[i]) != S.end()) nim[i]++;
    }  
    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d"</span>, &amp;t);
    <span class="hljs-keyword">while</span> (t--) {
        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d"</span>, &amp;n);
        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%s"</span>, str);
        <span class="hljs-keyword">int</span> res = <span class="hljs-number">0</span>;
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) <span class="hljs-keyword">if</span> (str[i] == <span class="hljs-string">'I'</span>) {
            <span class="hljs-keyword">int</span> j = i;
            <span class="hljs-keyword">while</span> (j &lt; n &amp;&amp; str[j] == <span class="hljs-string">'I'</span>) j++;
            res ^= nim[j - i];
            i = j;
        }
        <span class="hljs-built_in">printf</span>(<span class="hljs-string">"%s\n"</span>, res? <span class="hljs-string">"WIN"</span>: <span class="hljs-string">"LOSE"</span>);
    }
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Exploring OpenCost]]></title><description><![CDATA[OpenCost is a neat interface between FINops, Open-Source, and K8 worlds. The goal of Opencost is to be agnostic to exported metrics that customers want to…]]></description><link>https://searidges.hashnode.dev/exploring-opencost</link><guid isPermaLink="true">https://searidges.hashnode.dev/exploring-opencost</guid><category><![CDATA[#opencost]]></category><category><![CDATA[CNCF]]></category><category><![CDATA[Kubecon]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Tue, 27 May 2025 19:23:32 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-kubecon-2024-takeaways">KubeCon 2024 Takeaways</h2>
<ul>
<li><p>OpenCost is a neat interface between FINops, Open-Source, and K8 worlds.</p>
</li>
<li><p>The goal of Opencost is to be agnostic to exported metrics that customers want to monitor</p>
<ul>
<li><p>The FOCUS specifications agree to ~43 fields that cover most use cases. The UI is tested heavily on these fields</p>
</li>
<li><p>There is an option to add external metrics through the interface. This is not well tested but is meant to cover special cases.</p>
</li>
</ul>
</li>
<li><p>The EndGame for Opencost is to become the “Cost Usage Report” for the internet</p>
<ul>
<li>You can visualize cloud providers as well as allocation costs from Databases in one single glass pane.</li>
</ul>
</li>
<li><p>OpenCosts Runs tests on “AMD”, “MacOS” and “ARM” nodes.</p>
<ul>
<li>It is an active decision to not ship the plugins because of their size. We are currently trying to build the ecosystem with more plugins. $1000 for a new plugin, only for the first 10.</li>
</ul>
</li>
<li><p>There is a filter option in the dashboard for costs</p>
<ul>
<li>billed and list types</li>
</ul>
</li>
<li><p>The data is stored in a 7-day rolling window. The resolution of queries is 1 minute.</p>
</li>
</ul>
<h1 id="heading-matt-roys-expectations">Matt Roy’s Expectations</h1>
<ul>
<li><p>Take it to the CNCF-Incubation stage from CNCF-Sandbox stage.</p>
<ul>
<li><p>More anecdotes from customers</p>
</li>
<li><p>More developers outside of KubeCost. Right now we have Randolia and Grafana Labs. (4/75 developers)</p>
</li>
</ul>
</li>
<li><p>More requests for OpenTelemetry integration</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[My Experience Contributing to AI-Tools]]></title><description><![CDATA[AI-Tools is a Digital Public Good created as part of the Samagra initiative. AI-Tools is an Open Source Project comprising a collection of tools aimed to…]]></description><link>https://searidges.hashnode.dev/my-experience-contributing-to-ai-tools</link><guid isPermaLink="true">https://searidges.hashnode.dev/my-experience-contributing-to-ai-tools</guid><category><![CDATA[Open Source]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Experience ]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Thu, 13 Jul 2023 03:33:32 GMT</pubDate><content:encoded><![CDATA[<p><a target="_blank" href="https://github.com/Samagra-Development/ai-tools">AI-Tools</a> is a Digital Public Good created as part of the <a target="_blank" href="https://www.samagragovernance.in/">Samagra</a> initiative.</p>
<p>AI-Tools is an Open Source Project comprising a collection of tools aimed to quickly build and deploy Machine Learning(ML) models for various use cases. Essentially it helps abstract the deployment operations layer and allows for a pure ML development experience.</p>
<p>In the next couple of posts, I will be talking about my learnings, thoughts and observations as a contributor to the <a target="_blank" href="https://www.codeforgovtech.in/">C4GT</a> Program.</p>
<p><strong>Weekly Contributions</strong></p>
<ul>
<li><p>Week - 0 : <a target="_blank" href="https://hashnode.com/post/clk0josvq000j09l55l693ts1">A Code Odyssey</a></p>
</li>
<li><p>Week - 1 : <a target="_blank" href="https://hashnode.com/post/clk0lgad0000109ky7vx32vd3">Mission Multi Image</a></p>
</li>
<li><p>Week - 2 :</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[AI-Tools Week - 1 : Mission Multi Image]]></title><description><![CDATA[My main goal was to set up an Ansible script that can deploy all the docker images onto any remote infrastructure. The aim was to understand if pulling…]]></description><link>https://searidges.hashnode.dev/ai-tools-week-1-mission-multi-image</link><guid isPermaLink="true">https://searidges.hashnode.dev/ai-tools-week-1-mission-multi-image</guid><category><![CDATA[ansible]]></category><category><![CDATA[hashicorp-vault]]></category><category><![CDATA[TLS]]></category><category><![CDATA[ssh-keys]]></category><category><![CDATA[Github Packages]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Thu, 13 Jul 2023 03:32:04 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-goal">Goal</h2>
<p>My main goal was to set up an Ansible script that can deploy all the docker images onto any remote infrastructure. The aim was to understand if pulling images from a Package Registry like Github Packages or Docker Hub is faster than building the image from the code and running them.</p>
<p>Technologies Needed</p>
<ul>
<li><p>Ansible</p>
</li>
<li><p>Hashicorp Vault</p>
</li>
<li><p>Docker Swarm</p>
</li>
<li><p>GitHub Personal Access Token</p>
</li>
</ul>
<h2 id="heading-what-i-was-able-to-do">What I was able to do?</h2>
<p>The first thing I tried to do was understand the technologies individually. I had used docker swarm and a GitHub PAT before. But Ansible and Hashicorp Vault for new to me. Although I had heard of it and had an idea of what it did, I had never used it.</p>
<h3 id="heading-target-machine-that-acts-as-a-docker-swam-manager">Target Machine that acts as a Docker Swam Manager.</h3>
<p>I created a Docker Swarm to orchestrate my Docker images. One thing I learnt that is you need to SSH into the target machine from the local machine. For that, you need a SSH key-value pair. The reason this is better than a simple HTTP password-based connection is that it is susceptible to man-in-the-middle attacks.</p>
<p>SSH - Key Generation involves creating a private and public key. You will share the public key with the host you want to SSH onto. During the Login Process, the Target Machine will run your private key against the public key you shared and verify your authorization.</p>
<h3 id="heading-setting-up-hashicorp-vault">Setting up HashiCorp Vault</h3>
<p>I struggled a lot here and learnt many things the hard way.</p>
<p>Accessing a vault you create itself painstaking. I dreaded trying to debug this error <code>server returned HTTP response to HTTPS client</code>.</p>
<p>The vault always had some problems when I ran on my local system :(. Eventually, I decided to switch to an EC2 machine and ran the vault as a docker container.</p>
<p>I learnt a few things while I was attempting to debug:</p>
<p>TLS (Transport Layer Security) Certificate: a digital certificate that is used to establish secure and encrypted connections between a client (such as a web browser) and a server.</p>
<p>There are two steps to using a TLS Certificate</p>
<ul>
<li><p>Creating One: This is similar to creating a SSH key pair. Here you will generate a .PEM key which will act as the certificate</p>
</li>
<li><p>Signing it: This step is crucial. The signing authority is like a digital stamp that tells others that this certificate is valid. Signing is again a two-step process</p>
<ul>
<li><p>You need to generate a CSR (Certificate Signing Request). You will be providing details about your organisation and yourself.</p>
</li>
<li><p>Once you have CSR, you need to submit it to a CA (Certificate Authority) for them to verify and sign it. CA's are the ones that validate your TLS Certificate.</p>
</li>
</ul>
</li>
</ul>
<p>Fun Fact: You can sign a certificate by yourself (Self-Signing). But unfortunately, many services don't accept unauthorized CA's :(.</p>
<h3 id="heading-ansible-playbook">Ansible Playbook</h3>
<p>This was the simplest yet the most essential step of all. I used Ansible to automate the deployment process from end to beginning. It goes as follows</p>
<ol>
<li><p>Set up Vault with Vault Credentials</p>
</li>
<li><p>Retrieve Secrets from Vaults about Docker Environment Variables and GitHub</p>
</li>
<li><p>Login into GitHub Registry (ghcr.io) using a GitHub Personal Access Token (PAT) to pull the Docker images.</p>
</li>
<li><p>Deploy the Docker Images onto a Docker Swarm.</p>
</li>
</ol>
<p>Here is the PR: <a target="_blank" href="https://github.com/Samagra-Development/ai-tools/pull/191">https://github.com/Samagra-Development/ai-tools/pull/191</a></p>
<h2 id="heading-thoughts">Thoughts</h2>
<p>I realised taking the extra minute to look at the code you write can take you for KiloMetres. While working with the Vault, I always had trouble figuring out the path of the secret I uploaded myself. Looking at the log after each command will eliminate a lot of the problems you might face.</p>
]]></content:encoded></item><item><title><![CDATA[AI-Tools Week - 0: A Code Odyssey]]></title><description><![CDATA[The night before the hike]]></description><link>https://searidges.hashnode.dev/ai-tools-week-0-a-code-odyssey</link><guid isPermaLink="true">https://searidges.hashnode.dev/ai-tools-week-0-a-code-odyssey</guid><category><![CDATA[AI]]></category><category><![CDATA[#ai-tools]]></category><category><![CDATA[Devops]]></category><category><![CDATA[planning]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Manas Sivakumar]]></dc:creator><pubDate>Thu, 13 Jul 2023 02:42:42 GMT</pubDate><content:encoded><![CDATA[<p>AI-Tools started with a vision to be the Open Source version of Amazon Sage Maker - Provide Infrastructure Management and Deployment Optimization as a service. This process will abstract many stages of deployment and hence will allow AI engineers to only focus on the development work.</p>
<h2 id="heading-work-already-done">Work Already Done:</h2>
<p>AI-Tools were already supporting a few AI workflows such as Text Translation, Language Detection, etc. Each Image also comes with a docker image for containerizing the application.</p>
<p>AI-Tools bundles all the images together by generating a docker-compose file dynamically and deploying it. All the images are served via an NginX proxy.</p>
<p>The Objective is to enable Multi Image Deployment Seamlessly.</p>
<p>I picked some tasks that aid this major plan:</p>
<ul>
<li><p>Upgraded the shell script that generates a docker-compose file that references the existing docker images in every AI workflow model. Here is the PR <a target="_blank" href="https://github.com/Samagra-Development/ai-tools/pull/122">https://github.com/Samagra-Development/ai-tools/pull/122</a></p>
</li>
<li><p>GitHub Actions. I created a GitHub workflow that builds the images from the codebase and pushes them to GitHub Packages as a Public Image. Here is the PR <a target="_blank" href="https://github.com/Samagra-Development/ai-tools/pull/123">https://github.com/Samagra-Development/ai-tools/pull/123</a></p>
</li>
</ul>
<h2 id="heading-end-goal">End Goal:</h2>
<p>The Mission is to develop a system that can work like Amazon Sage Maker. Over the coming weeks, I will try to identify the salient features of this product and formulate a plan on how to implement them.</p>
<p>Relevant Technologies I identified: for the upcoming weeks</p>
<ul>
<li><p>Packer - To bundle the Images</p>
</li>
<li><p>Kubernetes - To Orchestrate the Images</p>
</li>
<li><p>KubeFlow - Optimize Machine Learning Training Process</p>
</li>
<li><p>ReactAdmin - A dashboard to visualize the Training and Deployment Process</p>
</li>
</ul>
<h2 id="heading-thoughts">Thoughts</h2>
<p>It is important to visualize the process and that Is what I think I did this week. I understood what we have right now and what we want to be. Realizing the process needs patience and tenacity as it might not go as planned. At the present, I have visualized a few intermediate milestones between the present and the end goal. I'll strive to stick to them but will also be open to other approaches during the process</p>
]]></content:encoded></item></channel></rss>