<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zouyee</title>
    <description>The latest articles on DEV Community by zouyee (@zouyee).</description>
    <link>https://dev.to/zouyee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2015578%2F96ffccb7-e190-48b4-bae2-cb956a15d704.png</url>
      <title>DEV Community: zouyee</title>
      <link>https://dev.to/zouyee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zouyee"/>
    <language>en</language>
    <item>
      <title>Introducing llmlite: The First Unified LLM Provider Library for the @ZigLang Ecosystem</title>
      <dc:creator>zouyee</dc:creator>
      <pubDate>Sun, 05 Apr 2026 13:51:18 +0000</pubDate>
      <link>https://dev.to/zouyee/introducing-llmlite-the-first-unified-llm-provider-library-for-the-ziglang-ecosystem-33l4</link>
      <guid>https://dev.to/zouyee/introducing-llmlite-the-first-unified-llm-provider-library-for-the-ziglang-ecosystem-33l4</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;I'm excited to share a project I've been working on, llmlite.&lt;/p&gt;

&lt;p&gt;It's an open-source library that aims to be the first unified LLM (Large Language Model) provider library for the Zig programming language.&lt;/p&gt;

&lt;p&gt;While LLM ecosystems are booming in other languages, Zig developers often have to manually integrate different APIs or use heavy C bindings. llmlite seeks to solve that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why llmlite? Our Core Design Goals:
&lt;/h3&gt;

&lt;p&gt;A Unified API: The goal is not just one more API wrapper. It provides a common interface for multiple LLMs.&lt;/p&gt;

&lt;p&gt;Priority Support for Key Suites: We have initially focused on supporting the complete API suites of GenAI and Minimax.&lt;/p&gt;

&lt;p&gt;Zig-First, Zero Dependencies: We are committed to a zero-dependency build, maximizing performance, reducing security surface area, and maintaining the minimalist philosophy of Zig.&lt;/p&gt;

&lt;p&gt;Full Compile-Time Type Safety: Leveraging Zig's compile-time capabilities, we ensure that your LLM interactions are as type-safe as possible before your code even runs.&lt;/p&gt;

&lt;p&gt;Lightweight: The entire library is ~500KB.&lt;/p&gt;

&lt;p&gt;Features Supported:&lt;/p&gt;

&lt;p&gt;Streaming &amp;amp; Embeddings&lt;/p&gt;

&lt;p&gt;Context Caching &amp;amp; Tuning&lt;/p&gt;

&lt;p&gt;(And more as we expand the list of providers)&lt;/p&gt;

&lt;p&gt;System Requirements:&lt;/p&gt;

&lt;p&gt;Zig 0.15+&lt;/p&gt;

&lt;p&gt;Apache 2.0 License&lt;/p&gt;

&lt;p&gt;We would love for you to try it out, critique the code, and contribute to its development. Our goal is to make AI development in Zig as seamless and robust as possible.&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/zouyee/llmlite" rel="noopener noreferrer"&gt;https://github.com/zouyee/llmlite&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for your time. Questions and feedback are very welcome in the comments!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Embracing Cgroup V2:Best Practices for Migrating Kubernetes Clusters to AlmaLinux</title>
      <dc:creator>zouyee</dc:creator>
      <pubDate>Fri, 13 Sep 2024 03:19:30 +0000</pubDate>
      <link>https://dev.to/zouyee/embracing-cgroup-v2best-practices-for-migrating-kubernetes-clusters-to-almalinux-37np</link>
      <guid>https://dev.to/zouyee/embracing-cgroup-v2best-practices-for-migrating-kubernetes-clusters-to-almalinux-37np</guid>
      <description>&lt;p&gt;With the announcement of CentOS discontinuation by the CentOS community , along with the set dates for service termination, we have put the switch to a new container operating system on our agenda. Based on factors such as migration cost, smoothness of transition, and maintenance difficulty, we have chosen AlmaLinux from the RHEL series as an alternative solution.&lt;/p&gt;

&lt;p&gt;NOTE: AlmaLinux is just one of the replacement options available within the RHEL ecosystem. Our choice is based on our specific production needs and does not necessarily apply to everyone.&lt;/p&gt;

&lt;p&gt;AlmaLinux 9 defaults to using cgroup v2, and this configuration affects some underlying components. Therefore, certain adaptations and compatibility work need to be done. This article presents the best practices for migrating Kubernetes cluster nodes from CentOS to AlmaLinux which involves removing dockershim and utilizing cgroup v2 for node resource management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Cgroup v2?
&lt;/h2&gt;

&lt;p&gt;Effective resource management is a critical aspect of Kubernetes. This involves managing the finite resources in your nodes, such as CPU, memory, and storage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cgroups&lt;/em&gt; are a Linux kernel capability that establish resource management functionality like limiting CPU usage or setting memory limits for running processes.&lt;/p&gt;

&lt;p&gt;When you use the resource management capabilities in Kubernetes, such as configuring requests and limits for Pods and containers, Kubernetes uses cgroups to enforce your resource requests and limits.&lt;/p&gt;

&lt;p&gt;The Linux kernel offers two versions of cgroups: cgroup v1 and v2.&lt;/p&gt;

&lt;p&gt;Here is our comparison between the two versions based on our research:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;cgroup v1&lt;/th&gt;
&lt;th&gt;cgroup v2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Maintainability&lt;/td&gt;
&lt;td&gt;deprecate and systemd community intend to remove cgroup v1 support from systemd release after the end of 2023&lt;/td&gt;
&lt;td&gt;Many recent releases of Linux distributions have switched over to cgroup v2 by default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compatibility&lt;/td&gt;
&lt;td&gt;support&lt;/td&gt;
&lt;td&gt;1. Components such as kubelet need to be adapted for cgroup v2 2. Business applications require JDK version upgrades, which can be achieved by replacing the base image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hierarchy&lt;/td&gt;
&lt;td&gt;multiple hierarchies，it wasn't useful and complicated in practice&lt;/td&gt;
&lt;td&gt;single unified hierarchy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;resource allocation management&lt;/td&gt;
&lt;td&gt;basic&lt;/td&gt;
&lt;td&gt;more powerful、dynamic and enhanced resource allocation management，such as the following： • Unified accounting for different types of memory allocations (network and kernel memory, etc) • Accounting for non-immediate resource changes such as page cache write backs • Safer sub-tree delegation to containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;support for multiple hierarchies came at a steep cost&lt;/td&gt;
&lt;td&gt;better&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scalability&lt;/td&gt;
&lt;td&gt;it seemed to provide a high level of flexibility,  but it wasn't useful in practice&lt;/td&gt;
&lt;td&gt;provide a high level of flexibility ，new features like PSI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;the known CVEs, such as cve-2022-0492、cve-2021-4154&lt;/td&gt;
&lt;td&gt;support rootless container&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;cgroup v2 has been in development in the Linux Kernel since 2016 and in recent years has matured across the container ecosystem. With Kubernetes 1.25, cgroup v2 support has graduated to general availability.&lt;/p&gt;

&lt;h2&gt;
  
  
  What issues were encountered？
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Java applications
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://bugs.openjdk.org/browse/JDK-8146115" rel="noopener noreferrer"&gt;JDK-8146115&lt;/a&gt; added Hotspot runtime support for JVMs running in Docker containers. At the time Docker used cgroups v1 and, hence, runtime support only includes cgroup v1 controllers.&lt;/p&gt;

&lt;p&gt;JDK-8230305 extended functionality of &lt;a href="https://bugs.openjdk.org/browse/JDK-8146115" rel="noopener noreferrer"&gt;JDK-8146115&lt;/a&gt; to also detect cgroups v2. That is iff cgroups v2 unified hierarchy is available only, use the cgroups v2 backend. Otherwise fall back to existing cgroups v1 container support.&lt;/p&gt;

&lt;p&gt;require version：jdk8u372, 11.0.16, 15 and later&lt;/p&gt;

&lt;h3&gt;
  
  
  Kubernetes
&lt;/h3&gt;

&lt;p&gt;Currently,  the version of Kubernetes in production is 1.19 and enabling cgroup v2 support for kubelet is proving to be challenging. While a comprehensive upgrade of Kubernetes is being researched and prepared, we are currently focusing on implementing cgroup v2 support specifically for kubelet. This approach allows for a shorter implementation time while laying the foundation for the subsequent comprehensive upgrade.&lt;/p&gt;

&lt;p&gt;To enable cgroup v2 support, several adjustments need to be made to various components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kernel Version: We are currently using kernel version 5.15, which meets the minimum requirement for cgroup v2 (4.14). However, it is recommended to use kernel version 5.2 or newer due to the lack of freezer support in older versions.&lt;/li&gt;
&lt;li&gt;Systemd and Runc: It is highly recommended to run runc with the systemd cgroup driver (&lt;code&gt;runc --systemd-cgroup&lt;/code&gt;), although it is not mandatory. To ensure compatibility, it is recommended to use systemd version 244 or later, as older versions do not support delegation of the &lt;code&gt;cpuset&lt;/code&gt; controller.&lt;/li&gt;
&lt;li&gt;Kubelet : The vendor for kubelet needs to upgrade the runc version. Currently, the latest fully supported version of runc for cgroup v2 is rc93. To minimize changes, we have chosen rc94 and modified the kubelet code to internally maintain runc rc94. This allows us to merge the necessary cgroup v2-related pull requests. However, in rc95, there are significant changes to the cgroup.Manager interface, which does not align with the principle of minimal changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;metrics-server retrieves resource usage information of nodes and pods using kubelet summary and other interfaces. This data is crucial for Horizontal Pod Autoscaling (HPA) based on resource scaling. To eliminate dockershim, the kubelet should utilize the systemd cgroup driver and configure the runtime accordingly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;--container-runtime&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;remote &lt;span class="nt"&gt;--container-runtime-endpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;unix:///run/containerd/containerd.sock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Containerd : starting from version 1.4, containerd supports cgroup v2. We have successfully validated the removal of dockershim and conducted thorough testing of business operations in the testing environment. With the successful testing, we will proceed with the production rollout. Similar to kubelet, containerd also requires the systemd cgroup driver. Use the following configuration for the systemd cgroup driver:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;plugins.&lt;span class="s2"&gt;"io.containerd.grpc.v1.cri"&lt;/span&gt;.containerd.runtimes.runc]
  ...
  &lt;span class="o"&gt;[&lt;/span&gt;plugins.&lt;span class="s2"&gt;"io.containerd.grpc.v1.cri"&lt;/span&gt;.containerd.runtimes.runc.options]
    SystemdCgroup &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration of the sandbox image and registry can be customized based on specific requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Systemd with cilium
&lt;/h3&gt;

&lt;p&gt;SystemD versions greater than 245 automatically set the rp_filter value to 1 for all network interfaces. This conflicts with Cilium, which requires rp_filter to be 0 on its interfaces, leading to a disruption in out-of-node IPv4 traffic.&lt;/p&gt;

&lt;p&gt;Therefore, it is crucial to exercise caution before upgrading SystemD, as demonstrated by the failure experienced by Datadog, which served as a significant warning.&lt;/p&gt;

&lt;p&gt;on March 8, 2023, at 06:00 UTC, a security update to systemd was automatically applied to several VMs, which caused a latent adverse interaction in the network stack (on Ubuntu 22.04 via systemd v249) to manifest upon systemd-networkd restarting.Namely, &lt;code&gt;systemd-networkd&lt;/code&gt; forcibly deleted the routes managed by the Container Network Interface (CNI) plugin (Cilium) we use for communication between containers. This caused the affected nodes to go offline.&lt;/p&gt;

&lt;p&gt;Additionally, when container runtimes are configured with cgroup v2, the Cilium agent pod is deployed in a separate cgroup namespace. For example, Docker container runtime with cgroupv2 support defaults to private cgroup namespace mode. Due to cgroup namespaces, the Cilium pod's cgroup filesystem points to a virtualized hierarchy instead of the host cgroup root. Consequently, BPF programs are attached to the nested cgroup root, rendering socket load balancing ineffective for other pods. To address this limitation, work is being done in the Cilium project  to revisit assumptions made around cgroup hierarchies and enable socket load balancing in different environments.&lt;/p&gt;

&lt;p&gt;Don't worry, these issues have already been fixed by the community.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;During the testing process of Cgroup V2 and removing dockershim in our testing environment, we conducted extensive adaptation and stability tests. Our long-term analysis revealed that the benefits of adopting this technology roadmap far outweigh the initial investment. As part of our plan, we intend to promote the adoption of Cgroup V2-based machines in production. This will involve a meticulous testing and validation process, followed by a gradual rollout in production environments. We will start with offline applications such as logging and big data applications.&lt;/p&gt;

&lt;p&gt;The Cloud Native Computing Foundation’s flagship conference gathers adopters and technologists from leading open source and cloud native communities in Shanghai, China from 26-28 September, 2023.  We are considering submitting a proposal for a presentation at KubeCon 2023, where we will have the opportunity to share the latest developments and insights with the conference attendees.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bugs.openjdk.org/browse/JDK-8230305" rel="noopener noreferrer"&gt;https://bugs.openjdk.org/browse/JDK-8230305&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kubernetes.io/blog/2022/08/31/cgroupv2-ga-1-25/" rel="noopener noreferrer"&gt;https://kubernetes.io/blog/2022/08/31/cgroupv2-ga-1-25/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html" rel="noopener noreferrer"&gt;https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cilium/cilium/issues/10645" rel="noopener noreferrer"&gt;https://github.com/cilium/cilium/issues/10645&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zoues.com/posts/58fc8d19/" rel="noopener noreferrer"&gt;https://zoues.com/posts/58fc8d19/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>cloudnative</category>
      <category>linux</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
