<?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 Preston Turner Jr on Medium]]></title>
        <description><![CDATA[Stories by Preston Turner Jr on Medium]]></description>
        <link>https://medium.com/@prestonturner?source=rss-1e75db4fe92d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6qkL48kov6Wa4zQ6NsGkwA@2x.jpeg</url>
            <title>Stories by Preston Turner Jr on Medium</title>
            <link>https://medium.com/@prestonturner?source=rss-1e75db4fe92d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:07:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prestonturner/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[Stargate, The AI Frontier or a Risky Gamble?]]></title>
            <link>https://medium.com/@prestonturner/stargate-the-ai-frontier-or-a-risky-gamble-fda44578e414?source=rss-1e75db4fe92d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fda44578e414</guid>
            <dc:creator><![CDATA[Preston Turner Jr]]></dc:creator>
            <pubDate>Sat, 25 Jan 2025 01:09:01 GMT</pubDate>
            <atom:updated>2025-01-25T01:14:22.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qe2zPa_TL1-3IEuChROvFw.jpeg" /></figure><p>When President Trump revoked Executive Order 14110 earlier this month, the decision flew under the radar for most Americans. But for those of us tuned into the artificial intelligence (AI) space, this move felt less like deregulation and more like opening Pandora’s Box — with a Stargate waiting on the other side. The timing? Too coincidental to ignore. Let’s break this down.</p><h4><strong>Executive Order 14110 — A Safety Net for AI</strong></h4><p>Signed in October 2023, Executive Order 14110 was an ambitious effort to set guardrails on AI development. It wasn’t just another piece of bureaucratic noise — this was a framework to address the very real dangers AI poses to society. Think synthetic biology misuse, AI-generated cyber threats, or unchecked bias in algorithms shaping public policy. It mandated rigorous testing for dual-use AI systems and required transparency from developers working on models capable of influencing critical infrastructure or public health.</p><p>For the technical readers, the EO emphasized developing a structured testing framework — like AI red-teaming — to identify flaws, biases, or vulnerabilities. For everyone else, think of it as requiring companies to crash-test AI models before putting them on the road. The EO wasn’t perfect, but it was a step in the right direction — a rare acknowledgment that while AI can elevate humanity, it can also burn us if left unchecked.</p><h3><strong>Enter Stargate</strong></h3><p>Fast forward to 2025. Weeks after rescinding EO 14110, Trump unveiled the Stargate project, a $500 billion initiative in collaboration with OpenAI, Oracle, SoftBank, and a who’s who of Silicon Valley and global finance. Stargate aims to catapult America to the forefront of AI infrastructure, promising massive data centers, power plants, and a competitive edge in global AI development.</p><p>It’s a bold move, no doubt. But bold doesn’t always mean wise.</p><h4>Risks in the Shadows</h4><ul><li><em>Unchecked AI Deployment</em><strong> -</strong> With no mandate for safety evaluations, developers can release AI systems without understanding their full implications. Imagine systems designed for healthcare diagnostics being repurposed — or hacked — for malicious intent. For the non-technical reader, this is like leaving a loaded gun unattended in a crowded room.</li><li><em>Ethical Black Holes</em><strong> -</strong> EO 14110 prioritized transparency and accountability. Without it, we’re left with a Wild West of AI, where the race to innovate might overshadow concerns like bias, discrimination, or surveillance creep. Think about apps or algorithms making life-altering decisions without proper safeguards.</li><li><em>National Security Blind Spots</em><strong> -</strong> Stargate’s scale is impressive, but what happens when this infrastructure is targeted? AI’s complexity makes it both a weapon and a vulnerability. A compromised large-language model or infrastructure breach could spell disaster. Imagine hackers weaponizing AI to destabilize critical systems.</li><li><em>Economic Disruption</em><strong> -</strong> Stargate’s promise of jobs is alluring, but we can’t ignore the other edge of the sword: automation. Without guardrails, we risk accelerating job displacement at a rate society isn’t prepared to handle. Picture entire industries replaced by machines overnight.</li></ul><h4>What’s the Play Here?</h4><p>Stargate is being framed as a project to secure America’s AI dominance. But at what cost? The lack of oversight means we’re pushing innovation at the expense of safety, ethics, and, arguably, public trust. While competition with countries like China is a valid concern, gutting internal regulations isn’t the answer.</p><h4>So What Can You Do About It?</h4><p>For those of us watching this unfold, it’s tempting to feel powerless. But there are ways to stay engaged:</p><ul><li><em>Stay Informed</em><strong> -</strong> Understanding the implications of policies like EO 14110 and projects like Stargate is half the battle. Knowledge equips you to ask the right questions.</li><li><em>Speak Up</em><strong> -</strong> Whether you’re a developer, an academic, or just someone who uses AI-enabled devices, your voice matters. Public discourse can push leaders to reconsider reckless decisions.</li><li><em>Support Ethical AI</em><strong> -</strong> Look for organizations, companies, and leaders prioritizing safe and transparent AI practices. Dollars speak louder than words.</li></ul><h4>A Call to Action</h4><p>If we’ve learned anything from technological revolutions, it’s that the long game matters. Rushing headfirst into AI supremacy without considering the consequences is reckless. We need:</p><ul><li><em>A Balanced Framework</em><strong> -</strong> Innovation thrives in structure. Reinstating and updating a version of EO 14110 could ensure safety without stifling progress.</li><li><em>Global Collaboration</em><strong> -</strong> AI’s risks are global. Partnering with allies to establish international standards could prevent misuse while fostering innovation.</li><li><em>Public Awareness</em><strong> -</strong> People need to understand the stakes. Transparency around projects like Stargate isn’t just good ethics — it’s essential for public trust.</li></ul><p>Stargate has the potential to be a monumental step forward for AI, but it’s also a flashing neon warning sign. Without safeguards, we’re playing with fire — and the burn might not just hurt America but the entire world.</p><p>If there’s ever been a time to ask hard questions and demand accountability, it’s now. Because once we step through this Stargate, there’s no turning back.</p><p>Let’s make sure we know where it leads.</p><p>link to Executive Order 14110:</p><p><a href="https://www.govinfo.gov/app/details/CFR-2024-title3-vol1/CFR-2024-title3-vol1-eo14110/summary">https://www.govinfo.gov/app/details/CFR-2024-title3-vol1/CFR-2024-title3-vol1-eo14110/summary</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fda44578e414" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution of Containerization: From cgroups and Namespaces to OCI Images]]></title>
            <link>https://medium.com/@prestonturner/the-evolution-of-containerization-from-cgroups-and-namespaces-to-oci-images-ba707fb9cb8e?source=rss-1e75db4fe92d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba707fb9cb8e</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Preston Turner Jr]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 13:25:47 GMT</pubDate>
            <atom:updated>2024-09-10T15:36:47.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XJXXiO_-NGe46PN" /></figure><p>Today, we’re diving into a topic that’s near and dear to my heart — <strong>containers</strong>. If you’ve been working in this field for any amount of time, you know containerization has reshaped how we think about building, shipping, and running applications. But have you ever stopped to ask <em>how</em> we got here? It wasn’t always this simple!</p><p>I’m going to walk you through the journey from using Linux’s <strong>cgroups</strong> and <strong>namespaces</strong> to where we are now with <strong>OCI images</strong>. We’ll also look at why developers struggled with early container technologies, how OCI images solved those issues, and how today’s container daemons are making it all easier. And, as promised, I’ll drop in a real-world example with a Flask app to show you how to containerize your projects like a pro.</p><p>Let’s dive in!</p><h3>The OGs of Containerization: cgroups and Namespaces</h3><p>Before we had Docker and OCI images, Linux containers were powered by two key technologies: <strong>control groups (cgroups)</strong> and <strong>namespaces</strong>. These features helped isolate and manage applications running on the same system, forming the bedrock of early container efforts. If you could master cgroups and namespaces, you were the container boss — except it wasn’t always easy.</p><ul><li><strong>cgroups</strong> allowed us to control resource usage (CPU, memory, disk I/O) by grouping processes and setting limits.</li><li><strong>namespaces</strong> isolated system resources (like network interfaces or file systems), meaning each container had its own version of these resources, fully separate from other containers on the system.</li></ul><p>For a while, this was the best we had to virtualize apps without spinning up heavy VMs. It gave us that lightweight isolation, but if you’ve ever tried working with these tools directly, you’ll know it’s not exactly a picnic.</p><h3>Why Developers Struggled</h3><p>The truth is, while cgroups and namespaces were foundational, they weren’t easy to use, especially if you’re trying to <strong>scale</strong>.</p><ol><li><strong>Manual Configuration Headaches</strong>: Setting up cgroups and namespaces manually was painful. You needed to tinker with kernel-level settings, and mistakes could easily result in security vulnerabilities or resource management problems.</li><li><strong>No Standard Way to Package Apps</strong>: Developers had to piece together dependencies and configuration files themselves. You couldn’t just “hand over” an app in a neat bundle. Running the same app in multiple environments? Good luck with that.</li><li><strong>Security Shortcomings</strong>: While cgroups and namespaces provided isolation, the boundaries weren’t always as tight as we’d want for secure, multi-tenant environments. Managing security at the kernel level isn’t exactly beginner-friendly, either.</li><li><strong>Resource Management</strong>: Sure, you could set resource limits with cgroups, but tracking, tuning, and enforcing them was complex — especially when dealing with complex applications. There wasn’t a neat, bundled solution.</li></ol><h3>Enter OCI Images: Game-Changer Mode Activated</h3><p>Around 2015, things started to shift with the rise of <strong>OCI images</strong>. The <strong>Open Container Initiative (OCI)</strong> standardized how we build and run containers, and suddenly, everyone was speaking the same language when it came to containers. But the real win? Developers didn’t need to wrestle with cgroups and namespaces manually anymore. Now, it was all abstracted into a simpler, more powerful format.</p><p>Here’s why OCI images were an absolute game-changer:</p><ol><li><strong>Consistency Across Platforms</strong>: OCI images created a standard format for containers, so you could run the same image in any environment — whether it’s a local machine, a cloud server, or Kubernetes. No more “works on my machine” excuses!</li><li><strong>Developer-Friendly</strong>: OCI images let us define everything in a <strong>Dockerfile</strong> (or similar tools), bundling the app, its dependencies, and environment configuration into one neat package. No more complicated setups!</li><li><strong>Security Improvements</strong>: Thanks to improved isolation techniques and better support for modern container runtimes, we got containers that are way more secure by default. Plus, the container ecosystems evolved rapidly to give us better tools for scanning, signing, and locking down images.</li><li><strong>Layering FTW</strong>: OCI images are built in <strong>layers</strong>, which means if you update just one piece of your app, you don’t have to rebuild the whole image. This is a huge time-saver, especially in large-scale deployments.</li></ol><h3>The Role of OCI Image Daemons</h3><p>So, what exactly is an <strong>OCI image daemon</strong>? Glad you asked.</p><p>An OCI image daemon is essentially the background process that handles all things related to images and containers — building, pulling, running, you name it. If you’re familiar with Docker, you already know the role daemons play.</p><p>Some of the most popular OCI image daemons you’ll encounter:</p><ul><li><strong>Docker Daemon</strong>: Still the go-to for many developers, Docker’s daemon manages container lifecycles, from building to running to tearing down containers.</li><li><strong>containerd</strong>: This is a lighter-weight daemon often used by Kubernetes under the hood. It focuses solely on managing container lifecycles without the extra fluff Docker has.</li><li><strong>CRI-O</strong>: Built to be Kubernetes-native, CRI-O is another daemon designed for running OCI-compliant containers with minimal overhead.</li></ul><h3>Putting It All Together: A Flask App in a Container</h3><p>Alright, enough theory. Let’s get practical and show you how to package a simple <strong>Flask</strong> app into a container using a <strong>Dockerfile</strong>.</p><h4>The Flask App (app.py)</h4><pre>from flask import Flask<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def hello_world():<br>    return &#39;Hello, OCI C;ontainers!&#39;<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=5000)</pre><h4>Writing the Dockerfile</h4><p>A <strong>Dockerfile</strong> is where you define your container environment. Think of it as a blueprint for how to package your app with all its dependencies.</p><pre># Use the official Python image as a base<br>FROM python:3.10-slim<br><br># Set the working directory<br>WORKDIR /app<br><br># Copy the current directory contents into the container at /app<br>COPY . .<br><br># Install the required Python packages<br>RUN pip install --no-cache-dir flask<br><br># Expose the port the Flask app runs on<br>EXPOSE 5000<br><br># Command to run the app<br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><h4>Building and Running Your Flask Container</h4><p>Now, the fun part: using Docker to build and run your container.</p><p>Build the Docker Image:</p><pre>docker build -t flask-oci-app .</pre><p>This command builds the image and tags it flask-oci-app.</p><p>Run the Container:</p><pre>docker run -d --name flask-app -p 5000:5000 flask-oci-app</pre><p>This runs the container in detached mode (-d) and maps port 5000 on your host to port 5000 in the container.</p><p>Check the running container:</p><pre>docker ps</pre><p>Here you’ll see your Flask app container humming along.</p><p>Stop the container:</p><pre>docker stop flask-app</pre><p>Boom, you’ve got a Flask app running in a fully containerized environment! This simple workflow shows just how powerful OCI images (and Docker) are when compared to the old days of manual cgroup and namespace wrangling.</p><h3>Wrapping Up</h3><p>The move from <strong>cgroups</strong> and <strong>namespaces</strong> to <strong>OCI images</strong> transformed how we think about containers. Developers no longer need to manually configure every aspect of resource control or isolation — <strong>OCI images</strong> handle that for us, in a standard, secure, and efficient way. Tools like Docker and containerd provide an intuitive interface on top of these innovations, making containerization something everyone can take advantage of.</p><p>If you’re a junior DevSecOps engineer, understanding how OCI images have revolutionized the landscape is a key part of your journey. This is where modern software is headed — fast, secure, and efficient containerization.</p><p>Stay tuned for more blogs where we’ll dive deeper into container security, container orchestration, and everything else that makes DevSecOps tick.</p><p>Until next time, keep shipping, keep securing, and keep learning! ✌️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba707fb9cb8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Run a Flask Application in a Minimal Container-Like Environment Using cgroups and Namespaces…]]></title>
            <link>https://medium.com/@prestonturner/how-to-run-a-flask-application-in-a-minimal-container-like-environment-using-cgroups-and-namespaces-9604628944c0?source=rss-1e75db4fe92d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9604628944c0</guid>
            <category><![CDATA[process-isolation]]></category>
            <dc:creator><![CDATA[Preston Turner Jr]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 02:22:20 GMT</pubDate>
            <atom:updated>2024-09-10T15:33:03.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Chi9SGqCpBE4oqZw" /></figure><h3>How to Run a Flask Application in a Minimal Container-Like Environment Using cgroups and Namespaces on Ubuntu 24.04</h3><p>Containers, like those used in Docker, are powerful tools that make software easier to develop, deploy, and scale. However, understanding how containers work under the hood can make you a stronger developer or DevOps engineer. In this tutorial, we’ll break down how to manually create a basic container-like environment using two core Linux features: <strong>cgroups</strong> and <strong>namespaces</strong>. This will help you understand how containers isolate applications and manage resources.</p><p>By the end of this tutorial, you’ll have a Flask application running inside this minimal, manually-created container on Ubuntu 24.04.</p><h3>What are cgroups and Namespaces?</h3><p>Before we dive in, let’s define two key concepts:</p><p><strong>cgroups </strong>(Control Groups): These allow us to limit and monitor the amount of resources (like CPU and memory) a group of processes can use.</p><p><strong>Namespaces</strong>: Namespaces isolate certain parts of the operating system (like networking or processes). When a program runs inside its own set of namespaces, it behaves as if it’s the only thing running on the system, even though other programs are still running in the background.</p><p>Together, these features can create an environment that behaves like a container.</p><h3>Prerequisites</h3><p>To follow this tutorial, you’ll need:</p><ul><li>Ubuntu 24.04 installed</li><li>Basic knowledge of Python and Flask</li><li>Some familiarity with Linux commands</li></ul><h3>Install the Required Tools</h3><p>First, we need to make sure the necessary tools are installed on your machine. Open your terminal and run the following commands:</p><pre>sudo apt update<br>sudo apt install -y python3 python3-pip cgroup-tools util-linux</pre><p>Here’s what these tools do:</p><ul><li>python3 and python3-pip: Required to run and install Python programs, including Flask.</li><li>cgroup-tools: Tools to create and manage resource limits.</li><li>util-linux: Provides the unshare command, which allows us to create isolated namespaces.</li></ul><h3>Set Up a Simple Flask Application</h3><p>Next, let’s create a basic Flask application that we’ll run inside our containerized environment.</p><p>Create a new directory for the app and navigate into it:</p><pre>mkdir -p ~/flask_app<br>cd ~/flask_app</pre><p>Now, create the Flask application file:</p><pre>nano app.py</pre><p>Paste the following Python code into app.py:</p><pre>from flask import Flask<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def hello_world():<br>    return &#39;Hello from your container!&#39;<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=5000)</pre><p>Finally, install Flask using pip:</p><pre>pip3 install flask</pre><p>At this point, you’ve created a basic Flask app that will respond with “Hello from your container!” when you visit it in your browser.</p><h3>Create Resource Limits with cgroups</h3><p>We’ll now use <strong>cgroups</strong> to restrict how much memory and CPU our application can use, just like a real container.</p><ol><li><strong>Create a new cgroup:</strong></li><li>This command creates a new cgroup named mycontainer for managing memory and CPU limits:</li></ol><pre>sudo cgcreate -g memory,cpu:/mycontainer</pre><p><strong>Set memory and CPU limits:</strong></p><p>We’ll restrict the memory usage to 256MB and limit the CPU to 50% of its capacity.</p><pre>echo &quot;268435456&quot; | sudo tee /sys/fs/cgroup/memory/mycontainer/memory.limit_in_bytes<br>echo &quot;50000&quot; | sudo tee /sys/fs/cgroup/cpu/mycontainer/cpu.cfs_quota_us</pre><ul><li><strong>Why these limits?</strong></li><li>268435456 bytes = 256MB.</li><li>50000 represents 50% CPU usage (in microseconds out of 100000 microseconds, or 0.5 seconds of CPU time every second).</li></ul><p>Now, when we run our Flask app inside this cgroup, it will be limited to those resource constraints.</p><h3>Isolate the Environment with Namespaces</h3><p>Next, let’s isolate our Flask app using <strong>namespaces</strong>. This will make it run in a virtual environment where it won’t see other processes or network settings on the host.</p><p>Run this command to create new namespaces for <strong>mounting</strong>, <strong>process IDs</strong>, and <strong>networking</strong>:</p><pre>sudo unshare --mount --pid --net --fork bash</pre><p>What does this do?</p><ul><li>--mount: Creates an isolated file system.</li><li>--pid: Isolates the process ID namespace (the Flask app won’t see other processes running on the system).</li><li>--net: Isolates network settings.</li><li>--fork: Starts a new shell.</li></ul><p>Now, you’re in a new shell where your environment is isolated from the host system.</p><h3>Set Up the Hostname and Network Inside the Container</h3><p>Inside the new isolated shell, we can set up a unique hostname and enable the local network for Flask:</p><p>Change the hostname:</p><pre>hostname container</pre><p>This makes the hostname inside this isolated environment container.</p><p><strong>Set up the loopback interface for networking:</strong></p><p>Flask uses localhost to serve the application. We need to enable the loopback interface so the Flask app can bind to 127.0.0.1:</p><pre>ip link set lo up<br>ip addr add 127.0.0.1/8 dev lo</pre><p>Now the networking setup is complete, and Flask can run normally inside this isolated environment.</p><h3>Run the Flask Application in the Isolated Environment</h3><p>We’ll now run our Flask application inside the isolated namespace and with the cgroup limits in place.</p><p>Inside the isolated shell, navigate to the Flask app directory and run the app:</p><pre>cd ~/flask_app<br>cgexec -g memory,cpu:/mycontainer python3 app.py</pre><p>Here’s what’s happening:</p><ul><li>cgexec -g memory,cpu:/mycontainer: Runs the Flask app inside the cgroup, applying the memory and CPU limits we set earlier.</li><li>python3 app.py: Runs the Flask application.</li></ul><p>Your Flask app is now running in an isolated environment with restricted resources, just like in a container!</p><h3>Access the Flask Application</h3><p>To confirm everything is working, open a new terminal window (outside the isolated environment) and run:</p><pre>curl http://127.0.0.1:5000</pre><p>You should see:</p><pre>Hello from your container!</pre><h3>Conclusion</h3><p>Congratulations! You’ve just created a minimal container-like environment using <strong>cgroups</strong> and <strong>namespaces</strong> to run a Flask application. While this setup isn’t as user-friendly as Docker or other container tools, it gives you a better understanding of the underlying technology that powers modern containers.</p><p>Understanding these concepts helps you control how much CPU or memory an application can use, isolate processes from each other, and create secure, efficient environments for running software.</p><p>If you found this tutorial helpful, feel free to leave a comment or share it! Stay tuned for more tutorials on containers, DevSecOps, and building secure applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9604628944c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>