<?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 Veysel Şahin on Medium]]></title>
        <description><![CDATA[Stories by Veysel Şahin on Medium]]></description>
        <link>https://medium.com/@veyselsahin?source=rss-e9718362ab20------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4rBC5u-wvQ_ftdsP_TlKEA.jpeg</url>
            <title>Stories by Veysel Şahin on Medium</title>
            <link>https://medium.com/@veyselsahin?source=rss-e9718362ab20------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:20:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@veyselsahin/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[Diagnosing Kernel Freezes, RCU Stalls, and OOM Events on Raspberry Pi]]></title>
            <link>https://medium.com/@veyselsahin/diagnosing-kernel-freezes-rcu-stalls-and-oom-events-on-raspberry-pi-f2f11ab0aca5?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2f11ab0aca5</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[oomkill]]></category>
            <category><![CDATA[rcustall]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 14:50:53 GMT</pubDate>
            <atom:updated>2026-01-27T14:50:53.525Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever seen a Linux box (especially a Raspberry Pi) look “fine” most of the time, but then suddenly become unresponsive with scary kernel spam like <strong>RCU stalls</strong>, you’re not alone. This write-up documents a real incident, the exact failure chain, and a clean fix you can paste straight into a Medium post.</p><h3>The Symptoms</h3><p>The machine appeared healthy during normal operation:</p><ul><li>Plenty of free RAM</li><li>Normal load most of the time</li></ul><p>But after some time under load, logs showed:</p><ul><li>Repeated kernel warnings like:</li></ul><pre>rcu_preempt detected expedited stalls</pre><ul><li>Services failing to start / random restarts</li><li>The system becoming sluggish or “frozen”</li></ul><p>Then the key smoking gun appeared:</p><pre>Out of memory: Killed process (snuba)<br>Out of memory: Killed process (systemd)</pre><h3>The Key Insight: RCU Stalls Were Not the Root Problem</h3><p>Those rcu_preempt detected expedited stalls messages <strong>look like a kernel bug</strong>, but in this case they were simply a <em>symptom</em>.</p><p>What was really happening:</p><ol><li>A heavy service (in this case, components of <strong>Sentry self-hosted</strong>) caused a sudden memory spike.</li><li>The system had <strong>no swap configured</strong>.</li><li>The kernel had nowhere to go, so it invoked the <strong>OOM killer</strong>.</li><li>Under extreme memory pressure (and reclaim work), the scheduler and kernel subsystems got starved long enough that <strong>RCU reported stalls</strong>.</li><li>The machine looked “frozen”.</li></ol><p>So the actual chain was:</p><blockquote><strong><em>Memory spike → No swap → OOM killer → Scheduler disruption → RCU stall spam</em></strong></blockquote><h3>Why This Can Happen Even If RAM Looks “Fine”</h3><p>At the time of debugging, free -h looked like this (good memory availability):</p><ul><li>~8 GB RAM total</li><li>lots of available RAM</li><li><strong>Swap: 0</strong></li></ul><p>That’s the trap: <strong>OOM can be triggered by a short spike</strong>, not by sustained average usage.</p><p>With swap set to <strong>zero</strong>, even a brief allocation burst can push the kernel over the edge.</p><h3>Root Cause</h3><h3>No swap configured</h3><p>The system had:</p><pre>SwapTotal: 0 kB</pre><h3>Workload that spikes memory</h3><p>Services like:</p><ul><li>snuba (Sentry ingestion for my case)</li><li>clickhouse</li><li>kafka</li></ul><p>…can allocate large chunks of memory quickly. One log line showed:</p><ul><li>snuba had ~384 MB RSS at the time it was killed</li></ul><p>On a swap-less host, that’s enough to trigger a cascade during peak moments.</p><h3>The Fix: Add Real Swap (on NVMe)</h3><p><em>If you have NVMe, use it. NVMe swap is fast and avoids burning SD cards.</em></p><p>In this setup, the NVMe disk was mounted as the root filesystem (/), so we created /swapfile directly on NVMe.</p><h3>Step 0 — Disable any existing swap</h3><pre>sudo swapoff -a</pre><h3>Step 1 — Comment out any old swapfile fstab entries (safe cleanup)</h3><pre>sudo sed -i &#39;\|swapfile none swap|s|^|#|&#39; /etc/fstab</pre><h3>Step 2 — Create a 32 GB swap file (units matter!)</h3><pre>sudo fallocate -l 32G /swapfile<br>sudo chmod 600 /swapfile</pre><p>Verify file size:</p><pre>ls -lh /swapfile</pre><p>Expected:</p><pre>-rw------- 1 root root 32G /swapfile</pre><h3>Step 3 — Initialize swap header (critical)</h3><pre>sudo mkswap /swapfile</pre><p>You should see something like:</p><pre>Setting up swapspace version 1, size = 32 GiB ...</pre><h3>Step 4 — Enable swap</h3><pre>sudo swapon /swapfile</pre><h3>Step 5 — Persist across reboots</h3><pre>echo &#39;/swapfile none swap sw,pri=10 0 0&#39; | sudo tee -a /etc/fstab</pre><h3>Step 6 — Tune swappiness for NVMe</h3><p>A moderate value works well for container workloads:</p><pre>echo &#39;vm.swappiness=30&#39; | sudo tee /etc/sysctl.d/99-swappiness.conf<br>sudo sysctl -p /etc/sysctl.d/99-swappiness.conf</pre><h3>Step 7 — Verify</h3><pre>swapon --show<br>free -h</pre><p>Expected:</p><ul><li>Swap is visible</li><li>Size matches (e.g., 32G)</li><li>You can reduce to 8G or 16G</li></ul><h3>A Real Pitfall We Hit (and How to Avoid It)</h3><p>We initially created a larger swap file but still saw:</p><pre>/swapfile file 4G</pre><p>That happens if:</p><ul><li>the swap header was not reinitialized after resizing</li><li>or mkswap wasn’t run after changing file size</li></ul><p><strong>Fix:</strong> always run swapoff → mkswap → swapon after resizing the swap file.</p><h3>Final</h3><p>After enabling NVMe swap and tuning swappiness:</p><ul><li>OOM kills stopped</li><li>RCU stall warnings disappeared</li><li>System stayed responsive under load</li></ul><h3>Recommendations (If You Run Docker / Observability Stacks)</h3><p>Swap is the safety net. But you should still:</p><ol><li><strong>Set memory limits</strong> for heavy containers (Snuba / ClickHouse / Kafka).</li><li>Disable non-essential services if running on small hardware.</li><li>Monitor docker stats and journalctl -k | grep -i oom.</li></ol><h3>TL;DR</h3><p>If you see <strong>RCU stalls</strong> together with <strong>OOM kills</strong>, don’t chase kernel ghosts first.</p><p>Check swap.</p><blockquote><strong><em>No swap + memory spikes = OOM killer = “freeze” + RCU stall spam</em></strong></blockquote><p>Add NVMe-backed swap, and your system becomes dramatically more stable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f11ab0aca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Vibe Coding Manifesto]]></title>
            <link>https://medium.com/@veyselsahin/the-vibe-coding-manifesto-73d406ffbde3?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/73d406ffbde3</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 01:05:12 GMT</pubDate>
            <atom:updated>2025-12-05T01:05:12.811Z</atom:updated>
            <content:encoded><![CDATA[<p>TL;DR</p><blockquote>Think like a machine, use like a human.</blockquote><p>Hello dear reader. The title was chosen for fun, as everything here is based on my personal experiences, findings, and opinions☺️ Feel free to comment or ask questions if you notice anything worth correcting.</p><p>I personally would salute all stakeholders from investors to companies, Data and ML Engineers to scientists by bringing a light by building all these models and architectures.</p><p>The main reason of this article is to establish a common and an intermediate understanding between complex Machine Learning argorithms and people who intended to build something with agentic AI opportunities in a cheaper, secure and efficient manner.</p><p>The initial sentence would expressing the fact that there is no such thing like vibe coding. On the other hand, there should be something closer to that. No current tech can give you a production-ready system from vibes + one prompt</p><h4>Language and Framework</h4><p>The relationship between the benefit of using AI agents for coding and the cost of increasing context length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PrnBVxeSXzoxM-TwCDygaQ.png" /><figcaption>Red: costs</figcaption></figure><p>This visualization can ring a bell about the initial decision: language and the framework. You should pick something really easy for AI to understand. This points the most base, context lenght. If your decision requires your AI agent to consume high number of context to start then this can be the main issue. Because it won’t be the reason only for the high cost but it will be one of the potential reason for complete disaster, overdue, logical bug or a really weird thing that even a human can be struggle to understand and troubleshoot.</p><p>We need to understand some terms, their meanings and their affects to avoid the absolute inevitable failure.</p><h4>Prompt</h4><p><strong>Properly and completely feed the prompt to build the context that almost perfectly suits with your demand.</strong></p><p>I believe the best way to using AI agents is to providing the proper prompts. There are a couple of reasons and consequences behind this sentence:</p><ul><li>Cost</li></ul><p>Don’t miss providing any details that LLM engine might need to know.</p><p>It doesn’t matter whether you running your own infrastructure or using a paid service. You can pay more to paid services or you will need to wait for execution of multiple prompt processings to bring the context closer to the expected shape.</p><p>Another consequence is to higher risk of hallusination.</p><ul><li>Accuracy</li></ul><p>The accuracy rate of the current topic is something that almost equals to a factor that can express your demand’s over the ultimate shape of the end product. In basic words, it can be something like the difference between expecting the ultimate end product or constructing a test curl request by providing a couple of log lines☺️</p><p>Moving forward with the second path will not require any additional hardware besides the ones which already existing in almost all recently produced laptops.</p><p>This can be expressed in another way in a sentence like “Task division cardinality is a balancing act between accuracy and time: splitting tasks further helps only up to a point, so the optimal degree of subdivision is context-dependent and should be reviewed periodically.”</p><ul><li>Development speed</li></ul><p>Development speed is the most important key as it does means “Time”. Eventhough the philosophical debate is controversial, time is the most precious thing in this topic. It’s not only about the race built by the hype, it does also means the increasing the cost or the worst, unconsciously slowing down to zero.</p><p>That results to having nothing on the hand except a garbage after spending money, time, effort and many other things like hopes☺️</p><h3>Context control coverage</h3><p>I haven’t heard anything like this before but this might be one of the best ways and the shortest combination of words to describe what I am planning to bring your attention.</p><p>You may want to start a new session each time due to several reasons like changing the high-level <a href="https://en.wikipedia.org/wiki/Attention_(machine_learning)">attention</a>, custom or/and independent new folder arrangements for tasks that require multi-service readiness or/and code based inter-service communications, handling efforts for hallucinations due to poor prompts, etc. I would make the list longer but it’s in the better shape to keep the article short and express the fact that you will need context rebuilding from scratch many times.</p><p>To keep and build the context under control requires LLM to be informed each time, at least for the most important points.</p><p>While there are many tools to accomplish it as like you decide(in TUI, GUI), the basic and universal common name of this method is “Specifications” or shortly “specs”.</p><p>This is the best way to tame an LLM for an end-consumer no matter where it runs(theorically☺️).</p><p>https://en.wikipedia.org/wiki/Attention_(machine_learning)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73d406ffbde3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building MVPs: The Trade-Off Between Strategy and Stability]]></title>
            <link>https://medium.com/@veyselsahin/building-mvps-the-trade-off-between-strategy-and-stability-6771afaa43f7?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/6771afaa43f7</guid>
            <category><![CDATA[mvp]]></category>
            <category><![CDATA[indie-developer]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Tue, 14 Oct 2025 03:42:19 GMT</pubDate>
            <atom:updated>2025-10-14T05:21:01.103Z</atom:updated>
            <content:encoded><![CDATA[<p>I may review it later on in point of grammer and redaction view but this is not something more than personal thoughts and findings.</p><p>Nothing can be perfect except the MVP plan. I will try to express what I noticed so far as an indie developer in order to convey something useful to you dear reader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8g-zIdx1UM2csDO1t6eFpA.png" /></figure><ol><li>The first plan is keep the control of the complexity.</li></ol><p>This is not only a plan also it’s a checklist for all the steps and step by step. We might put extra complexity during solving problems of a step. This can cause two major effects, one is maintenance burden and the other is its adverse effect on step decay. These effects differs in both development and production stage. The effects on the production stage is whole another story. In development, it can cause different kind of issues that require experience out of subject matter expertise. In other short words, decision on a new tool on the application should be considered twice. Hundreds of new and maybe useful products so ideas fails before they arrived to the end user.</p><p>2. Use what you are good most</p><p>There are hundreds of libraries, languages, technologies, methods, frameworks and their combinations are out there. The most important things is to ability to move forward faster. Time has always been limited. If you struggle with something which cause you to add a new feature in days then there is a problem. Eventhough the term “feature” depends, subtasks or milestones speaks at the end of the day.</p><p>3. The easiest part, maintenance</p><p>Every steps needs to be reviewed again in sake of the first rule. Don’t think that you will be reach 1M users from the first day unless the business model forces. In that case, you will need to review the MVP plan to handle the initial preparation. Most useful systems rewritten at least once. The perfect balance between the perfect and successful product is something needs to be carefully decided. My experience tells me that the maintenance parts it the easiest one and don’t mess the system with the easiest part.</p><p>4. Cumulatively prepared</p><p>Such a mindset requires something to be up and running or already configured or registered or whatever you used in past or you might be using in the future. I keep my own company, own servers(for cheaper compute if the product requires), resillient and easily maintained cloud services(S3, configured cloudflare projects, ready-to-use API keys from different service providers, etc). These can also be modified frameworks, linkable libraries, boilerplates that you highly familiar with. Familiarity is for cumulative rapid development agility.</p><p>5. Benefiting of Open Source</p><p>We developers dependent of open source as we develop collaboratively. You sometimes can find something in Github that you would spend months to develop. Finding a battle-tested Python library will save a lot including less time on maintenance-burden, troubleshooting and debugging.</p><p>6. Limit using AI tools</p><p>Using AI is inevitable. The important things is that you should be able to write your own code. AI makes you faster if you limit it and AI makes you slower if you don’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fbhqh_D1aRIQO2PSxeOOdA.png" /></figure><p><em>ChatGPT used to draw the graph.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6771afaa43f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running GPT-OSS-20B with MXFP4 Quantization on AMD GPUs]]></title>
            <link>https://medium.com/cloud-native-daily/running-gpt-oss-20b-with-mxfp4-quantization-on-amd-gpus-c82e97391ce7?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/c82e97391ce7</guid>
            <category><![CDATA[vulkan]]></category>
            <category><![CDATA[amd]]></category>
            <category><![CDATA[gpt-oss]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 23:32:24 GMT</pubDate>
            <atom:updated>2025-08-07T23:33:55.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/419/0*GkN5PdmzK_ttK3Ow" /></figure><p>Just recently, OpenAI dropped a bombshell: the release of two <strong>open-weight language models</strong> — <strong>gpt‑oss‑20b</strong> and <strong>gpt‑oss‑120b</strong>, available under the permissive <strong>Apache 2.0 license</strong></p><ul><li><strong>gpt‑oss‑20b</strong> (~21B parameters) is compact enough to run locally on consumer-grade hardware (like systems with 16 GB of RAM), making on-device experimentation more accessible than ever</li><li><strong>gpt‑oss‑120b</strong> (~117B parameters) offers reasoning performance on par with OpenAI’s o4‑mini model, while still being deployable on a single 80 GB GPU</li></ul><p>As a Linux user and despite my long-standing affection for Nvidia I’m casting my vote for AMD this time. I own a couple of different AMD GPUs, and these new open-weight models were giving me a hard time. After plenty of trial and error, I finally pieced together a working setup. This article is my way of helping anyone who loves Nvidia as much as I do, but finds themselves wrestling with AMD hardware.</p><p><strong>AMD GPU owners have a problem:</strong> most quantized large language models — especially in formats like MXFP4 — either don’t load or crash with ROCm. In this guide, you’ll run GPT-OSS-20B MXFP4 on your Radeon card using Vulkan, bypassing ROCm headaches, and unlocking full GPU acceleration in under an hour.</p><p>Getting large language models to run on AMD GPUs can be challenging, especially when dealing with newer quantization formats like MXFP4. This guide documents how to successfully run GPT-OSS-20B (MXFP4 quantized) on AMD GPUs using Vulkan acceleration, solving common issues with ROCm compatibility and unsupported tensor types.</p><p><strong>## The Problem</strong></p><p>When trying to run GPT-OSS-20B with LocalAI on AMD GPUs, you might encounter several issues:</p><p>1. <strong>ROCm library compatibility issues</strong> — Missing or incompatible libraries like `libhipblas.so`, `librocblas.so`, etc.</p><p>2. <strong>GLIBC version mismatches</strong> — Bundled libraries requiring different GLIBC versions</p><p>3. <strong>GPU device detection failures</strong> — “no ROCm-capable device is detected”</p><p>4. <strong>Unsupported model format*</strong>— “tensor has invalid ggml type 39 (NONE)” error for MXFP4 quantization</p><p><strong>Why LMStudio Works But LocalAI Doesn’t</strong></p><p>LMStudio successfully runs MXFP4 models on AMD GPUs because:</p><p>- It uses <strong>Vulkan</strong> for GPU acceleration (cross-platform GPU API)</p><p>- Ships with llama.cpp v1.44.0 that supports MXFP4 quantization</p><p>- Doesn’t rely on ROCm, avoiding AMD driver compatibility issues</p><p><strong>The Solution: Building llama.cpp with Vulkan Support</strong></p><p><strong>Prerequisites</strong></p><p>- AMD GPU (tested on Radeon RX 7600 XT)</p><p>- Ubuntu/Linux system</p><p>- Basic development tools</p><p><strong>Step 1: Install Vulkan Development Tools</strong></p><pre>bash<br>sudo apt-get update<br>sudo apt-get install -y vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools<br>sudo apt-get install -y cmake build-essential git<br># required for Vulkan shaders<br>sudo apt-get install -y glslc</pre><p><strong>Step 2: Verify Vulkan Detects Your AMD GPU</strong></p><pre>bash<br>vulkaninfo - summary | grep -E &quot;GPU|AMD|Radeon&quot;</pre><p>You should see output like:</p><pre>deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU<br>deviceName = AMD Radeon RX 7600 XT (RADV NAVI33)</pre><p><strong>Step 3: Clone and Build llama.cpp with Vulkan</strong></p><pre>bash<br>mkdir -p ~/llama-cpp-vulkan-build<br>cd ~/llama-cpp-vulkan-build<br>git clone https://github.com/ggerganov/llama.cpp.git<br>cd llama.cpp<br>cmake -B build -DGGML_VULKAN=1 -DCMAKE_BUILD_TYPE=Release<br># Build (adjust -j flag based on your CPU cores)<br>cmake - build build - config Release -j8</pre><p><strong>Step 4: Test the Build</strong></p><pre>bash<br>./build/bin/llama-server \<br>-m /path/to/gpt-oss-20b-mxfp4.gguf \<br>-ngl 99 \ # Use GPU layers<br> - port 8081</pre><p><strong>Step 5: Integrate with LocalAI</strong></p><p><strong>Copy Vulkan-enabled Binary</strong></p><pre>bash<br>cp ~/llama-cpp-vulkan-build/llama.cpp/build/bin/llama-server \<br>/path/to/LocalAI/backends/rocm-llama-cpp/llama-cpp-vulkan</pre><p><strong>Create Run Script</strong></p><pre>bash<br>cat &gt; /path/to/LocalAI/backends/rocm-llama-cpp/run-vulkan.sh &lt;&lt; &#39;EOF&#39;<br>#!/bin/bash<br>CURDIR=$(dirname &quot;$(realpath $0)&quot;)<br>cd /<br>echo &quot;Using Vulkan-enabled llama.cpp&quot;<br>exec $CURDIR/llama-cpp-vulkan - addr $1<br>EOF<br>chmod +x /path/to/LocalAI/backends/rocm-llama-cpp/run-vulkan.sh</pre><p><strong>Configure Model for LocalAI</strong></p><pre>yaml<br># /path/to/LocalAI/models/gpt-oss-20b-vulkan.yaml<br>backend: llama-cpp<br>context_size: 8192<br>f16: true<br>mmap: true<br>name: gpt-oss-20b-vulkan<br>parameters:<br>model: gpt-oss-20b-mxfp4.gguf<br>ngl: 99 # Use GPU layers<br>stopwords:<br>- &lt;|im_end|&gt;<br>- &lt;dummy32000&gt;<br>- &lt;/s&gt;<br>- &lt;|endoftext|&gt;<br>- &lt;|return|&gt;<br>template:<br>chat: |-<br>&lt;|start|&gt;system&lt;|message|&gt;You are ChatGPT, a large language model trained by OpenAI.<br>Knowledge cutoff: 2024–06<br>Current date: {{ now | date &quot;Mon Jan 2 15:04:05 MST 2006&quot; }}<br>&lt;|end|&gt;{{- .Input -}}&lt;|start|&gt;assistant</pre><p><strong>Step 6: Test Your Setup</strong></p><pre>bash<br># Start LocalAI<br>local-ai run - disable-api-key-requirement-for-http-get \<br> - address=&quot;:9998&quot; \<br> - log-level=debug<br># Test the model<br>curl http://localhost:9998/v1/chat/completions \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{<br>&quot;model&quot;: &quot;gpt-oss-20b-vulkan&quot;,<br>&quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hello, how are you?&quot;}]<br>}&#39;</pre><p><strong>Troubleshooting Common Issues</strong></p><p><strong>Issue 1: Missing ROCm Libraries</strong></p><p>If you see errors about missing libraries like `libhipblas.so.2`, `librocblas.so.4`, etc.:</p><pre>bash<br>sudo apt-get install -y hipblas rocblas rocsolver rocsparse<br>sudo ln -sf /opt/rocm-*/lib/libhipblas.so.2 /usr/lib/x86_64-linux-gnu/<br>sudo ldconfig</pre><p><strong>Issue 2: Permission Denied for GPU Access</strong></p><p>If you get “Permission denied” when accessing the GPU:</p><pre>bash<br># Add user to render group<br>sudo usermod -a -G render $USER<br># Log out and log back in for changes to take effect or reboot</pre><p><strong>Issue 3: GLIBC Version Conflicts</strong></p><p>If the backend has bundled libraries causing GLIBC conflicts:</p><p><strong>Performance Considerations</strong></p><p>- <strong>Vulkan vs ROCm</strong>: Vulkan provides better cross-platform compatibility and often works more reliably on consumer AMD GPUs</p><p>- <strong>GPU Memory</strong>: The MXFP4 quantization significantly reduces model size (~12GB for 20B parameters)</p><p>- <strong>Layer Offloading</strong>: Use `-ngl` parameter to control how many layers are offloaded to GPU</p><p><strong>Why This Approach Works</strong></p><p>1. <strong>Vulkan Support</strong>: Works on AMD GPUs without ROCm driver complexities</p><p>2. <strong>MXFP4 Support</strong> Latest llama.cpp includes support for MXFP4 quantization (type 39)</p><p>3. <strong>Native Performance</strong>: Direct GPU acceleration without compatibility layers</p><p>4. <strong>Flexibility</strong>: Can fall back to CPU if GPU issues arise</p><p><strong>Current Limitations and Alternative Solutions</strong></p><p><strong>Important Note: Protocol Mismatch</strong></p><p>While we successfully built llama.cpp with Vulkan support that detects AMD GPUs, integrating it with LocalAI has a fundamental limitation:</p><p>- <strong>LocalAI</strong>uses GRPC protocol for backend communication</p><p>- <strong>llama-server</strong> (the Vulkan-enabled binary) uses REST API protocol</p><p>- This protocol mismatch prevents direct integration without additional development</p><p><strong>Working Alternatives</strong></p><p><strong>Option 1: Use LocalAI in CPU Mode</strong></p><p>The model works with LocalAI’s standard backend in CPU mode. While slower than GPU, it’s fully functional:</p><pre>yaml<br># models/gpt-oss-20b-cpu.yaml<br>backend: llama-cpp<br>context_size: 8192<br>name: gpt-oss-20b-cpu<br>parameters:<br>model: gpt-oss-20b-mxfp4.gguf<br>threads: 128 # Adjust based on your CPU cores</pre><p><strong>Option 2: Use Standalone llama-server with Vulkan</strong></p><p>Run the Vulkan-enabled llama-server directly:</p><pre>bash<br>./llama-server -m gpt-oss-20b-mxfp4.gguf -ngl 99 - port 8080 - host 0.0.0.0</pre><p>Then interact via REST API:</p><pre>bash<br>curl http://localhost:8080/v1/chat/completions \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hello&quot;}]}&#39;</pre><p><strong>Option 3: Use LMStudio (Recommended for GPU)</strong></p><p>For the easiest GPU-accelerated experience on AMD:</p><p>1. Download LMStudio from <a href="https://lmstudio.ai/">https://lmstudio.ai/</a></p><p>2. Load the GPT-OSS-20B MXFP4 model</p><p>3. Automatic Vulkan GPU acceleration works out-of-the-box</p><p>It also show which libraries are missing and you can easiliy install</p><p><strong>Conclusion</strong></p><p>This guide documented the journey of getting GPT-OSS-20B with MXFP4 quantization running on AMD GPUs. While full LocalAI integration requires additional development to bridge the GRPC/REST protocol gap, we’ve identified multiple working solutions:</p><p><strong>Key points:</strong></p><p>- MXFP4 quantization (GGUF type 39) requires latest llama.cpp versions</p><p>- Vulkan provides excellent AMD GPU support without ROCm complexity</p><p>- Protocol compatibility (GRPC vs REST) is crucial for backend integration</p><p>- Multiple solutions exist depending on your performance requirements</p><p><strong>For Production Use:</strong></p><p>- <strong>CPU mode with LocalAI</strong>: Fully integrated but slower</p><p>- <strong>Standalone llama-server</strong>: GPU accelerated but requires custom integration</p><p>- <strong>LMStudio</strong>: Best out-of-the-box GPU experience for AMD users</p><p>This investigation reveals that AMD GPU users have viable paths to running advanced quantized models, even if some assembly is required for full integration.</p><p>Use Strace for troubleshooting</p><p>You might see nothing even debug mode enabled if something bad happened. I had an outdated Ollama, and nothing was written on the screen for me to notice. I used strace to see what’s going on at the kernel level.</p><pre>strace -o strace.log local-ai run --disable-api-key-requirement-for-http-get --address=&quot;:9998&quot;  --log-level=debug</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eBfIE-kvW3DbmZm6q3N7pQ.png" /></figure><p><strong>Resources</strong></p><p>- [llama.cpp GitHub Repository](https://github.com/ggerganov/llama.cpp)</p><p>- [Vulkan SDK Documentation](https://vulkan.lunarg.com/doc/sdk)</p><p>- [LocalAI Documentation](https://localai.io)</p><p>- [AMD ROCm Documentation](https://rocm.docs.amd.com)</p><p><strong>— -</strong></p><p><em>*Tested on: AMD Ryzen Threadripper PRO 5995WX with AMD Radeon RX 7600 XT, Ubuntu 24.04*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c82e97391ce7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-native-daily/running-gpt-oss-20b-with-mxfp4-quantization-on-amd-gpus-c82e97391ce7">Running GPT-OSS-20B with MXFP4 Quantization on AMD GPUs</a> was originally published in <a href="https://medium.com/cloud-native-daily">Cloud Native Daily</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CV formatına başka bir pencereden bakış]]></title>
            <link>https://medium.com/@veyselsahin/cv-format%C4%B1na-ba%C5%9Fka-bir-pencereden-bak%C4%B1%C5%9F-2acecbb8a257?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/2acecbb8a257</guid>
            <category><![CDATA[cv-writing]]></category>
            <category><![CDATA[cv]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Sat, 19 Jul 2025 11:51:45 GMT</pubDate>
            <atom:updated>2025-07-19T12:02:41.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*3SZDXhfSBHTmO7NN.png" /></figure><p>Merhabalar, bazı pozisyonlar için gelen başvuruları değerlendirirken adayın teknik yeterliliklerini değerlendirecek biri gözünden farkettiğim bazı hususları yazmak istedim. Bu tek tip IKcı arkadaşlarımızın beklediği bir CV formatına yönlendirmekten ziyade bir CVyi hazırlarken onun sizin vitrininiz olduğunu ve hazırlarken bir nevi planlı olup olmadığınız, özenli olup olmadığınız, çalışkan ve ataletten uzak olup olmadığınız gibi sizle ilgili birçok bilgi verdiğini ayrıca hatırlatmak istedim.</p><p>Günde 17 saatinizi kodlama becerilerinizi keskinleştirmek için harcıyor olabilirsiniz fakat CVnizde halı sahadan bir fotoğrafınız varsa büyük ihtimal insan kaynakları tarafından daha ilk adımda eleneceksinizdir:)</p><p>Bu hususlar uzun zaman önce konuşulmuş tartışılmış olabilir fakat ben en azından bir backend poziyonuna başvuruyor iken CV’de bulunmasının sadece kalabalık yarattığını farkettiğim bilgileri kabaca not almıştım. Yani araç kullanmanızı gerektirecek bir poziyon için ehliyet bilgisi eklenmesi iyi olacaksa ekleyin tabi ama ofiste çalışacağınız bir iş için göz kalabalığı ve özensizlik görüntüsünden başka birşey olmaz.</p><p>Çok fazla CV incelemek zorunda kalan insanların da düşünüldüklerini hissetmeleri sandığınızdan daha iyi bir ilk intiba vermenizi sağlar.:)</p><p>Ara sıra gördükçe eklerim yine de ama genelde çoğunlukla gördüklerim:</p><ul><li>Vatandaşlık bilgisi</li><li>Kan grubu</li><li>Üniversite mezuniyet ortalaması</li></ul><p>İlk bakışta iyi bir intiba için</p><ul><li>Yazıların fontu(bence en az özenilen ama en önemlisi)</li><li>Bilindik CV formatlarına benzemesi (Şart olmasa da hızlıca CV inceleyen bir göz absürd CV’lere istemsizce kötü not verir.)</li><li>Github, stackoverflow, behance vs. (Vitrinizi dolu göstermeniz önemli. Github hesabınızda hiçbir şey yapmadıysanız eklemeniz de fayda etmeyecek olsa da ilk aşama olan IK incelemesi için profesyonel bir görüntü verecektir.)</li><li>Link verdiğiniz hesaplarınıza göstermiş olduğunuz özen( İşinizin gereği olarak süregelen, stabil ve en önemlisi istikrarlı bir katkı görüntüsü en önemlisidir. İş aramaya başladık hadi birkaç projeyi ekleyeyim onları da initial commit’ten başka beslemeyeyim dediğiniz çok net belli oluyor birçok CV izleyen birinin gözünden.)</li><li>İşinizin teamüllerinin gerektirdiği konuları vitrinde göstermek(README.md eklemek suretiyle dökümantasyon yazma alışkanlığınız, commit mesajlarınızı yazmanız, atomic commitler atmanız gibi gibi aslında soru işareti olan ama bir mülakat sürecinde konuşulmayan birçok hususu bu yollarla ifade etmeniz sizi adaylar arasında dikkat çekici bir yere koyacaktır.)</li></ul><h3>Önem sırasına göre derinlik</h3><p>Aşamaları kolaylıkla ve dikkat çekici bir şekilde geçmeniz önemli iken her bakanın kendine ait alanı kolayca seçebileceği farklı hususları benzer derinliklerde konuşlandırmanız hiç dile getirildiğini görmediğim ama bence önemli bir konu.</p><p>Açıklayacak olursak CVnizin minimum en bilindik 2 aşamada bazen 3 aşamada duruma göre daha fazla aşamada inceleneceğini göz önünde tutarsak ilk bakan IKcı genel kontrol yapacaksa ilk bakışta neler görmesi gerekiyorsa onlar daha dikkat çekici(belki büyük font, belki soft bir renklendirme, belki daha kalın yazma) şekilde belirtilebilir.</p><p>Teknik inceleme aşamasında zaten teknik kişi hangi seviyede nereye bakması gerektiğini sezgisel olarak algılayıp o kısımlarla ilgilenecektir. Böyle birşey şart değil elbet ama farkınızı sadece bir pdf dosyası gösterecekse onun üstünde bir kurgunuz, planınız ve özeniniz olduğunu hissettirmek zorundasınız. Bu sadece son zamanlar değil 20 yıla yakındır gözlemlediğim tüm zamanlarda böyleydi.</p><p>Son aşama soft-skillerin değerlendirilmesi, entrepreneur mindset, hızlı adaptasyon, yaratıcılık, analitik düşünme, iletişim becerileri ve pozisyona özel gereklilikleri cümlelerinizden doğrudan veya dolaylı olarak anlamak için vakti IK personelinden daha fazla bir yönetici tarafından detaylıca okunup irdelenecektir.</p><h3>Basit ama önemli hatalardan emin olun</h3><p>Yerleşim, hizalama, yazım ve imla hatalarından bahsetmemize gerek yoktur herhalde. Bunlara özen göstermeyen işine de özen göstermiyordur gibi bir kanıyı çok da haksız bulduğumu söyleyemeyeceğim.</p><h3>Güncel tutun</h3><p>Cvnizi ara sıra inceleyip güncel tutmak konusunda istikrarlı olursanız farklı zamanlar farklı küçük kusurlar bulabileceğiniz gibi iş sürecinde yapacağınız büyük çaplı güncellemelerin sebep olabileceği kusurlardan da korunmuş olursunuz.</p><h3>Tavsiye alın</h3><p>Bazı Ikcı arkadaşlarımız makul fiyatlara sizi bir IKcı gözüyle değerlendirip aslında gözünüzün önünde yıllardır duran ama farketmediğiniz hususlar hakkında çok değerli dönütler veriyorlar. Ben kıymetli <a href="https://www.linkedin.com/in/cagatayguc/">Çağatay Güç</a>’ten çok güzel dönütler almıştım. Başka birçok arkadaşımız da linkedin üzerinden benzer hizmetleri sunuyorlar.</p><p>Benim bahsini etmek istediğim hususlar haricinde bu aşağıdaki listedeki yazıların da okunması tavsiye olunur.</p><p><a href="https://www.indeed.com/career-advice/resumes-cover-letters/simple-resume-format">https://www.indeed.com/career-advice/resumes-cover-letters/simple-resume-format</a></p><p><a href="https://www.indeed.com/career-advice/resumes-cover-letters/cv-format-guide">https://www.indeed.com/career-advice/resumes-cover-letters/cv-format-guide</a></p><p><a href="https://www.jobseeker.com/tr/cv/ipuclari/cv-hazirlarken-dikkat-edilmesi-gerekenler">CV hazırlarken dikkat edilmesi gerekenler</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2acecbb8a257" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Seccomp: Restricting System Calls for Security]]></title>
            <link>https://medium.com/cloudplatformengineering/understanding-seccomp-restricting-system-calls-for-security-3985fae97df8?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/3985fae97df8</guid>
            <category><![CDATA[seccomp]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 03:54:49 GMT</pubDate>
            <atom:updated>2025-03-09T03:57:43.591Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Seccomp?</h3><p>Seccomp (short for “secure computing”) is a Linux kernel feature that restricts the system calls a process can make. It reduces the attack surface by preventing unauthorized syscalls, making it a critical security mechanism for sandboxing applications.</p><p>Seccomp has two main modes:</p><ul><li><strong>Strict Mode</strong>: Only allows four syscalls — read(), write(), exit(), and sigreturn(). Any other syscall results in process termination.</li><li><strong>Filter Mode (seccomp-bpf)</strong>: Uses <strong>Berkeley Packet Filters (BPF)</strong> to define allowed and blocked syscalls dynamically. This mode provides fine-grained control over what a process can do.</li></ul><p>Once a process enters seccomp mode, it <strong>cannot revert</strong> to an unrestricted state. Any forked child processes inherit the restrictions, making it an effective containment tool.</p><h3>Enabling Seccomp: prctl(), seccomp(), and libseccomp</h3><p>To apply seccomp, developers use:</p><ul><li><strong>prctl(2)</strong>: The prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, filter) call enables seccomp in filter mode with a BPF filter.</li><li><strong>seccomp(2) syscall</strong>: Introduced in Linux 3.17, this provides better multi-threaded process support and filter management.</li><li><strong>Libseccomp</strong>: A user-friendly library that simplifies seccomp rule management, allowing developers to define syscall filters without writing raw BPF bytecode.</li></ul><p>For security, an unprivileged process must enable PR_SET_NO_NEW_PRIVS before applying seccomp to prevent privilege escalation.</p><h3>Seccomp in Containers: Docker, LXC, and Kubernetes</h3><h3>Docker and LXC</h3><p>Seccomp is widely used in containerized environments to prevent privilege escalation and syscall misuse.</p><ul><li><strong>Docker</strong>: By default, Docker applies a seccomp <strong>profile</strong> that blocks around 44 dangerous syscalls while allowing commonly used ones. Users can customize this profile via --security-opt seccomp=/path/to/profile.json.</li><li><strong>LXC</strong>: Uses seccomp to blacklist high-risk syscalls that could allow breaking out of the container, such as init_module, kexec_load, and open_by_handle_at.</li></ul><h3>Kubernetes and Seccomp</h3><p>Kubernetes leverages seccomp to enhance container security. It allows users to define seccomp profiles at different levels:</p><ul><li><strong>Pod Level</strong>: Seccomp can be configured in the securityContext of a Pod’s YAML definition.</li><li><strong>Container Level</strong>: Individual containers within a pod can have different seccomp profiles.</li><li><strong>Node-Level Defaults</strong>: Kubernetes distributions can set default seccomp profiles at the node level to enforce security policies cluster-wide.</li></ul><h4>Using Seccomp in Kubernetes</h4><p>A seccomp profile can be applied in Kubernetes using the securityContext.seccompProfile field:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: secure-pod<br>spec:<br>  securityContext:<br>    seccompProfile:<br>      type: RuntimeDefault<br>  containers:<br>    - name: nebula-graphd<br>      image: veyselsahin16/nebula-storaged:v3.6.0<br>      securityContext:<br>        seccompProfile:<br>          type: Localhost<br>          localhostProfile: profiles/seccomp.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCPOi3nCSTvh1VF7GrnLxQ.png" /></figure><p>Kubernetes supports the following seccomp profile types:</p><ul><li><strong>RuntimeDefault</strong>: Uses the default seccomp profile provided by the container runtime.</li><li><strong>Localhost</strong>: Loads a custom seccomp profile stored on the node.</li><li><strong>Unconfined</strong>: Disables seccomp for the container (not recommended for security-sensitive workloads).</li></ul><h4>Seccomp and Kubernetes Security Policies</h4><ul><li><strong>Pod Security Standards (PSS)</strong>: Enforce seccomp profiles at a namespace level to ensure compliance with security policies.</li><li><strong>Pod Security Admission (PSA)</strong>: Deprecates PodSecurityPolicies (PSP) but still allows restricting seccomp settings at the admission controller level.</li></ul><h4>Auditing and Logging Seccomp Violations</h4><p>Starting with Linux kernel 4.14, seccomp actions can be logged via /proc/sys/kernel/seccomp:</p><ul><li><strong>actions_avail</strong>: Lists supported seccomp actions.</li><li><strong>actions_logged</strong>: Defines which actions should be logged.</li></ul><p>By enabling seccomp logging, Kubernetes administrators can monitor blocked syscalls and refine security policies accordingly.</p><p>Seccomp is a lightweight yet powerful security mechanism for isolating processes by restricting their syscall access. By carefully configuring seccomp profiles, administrators can significantly reduce the attack surface and prevent privilege escalation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3985fae97df8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudplatformengineering/understanding-seccomp-restricting-system-calls-for-security-3985fae97df8">Understanding Seccomp: Restricting System Calls for Security</a> was originally published in <a href="https://medium.com/cloudplatformengineering">Cloud Platform Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Lambda Gotchas and Reminders — NodeJS]]></title>
            <link>https://medium.com/@veyselsahin/aws-lambda-gotchas-and-reminders-nodejs-7a684ac5cf48?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a684ac5cf48</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[lambda-function]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 06:39:43 GMT</pubDate>
            <atom:updated>2024-09-01T06:59:36.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kq5B1488Va5Ycu6P.png" /></figure><p>Hello, I usually like to keep notes for myself for the future. It’s unbelievable how little time has been spent on such notes and how much time they save whenever I need them. Even laying it down in draft form might save you a day if you’re not very eager to polish it.</p><p><em>Note that these things are not implied as best practices but rather shared as quick, short notes for a beginner or developer who wants to focus on the lambda functionality instead.</em></p><h4>Don’t forget removing “node_modules” before the last “npm update”</h4><p>Some error occurrences are inevitable if you build your node modules on a non-Linux system during development. For example, you can see both linux64 and darwin-x64. It’s been assumed that you are tweaking lambda functionality and you deploy your code by uploading a zip file regardless of how this approach is controversial:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*MW_5c7BZLemsF13PY2GBcg.png" /></figure><h4>Building modules for the relevant environment</h4><p>Linux-x64-based modules will not take place in the proper folders when the development is initiated in a non-Linux env, for example, from a MacOS.</p><p>There might be better methods to work around this problem, but I wanted to see the result as soon as possible, so I created a Dockerfile readily to build modules for the Linux-x64 environment. Your lambda code somehow(extremely fragile) might work even if you don’t build your modules for the environment, but I strongly recommend building modules according to the runtime environment. Lots of potential and complex problems can be avoided from the very first day, plus there are tons of benefits(Performant and secure runtime) you might gain this way.</p><pre>2024-09-01T03:37:56.151Z undefined ERROR Uncaught Exception  <br>{<br>    &quot;errorType&quot;: &quot;Error&quot;,<br>    &quot;errorMessage&quot;: &quot;Could not find ffmpeg executable, tried \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;, \&quot;/var/task/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot; and \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;&quot;,<br>    &quot;stack&quot;: [<br>        &quot;Error: Could not find ffmpeg executable, tried \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;, \&quot;/var/task/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot; and \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;&quot;,<br>        &quot;    at Object.intoError (file:///var/runtime/index.mjs:46:16)&quot;,<br>        &quot;    at Object.textErrorLogger [as logError] (file:///var/runtime/index.mjs:684:56)&quot;,<br>        &quot;    at process.&lt;anonymous&gt; (file:///var/runtime/index.mjs:1272:32)&quot;,<br>        &quot;    at process.emit (node:events:517:28)&quot;,<br>        &quot;    at process._fatalException (node:internal/process/execution:169:25)&quot;,<br>        &quot;    at loadESM (node:internal/process/esm_loader:40:33)&quot;,<br>        &quot;    at async handleMainPromise (node:internal/modules/run_main:106:12)&quot;<br>    ]<br>}</pre><h4>What did I do?</h4><p>I wrote a simple Dockerfile and executed a one-liner code to build my node_modules folder.</p><p>Note: Python is not mandatory, but It will be required to automate if your packages are built from source via `node-gyp` or `pre-build`.</p><pre>FROM node:18-bookworm<br><br>RUN apt-get update &amp;&amp; apt-get install -y \<br>    python3 \<br>    make \<br>    g++ \<br>    &amp;&amp; ln -s /usr/bin/python3 /usr/bin/python<br><br>WORKDIR /app<br>COPY package*.json /app/<br><br></pre><pre>rm -rf node_modules;\<br>docker build -t temporary-image:tag . &amp;&amp;  \<br>docker run -v /path/to/theapp:/app temporary-image:tag  sh -c &quot;npm install&quot; <br></pre><pre>[+] Building 0.3s (9/9) FINISHED                                                                                                                                                                            docker:orbstack<br> =&gt; [internal] load build definition from Dockerfile                                                                                                                                                                   0.0s<br> =&gt; =&gt; transferring dockerfile: 229B                                                                                                                                                                                   0.0s<br> =&gt; [internal] load metadata for docker.io/library/node:18-bookworm                                                                                                                                                    0.0s<br> =&gt; [internal] load .dockerignore                                                                                                                                                                                      0.0s<br> =&gt; =&gt; transferring context: 2B                                                                                                                                                                                        0.0s<br> =&gt; [1/4] FROM docker.io/library/node:18-bookworm                                                                                                                                                                      0.0s<br> =&gt; [internal] load build context                                                                                                                                                                                      0.0s<br> =&gt; =&gt; transferring context: 240B                                                                                                                                                                                      0.0s<br> =&gt; CACHED [2/4] RUN apt-get update &amp;&amp; apt-get install -y     python3     make     g++     &amp;&amp; ln -s /usr/bin/python3 /usr/bin/python                                                                                   0.0s<br> =&gt; CACHED [3/4] WORKDIR /app                                                                                                                                                                                          0.0s<br> =&gt; CACHED [4/4] COPY package*.json /app/                                                                                                                                                                              0.0s<br> =&gt; exporting to image                                                                                                                                                                                                 0.1s<br> =&gt; =&gt; exporting layers                                                                                                                                                                                                0.1s<br> =&gt; =&gt; writing image sha256:fcfe903c89d19dc89051fa18afebe3ece68742c969d6414801c2dbb92b310af6                                                                                                                           0.0s<br> =&gt; =&gt; naming to docker.io/library/temporary-image:tag                                                                                                                                                                 0.0s<br>npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.<br><br>added 70 packages, and audited 71 packages in 11s<br><br>20 packages are looking for funding<br>  run `npm fund` for details<br><br>found 0 vulnerabilities<br>npm notice<br>npm notice New minor version of npm available! 10.7.0 -&gt; 10.8.3<br>npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3<br>npm notice To update run: npm install -g npm@10.8.3<br>npm notice<br><br><br><br></pre><p>We reduce the archive size by removing unnecessary environment-related node_modules files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mn8Gma4Wfp1X8FaXQUv-mw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgeI0clZWatPb6KsqPSPOw.png" /></figure><h4>The Zip File</h4><p>All the application files, including node_modules, should be inside the zip file if you plan to deploy via uploading. With easy words, select all the files inside the project folder and compress them. There shouldn’t be any other folder covering the application files inside the zip file.</p><p>The error trace below is a symptom of a wrong zip file content.</p><pre>2024-09-01T03:37:56.151Z undefined ERROR Uncaught Exception  <br>{<br>    &quot;errorType&quot;: &quot;Error&quot;,<br>    &quot;errorMessage&quot;: &quot;Could not find ffmpeg executable, tried \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;, \&quot;/var/task/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot; and \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;&quot;,<br>    &quot;stack&quot;: [<br>        &quot;Error: Could not find ffmpeg executable, tried \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;, \&quot;/var/task/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot; and \&quot;/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg\&quot;&quot;,<br>        &quot;    at Object.intoError (file:///var/runtime/index.mjs:46:16)&quot;,<br>        &quot;    at Object.textErrorLogger [as logError] (file:///var/runtime/index.mjs:684:56)&quot;,<br>        &quot;    at process.&lt;anonymous&gt; (file:///var/runtime/index.mjs:1272:32)&quot;,<br>        &quot;    at process.emit (node:events:517:28)&quot;,<br>        &quot;    at process._fatalException (node:internal/process/execution:169:25)&quot;,<br>        &quot;    at loadESM (node:internal/process/esm_loader:40:33)&quot;,<br>        &quot;    at async handleMainPromise (node:internal/modules/run_main:106:12)&quot;<br>    ]<br>}</pre><h4>Highlight errors via `console.error`</h4><p>There are small differences in purpose between `console.log` and `console.error`. It’s better to use `console.error` if you intend to report an error and navigate through CloudWatch.</p><pre>console.error(`Something terrible happened`);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a684ac5cf48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goroutines and OpenTelemetry: Avoiding Common Pitfalls]]></title>
            <link>https://medium.com/@veyselsahin/goroutines-and-opentelemetry-avoiding-common-pitfalls-538688f10b68?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/538688f10b68</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Mon, 26 Aug 2024 03:15:11 GMT</pubDate>
            <atom:updated>2024-08-26T03:22:24.134Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qlP9wPI_y4Juq23N.jpeg" /></figure><p>In Go programming, goroutines are a powerful feature that allows for concurrent execution. When combined with OpenTelemetry for observability, they can create more efficient systems. However, this combination also introduces some potential pitfalls. In this article, we’ll explore these challenges and how to overcome them.</p><h4>1. Context Propagation: The Silent Killer</h4><p>One of the most common mistakes when working with goroutines and OpenTelemetry is failing to propagate the context properly. Let’s look at an example:</p><pre>func main() {<br>    ctx, span := otel.Tracer(&quot;main&quot;).Start(context.Background(), &quot;main&quot;)<br>    defer span.End()<br><br>    go incorrectWorker()<br>    <br>    go correctWorker(ctx)<br>}<br><br>func incorrectWorker() {<br>    fmt.Println(&quot;Incorrect worker: No trace context&quot;)<br>}<br><br>func correctWorker(ctx context.Context) {<br>    _, span := otel.Tracer(&quot;worker&quot;).Start(ctx, &quot;correctWorker&quot;)<br>    defer span.End()<br>    <br>    span.SetAttributes(attribute.String(&quot;worker&quot;, &quot;correct&quot;))<br>    fmt.Println(&quot;Correct worker: Has trace context&quot;)<br>}</pre><p>In the `incorrectWorker` function, we lose all trace context. This means any spans created within this goroutine will not be properly linked to the parent trace. Always pass the context to your goroutines to maintain the trace.</p><h4>2. Race Conditions: The Sneaky Bug</h4><p>When multiple goroutines access shared data, race conditions can occur. These are notoriously difficult to debug. Here’s how to avoid them:</p><pre>func unsafeWorker(data map[string]int) {<br>    // race condition...<br>    data[&quot;unsafe&quot;] = 1<br>}<br><br>func safeWorker(mu *sync.Mutex, data map[string]int) {<br>    mu.Lock()<br>    defer mu.Unlock()<br>    data[&quot;safe&quot;] = 1<br>}</pre><p>Always use appropriate synchronization mechanisms like mutexes when accessing shared data from multiple goroutines.</p><h4>3. Long-Running Goroutines: The Resource Leak</h4><p>Long-running goroutines can outlive their parent context, leading to resource leaks. Here’s how to handle them properly:</p><pre>func longRunningTask(ctx context.Context) {<br>    _, span := otel.Tracer(&quot;worker&quot;).Start(ctx, &quot;longRunningTask&quot;)<br>    defer span.End()<br><br>    for {<br>        select {<br>        case &lt;-ctx.Done():<br>            fmt.Println(&quot;Long-running task cancelled&quot;)<br>            return<br>        default:<br>           <br>            time.Sleep(1 * time.Second)<br>            fmt.Println(&quot;Long-running task working...&quot;)<br>        }<br>    }<br>}<br><br><br>ctx, cancel := context.WithTimeout(ctx, 5*time.Second)<br>defer cancel()<br>go longRunningTask(ctx)</pre><p>By respecting context cancellation, we ensure that long-running tasks can be gracefully terminated when needed.</p><h4>Best Practices</h4><ol><li><strong>Always propagate context</strong>: Pass the context to all goroutines that need to participate in the trace.</li></ol><p>2. <strong>Use synchronization</strong>: Employ mutexes, channels, or other synchronization primitives when accessing shared data.</p><p>3. <strong>Respect context cancellation</strong>: Design long-running goroutines to terminate when their context is cancelled.</p><p>4. <strong>End spans properly</strong>: Use `defer span.End()` immediately after creating a span to ensure it’s always closed.</p><p>5. <strong>Set meaningful attributes</strong>: Add attributes to spans to provide more context for your traces. Here are some examples:</p><pre><br><br> <br>    span.SetAttributes(<br>        attribute.String(&quot;order.id&quot;, orderID),<br>        attribute.Int(&quot;order.item_count&quot;, len(items)),<br>        attribute.Int(&quot;item.index&quot;, index),<br>        attribute.String(&quot;item.name&quot;, item),<br>    )<br><br>    span.SetAttributes(<br>        attribute.String(&quot;http.method&quot;, r.Method),<br>        attribute.String(&quot;http.route&quot;, r.URL.Path),<br>        attribute.String(&quot;http.user_agent&quot;, r.UserAgent()),<br>    )<br><br>    span.SetAttributes(<br>        attribute.String(&quot;db.system&quot;, &quot;postgresql&quot;),<br>        attribute.String(&quot;db.statement&quot;, query),<br>    )<br></pre><p>6. <strong>Handle errors</strong>: Implement proper error handling and propagation from goroutines back to the parent.</p><p>7. <strong>Avoid goroutine leaks</strong>: Ensure all goroutines have a way to terminate, either through completion or cancellation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=538688f10b68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OnPrem Kubernetes Best Practices]]></title>
            <link>https://medium.com/@veyselsahin/onprem-kubernetes-best-practices-ff37154bb63f?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff37154bb63f</guid>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Fri, 23 Aug 2024 20:23:44 GMT</pubDate>
            <atom:updated>2025-02-13T09:30:49.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>Don’t forget to limit consumption</h3><p>You may have to deal with many components, some of which might just be proof-of-concept. One of the most important things here is ensuring that the candidate tools’ deployments or statefulsets have resource limits. A little extra attention can prevent you from being a major incident responsible, especially a new system that you have to tune to handle a huge load. Possible bottlenecks on a chain of Kubernetes components can cause RAM, CPU, or Disk overuse. Such plumbing issues can take you into an entire cluster-level cascading failure.</p><h3>Avoid using node FS</h3><p>Even the most poor infrastructure deserves a Network File System. Using the node file system may result in two consequences in the future.</p><ol><li>It’s highly possible that you will start thinking about drainage or migration one day. This will be a more painful and inefficient way than establishing a NFS. Apart from the first two options, the worst case is a “<em>node corruption</em>”.</li><li>Using IaC tools will be either limited or risky. It will delete your data if you forget to migrate before a cluster-wide upgrade.</li></ol><p><strong>Balance between complexity and needs</strong><br>When designing your Kubernetes environment, aim to balance complexity with operational needs. Start with a minimal viable architecture and gradually add components only as necessary. Use Kubernetes-native tools and features to simplify management and avoid introducing unnecessary complexity. For example, use Kubernetes ConfigMaps and Secrets for configuration management rather than custom solutions. Regularly reassess your setup to ensure it meets current needs without becoming overly complex.</p><p><strong>RBAC and Audit</strong><br>Implementing robust Role-Based Access Control (RBAC) and auditing practices is essential for maintaining security and compliance in an on-premises Kubernetes cluster. Define granular roles and permissions to ensure that users and services only have access to the resources they need. Enable audit logging to track changes and access patterns, which can help in identifying and responding to potential security incidents. Regularly review and update RBAC policies and audit logs to maintain a secure and compliant environment.</p><p><strong>Fault tolerance</strong><br>To enhance fault tolerance in your Kubernetes environment, design your system with redundancy and failover capabilities. Use replication and high-availability configurations for critical components, such as etcd, and ensure that your pods are distributed across multiple nodes and availability zones. Implement backup and recovery strategies to safeguard against data loss and provide mechanisms for quick recovery in case of failures. Regularly test your failover and recovery processes to ensure they work as expected.</p><p><strong>Don’t put all eggs into one basket</strong><br>Avoid relying on a single point of failure by diversifying your infrastructure and implementing redundancy. Distribute your workloads across multiple nodes and clusters to prevent a single failure from impacting the entire system. Use multiple storage solutions and backup strategies to protect against data loss and ensure high availability. For example, combine local and cloud storage options to mitigate the risk of storage failures. Adopting a multi-cluster or hybrid-cloud approach can also enhance resilience and provide additional flexibility.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff37154bb63f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Organizations Should Implement OpenTelemetry]]></title>
            <link>https://medium.com/cloud-native-daily/opentelemetry-and-the-story-behind-it-45a68e52a0b6?source=rss-e9718362ab20------2</link>
            <guid isPermaLink="false">https://medium.com/p/45a68e52a0b6</guid>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[distributed-tracing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Veysel Şahin]]></dc:creator>
            <pubDate>Tue, 11 Jul 2023 22:50:41 GMT</pubDate>
            <atom:updated>2023-08-16T22:53:49.009Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn why companies should have an observability platform, the benefits of implementing OpenTelemetry and its best practices.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nfhkFD0aBDEeK-FI.png" /></figure><p>In this topic, I will explain what circumstances forced companies to use OpenTelemetry (OpenCensus+OpenTracing) and what I am trying to accomplish to have better observability.</p><p>First of all, instead of talking about the things that a couple of googling can find, I will try explaining the philosophy behind “<em>Why OpenTelemetry should be implemented in any case.</em>”</p><blockquote>OpenTelemetry is free freedom.</blockquote><p>What does it mean? All companies are not in the shape of paying thousands of dollars per user, per byte, per line, per container per month, but all companies should have an observability infrastructure. One of the paid solutions might be selected regardless of business or company. OpenTelemetry supports all these cases. You can even use NewRelic or DataDog after implementing OpenTelemetry into your application.</p><h4><strong>Why should we have an observability platform?</strong></h4><p>Let’s talk about evolving of applications first. Even five years ago, most developers weren’t aware of service architecture, but most things weren’t accessible with a couple of button clicks. Our habits have changed. This change brought dozens of challenges to the application development lifecycle. For example, e-mail notifications could be handled simultaneously as all remaining transaction pieces in the monolith application era. If you want to buy something, database CRUD, notification, payment, and shipping are in the same request. Once one of these processes somehow failed, the entire form inputs were wasted, and the sale wouldn’t occur. This is an unacceptable situation for requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OxA_0U9TCtC928PZ.png" /></figure><p>Regardless of long-time processes like e-mailing, working parts should be distinguished from non-working parts. Also, multiple teams with multiple approaches would make the development process flexible. A high-volume and wide application can’t be written with only language since application requirements must interact with various infrastructure layers. For example, some application parts should be written in Golang, and some should not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*quI8oPZOSqR2Eg_Q.jpg" /></figure><p>All these requirements brought microservice architecture with its own challenges. APMs were enough during the monolith era, but now a correlation has become a requirement across all running services since transactions spread across services.</p><p>From the user&#39;s first click to the notification, e-mails should be tracked and correlated with each other in a context to understand and address the root cause of a problem.</p><h4><strong>Distributed Tracing</strong></h4><p>You should be aware of what is happening between services, and You should be aware of which services are misbehaving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*o7dtKI5mZHm_k3UYBR-npg.png" /></figure><p>With the classic APM approach, it wasn’t possible, and actually, it wasn&#39;t necessary to correlate things since the application was working like only one piece.</p><p>OpenTelemetry provides standardized APIs, libraries, and instrumentation to collect observability data from various components of an application, including code, frameworks, libraries, and infrastructure. It seamlessly integrates with different programming languages and platforms, enabling developers to instrument their code and capture telemetry data effortlessly.</p><p>By implementing OpenTelemetry, developers can easily add distributed tracing, metrics, and logging capabilities to their applications. The captured data is then propagated and correlated across various services, allowing for end-to-end visibility and analysis of the application’s performance and behavior.</p><p>OpenTelemetry achieves interoperability and consistency through its vendor-agnostic approach. It promotes open standards and collaboration within the observability community, ensuring that developers can seamlessly switch between different monitoring and analysis tools without being tied to a specific vendor or technology stack.</p><p>This flexible and standardized approach of OpenTelemetry empowers developers to gain deep insights into the behavior and performance of their distributed systems, facilitating troubleshooting, optimization, and continuous improvement of their applications.</p><h4><strong>How it works</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dqtW5nSs_P9vmwCq.jpg" /></figure><h4><strong>At which point you need to be careful</strong></h4><p><strong><em>Keep the learning curve least</em></strong></p><p>It doesn’t matter how long you have been working as an IT staff you should start as much as simple as possible. I can recommend that there is a GitHub folder under the opentelemetry repository and you can find some example applications to make a good start. The important thing is that docker-compose files are very useful for understanding OpenTelemetry on the first day.</p><p><strong><em>Instrumentation strategy</em></strong></p><p>You need to select the service that has the least load. If you are unfamiliar with OpenTelemetry, I strongly recommend starting with baby steps. The OpenTelemetry infrastructure requirements might seem pretty complex to you. There are lots of configuration parameters you need to tune based on your application load. Things don’t always work as they look in a non-prod environment.</p><p>Based on your instrumentation selection, I can say that don’t instrument all libraries at once. Enable one instrumentation, watch the system for at least a few hours, then enable another. Otherwise, some instrumentations can break the system by making it extremely slow. Gradually enable OpenTelemetry and delay most mission-critical operations and services to the end of the day.</p><p><strong><em>Collectors should be monitored</em></strong></p><p>The OpenTelemetry collector has its own Prometheus format exporter built-in. You can track the collectors by creating a simple ServiceMonitor and Grafana dashboard. It’s possible to see some slowness during the lack of collector.</p><p><strong><em>Keep control of OpenTelemetry instrumentation</em></strong></p><p>I put if conditions into services to exclude executing OpenTelemetry-related code by passing an environment name OTEL_ENABLED. There are some additional environment variables like NOOP to suspend instrumentation but I decided to avoid all possible issues related to OpenTelemetry when an incident happened. You should be able to exclude even docker-entrypoints when a suspicious situation arises.</p><h4>Further Reading:</h4><ul><li><a href="https://gethelios.dev/opentelemetry-a-full-guide/?utm_source=medium&amp;utm_medium=cloud+native+daily">OpenTelemetry: A full guide</a></li><li><a href="https://gethelios.dev/blog/api-observability-leveraging-otel-to-improve-developer-experience/?utm_source=medium&amp;utm_medium=referral&amp;utm_campaign=cloud+native+daily">API observability: Leveraging OTel to improve developer experience</a></li><li><a href="https://medium.com/cloud-native-daily/distributed-tracing-a-guide-for-2023-a40a1ee218b5">Distributed Tracing: A Guide for 2023</a></li><li><a href="https://gethelios.dev/blog/serverless-observability/?utm_source=medium&amp;utm_medium=cloud+native+daily">Serverless observability, monitoring, and debugging explained</a></li><li><a href="https://gethelios.dev/blog/combinining-opentelemetry-traces-with-prometheus-metrics-to-build-a-powerful-alerting-mechanism/?utm_source=medium&amp;utm_medium=referral&amp;utm_campaign=cloud+native+daily">Combining OTel and Prometheus metrics for alerting machine</a></li><li><a href="https://javascript.plainenglish.io/9-best-distributed-tracing-tools-for-developers-185e415b7101">9 Best Distributed Tracing Tools for Developers</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45a68e52a0b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-native-daily/opentelemetry-and-the-story-behind-it-45a68e52a0b6">Why Organizations Should Implement OpenTelemetry</a> was originally published in <a href="https://medium.com/cloud-native-daily">Cloud Native Daily</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>