<?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 Julius Tuliao on Medium]]></title>
        <description><![CDATA[Stories by Julius Tuliao on Medium]]></description>
        <link>https://medium.com/@juliuserictuliao?source=rss-68ed321afd29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YPLcZavRuykdypE_fwShiQ.jpeg</url>
            <title>Stories by Julius Tuliao on Medium</title>
            <link>https://medium.com/@juliuserictuliao?source=rss-68ed321afd29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:24:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juliuserictuliao/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[How to Multi-Tenant Your AI: Switching Between Claude, Qwen, and Z.ai in Claude Code CLI]]></title>
            <link>https://medium.com/@juliuserictuliao/how-to-multi-tenant-your-ai-switching-between-claude-qwen-and-z-ai-in-claude-code-cli-7f286889f469?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f286889f469</guid>
            <category><![CDATA[glm]]></category>
            <category><![CDATA[qwen]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Thu, 26 Feb 2026 09:43:24 GMT</pubDate>
            <atom:updated>2026-02-26T09:43:24.667Z</atom:updated>
            <content:encoded><![CDATA[<h4>The ultimate developer setup for switching between LLM providers with a single command.</h4><p>Anthropic’s <strong>Claude Code</strong> is arguably one of the most powerful agentic CLIs available right now. But as developers, we aren’t always tied to a single provider. Sometimes you want the native reasoning of <strong>Claude 4.6 Opus</strong>, the specialized coding prowess of <strong>AliYun’s Qwen 3.5</strong>, or the cost-efficiency of <strong>Z.ai</strong>.</p><h4><strong>The problem?</strong></h4><p>Claude Code stores its configuration in a single settings.json file. Manually editing this file every time you want to switch models is a productivity killer.</p><p>In this guide, I’ll show you how to build a &quot;Model Switcher&quot; script that lets you swap your entire AI backend in less than a second.</p><h4>The Challenge: Configuration Lock-in</h4><p>Claude Code looks for its instructions in ~/.claude/settings.json. To switch providers (like moving to AliYun’s Dashscope for Qwen), you have to change the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.</p><p>Instead of manual editing, we are going to treat these configurations as &quot;profiles.&quot;</p><h4>Step 1: Create Your Profiles</h4><p>Navigate to your .claude directory and create three distinct JSON files.</p><h4>1. The Qwen Profile (settings_q.json)</h4><p>This uses AliYun’s Dashscope endpoint to run Qwen models.</p><p>JSON</p><pre>{<br>  &quot;env&quot;: {<br>    &quot;ANTHROPIC_AUTH_TOKEN&quot;: &quot;API_KEY&quot;,<br>    &quot;ANTHROPIC_BASE_URL&quot;: &quot;https://coding-intl.dashscope.aliyuncs.com/apps/anthropic&quot;,<br>    &quot;ANTHROPIC_MODEL&quot;: &quot;qwen3.5-plus&quot;<br>  }<br>}</pre><h4>2. The Z.ai Profile (settings_z.json)</h4><p>Your custom routing or alternative provider.</p><p>JSON</p><pre>{<br>  &quot;env&quot;: {<br>    &quot;ANTHROPIC_AUTH_TOKEN&quot;: &quot;APIKEY&quot;,<br>    &quot;ANTHROPIC_BASE_URL&quot;: &quot;https://api.z.ai/api/anthropic&quot;,<br>    &quot;API_TIMEOUT_MS&quot;: &quot;3000000&quot;,<br>    &quot;CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC&quot;: &quot;1&quot;<br>  }<br>}</pre><h4>3. The Native Claude Profile (settings.json.bak)</h4><p>Keep your original Anthropic settings as a backup.</p><h4>Step 2: The Logic — The Switcher Script</h4><p>Create a script named switch.sh inside your ~/.claude/ folder. This script handles the file swapping and—more importantly—<strong>bypasses the onboarding login</strong> that often breaks when using non-Anthropic endpoints.</p><p>Bash</p><pre>#!/bin/bash<br># Path: ~/.claude/switch.sh<br><br>CLAUDE_DIR=&quot;$HOME/.claude&quot;<br>ZAI_SRC=&quot;$CLAUDE_DIR/settings_z.json&quot;<br>QWEN_SRC=&quot;$CLAUDE_DIR/settings_q.json&quot;<br>CLAUDE_SRC=&quot;$CLAUDE_DIR/settings.json.bak&quot;<br>TARGET=&quot;$CLAUDE_DIR/settings.json&quot;<br><br># Function to bypass &quot;Log in to Anthropic&quot; prompts<br>fix_onboarding() {<br>  ONBOARDING_FILE=&quot;$HOME/.claude.json&quot;<br>  if [ -f &quot;$ONBOARDING_FILE&quot; ]; then<br>    sed -i &#39;&#39; &#39;s/&quot;hasCompletedOnboarding&quot;: false/&quot;hasCompletedOnboarding&quot;: true/g&#39; &quot;$ONBOARDING_FILE&quot; 2&gt;/dev/null<br>  fi<br>}<br><br>case $1 in<br>  zai)<br>    cp &quot;$ZAI_SRC&quot; &quot;$TARGET&quot;<br>    fix_onboarding<br>    echo &quot;🚀 Switched to Z.ai&quot;<br>    ;;<br>  qwen)<br>    cp &quot;$QWEN_SRC&quot; &quot;$TARGET&quot;<br>    fix_onboarding<br>    echo &quot;🐉 Switched to Qwen (AliYun)&quot;<br>    ;;<br>  claude)<br>    cp &quot;$CLAUDE_SRC&quot; &quot;$TARGET&quot;<br>    echo &quot;🤖 Switched to Native Claude&quot;<br>    ;;<br>  *)<br>    echo &quot;Usage: switch [zai|qwen|claude]&quot;<br>    ;;<br>esac</pre><p><em>Don’t forget to make it executable:</em> chmod +x ~/.claude/switch.sh</p><h4>Step 3: Global Shortcuts</h4><p>To make this truly seamless, add aliases to your ~/.zshrc or ~/.bashrc. This allows you to switch contexts from any directory in your terminal.</p><p>Bash</p><pre># AI Switcher Aliases<br>alias use-zai=&#39;~/.claude/switch.sh zai&#39;<br>alias use-qwen=&#39;~/.claude/switch.sh qwen&#39;<br>alias use-claude=&#39;~/.claude/switch.sh claude&#39;</pre><h4>The Workflow in Action</h4><p>Now, your development workflow looks like this:</p><ul><li><strong>Need deep reasoning?</strong> Type use-claude.</li><li><strong>Working on a heavy Refactor with Qwen?</strong> Type use-qwen.</li><li><strong>Run the tool:</strong> Just type claude.</li></ul><p>By swapping the underlying settings.json file, the Claude Code CLI remains &quot;unaware&quot; of the change, but it instantly inherits the new API keys and model constraints of your chosen provider.</p><h4>Final Thoughts</h4><p>In an era where AI models are updated weekly, being locked into one provider’s CLI is a bottleneck. By modularizing your configurations, you turn Claude Code into a universal interface for the world&#39;s best LLMs.</p><p><strong>Happy coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f286889f469" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Serve Ollama in server and Connect to Claude Code]]></title>
            <link>https://medium.com/@juliuserictuliao/how-to-serve-ollama-in-server-and-connect-to-claude-code-a074fe31234e?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/a074fe31234e</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ollama]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 01:08:18 GMT</pubDate>
            <atom:updated>2026-02-02T01:08:18.595Z</atom:updated>
            <content:encoded><![CDATA[<p>Running large language models locally is useful, but running them in the cloud and wiring them into real developer tools is where things become genuinely powerful.</p><p>In this tutorial, I’ll walk through how to deploy Ollama on a cloud server, expose it over the internet, run a fast long-context model, and connect everything directly to Claude Code. The result is a setup where Claude Code behaves exactly as usual, except instead of calling Anthropic’s servers, it talks to your own model.</p><p>This approach works surprisingly well and removes many of the usual limits developers run into.</p><h3>What We’re Building</h3><p>The idea is simple. Claude Code normally talks to Anthropic’s API. Claude Code also allows you to override that API endpoint using environment variables. Ollama exposes an API that is compatible enough to make this work.</p><p>So the flow becomes: Claude Code running on your local machine sends requests to a cloud-hosted Ollama server, which then runs the GLM-4.7-Flash model and sends responses back.</p><p>No wrappers, no proxies, no extra services.</p><h3>Step 1: Install Ollama on the Cloud Server</h3><p>Start by creating a Linux virtual machine. Ubuntu 22.04 works well. SSH into the server and install Ollama using the official install script.</p><pre>curl -fsSL https://ollama.com/install.sh | sh</pre><p>Once installed, confirm that Ollama is available.</p><pre>ollama --version</pre><p>By default, Ollama only listens on localhost, which means it cannot be accessed from outside the server. That is expected and we will change it next.</p><h3>Step 2: Configure Ollama to Accept External Connections</h3><p>Ollama runs as a systemd service. To expose it, we need to override its environment variables.</p><p>Open the systemd override editor.</p><pre>sudo systemctl edit ollama</pre><p>Add the following configuration.</p><pre>[Service]<br>Environment=&quot;OLLAMA_HOST=0.0.0.0:11434&quot;</pre><pre>[Service]<br>Environment=&quot;OLLAMA_CONTEXT_LENGTH=64000&quot;</pre><p>The first line allows Ollama to accept connections from outside the machine. The second line increases the maximum context length so the model can handle large codebases and long conversations.</p><h3>Step 3: Restart Ollama Cleanly</h3><p>Reload systemd and restart the service so the changes take effect.</p><pre>sudo systemctl daemon-reexec<br>sudo systemctl restart ollama</pre><p>You can verify that Ollama is listening publicly by checking open ports.</p><pre>ss -tulpn | grep 11434</pre><p>If you see it bound to 0.0.0.0, the server is ready.</p><h3>Step 4: Install and Run the Model</h3><p>Now pull and run the model you want to use. In this example, we use GLM-4.7-Flash because it is fast and handles long context well.</p><pre>ollama run glm-4.7-flash</pre><p>Once the model loads successfully, you can exit the interactive session. Ollama will keep the model available in the background.</p><h3>Step 5: Expose the Port to the Internet</h3><p>Your Ollama server needs a public URL. How you do this depends on your provider.</p><p>If you are using Lightning.ai, open the port viewer and copy the generated HTTPS link.<br> If you are using a VPS or cloud VM, open port 11434 in the firewall or security group.</p><p>Once exposed, test the endpoint.</p><pre>curl https://YOUR_PUBLIC_URL/api/tags</pre><p>If you receive model information, your Ollama API is publicly reachable.</p><h3>Step 6: Connect Claude Code to Ollama</h3><p>On your local machine, make sure Claude Code is installed. Then run Claude Code with custom environment variables pointing to your Ollama server.</p><pre>ANTHROPIC_AUTH_TOKEN=ollama \<br>ANTHROPIC_BASE_URL=https://11434-publicurl.cloudspaces.litng.ai \<br>ANTHROPIC_API_KEY=&quot;&quot; \<br>claude --model glm-4.7-flash</pre><p>Claude Code now believes it is talking to Anthropic, but every request is actually sent to your own cloud-hosted Ollama instance.</p><h3>What Works Well With This Setup</h3><p>This setup shines when working with large repositories. Claude Code can scan many files, reason across them, and suggest changes without constantly running into limits.</p><p>It is especially good for refactoring work, generating diffs, navigating unfamiliar codebases, and maintaining long interactive sessions. The long context window makes it feel closer to working with a senior engineer who remembers everything discussed earlier.</p><p>One major advantage is that there are no daily, weekly, or hourly token limits. There is no quota to reset and no hard cap enforced by an API provider. You can run continuous sessions, analyze large projects, and loop over tasks as long as your server can handle it.</p><p>Instead of being limited by billing rules, you are limited only by your hardware and network. For power users and teams, this often feels far more natural.</p><h3>Limitations to Be Aware Of</h3><p>This setup does not include Anthropic’s safety layers or managed protections. You are fully responsible for access control, usage limits, and security.</p><p>Latency depends on your server location and the tunneling method you use. A poorly sized VM will feel slow. A properly sized one feels almost local.</p><p>For production or team use, you should strongly consider adding authentication, rate limiting, and HTTPS if your tunnel does not already provide it.</p><h3>When This Approach Makes Sense</h3><p>This approach makes sense if you want full control, predictable costs, and long uninterrupted coding sessions. It is ideal for internal tools, private codebases, and developers who already manage their own infrastructure.</p><p>If you are comfortable running servers, this setup delivers one of the highest return-on-effort workflows available today.</p><h3>Final Thoughts</h3><p>By serving Ollama in the cloud and connecting it to Claude Code, you effectively turn your own model into a drop-in replacement for a hosted AI API.</p><p>You keep the excellent developer experience of Claude Code while owning the entire backend.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a074fe31234e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing Automation with GitHub Actions: A Beginner's Guide]]></title>
            <link>https://medium.com/@juliuserictuliao/unleashing-automation-with-github-actions-a-beginners-guide-95c04551a11e?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/95c04551a11e</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 14:59:09 GMT</pubDate>
            <atom:updated>2024-11-25T14:59:09.551Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>GitHub Actions</strong> is revolutionizing how developers approach workflow automation. If you&#39;re new to it or want a comprehensive refresher, this guide distills key concepts, making it your ultimate primer for understanding and leveraging GitHub Actions effectively.</p><p>---</p><p><strong>What Are GitHub Actions?</strong></p><p>GitHub Actions is a workflow automation service by GitHub. At its core, it allows developers to automate processes related to repositories—storage spaces for code. With GitHub Actions, you can streamline tasks like testing, deployment, and even repository management, saving valuable time and reducing human error.</p><p>---</p><p><strong>The Role of Repositories</strong></p><p>In GitHub, repositories act as &quot;buckets&quot; to store code for applications, websites, or packages. GitHub Actions adds a layer of automation to these repositories, handling tasks like Continuous Integration and Continuous Delivery (CI/CD).</p><p>---</p><p><strong>Understanding CI/CD</strong></p><p>CI/CD processes form the backbone of modern software development:</p><p>1. Continuous Integration (CI):<br>Automatically integrates new code or changes into an existing codebase. This involves:</p><p>Building the new code.</p><p>Testing it for compatibility and issues.</p><p>Merging it seamlessly with the existing project.</p><p>2. Continuous Delivery/Deployment (CD):<br>Focuses on publishing updates automatically after testing and integration. For instance:</p><p>Deploying a new version of a website after code changes.</p><p>Ensuring every update reaches production without manual intervention.</p><p>GitHub Actions makes configuring CI/CD pipelines effortless, enabling automated building, testing, and deploying with minimal setup.</p><p>---</p><p><strong>Beyond CI/CD: Repository Management</strong></p><p>GitHub Actions isn&#39;t limited to CI/CD. It can also help automate:</p><p>Code Reviews: Automate the assignment of reviewers or ensure certain checks are passed before merging.</p><p>Issue Management: Triage, label, or close issues based on predefined rules.</p><p>These automations simplify collaborative coding and ensure smooth repository management.</p><p>---</p><p><strong>What Is GitHub?</strong></p><p>To fully appreciate GitHub Actions, understanding GitHub is crucial. GitHub is a cloud-based platform for storing and managing code, built on top of Git, an open-source version control system.</p><p><strong>Key Features of Git:</strong></p><p>Version Control: Track and manage changes to your code.</p><p>Commits: Snapshots of your code at specific points in time.</p><p>Branches: Parallel versions of code for experimenting or developing new features.</p><p>GitHub extends Git by offering:</p><p>Cloud Repositories: Back up and collaborate on code from anywhere.</p><p>Collaboration Tools: Features like pull requests, issues, and projects to streamline teamwork.</p><p>Access Control: Manage permissions to ensure secure development.</p><p>---</p><p><strong>What Makes GitHub Actions Unique?</strong></p><p>GitHub Actions empowers developers with pre-built or customizable workflows. These workflows can:</p><p>Automatically build and deploy code.</p><p>Trigger specific actions when changes are made.</p><p>Manage code collaboratively with automated tasks.</p><p>Whether you&#39;re automating tests, deploying updates, or managing repository tasks, GitHub Actions ensures consistency and efficiency.</p><p>---</p><p><strong>Learning GitHub Actions</strong></p><p>If you&#39;re new to GitHub or GitHub Actions, the best way to start is by:</p><p>1. Understanding Git and GitHub Basics: Learn about version control, repositories, branches, and commits.</p><p>2. Exploring GitHub Actions: Familiarize yourself with core building blocks like workflows, jobs, and actions.</p><p>3. Practicing Automation: Set up sample workflows and experiment with automating simple tasks.</p><p>---</p><p><strong>Final Tips for Mastery</strong></p><p>Follow a Structured Approach: Learn GitHub Actions step-by-step, as concepts often build on one another.</p><p>Experiment Freely: Create demo projects to test workflows and gain hands-on experience.</p><p>Engage with the Community: Participate in forums and communities to share knowledge and troubleshoot challenges.</p><p>---</p><p>GitHub Actions isn&#39;t just a tool; it&#39;s a catalyst for efficiency and innovation. By mastering it, you&#39;re not just automating workflows—you&#39;re transforming how you build and manage software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95c04551a11e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Documentation: Installing CUDA on Ubuntu 22.04]]></title>
            <link>https://medium.com/@juliuserictuliao/documentation-installing-cuda-on-ubuntu-22-04-2c5c411df843?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c5c411df843</guid>
            <category><![CDATA[ubuntu-22-04]]></category>
            <category><![CDATA[cuda]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 01:24:29 GMT</pubDate>
            <atom:updated>2024-10-28T04:59:53.212Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will walk you through the process of installing CUDA on Ubuntu 22.04. Follow these steps carefully to ensure a proper setup.</p><h3>Prerequisites</h3><ul><li>A system running Ubuntu 22.04 with a CUDA-capable NVIDIA GPU.</li><li>Admin (sudo) access to the system.</li></ul><h3>1. Verify GPU is CUDA-Capable</h3><p>Before installing CUDA, check if your system has an NVIDIA GPU that supports CUDA:</p><pre>lspci | grep -i nvidia</pre><h3>2. Remove Previous NVIDIA Installations</h3><p>If you have any previous NVIDIA installations, remove them to avoid conflicts:</p><pre>sudo apt purge nvidia* -y<br>sudo apt remove nvidia-* -y<br>sudo rm /etc/apt/sources.list.d/cuda*<br>sudo apt autoremove -y &amp;&amp; sudo apt autoclean -y<br>sudo rm -rf /usr/local/cuda*</pre><h3>3. System Update</h3><p>Update and upgrade your system packages:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><h3>4. Install Required Packages</h3><p>Install the following essential packages for building CUDA and cuDNN:</p><pre>sudo apt install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev</pre><h3>5. Add NVIDIA Driver PPA and Install Drivers</h3><p>Add the NVIDIA PPA and install the recommended NVIDIA drivers for your system:</p><pre>sudo add-apt-repository ppa:graphics-drivers/ppa<br>sudo apt update<br>ubuntu-drivers devices  # to check recommended driver versions<br>sudo apt install libnvidia-common-515 libnvidia-gl-515 nvidia-driver-515 -y</pre><p>Reboot your system after installing the drivers:</p><pre>sudo reboot now</pre><p>After reboot, verify the driver installation:</p><pre>nvidia-smi</pre><h3>6. Install CUDA Toolkit</h3><p>Download and install CUDA 11.8 for Ubuntu 22.04:</p><pre>sudo wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin<br>sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600<br>sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub<br>sudo add-apt-repository &quot;deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /&quot;</pre><p>Update and install CUDA 11.8:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt upgrade<br>sudo apt install cuda-11-8</pre><h3>7. Set Up Environment Variables for CUDA</h3><p>Add CUDA to your system’s PATH and LD_LIBRARY_PATH by editing the .bashrc file:</p><pre>echo &#39;export PATH=/usr/local/cuda-11.8/bin:$PATH&#39; &gt;&gt; ~/.bashrc<br>echo &#39;export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH&#39; &gt;&gt; ~/.bashrc<br>source ~/.bashrc</pre><p>Run ldconfig to update the shared library cache:</p><pre>sudo ldconfig</pre><h3>8. Install cuDNN (CUDA Deep Neural Network Library)</h3><p>Register at <a href="https://developer.nvidia.com/developer-program/signup">NVIDIA Developer Program</a> to get access to cuDNN files. Then, download and install cuDNN 8.7 for CUDA 11.8:</p><pre>CUDNN_TAR_FILE=&quot;cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz&quot;<br>sudo wget https://developer.download.nvidia.com/compute/redist/cudnn/v8.7.0/local_installers/11.8/${CUDNN_TAR_FILE}<br>sudo tar -xvf ${CUDNN_TAR_FILE}<br>sudo mv cudnn-linux-x86_64-8.7.0.84_cuda11-archive cuda</pre><p>Copy the necessary files to the CUDA directory:</p><pre>sudo cp -P cuda/include/cudnn.h /usr/local/cuda-11.8/include<br>sudo cp -P cuda/lib/libcudnn* /usr/local/cuda-11.8/lib64/<br>sudo chmod a+r /usr/local/cuda-11.8/lib64/libcudnn*<br>sudo reboot<br></pre><h3>9. Verify Installation</h3><p>To verify CUDA and cuDNN installation, run the following commands:</p><pre>nvidia-smi  # Checks NVIDIA driver and CUDA status<br>nvcc -V     # Verifies the CUDA compiler version</pre><h3>10. Install PyTorch with CUDA Support</h3><p>Finally, install PyTorch with CUDA 11.8 support:</p><pre>pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118</pre><h3>Conclusion</h3><p>You have now installed the NVIDIA driver, CUDA toolkit, cuDNN, and PyTorch on your Ubuntu 22.04 system. Ensure that the installations are verified with nvidia-smi and nvcc -V for CUDA.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c5c411df843" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bonfire Moment: Igniting Success in the Heart of Your Startup]]></title>
            <link>https://medium.com/@juliuserictuliao/the-bonfire-moment-igniting-success-in-the-heart-of-your-startup-47cc8aec27f5?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/47cc8aec27f5</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Thu, 08 Aug 2024 01:58:12 GMT</pubDate>
            <atom:updated>2024-08-08T01:58:43.698Z</atom:updated>
            <content:encoded><![CDATA[<h3>Igniting Success in the Heart of Your Startup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*77NCwVjdXK78MoK1" /><figcaption>Photo by <a href="https://unsplash.com/@lukeporter?utm_source=medium&amp;utm_medium=referral">Luke Porter</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Synopsis:</strong></p><p>Martin Gonzalez’s book and workshop, “The Bonfire Moment,” focus on the human side of starting and running a business. By tackling the real-life ups and downs of building and managing startups, the course offers entrepreneurs practical advice and strategies. The main goal is to help them lead their teams better and boost their chances of long-term success while keeping their sanity and sense of humor intact.</p><p><strong>Key Topics Covered:</strong></p><p><strong>Founder Stories and Challenges:</strong></p><p>Ever heard about the startup founder who walked into a bar, only to realize it was just another meeting he couldn’t afford to miss? The program sheds light on these kinds of idealized stories of hardship and achievement.<br>Founders talk about feeling hopeless, dealing with pain, and making tough choices that make them question everything.</p><p><strong>Four Common Pitfalls:</strong></p><p><strong>Speed Trap</strong>: It’s like running a marathon with your shoelaces untied. Rushing to launch can make you miss important long-term planning and sustainable practices.</p><p><strong>Inner Circle Trap</strong>: Friends and family in the founding team? It’s like bringing your pet to a business meeting — cute, but not always practical. The dual strain on personal and professional relationships can lead to instability.</p><p><strong>Maverick Mindset Trap</strong>: Overconfidence is your frenemy. Disregarding established management practices can be as risky as going to a sword fight with a butter knife. Beware the myth of shared command, scaling without hierarchy, and sustained heroics.</p><p><strong>Confidence Trap</strong>: Initially necessary but can quickly become a liability. According to the Dunning-Kruger effect, the more you understand, the more you become aware of your ignorance. It’s similar to believing that one excellent omelette qualifies one as a master cook.</p><p><strong>Perspectives on Culture and Organisation:</strong></p><p>Striking a balance between short-term achievements and long-term objectives is difficult yet vital. Efficient leadership combines the agility of a sprinter with the strategic planning of a marathon runner to handle day-to-day operations. Effective teams engage in open communication and confront challenging topics head-on, even if it means taking care of the things that are clearly on their to-do list..</p><p><strong>Application in Large Organizations:</strong></p><p>“The Bonfire Moment” principles can inspire innovation and adaptability in larger organizations. Embrace the contradictions of innovation: allow for mistakes but not incompetence, and balance teamwork with individual responsibility. It’s about creating a dynamic work environment where creativity thrives.</p><p><strong>Founder and Team Dynamics:</strong></p><p>Workshops help founders reflect on and share their insecurities with their teams, similar to group therapy but with more post-it notes and less couch time. The objective is to normalise difficulties with confidence and to offer resources for productive team communication and dispute resolution.</p><p><strong>Prospective Courses:</strong></p><p>Martin is investigating what qualities successful founder-CEOs with long-term startup scaling possess. Hint: It goes beyond appearances. There’s also interest in creating a certification program for facilitators to spread the workshop methods more widely. Think of it as a startup’s version of a ninja training camp.</p><p><strong>Case Study: Kumu</strong></p><p>Roland Ros, the founder of Kumu, shares his roller-coaster journey of building and scaling the Filipino social media app.<br>Transitioning from a startup to a larger, more structured organization was like trying to switch from a skateboard to a cruise ship mid-ride.</p><p><strong>In a nutshell:</strong><br>Martin’s book and course, which focus on the people side of running a company, give entrepreneurs advice on how to work with their employees. Martin spoke with the entrepreneurs about a number of important topics, such as the need for better infrastructure, more funding for local talent, and a welcoming community. They also discussed how cultural differences may impede progress and the advantages of being flexible and learning from others.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47cc8aec27f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Crypto Research API: Part 1 — Test-Driven Development Using Django, Docker, and GitHub…]]></title>
            <link>https://medium.com/@juliuserictuliao/building-a-crypto-research-api-part-1-test-driven-development-using-django-docker-and-github-83e05688b04d?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/83e05688b04d</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 12:11:10 GMT</pubDate>
            <atom:updated>2023-07-23T12:11:55.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Crypto Research API: Part 1 — Test-Driven Development Using Django, Docker, and GitHub Actions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xi5TTJOhyGxlR1ZJXJKOQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@claybanks?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Clay Banks</a> on <a href="https://unsplash.com/photos/NPlMmVsC40I?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Welcome to the first part of our series on building a Crypto Research API! In this multi-part series, we will guide you through the process of creating a powerful and interactive Crypto Research API using Django, containerizing it with Docker, and automating testing with GitHub Actions.</p><p>In this first part, we will focus on the essential practice of Test-Driven Development (TDD). By writing tests before writing code, TDD ensures that our API functions as expected, catches bugs early, improves reliability, and provides developers with the confidence to make changes without breaking existing functionality.</p><p>Let&#39;s dive into the world of cryptocurrencies and start building our Crypto Research API!</p><h3>Crypto Research API: Designing the Backend</h3><p>Our Crypto Research API will be the foundation of our application. It will provide various API endpoints to access valuable cryptocurrency data, including real-time prices, historical trends, market analysis, and more. We&#39;ll implement this API using Django, Python&#39;s robust web framework, and store the cryptocurrency data in a Postgres database for efficient retrieval.</p><h3>Technologies Used</h3><p>Before we delve into TDD and building our API, let&#39;s familiarize ourselves with the technologies we&#39;ll be using throughout the series:</p><ul><li>Python: A versatile and high-level programming language ideal for web development with Django.</li><li>Django: A powerful web framework that enables rapid development with clean, pragmatic design.</li><li>Postgres: A robust and open-source relational database system that will store our cryptocurrency data.</li><li>Docker: A platform that allows us to package our application and its dependencies into containers, ensuring consistency across different environments.</li><li>GitHub Actions: An automation tool that automates tasks like testing, linting, and more whenever code changes are pushed to GitHub.</li></ul><h3>Test-Driven Development (TDD) Explained</h3><p>Test-Driven Development (TDD) will be our guiding principle throughout this series. TDD is a software development practice that emphasizes writing tests before writing code. The TDD process follows the &quot;Red, Green, Refactor&quot; mantra:</p><ol><li>Red: Write a test that initially fails because the functionality is not implemented.</li><li>Green: Write the minimum amount of code required to pass the test.</li><li>Refactor: Improve the code while ensuring all tests still pass.</li></ol><p>TDD offers several benefits, including better code quality, a deeper understanding of the codebase, early bug detection, and increased developer confidence when making changes.</p><h3>Setting Up the Development Environment</h3><p>Before we begin building our Crypto Research API, let&#39;s set up our development environment using Docker for consistent and reproducible builds.</p><ol><li>Install VS Code, Docker Desktop, and Git on your machine.</li><li>Create a new public repository on GitHub titled &quot;crypto-research-api&quot; and add a README and .gitignore file suitable for Python.</li><li>Clone the repository to your local machine using the command:</li><li>Visit Docker Hub and navigate tothe Account Settings .Create an access token with appropriate permissions for Docker Hub auth.</li><li>Go to Github repo navigate to secrets and create two secrets . “DOCKERHUB_USER”(docker username) and ”DOCKERHUB_TOKEN”(docker generated access token)</li></ol><h3>Dockerizing the Crypto Research API</h3><p>To containerize our Crypto Research API, we&#39;ll create a Dockerfile in the project root directory.</p><p>Dockerfile:</p><pre>FROM python:3.9-alpine3.13<br>LABEL maintainer=&quot;your-name&quot;<br><br>ENV PYTHONUNBUFFERED 1<br><br>COPY ./requirements.txt /tmp/requirements.txt<br>COPY ./app /app<br>WORKDIR /app<br>EXPOSE 8000<br><br>RUN python -m venv /py &amp;&amp; \<br>    /py/bin/pip install --upgrade pip &amp;&amp; \<br>    /py/bin/pip install -r /tmp/requirements.txt &amp;&amp; \<br>    adduser --disabled-password --no-create-home django-user<br><br>ENV PATH=&quot;/py/bin:$PATH&quot;<br><br>USER django-user</pre><p>Next, create a .dockerignore file to specify which files should be excluded from the Docker image.</p><p>.dockerignore:</p><pre>.git <br>.gitignore<br>.docker <br>app/__pycache__/<br>app/*/__pycache__/<br>app/*/*/__pycache__/<br>app/*/*/*/__pycache__/<br>.env/<br>.venv/<br>venv/</pre><p>Now, build the Docker image using the following command in the terminal:</p><pre>docker build -t crypto-research-api .</pre><h3>Linting and Testing with Docker Compose</h3><p>Before we start writing tests, let&#39;s set up linting to ensure consistent code formatting and run the Django test suite for unit testing.</p><p>Step 1: Install Flake8</p><p>Flake8 is a powerful linting tool for Python. We&#39;ll add it to our project by modifying the Docker Compose configuration to include a development environment.</p><p>docker-compose.yml:</p><pre>version: &quot;3.9&quot;<br><br>services:<br>  app:<br>    build:<br>      context: .<br>      args:<br>        - DEV=true<br>    ports:<br>      - &quot;8000:8000&quot;<br>    volumes:<br>      - ./app:/app<br>    command: &gt;<br>      sh -c &quot;python manage.py runserver 0.0.0.0:8000&quot;</pre><p>Step 2: Update the Dockerfile</p><p>We&#39;ll modify the Dockerfile to include conditional installation of development requirements.</p><p>Dockerfile (updated):</p><pre>FROM python:3.9-alpine3.13<br>LABEL maintainer=&quot;your-name&quot;<br><br>ENV PYTHONUNBUFFERED 1<br><br>COPY ./requirements.txt /tmp/requirements.txt<br>COPY ./app /app<br>WORKDIR /app<br>EXPOSE 8000<br><br>ARG DEV=false<br>RUN python -m venv /py &amp;&amp; \<br>    /py/bin/pip install --upgrade pip &amp;&amp; \<br>    /py/bin/pip install -r /tmp/requirements.txt &amp;&amp; \<br>    if [ $DEV = true ]; then /py/bin/pip install -r /tmp/requirements.dev.txt; fi &amp;&amp; \<br>    adduser --disabled-password --no-create-home django-user<br><br>ENV PATH=&quot;/py/bin:$PATH&quot;<br><br>USER django-user</pre><p>Step 3: Create requirements.dev.txt</p><p>Separate development requirements from production requirements.</p><p>requirements.dev.txt:</p><pre># Add your development requirements here<br>flake8</pre><p>Step 4: Run Flake8</p><pre>docker-compose run --rm app sh -c &quot;flake8&quot;</pre><h3>Writing Unit Tests for the Crypto Research API</h3><p>With linting in place, it&#39;s time to write unit tests for our Crypto Research API. We will use the unittest library, and Django adds features like the test client, which simulates web requests.</p><p>tests.py:</p><pre>from django.test import TestCase<br>from app.models import Crypto<br><br>class CryptoModelTest(TestCase):<br><br>    def test_create_crypto(self):<br>        # Test creating a new cryptocurrency<br>        crypto = Crypto.objects.create(<br>            name=&#39;Bitcoin&#39;,<br>            symbol=&#39;BTC&#39;,<br>            price_usd=45000.00,<br>            market_cap=800000000000,<br>            volume_24h=50000000000,<br>        )<br>        self.assertEqual(crypto.name, &#39;Bitcoin&#39;)<br>        self.assertEqual(crypto.symbol, &#39;BTC&#39;)<br>        self.assertEqual(crypto.price_usd, 45000.00)<br>        self.assertEqual(crypto.market_cap, 800000000000)<br>        self.assertEqual(crypto.volume_24h, 50000000000)</pre><p>To run the tests in the Docker container, use the following command:</p><pre>docker-compose run --rm app sh -c &quot;python manage.py test&quot;</pre><h3>Conclusion</h3><p>Congratulations! You have taken the first step towards building a powerful Crypto Research API by implementing Test-Driven Development (TDD). TDD ensures that your code is thoroughly tested, catches bugs early, and increases your confidence in making changes.</p><p>In Part 2 of this series, we will continue building our Crypto Research API, focusing on creating powerful API endpoints . So stay tuned for more crypto-filled adventures!</p><p>Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83e05688b04d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Learning Django Part 1]]></title>
            <link>https://medium.com/@juliuserictuliao/a-comprehensive-guide-to-learning-django-part-1-d296af7e3866?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/d296af7e3866</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 00:08:22 GMT</pubDate>
            <atom:updated>2023-07-18T00:08:22.430Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Django is a powerful and popular Python web framework that simplifies web development tasks, enabling the development of robust and scalable web applications. In this comprehensive guide, we will journey through the process of learning Django from scratch, covering essential topics from initial setup to advanced features. Let’s dive in!</p><h3>Part 1: Getting Started with Django</h3><h3>1. Setting Up a Virtual Environment</h3><p>Virtual environments are important for isolating project-specific dependencies, which prevents conflicts between different projects. To create a virtual environment:</p><pre>python -m venv myenv</pre><p>To activate it:</p><p>For Windows:</p><pre>myenv\Scripts\activate</pre><p>For macOS/Linux:</p><pre>source myenv/bin/activate</pre><p>To deactivate the virtual environment:</p><pre>deactivate</pre><h3>2. Installing Django and Creating a Project</h3><p>To install Django, open your terminal and use the Python package installer (pip):</p><pre>pip install django</pre><p>After successfully installing Django, create a new project:</p><pre>django-admin startproject myproject</pre><h3>3. Exploring the Django Project Structure</h3><p>Django creates a directory structure with files such as manage.py, settings.py, urls.py, and wsgi.py. These files constitute the backbone of any Django application.</p><h3>4. Running the Development Server</h3><p>Navigate to your project directory in the terminal and run:</p><pre>python manage.py runserver</pre><p>Visit http://localhost:8000 in your browser to see your application running.</p><h3>5. Creating Your First Views and URL Routing</h3><p>In Django, views are Python functions that take a web request and return a web response. Create a new file in your application directory named views.py and define your first view:</p><pre>from django.http import HttpResponse</pre><pre>def home(request):<br>    return HttpResponse(&quot;Hello, Django!&quot;)</pre><p>To link this view to a URL, you’ll need to use a URL dispatcher which is handled in urls.py file. A simple URL dispatcher can look like this</p><pre>from django.urls import path<br>from .views import home</pre><pre>urlpatterns = [<br>    path(&#39;&#39;, home),<br>]</pre><p>Now, if you navigate to http://localhost:8000, you should see the text &quot;Hello, Django!&quot;</p><h3>Apps, Templates, and Template Inheritance</h3><h3>6. Organizing Your Project with Apps</h3><p>In Django, apps are self-contained modules that handle specific functionalities. To create a new app, use:</p><pre>python manage.py startapp myapp</pre><p>Don’t forget to add the app to the INSTALLED_APPS list in settings.py:</p><pre>INSTALLED_APPS = [<br>    ...<br>    &#39;myapp&#39;,<br>]</pre><h3>7. URL Routing and Views</h3><p>In Django, URLs are mapped to views via a URL dispatcher. For instance:</p><pre>from django.urls import path<br>from myapp import views</pre><pre>urlpatterns = [<br>    path(&#39;home/&#39;, views.home, name=&#39;home&#39;),<br>]</pre><p>Django supports function-based views as well as class-based views:</p><pre>from django.views import View<br>from django.http import HttpResponse</pre><pre>class HomeView(View):<br>    def get(self, request):<br>        return HttpResponse(&quot;Welcome to the home page!&quot;)</pre><h3>8. Rendering Templates and Template Inheritance</h3><p>Templates in Django help separate presentation logic from business logic. To pass data to templates:</p><pre>from django.shortcuts import render</pre><pre>def home(request):<br>    data = {&#39;name&#39;: &#39;John Doe&#39;, &#39;age&#39;: 25}<br>    return render(request, &#39;home.html&#39;, context=data)</pre><p>In the template, context variables can be accessed via template tags:</p><pre>&lt;h1&gt;Welcome, {{ name }}!&lt;/h1&gt;<br>&lt;p&gt;Your age is {{ age }}.&lt;/p&gt;</pre><h3>Conclusion</h3><p>By now, you should have a solid understanding of Django’s core concepts and features, ranging from initial setup and views creation to more advanced topics like virtual environments, Django apps, templates, and template inheritance.</p><p>This knowledge serves as a strong foundation for further exploration of Django’s powerful capabilities such as handling forms, creating RESTful APIs, and working with databases. Django offers limitless possibilities for web development, and we hope this guide has sparked your enthusiasm to build your own amazing web applications. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d296af7e3866" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Fun Side of API Design]]></title>
            <link>https://medium.com/@juliuserictuliao/the-fun-side-of-api-design-a72839363fd9?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/a72839363fd9</guid>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 13:38:57 GMT</pubDate>
            <atom:updated>2023-07-14T13:38:57.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NsmkZMvaUnEtx7syCadVg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/de/@rubaitulazad?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rubaitul Azad</a> on <a href="https://unsplash.com/photos/FPK6K5OUFVA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Hello, mates from the API galaxy! Not long ago, I set off on an exciting quest through the API Academy course. In this article, I’ll share some captivating insights and introduce you to the awe-inspiring ‘Three Guiding Lights’ that show us the way to top-notch API creation. So, get comfortable and join me on this enlightening and entertaining journey!</p><p><strong>Crafting APIs for Developers</strong>: Making it Easy and Exciting First off, let’s look at crafting APIs that developers will truly love. Imagine developers as the heroes in our API tale. Our goal is to make their quest effortless and thrilling. By focusing on designs that are easy to use, intuitive interfaces, and understandable guides, we can fuel developers’ creativity and help them build remarkable applications using our APIs.</p><p>Introducing the Three Guiding Lights: <strong>Functionality, Usability, and Experience</strong> Now, let’s get acquainted with the ‘Three Guiding Lights’ — Functionality, Usability, and Experience, inspired by <strong>Vitruvius</strong>, an iconic Roman architect. Just as he valued these principles in architecture, they are equally crucial in API design. So, let’s commit to crafting APIs that are functional, user-friendly, and offer an outstanding user experience!</p><p><strong>The Joys of Well-Crafted APIs</strong>: Sparking Creativity and Engaging Users Well-crafted APIs are quite magical! They ignite fresh ideas, allowing creative third-party developers to add their unique flair to our digital world. Moreover, these APIs serve as bridges to users, reaching them wherever they are online and ensuring they enjoy a consistent experience across platforms. With our APIs as the foundation, we can unlock new possibilities and attract users with our digital offerings.</p><p><strong>API Styles</strong>: Unveiling the Style Superstars Hold on tight as we dive into the vibrant world of API styles! From SOAP tunnels that carry data to RESTful journeys, each style has its unique charm. The URI/CRUD style allows us to create simple and efficient interfaces, while the event-driven approach using WebSockets brings real-time excitement. Enjoy the art of API creation, adding layers of security, orchestration skills, caching tricks, and novel ways to represent data.</p><p><strong>Balancing API Management and Updates</strong>: Building Trust and Encouraging Growth As our API realm expands, we realize the importance of balancing API management and updates. This equilibrium is crucial for maintaining trust, nurturing growth, and ensuring developers have a fantastic experience. With API management tools at our disposal, we can overcome challenges related to management, security, and analytics. Together, we start the journey of semantic updates, syncing our releases and managing major changes to keep developers content and our APIs flourishing.</p><p>Hats off to you, API explorers! We’ve navigated the API Academy course, unraveled the secrets of API design, and discovered the magnificent ‘Three Guiding Lights’. With this fresh knowledge, we’re all set to design APIs that delight developers, inspire creativity, and provide extraordinary experiences. Let’s go out there and build API wonders that are functional, user-friendly, and deliver an awesome experience. Here’s to your API design journey being filled with joy, growth, and a bit of API magic!</p><p>Always remember, as we explore this universe, to keep the ‘Three Guiding Lights’ close — they are our compass on the API design voyage. And don’t forget to add a pinch of fun and creativity to your API designs — that’s what truly makes them stand out. Happy API designing, fellow explorers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a72839363fd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dockerizing Your Python Application and Persisting Data]]></title>
            <link>https://blog.devops.dev/dockerizing-your-python-application-and-persisting-data-8a82c410bf13?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a82c410bf13</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 09:04:48 GMT</pubDate>
            <atom:updated>2023-07-03T16:24:35.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*blgpOkRNH8aNaPgO.png" /></figure><p>Have you ever written a Python application and wanted to containerize it using Docker? This approach has many advantages, including isolating the app from other system processes, simplifying the app’s deployment, and offering better resource utilization.</p><p>One of the common scenarios while containerizing apps is the need to persist data, or deal with files that change over time, like configuration files, logs, or data files. Docker provides a mechanism for this via volume mounting using the -v command.</p><p>This tutorial aims to guide you on how to Dockerize your Python application and use the -it -v command to persist data that needs to change.</p><h3>Step 1: Create a Simple Python App</h3><p>First, let’s create a simple Python application. We’ll be building a simple “Hello, World!” application.</p><pre>print(&quot;Hello, World!&quot;)</pre><h3>Step 2: Write a Dockerfile</h3><p>The next step involves writing a Dockerfile that instructs Docker on how to build our Python application’s container.</p><pre># Use an official Python runtime as a parent image<br>FROM python:3.8</pre><pre># Set the working directory in the container to /app<br>WORKDIR /app</pre><pre># Copy the current directory contents into the container at /app<br>COPY . /app</pre><pre># Run app.py when the container launches<br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><h3>Step 3: Build the Docker Image</h3><p>With the Dockerfile ready, we can build our Docker image using the docker build command:</p><pre>docker build -t python-app .</pre><h3>Step 4: Persist Data Using -it -v</h3><p>So far, we have created a Docker image for our Python application. But how do we handle the case where our Python application changes data files and we want to persist those changes?</p><p>Docker has a solution for this — the -v flag, which stands for volume. You can use it to mount a local system directory as a volume in the Docker container. Changes to this directory in the container will then be reflected on your local system, allowing data persistence.</p><p>Here’s how you can do it:</p><pre>docker run -it -v $(pwd)/data:/app/data python-app</pre><p>Here, $(pwd)/data is the local system directory, and /app/data is the path in the Docker container. Any changes made inside /app/data will reflect in your local data directory.</p><p>The -it option is used to run the Docker container in interactive mode and to allocate a pseudo-TTY for the container, which allows you to interact with the container from your terminal.</p><h3>Step 5: Making Changes and Observing Persistence</h3><p>To observe data persistence, modify your Python app to create a file in the /app/data directory.</p><pre>with open(&#39;data/hello.txt&#39;, &#39;w&#39;) as f:<br>    f.write(&quot;Hello, World!&quot;)</pre><p>After running the Docker container as before, you’ll notice that a new file hello.txt has been created in your local data directory.</p><p>In conclusion, Dockerizing a Python application offers numerous advantages in terms of deployment and environment consistency. Docker’s -v flag allows you to mount local directories as volumes in Docker containers, which is extremely useful when you want to persist data or deal with files that change regularly. Happy Dockerizing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a82c410bf13" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/dockerizing-your-python-application-and-persisting-data-8a82c410bf13">Dockerizing Your Python Application and Persisting Data</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins Tutorial Part 2: From Simple Jobs to CI/CD Pipelines]]></title>
            <link>https://medium.com/@juliuserictuliao/jenkins-tutorial-part-2-from-simple-jobs-to-ci-cd-pipelines-acf37bed1a2c?source=rss-68ed321afd29------2</link>
            <guid isPermaLink="false">https://medium.com/p/acf37bed1a2c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Julius Tuliao]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 09:07:08 GMT</pubDate>
            <atom:updated>2023-06-28T09:07:08.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Jenkins tutorial. In Part 1, we started with Jenkins, and now we will move towards more advanced concepts. Let’s start by connecting a Git repository to Jenkins and setting up agents.</p><h3>Connecting a Repository to Jenkins</h3><p>First, we’ll create a new freestyle job — let’s call it my_python_job. Next, go to Source Code Management, click Git, and enter your repository&#39;s link.</p><p>To check if Python is installed, go to your Jenkins terminal and type python3 --version. If you see a Python version, that means it&#39;s installed. Under the Build section of the job configuration, we&#39;ll run a shell script - python3 helloworld.py. After saving and building, you should see the output of your Python script &quot;Hello World&quot; in the console output.</p><h3>Setting Up Agents</h3><p>An agent in Jenkins is a system that Jenkins can use to execute jobs. It can be any computer with a network connection to the Jenkins server.</p><p>To add agents, navigate to Dashboard -&gt; Manage Jenkins -&gt; Manage Nodes and Clouds. You have two options - New Node or Configure Clouds.</p><p>New Node allows you to build a permanent agent that could be a Linux or Windows server. Configure Clouds helps to set up agents using cloud platforms like Docker, Kubernetes, AWS.</p><p>We will focus on the cloud option because, in my opinion, it’s the most modern way of managing Jenkins agents.</p><ol><li>Click on Configure Clouds.</li><li>If you don’t see anything, go to Plugin Manager to install the necessary cloud implementations.</li><li>Once in the Plugin Manager, filter the available cloud providers. Select Docker, download it, then install after a restart.</li><li>After restarting Jenkins, you can verify the Docker plugin is installed via the Plugin Manager.</li><li>Now, go back to Configure Clouds and add Docker.</li></ol><p>You will need to fill out Docker cloud details. If you’re running it on the same server, you can use 127.0.0.1, else use the server&#39;s IP address and port.</p><p>Next, launch a Docker container (alpine/socat), get the IP address of the socat container, and use this in your Docker cloud configuration.</p><p>You can now create a Docker agent template:</p><ol><li>Click Add Docker Template.</li><li>Name and label it docker-agent-alpine.</li><li>Enable it.</li><li>For the Docker image, use jenkins/agent:alpine-jdk11.</li><li>Set instance capacity as 2.</li><li>Set remote file system root as /home/jenkins.</li></ol><p>Now, your Python job (my_python_job) can be restricted to run only on this agent.</p><p>If your job has specific dependencies, like Python3, you can create a custom Docker image with these dependencies installed. Use this image to set up another agent (e.g., docker-agent-python), and restrict your Python job to this new agent.</p><p>Now, how about if we want Jenkins to periodically fetch changes from our Python repo? In the Source Code Management section of the job, specify */5 * * * * to poll the repo every 5 minutes. Jenkins will trigger a build whenever it detects a change in the repo.</p><h3>Setting up CI/CD pipelines using Groovy Language</h3><p>A more powerful way of defining Jenkins jobs is by using Pipelines and Groovy language. You can create a new item and select Pipeline.</p><p>You can either write a script in the Jenkins UI or, preferably, create a Jenkinsfile in your source control.</p><p>Here’s an example of a declarative pipeline:</p><pre>pipeline {<br>    agent { <br>        node {<br>            label &#39;docker-agent-python&#39;<br>        }<br>    }<br>    triggers {<br>        pollSCM &#39;* * * * *&#39;<br>    }<br>    stages {<br>        stage(&#39;Build&#39;) {<br>            steps {<br>                sh &#39;&#39;&#39;<br>                cd myapp<br>                pip install -r requirements.txt<br>                &#39;&#39;&#39;<br>            }<br>        }<br>        stage(&#39;Test&#39;) {<br>            steps {<br>                sh &#39;&#39;&#39;<br>                cd myapp<br>                python3 hello.py<br>                python3 hello.py --name=Brad<br>                &#39;&#39;&#39;<br>            }<br>        }<br>        stage(&#39;Deliver&#39;) {<br>            steps {<br>                sh &#39;&#39;&#39;<br>                echo &quot;doing delivery stuff..&quot;<br>                &#39;&#39;&#39;<br>            }<br>        }<br>    }<br>}</pre><p>This pipeline script will poll the SCM every minute, then execute a build, test, and delivery stages. To use this pipeline, select Pipeline script from SCM, specify your Git repository URL, and provide the necessary credentials if it&#39;s a private repository.</p><p>And that’s it! You’ve now created a Jenkins CI/CD pipeline using Docker agents and Groovy scripting. In the next tutorial, we will be looking at more advanced pipeline concepts and integrations with other tools. Stay tuned!</p><p>Source: <a href="https://www.youtube.com/watch?v=6YZvp2GwT0A">https://www.youtube.com/watch?v=6YZvp2GwT0A</a></p><p>Github: <a href="https://github.com/devopsjourney1/jenkins-101">https://github.com/devopsjourney1/jenkins-101</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acf37bed1a2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>