<?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 Osinachi Okpara on Medium]]></title>
        <description><![CDATA[Stories by Osinachi Okpara on Medium]]></description>
        <link>https://medium.com/@sin4ch?source=rss-9f17453673aa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hiu0rS3WqA9qovF1VXb4mQ.png</url>
            <title>Stories by Osinachi Okpara on Medium</title>
            <link>https://medium.com/@sin4ch?source=rss-9f17453673aa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:28:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sin4ch/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[Building a Simple Exchange Rate MCP Server using FastMCP]]></title>
            <link>https://medium.com/@sin4ch/building-a-simple-exchange-rate-mcp-server-using-fastmcp-c87d7a454545?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87d7a454545</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Mon, 29 Sep 2025 02:04:27 GMT</pubDate>
            <atom:updated>2025-09-29T02:09:38.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UYR6EQj0Ger2nzVpxZwmQ.png" /></figure><p>MCP, or <a href="https://modelcontextprotocol.io/docs/getting-started/intro">Model Context Protocol</a>, is a protocol created by <a href="https://www.anthropic.com/">Anthropic </a>(the creators of <a href="https://www.claude.ai/">Claude</a>) to streamline and standardise LLM (large language model) access to external tools and resources. <a href="https://gofastmcp.com/getting-started/welcome">FastMCP</a> is a Python framework that allows you to implement MCP in your Python applications. In this article, I will guide you towards creating an Exchange Rate MCP server to use in any coding agent, Claude Desktop, or anywhere else you can connect an MCP, to allow them to get the latest exchange rates.</p><p>I know you’re ready to dive in, but first, let’s take a second to understand the relevance of MCP.</p><h3>What really is the point of MCP?</h3><p>LLMs, such as ChatGPT, Gemini, and Claude models, are trained on vast datasets up to a specific date, known as the <em>knowledge cut-off date. </em>The knowledge cut-off means that while they may excel with historical information, they might provide incorrect data or hallucinate when it comes to current facts. Be cautious of hallucinations when dealing with LLMs, as they may not let you know this upfront. Check out an example of this phenomenon in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_CUOsO1E5T68uTsarUzBw.png" /></figure><p>Also, by default, LLMs cannot inherently take action in the real world. They are just next-token predictors and cannot perform tasks such as searching, creating documents, or making purchases on the internet independently.</p><p>MCP solves these problems by enabling access to up-to-date information while allowing them to carry out external tasks that they would otherwise be unable to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GuECNtrdy_fPDR-o.jpg" /><figcaption><a href="https://www.lightflows.co.uk/blog/what-is-model-context-protocol-in-ai-an-introduction-to-its-role-and-importance/">lightflows.co.uk</a></figcaption></figure><p>Now that we understand why MCP is important,…</p><h3>Let’s build our Exchange Rate MCP Server!</h3><p>To get current exchange rates, we’ll be using <a href="https://www.exchangerate-api.com/">ExchangeRate-API</a>. At the time of writing, they <a href="https://www.exchangerate-api.com/docs/supported-currencies">support up to 161 currencies</a>. That should be more than enough!</p><p>To build our project, we will:</p><ul><li>create an ExchangeRate-API account to get our API key,</li><li>create our virtual environment as with any regular Python project,</li><li>write the Python code for the MCP server,</li><li>run it on the Claude Desktop app.</li></ul><blockquote>If you’d like to check out what the completed version of this project looks like, here’s the <a href="https://github.com/sin4ch/exchange-rate-mcp">GitHub link</a>.</blockquote><h4>Get your API key from ExchangeRate-API</h4><p>To obtain your API key, you must first create an account. Visit the <a href="https://exchangerate-api.com/">ExchangeRate-API</a> website and enter your email address, then click the “Get Free Key!” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etm3_3jcPLgojY0K6S9LkQ.png" /></figure><p>On the following page, enter your email address and desired password. Then, click on the “Accept Terms &amp; Create Account!” button to create your account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1obSiHGxPY0fT-p6Rwbb5Q.png" /></figure><p>The next screen will require you to open your email and click on the verification link. After you verify it, your dashboard should load and look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hnmoHFMGWfpRM79K3vs48A.png" /></figure><p>Now that you have your API key, it’s time to set up the project.</p><h4>Create a virtual environment</h4><p>In a terminal window, create a new folder named exchange-rate-mcp where your project will live, then change directory into the folder as follows:</p><pre>mkdir /path/to/your/exchange-rate-mcp<br>cd exchange-rate-mcp</pre><p>To set up your Python virtual environment, copy the following commands (I’ll be using <a href="https://docs.astral.sh/uv/">uv</a>. To install uv, check out the docs <a href="https://docs.astral.sh/uv/getting-started/installation/">here</a>.):</p><pre>uv init <br># This command creates the following:<br>#├── .git/<br>#├── .gitignore<br>#├── .python-version<br>#├── README.md<br>#├── main.py<br>#└── pyproject.toml<br><br>uv venv # This creates the virtual environment<br><br># To activate the virtual environment in UNIX-based OSes:<br>source venv/bin/activate <br><br># For Windows<br>.\venv\Scripts\activate.bat</pre><p>Now, open the folder in your favourite IDE (Integrated Development Environment). I use Visual Studio Code:</p><pre>code . # This opens the our project folder in VSCode<br><br># If you use Cursor:<br>cursor .<br><br># For those of you who live on the edge:<br>vim .</pre><p>Your IDE should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JClEEyH431Mmg1PeYshkiw.png" /></figure><p>For this project, you will only needfastmcp, dotenv and httpx as dependencies. So, to add them to your virtual environment and in your dependency files, use the following uv command:</p><pre>uv add fastmcp dotenv httpx</pre><h4>Writing the MCP server</h4><p>Copy and paste the following code into the main.py file:</p><pre>import httpx <br>import os <br>from dotenv import load_dotenv<br>from fastmcp import FastMCP<br><br>load_dotenv()<br><br>mcp = FastMCP(name=&quot;Exchange Rate MCP Server&quot;)<br><br>EXCHANGE_RATE_API_KEY = os.getenv(&quot;EXCHANGE_RATE_API_KEY&quot;)<br>if not EXCHANGE_RATE_API_KEY:<br>    raise EnvironmentError(&quot;EXCHANGE_RATE_API_KEY is not set in environment variables.&quot;)<br><br><br>@mcp.tool<br>async def convert_currency(amount: float, base_curr: str, target_curr: str) -&gt; str:<br>    &quot;&quot;&quot;Convert an amount from one currency to another using current exchange rates.&quot;&quot;&quot;<br><br>    try:<br>        async with httpx.AsyncClient() as client:<br>            response = await client.get(f&quot;https://v6.exchangerate-api.com/v6/{EXCHANGE_RATE_API_KEY}/pair/{base_curr.upper()}/{target_curr.upper()}/{amount}&quot;)<br>            response.raise_for_status()<br>            data = response.json()<br><br>            if data.get(&quot;result&quot;) == &quot;error&quot;:<br>                error_type = data.get(&quot;error-type&quot;, &quot;unknown&quot;)<br>                if error_type == &quot;unknown-code&quot;:<br>                    raise Exception(f&quot;Unknown currency code: {base_curr} or {target_curr}&quot;)<br>                elif error_type == &quot;malformed-request&quot;:<br>                    raise Exception(&quot;Invalid request format&quot;)<br>                elif error_type == &quot;invalid-key&quot;:<br>                    raise Exception(&quot;Invalid API key&quot;)<br>                elif error_type == &quot;inactive-account&quot;:<br>                    raise Exception(&quot;API account inactive&quot;)<br>                elif error_type == &quot;quota-reached&quot;:<br>                    raise Exception(&quot;API quota exceeded&quot;)<br>                else:<br>                    raise Exception(f&quot;API error: {error_type}&quot;)<br>        <br>            return f&quot;{amount} {base_curr.upper()} = {data.get(&#39;conversion_result&#39;):.2f} {target_curr.upper()} (Rate: {data.get(&#39;conversion_rate&#39;)})&quot;<br>        <br>    except httpx.HTTPStatusError as e:<br>        raise Exception(f&quot;HTTP error occurred: {e.response.status_code} - {e.response.text}&quot;)<br>    except httpx.RequestError as e:<br>        raise Exception(f&quot;Request error occurred: {str(e)}&quot;)<br>    except Exception as e:<br>        raise Exception(f&quot;Unexpected error occurred: {str(e)}&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    mcp.run()</pre><p>Let’s take a second to understand what’s going on here:</p><p>First, we imported httpx to handle API requests to the ExchangeRate-API server, load_dotenv from the dotenv library to use the os library to load environmental variables from our .env file, and the FastMCP class from the fastmcp library for managing the MCP connection and creating tools.</p><p>Next, we loaded the environmental variable, which is the API key, and assigned it to a constant, EXCHANGE_RATE_API_KEY. To create your .env file to store your API key as an environmental variable, copy the following command and paste it in the terminal, making sure that your current working directory is your MCP project folder:</p><pre>echo &quot;EXCHANGE_RATE_API_KEY=your_api_key&quot; &gt; /path/to/your/mcp/server/.env<br># Make sure to change &#39;your-api-key&#39; to your actual API key.</pre><p>If you do not execute the command above, an environment error should be displayed in the console when the MCP server runs.</p><p>Then, we created an instance of the FastMCP class, mcp which we’ll use to create our tools and run the server.</p><p>We define MCP tools using the mcp.tool decorator. Our function convert currency is our tool in this case. It takes the amount, as well as the <a href="https://www.exchangerate-api.com/docs/supported-currencies">ISO 4217 three-letter codes</a> of the base and target currencies, and returns the conversion result.</p><p>The code also has robust error handling. To properly understand ExchangeRate-API’s error response for the API endpoint we are using, check the docs <a href="https://www.exchangerate-api.com/docs/pair-conversion-requests">here</a>.</p><p>And finally, we add the mcp.run() line to allow communication with the MCP server over <a href="https://man7.org/linux/man-pages/man3/stdio.3.html">standard input/output</a>, or stdio when we run the main.py file.</p><p>With these, our MCP server is ready to “serve” — pun intended — us some sweet, sweet exchange rates! ;D</p><p>Now, let’s run it!</p><h4>Running the MCP server</h4><p>We’ll be using Claude Desktop to run our MCP server. Go <a href="https://claude.ai/download">here</a> to install Claude Desktop on your machine. Once you have Claude installed, open it. It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SN75lsATbIt_lzxkNTFc-w.png" /></figure><p>To use our MCP server on Claude, we have to configure Claude to see our server over stdio. To do this, we will edit the Claude Desktop configuration file to point to our MCP server. Use the following commands to open the config file in your IDE of choice (Remember I’m using VSCode):</p><pre># On MacOS<br>code ~/Library/Application\ Support/Claude/claude_desktop_config.json<br><br># On Windows:<br>code %APPDATA%\Claude\claude_desktop_config.json</pre><p>Copy and paste the configuration below into the claude_desktop_config.json file:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;exchange-rate-mcp&quot;: {<br>      &quot;command&quot;: &quot;uv&quot;,<br>      &quot;args&quot;: [<br>        &quot;--directory&quot;,<br>        &quot;/path/to/your/mcp/server/&quot;,<br>        &quot;run&quot;,<br>        &quot;main.py&quot;<br>      ]<br>    }<br>  }<br>}</pre><p>If Claude Desktop is running, close it and restart it.</p><p>When it restarts, click on the button highlighted in the image below to open the overflow. Make sure the exchange-rate-mcp is toggled on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zS0dxHs1MMAfOJBhVV4p-w.png" /></figure><p>Now, ask Claude for the latest exchange rate. When you do, if the server is connected correctly, it should initiate the MCP tool call. Click on “Allow once” or “Always allow”. Any of them is fine for our demo, but I’d usually err on the side of clicking “Allow once” so I’m always in control of each tool call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZq0qpaMUJKOo_P8_vomrg.png" /></figure><p>If you notice, Claude properly formatted our base_curr and target_curr to their proper three-letter codes. The LLM shows that it’s well aware of the requirements of our tools and makes decisions accordingly.</p><p>Isn’t that pretty cool?</p><p>Once it runs, the output should look like the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8WL9kAcSlbOzDwbOwJVXw.png" /></figure><p>It even remarked on the exchange rates! That’s really something!</p><h4>Conclusion</h4><p>And, yeah, that’s it. If yours worked like mine, you’ve built your very own Exchange Rate MCP server. MCP enables us to make LLMs significantly more powerful than they currently are.</p><p>Now, don’t stop here; there’s a whole world of MCP servers that you can explore. If you’d like to try out some of them in Claude to supercharge it, check out this <a href="https://github.com/punkpeye/awesome-mcp-servers">MCP repository</a> and connect them to Claude through the configuration file.</p><p>Happy MCP’ing!</p><p>If you enjoyed reading this, please leave a clap or a comment. I’d also love to connect with you on <a href="https://linkedin.com/in/osinachiokpara">LinkedIn</a> or <a href="https://x.com/sin4ch">X</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87d7a454545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Model Context Protocol (MCP)]]></title>
            <link>https://medium.com/@sin4ch/understanding-model-context-protocol-mcp-2f8f0e7e9240?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f8f0e7e9240</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 11:59:03 GMT</pubDate>
            <atom:updated>2025-08-06T11:59:03.888Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MIWneyK0exeNL_LvMdFbQ.png" /><figcaption>Model Context Protocol - <a href="https://modelcontextprotocol.io/docs/learn/architecture">modelcontextprotocol.io</a></figcaption></figure><h3>Introduction</h3><p>If you’re chronically on the “inters of nets”, particularly on X and LinkedIn, like me 🥲, you must have come across this term, “MCP”, especially in discourse around LLMs, agents, and AI in general, and might have wondered what it actually means.</p><p>In the world of artificial intelligence, especially with advanced AI models like Large Language Models (LLMs), as you may have noticed with regular use of these models, a key challenge is how they remember past conversations, interface with external services or resources, or access large amounts of information related to what we’re discussing.</p><p>This capability is often managed by something called the Model Context Protocol (MCP).</p><p>The need for AI to be more helpful and “aware” of our ongoing tasks, as well as more resourceful in performing actions in the outside world, especially in the age of agents (pun not intended), is always growing. Whether a chatbot needs to remember your preferences over a long chat, or effectively perform operations using tools, giving the right information is essential.</p><p>This article will explain what the Model Context Protocol is, why it’s important, how the MCP server and MCP client work together to make AI truly smart, and what we can possibly look forward to beyond it.</p><h3>Table of Contents</h3><ol><li>What is Model Context Protocol (MCP)?</li><li>What is the point of the MCP standard?</li><li>The MCP architecture</li><li>How MCP client-server communication works</li><li>Benefits of Using MCP</li><li>The Future of MCP</li><li>Conclusion</li></ol><h3>What is Model Context Protocol (MCP)?</h3><p>The Model Context Protocol (MCP) is a set of rules for how different parts of an AI system talk to each other. Its main purpose is to help applications, which we call MCP clients, efficiently send important background information, or context, to an AI model, which acts as an MCP server. This happens before the client asks the AI model a question. This method is especially important when the background information is too large or complex to send all at once with every single request.</p><p>You can think of MCP for AI as what a USB-C port is for electronics. Before USB-C, we had dozens of different chargers and cables for every device. MCP aims to be that universal standard, allowing any AI application to “plug into” any data source or tool without needing a custom-built connector each time.</p><p>MCP makes sure that the AI model gets only the specific data it needs for the current conversation. This helps the AI give more accurate and useful answers without being overwhelmed by too much information.</p><h3>What is the point of the MCP standard?</h3><p>The idea of managing context for AI models developed because it was necessary. Early AI systems, including basic language models, often had no memory. Each question was handled on its own, without remembering anything from previous interactions. This meant that for an AI chatbot to remember a user’s name or a past question, the entire conversation history had to be sent again with every new message.</p><p>As AI models became more complex and users wanted more natural, continuous conversations, sending everything repeatedly became impractical. Large Language Models have a context window, which is a limited amount of text (like a certain number of words) they can process at one time. This limit remained a big challenge.</p><p>Because of this, developers started looking for ways to manage and retrieve outside information efficiently. This led to methods like retrieval-augmented generation (RAG), where AI models could get information from external knowledge bases. The Model Context Protocol then emerged as a standard way to manage this external context.</p><p>Notably, Anthropic, the creators of Claude AI, played a key role in developing and open-sourcing the MCP specification. Their work aims to standardize how AI applications access and utilize external tools and data, making it easier for developers to build more capable and context-aware AI systems.</p><p>So, in summary, why do we need MCPs?</p><ul><li><strong>Limited Context Windows:</strong> LLMs can process only a fixed number of tokens per request. Sending entire conversation histories or large documents each time is inefficient and costly.</li><li><strong>Brittle Integrations:</strong> Writing custom code to connect each tool to an AI model is time-consuming and breaks easily when APIs change.</li><li><strong>Scalability:</strong> As applications grow to use more tools and data sources, a standardized interface prevents integration bottlenecks and simplifies development.</li></ul><h3>The MCP architecture</h3><p>The Model Context Protocol provides a structured solution to a common problem in AI development: how to seamlessly integrate AI models with diverse external tools and data sources. Before MCP, connecting an AI to a new tool often meant custom, one-off integrations. MCP aims to standardize this process, making it much easier to build robust AI applications.</p><p>The MCP framework includes several key components that help address these tooling issues:</p><ul><li><strong>MCP Specification:</strong> A detailed document that outlines the exact rules for how MCP clients and servers must communicate.</li><li><strong>MCP SDKs:</strong> Software Development Kits (libraries) for languages like Python that implement the specification, speeding up development.</li><li><strong>MCP Development Tools:</strong> Tools like the MCP Inspector to help developers debug communication between clients and servers.</li><li><strong>MCP Reference Server Implementations:</strong> Example servers that serve as blueprints for developers building their own.</li></ul><p>Crucially, MCP focuses only on the protocol for exchanging context. It doesn’t tell AI applications how to use LLMs or how to manage the context once it’s provided. This clear separation of concerns simplifies development and allows for greater flexibility.</p><h4>Participants in the MCP Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JkWcGSClLbJiDly0.png" /><figcaption><a href="https://www.ibm.com/think/topics/model-context-protocol">Model Context Protocol Architecture - IBM</a></figcaption></figure><p>MCP follows a client-server model involving three main participants:</p><ul><li><strong>MCP Host:</strong> The AI application itself (e.g., Claude Desktop, Visual Studio Code, or your custom app). It coordinates one or multiple MCP clients.</li><li><strong>MCP Client:</strong> A component within the host that maintains a dedicated one-to-one connection with an MCP server and gets context from it.</li><li><strong>MCP Server:</strong> A program that provides context to clients. It can be local (e.g., a filesystem server) or remote (e.g., the Sentry MCP server).</li></ul><p>For example, if Visual Studio Code acts as an MCP host, when it connects to the Sentry MCP server, it creates an MCP client object for that connection. If it then connects to a local filesystem server, it creates another MCP client object, maintaining a separate one-to-one relationship.</p><p>This foundation provides a strong, scalable, and widely compatible way for clients and servers to exchange contextual information, ensuring efficient and reliable communication within the AI ecosystem.</p><h3>How MCP client-server communication works</h3><p>In this section, we’ll be diving deeper into how the server talks to the client between the server and client by understanding:</p><ul><li>the MCP’s layered structure,</li><li>how the connection between client and server is established, and</li><li>how exactly context is defined as it is shared.</li></ul><p>Then we’ll look at an MCP workflow example.</p><h4>The MCP layers</h4><p>MCP separates concerns into two distinct layers to ensure flexibility and simplicity.</p><p><strong>The Data Layer:</strong> This layer defines the message formats for all communication, including requests, responses, and notifications. It is where the specific rules for exchanging context are defined, using JSON-RPC 2.0 as its foundation. It also handles the connection lifecycle with messages for initialization (the initial handshake) and for negotiating the capabilities of the client and server.</p><p><strong>Transport Layer:</strong> This layer is responsible for carrying the JSON-RPC messages over a specific communication medium. Common transport methods include:</p><ul><li><strong>Standard I/O (stdio):</strong> Best for local, synchronous connections, like an AI in your code editor accessing local files.</li><li><strong>HTTP + Server-Sent Events (SSE):</strong> Ideal for remote services that need to send asynchronous notifications from the server to the client.</li><li><strong>WebSocket:</strong> A good choice for fully bidirectional, real-time communication between the client and server.</li></ul><h4>How server-client connection is established</h4><p>MCP is a stateful protocol and requires a careful handshake to start a connection.</p><ul><li>The client sends an initialize request to establish the connection and declare its capabilities.</li><li>The server responds, confirming the protocol version and outlining its own capabilities (e.g., which tools it supports).</li><li>After a successful handshake, the client sends a notification to indicate it’s ready.</li></ul><h4>How context is defined</h4><p>Primitives are the most important concept within MCP. They define what clients and servers can offer each other.</p><p>MCP defines three core primitives that servers can expose:</p><ul><li><strong>Tools:</strong> Executable functions an AI can call to perform actions (e.g., getOrderStatus<em>,</em> searchDatabase<em> </em>).</li><li><strong>Resources:</strong> Data sources that provide information (e.g., file contents, database records).</li><li><strong>Prompts:</strong> Reusable templates that help structure interactions (e.g., system prompts).</li></ul><p>Clients use methods like tools/list to discover available primitives dynamically.</p><p>MCP also defines client primitives, allowing servers to request actions from the AI application, such as:</p><ul><li><strong>Sampling:</strong> Requesting an LLM completion from the client.</li><li><strong>Elicitation:</strong> Asking the end-user for more information or confirmation.</li><li><strong>Logging: </strong>Sending log messages to the client for debugging.</li></ul><h4>Example MCP workflow</h4><p>Consider a scenario where an AI assistant helps with customer support.</p><ul><li><strong>User Query:</strong> A customer types, “My order #XYZ-789 hasn’t arrived. What’s the status?”</li><li><strong>Client Discovers Tools:</strong> The support app (MCP Host) has already connected to an order management server. Upon connection, it would have used a tools/list request to discover available tools, finding one named getOrderStatus.</li><li><strong>Client Executes Tool:</strong> The app’s logic identifies the order number. It then sends a tools/call request to the MCP server. The JSON-RPC payload would look like this:</li></ul><pre>{<br>  &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>  &quot;method&quot;: &quot;tools/call&quot;,<br>  &quot;params&quot;: {<br>    &quot;name&quot;: &quot;getOrderStatus&quot;,<br>    &quot;arguments&quot;: { &quot;orderId&quot;: &quot;XYZ-789&quot; }<br>  },<br>  &quot;id&quot;: 1<br>}</pre><ul><li><strong>Server Processes:</strong> The MCP server receives this request, runs its internal getOrderStatus function, and finds the order details in its database.</li><li><strong>Server Responds:</strong> The server sends back a JSON-RPC response containing the retrieved context:</li></ul><pre>{<br>&quot;jsonrpc&quot;: &quot;2.0&quot;,<br>&quot;result&quot;: {<br>&quot;content&quot;: \[<br>{ &quot;type&quot;: &quot;text&quot;, &quot;text&quot;: &quot;Order \#XYZ-789 was shipped on 2024–07–20 via Carrier A, tracking number TRK123. Latest status: &#39;In Transit \- Delayed&#39;.&quot; }<br>\]<br>},<br>&quot;id&quot;: 1<br>}</pre><ul><li><strong>Client Constructs Prompt &amp; Sends to LLM:</strong> The client now has the precise context from the tool. It combines it with the user’s query and sends it to the LLM for a natural language response.</li></ul><h3>Best Practices</h3><p>When building with MCP, keep these principles in mind for robust and efficient systems:</p><ul><li><strong>Be Concise: </strong>Expose only the necessary context to the model. Keep tool outputs as brief as possible.</li><li><strong>Version Your Primitives: </strong>Add versioning to your tools and resources to avoid breaking changes for clients using them in production.</li><li><strong>Handle Errors Gracefully:</strong> Ensure your tools have clear fallback behaviors and can handle unexpected errors without crashing.</li><li><strong>Monitor Everything:</strong> Keep an eye on the usage and performance of your context calls to identify bottlenecks or issues.</li></ul><h3>Benefits of Using MCP</h3><p>Implementing a Model Context Protocol system offers substantial advantages:</p><ul><li><strong>Enhanced AI Performance:</strong> By supplying models with precise context, they produce more accurate and relevant outputs.</li><li><strong>Cost Efficiency:</strong> Minimizes sending redundant data to LLM APIs, optimizing operational costs.</li><li><strong>Scalability:</strong> Enables applications to manage complex, long-running conversations without exceeding an LLM’s context window.</li><li><strong>Standardized Integration:</strong> MCP provides a standard way to connect to tools, reducing the need for custom, brittle integrations for each new data source.</li><li><strong>Complements, Not Replaces, Agent Frameworks:</strong> It’s crucial to understand that MCP is <strong>not an agent orchestration framework</strong> like LangChain or crewAI. It doesn’t decide when to call a tool. Instead, MCP is the standardized plumbing that those frameworks can use to make tool integration seamless. It handles the connection and data exchange, allowing the agent framework to focus on reasoning and planning.</li></ul><h3>The Future of MCP</h3><p>The Model Context Protocol continues to evolve, with future developments likely to include:</p><ul><li><strong>Broader Transport Support:</strong> Potential for standardization over other protocols like gRPC and GraphQL.</li><li><strong>Tighter Multi-Agent Integration:</strong> Creating standardized bridges between popular agent orchestration frameworks (like LangChain and BeeAI) and MCP.</li><li><strong>Enhanced Tool Discovery:</strong> Building central registries of public MCP servers and primitives to make them easier to find and reuse across applications.</li><li><strong>Improved Developer Experience:</strong> Creating visual editors for defining primitives, automating code generation, and offering hosted MCP services to simplify deployment.</li></ul><h3>Conclusion</h3><p>The Model Context Protocol is a fundamental technology for developing modern, intelligent AI applications. It serves as the critical mechanism enabling AI models to transcend simple, isolated queries and engage in rich, context-aware interactions.</p><p>By clearly delineating the responsibilities of the MCP server and client, this protocol ensures that AI models consistently receive the essential background information to operate at their peak. For developers aiming to build truly intelligent and scalable AI applications, a comprehensive grasp of the Model Context Protocol is an invaluable asset.</p><p>Hey there! Thanks for reading up till this point. Please do well to leave a clap and a comment. Have a great day! 🧡</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f8f0e7e9240" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a FastAPI Number Classification API with Docker, Nginx, and AWS EC2]]></title>
            <link>https://medium.com/@sin4ch/deploying-a-fastapi-number-classification-api-with-docker-nginx-and-aws-ec2-fe2358ef7835?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe2358ef7835</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[nginx-reverse-proxy]]></category>
            <category><![CDATA[fastapi]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Sat, 03 May 2025 11:12:40 GMT</pubDate>
            <atom:updated>2025-05-03T11:18:32.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsB53P2rXDJ4TjF-vR0Zuw.png" /></figure><h3>Introduction</h3><p>Building and deploying web APIs is a fundamental skill for modern developers. This tutorial guides you through the complete process of creating a Python-based Number Classification API using the high-performance FastAPI framework, containerizing it with Docker for consistent environments, and deploying it to the cloud on an AWS EC2 instance, using Nginx as a robust reverse proxy.</p><p>Our goal is to build an API endpoint that accepts an integer and returns various classifications (like prime, perfect, Armstrong), the sum of its digits, and a fun mathematical fact fetched from an external API (http://numbersapi.com).</p><p>You can find my version of the project on GitHub <a href="https://github.com/sin4ch/number_classification_api/">here</a>.</p><p>By following this guide, you will learn to:</p><ul><li>Develop a functional web API using FastAPI, including path operations, request handling, Pydantic models, and external API integration.</li><li>Understand and implement CORS (Cross-Origin Resource Sharing) for web APIs.</li><li>Containerize the Python application using Docker, writing a Dockerfile and building images.</li><li>Set up a basic cloud server environment on AWS EC2.</li><li>Configure Nginx as a reverse proxy to handle incoming traffic and forward it to the application container.</li><li>Automate the deployment process using a bash script.</li></ul><p>This article is aimed at developers with some Python experience who are looking to expand their skills into API development, containerization, and cloud deployment.</p><h3>Table of Contents</h3><ol><li>Introduction</li><li>Developing the FastAPI Application</li><li>Containerizing with Docker</li><li>Preparing the Cloud Environment (AWS EC2)</li><li>Deploying Manually (Conceptual Steps Covered by Script)</li><li>Automating Deployment with a Bash Script</li><li>Troubleshooting Common Deployment Issues</li><li>Updating the Deployment</li><li>Conclusion</li></ol><h3>1. Developing the FastAPI Application</h3><p>FastAPI is a modern, fast (high-performance) web framework for building APIs with Python 3.7+ based on standard1 Python type hints. It’s built upon Starlette (for the web parts) and Pydantic (for the data parts).</p><h3>1.1. Project Setup and Dependencies</h3><p>First, ensure you have Python 3.8+ installed. Create a project directory and set up a virtual environment:</p><pre>mkdir number_classification_api<br>cd number_classification_api<br>python3 -m venv venv<br>source venv/bin/activate # On Linux/macOS<br># .\venv\Scripts\activate # On Windows</pre><p>We need several libraries: fastapi itself, uvicorn to serve the application, requests to call the external Numbers API, and sympy for an efficient primality test. Create a requirements.txt file:</p><pre># requirements.txt<br>fastapi[standard]<br>uvicorn[standard]<br>requests<br>sympy</pre><p>Install them:</p><pre>pip install -r requirements.txt</pre><h3>1.2. Core Application Logic (main.py)</h3><p>Create a file named main.py. This will contain our API logic.</p><pre># main.py<br>import fastapi<br>from fastapi import status, HTTPException<br>import sympy # For isprime()<br>from pydantic import BaseModel<br>from fastapi.middleware.cors import CORSMiddleware<br>import requests<br>from requests.exceptions import RequestException<br>import logging # Optional: for better logging<br>from typing import List # Use typing.List for older Python versions if needed<br><br># Configure logging (Optional but recommended)<br>logging.basicConfig(level=logging.INFO)<br>logger = logging.getLogger(__name__)<br>app = fastapi.FastAPI()<br><br># --- CORS Middleware ---<br># Allows requests from web browsers on different origins (domains)<br>app.add_middleware(<br>    CORSMiddleware,<br>    allow_origins=[&quot;*&quot;], # Allow all origins (adjust for production)<br>    allow_credentials=True,<br>    allow_methods=[&quot;*&quot;], # Allow all HTTP methods<br>    allow_headers=[&quot;*&quot;], # Allow all headers<br>)<br><br># --- Pydantic Model for Response ---<br># Defines the structure and data types of the API response<br>class Armstrong(BaseModel):<br>    number: int<br>    is_prime: bool<br>    is_perfect: bool<br>    properties: list[str] # Use list[str] for Python 3.9+<br>    digit_sum: int<br>    fun_fact: str<br><br># --- Helper Functions for Number Classification ---<br>def split_integer(n: int) -&gt; List[int]:<br>    &quot;&quot;&quot;Splits an integer into a list of its digits.&quot;&quot;&quot;<br>    if n &lt; 0: n = abs(n) # Handle negative numbers if necessary<br>    if n == 0: return [0]<br>    digits = []<br>    temp_n = n<br>    while temp_n &gt; 0:<br>        digit = temp_n % 10<br>        digits.append(digit)<br>        temp_n //= 10<br>    return digits[::-1] # Reverse to get correct order<br><br>def check_perfect(n: int) -&gt; bool:<br>    &quot;&quot;&quot;Checks if a number is a perfect number.&quot;&quot;&quot;<br>    if n &lt; 1: return False # Perfect numbers are positive integers<br>    divisor_sum = 0<br>    for i in range(1, n):<br>        if n % i == 0:<br>            divisor_sum += i<br>    return divisor_sum == n<br><br>def check_armstrong(n: int) -&gt; bool:<br>    &quot;&quot;&quot;Checks if a number is an Armstrong number.&quot;&quot;&quot;<br>    if n &lt; 0: return False # Typically defined for non-negative integers<br>    digits = split_integer(n)<br>    num_digits = len(digits)<br>    armstrong_sum = sum(digit ** num_digits for digit in digits)<br>    return armstrong_sum == n<br><br>def check_even_or_odd(n: int) -&gt; str:<br>    &quot;&quot;&quot;Determines if a number is even or odd.&quot;&quot;&quot;<br>    return &quot;even&quot; if n % 2 == 0 else &quot;odd&quot;<br><br>def assign_property(n: int) -&gt; list[str]:<br>    &quot;&quot;&quot;Assigns properties like &#39;armstrong&#39; and &#39;even&#39;/&#39;odd&#39;.&quot;&quot;&quot;<br>    property_list = []<br>    if check_armstrong(n):<br>        property_list.append(&quot;armstrong&quot;)<br>    property_list.append(check_even_or_odd(n))<br>    return property_list<br><br>def add_digits(n: int) -&gt; int:<br>    &quot;&quot;&quot;Calculates the sum of the digits of a number.&quot;&quot;&quot;<br>    return sum(split_integer(n))<br><br># --- External API Integration ---<br>def get_fun_fact(number: int) -&gt; str:<br>    &quot;&quot;&quot;Fetches a fun math fact from numbersapi.com.&quot;&quot;&quot;<br>    try:<br>        api_url = f&quot;http://numbersapi.com/{number}/math&quot;<br>        # Set a timeout to prevent hanging indefinitely<br>        response = requests.get(api_url, timeout=5)<br>        # Raise an exception for bad status codes (4xx or 5xx)<br>        response.raise_for_status()<br>        return response.text<br>    except RequestException as e:<br>        logger.error(f&quot;Error fetching fun fact for {number}: {e}&quot;)<br>        return &quot;Could not retrieve fun fact at this time.&quot;<br>    except Exception as e: # Catch unexpected errors<br>        logger.error(f&quot;Unexpected error fetching fun fact: {e}&quot;)<br>        return &quot;An error occurred while retrieving the fun fact.&quot;<br><br># --- API Endpoint Definition ---<br>@app.get(<br>    &quot;/api/classify-number&quot;,<br>    response_model=Armstrong, # Validate the response against the Pydantic model<br>    status_code=status.HTTP_200_OK,<br>    summary=&quot;Classify an integer and get a fun fact&quot;,<br>    tags=[&quot;Classification&quot;] # Optional: for organizing docs<br>)<br>def classify_number_endpoint(number: int):<br>    &quot;&quot;&quot;<br>    Takes an integer query parameter `number` and returns its<br>    mathematical properties and a fun fact.<br>    &quot;&quot;&quot;<br>    # Basic input validation (FastAPI handles type errors for `int`)<br>    if number &lt; 0:<br>        # Example of custom validation/error handling<br>        raise HTTPException(<br>            status_code=status.HTTP_400_BAD_REQUEST,<br>            detail={&quot;error&quot;: &quot;Negative numbers are not supported for all classifications yet.&quot;}<br>        )<br>    fun_fact = get_fun_fact(number)<br>    # Assemble the response data<br>    result = {<br>        &quot;number&quot;: number,<br>        &quot;is_prime&quot;: sympy.isprime(number),<br>        &quot;is_perfect&quot;: check_perfect(number),<br>        &quot;properties&quot;: assign_property(number),<br>        &quot;digit_sum&quot;: add_digits(number),<br>        &quot;fun_fact&quot;: fun_fact<br>    }<br>    # Pydantic will automatically validate this dictionary against the Armstrong model<br>    return result<br># --- Optional: Root endpoint for basic check ---<br>@app.get(&quot;/&quot;, tags=[&quot;Root&quot;])<br>def read_root():<br>    return {&quot;message&quot;: &quot;Welcome to the Number Classification API!&quot;}<br># --- Running the App Locally (for development) ---<br># This block is typically not needed when running with Uvicorn command line<br># but can be useful for debugging.<br># if __name__ == &quot;__main__&quot;:<br>#     import uvicorn<br>#     uvicorn.run(app, host=&quot;127.0.0.1&quot;, port=8000)</pre><p><strong>Key FastAPI Concepts Used:</strong></p><ul><li>fastapi.FastAPI()<strong>:</strong> Creates the application instance.</li><li><strong>Path Operation Decorator (</strong>@app.get(...)<strong>):</strong> Defines an HTTP GET endpoint at the path /api/classify-number.</li><li><strong>Query Parameters (</strong>number: int<strong>):</strong> FastAPI automatically recognizes the number query parameter and validates that it&#39;s an integer. If validation fails, it returns a 422 Unprocessable Entity error.</li><li><strong>Pydantic Models (</strong>BaseModel<strong>):</strong> The Armstrong class defines the expected structure and types for the JSON response. FastAPI uses this for data validation and serialization, and also for generating API documentation. response_model=Armstrong in the decorator ensures the output matches this model.</li><li>HTTPException<strong>:</strong> Used for raising standard HTTP errors with custom details (e.g., 400 Bad Request).</li><li><strong>CORS Middleware (</strong>CORSMiddleware<strong>):</strong> Essential for allowing web frontends hosted on different domains to interact with your API. The configuration allow_origins=[&quot;*&quot;] is very permissive; in production, you should restrict this to specific domains.</li><li><strong>External API Integration (</strong>requests<strong>):</strong> The get_fun_fact function uses the requests library to fetch data from http://numbersapi.com. It includes error handling (try...except RequestException) and a timeout.</li><li><strong>Background Tasks (Implicit):</strong> While not explicitly using FastAPI’s BackgroundTasks, the request handling itself is asynchronous under the hood thanks to FastAPI and Starlette, allowing efficient I/O operations like the external API call.</li></ul><h3>1.3. Running Locally</h3><p>You can run the application locally using Uvicorn:</p><pre>uvicorn main:app --host 127.0.0.1 --port 8000 --reload</pre><ul><li>main:app: Tells Uvicorn to find the app object inside the main.py file.</li><li>--host 127.0.0.1: Binds the server to the local machine only.</li><li>--port 8000: Specifies the port to listen on.</li><li>--reload: Automatically restarts the server when code changes are detected (great for development).</li></ul><p>Open your browser to http://127.0.0.1:8000/docs to see the automatically generated interactive API documentation (Swagger UI). You can test the endpoint http://127.0.0.1:8000/api/classify-number?number=371 directly in your browser or using a tool like curl.</p><h3>2. Containerizing with Docker</h3><p>Docker allows us to package our application and all its dependencies (Python interpreter, libraries) into a standardized unit called a container. This ensures the application runs the same way regardless of the environment (local machine, staging server, production server).</p><h3>2.1. The Dockerfile</h3><p>Create a file named Dockerfile (no extension) in your project root:</p><pre># Dockerfile<br># 1. Base Image: Start with an official Python slim image<br>FROM python:3.10-slim<br># Using a specific version like 3.10-slim is good practice<br># 2. Set Working Directory: Define the working directory inside the container<br>WORKDIR /app<br># 3. Copy Requirements: Copy only the requirements file first<br># This leverages Docker&#39;s layer caching. If requirements.txt doesn&#39;t change,<br># the RUN step below won&#39;t be re-executed on subsequent builds.<br>COPY requirements.txt .<br># 4. Install Dependencies: Install Python packages<br># --no-cache-dir reduces image size<br># --upgrade pip ensures we have the latest pip<br>RUN pip install --no-cache-dir --upgrade pip &amp;&amp; \<br>    pip install --no-cache-dir -r requirements.txt<br># 5. Copy Application Code: Copy the rest of the application code into the container<br>COPY . .<br># 6. Expose Port: Inform Docker that the container listens on port 8000<br># This is documentation; it doesn&#39;t actually publish the port.<br>EXPOSE 8000<br># 7. Define Startup Command: Specify the command to run when the container starts<br># Use 0.0.0.0 to listen on all available network interfaces within the container,<br># necessary for Docker port mapping to work.<br>CMD [&quot;uvicorn&quot;, &quot;main:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;]</pre><p><strong>Dockerfile Instructions Explained:</strong></p><ul><li>FROM python:3.10-slim: Specifies the base image to build upon. slim variants are smaller than the full images.</li><li>WORKDIR /app: Sets the current directory for subsequent commands like COPY and RUN.</li><li>COPY requirements.txt .: Copies the requirements file from your local machine into the /app directory in the container.</li><li>RUN pip install ...: Executes the command to install dependencies inside the container. Using &amp;&amp; combines commands into a single layer.</li><li>COPY . .: Copies all files from the current directory on the host (where the Dockerfile is) into the /app directory in the container.</li><li>EXPOSE 8000: Documents that the application inside the container will listen on port 8000.</li><li>CMD [...]: Provides the default command to execute when the container starts. This runs our FastAPI app using Uvicorn.</li></ul><h3>2.2. Building the Docker Image</h3><p>Navigate to your project directory in the terminal (the one containing the Dockerfile) and run:</p><p>Bash</p><pre>docker build -t number-classifier-api .</pre><ul><li>docker build: The command to build an image.</li><li>-t number-classifier-api: Tags the image with a name (number-classifier-api) and optional tag (defaulting to latest). This makes it easier to refer to the image later.</li><li>.: Specifies the build context (the current directory), which tells Docker where to find the Dockerfile and the application code to COPY.</li></ul><p>Docker will execute the steps in the Dockerfile, downloading the base image and creating layers for each instruction.</p><p>You can optionally run the container locally to test the image:</p><pre>docker run -p 8080:8000 number-classifier-api</pre><p>This runs the container and maps port 8080 on your host machine to port 8000 inside the container. You should then be able to access the API at http://localhost:8080. Press Ctrl+C to stop it.</p><h3>3. Preparing the Cloud Environment (AWS EC2)</h3><p>AWS EC2 (Elastic Compute Cloud) provides virtual servers (instances) in the cloud. We’ll launch a simple Linux instance to host our application.</p><h3>3.1. Launching an EC2 Instance</h3><ul><li>Log in to the AWS Management Console.</li><li>Navigate to the EC2 service.</li><li>Click “Launch Instances”.</li><li><strong>Choose an AMI:</strong> Select an Amazon Machine Image (AMI), for example, “Ubuntu Server 22.04 LTS”.</li><li><strong>Choose an Instance Type:</strong> Select an instance size (e.g., t2.micro or t3.micro, which are often eligible for the AWS Free Tier).</li><li><strong>Configure Key Pair:</strong> Create or select an existing key pair (.pem file). You&#39;ll need this private key to connect via SSH. Download and save it securely.</li><li><strong>Network Settings (Security Group):</strong> This is crucial. Create a new security group or edit the default one. Add rules to allow inbound traffic on:</li><li><strong>Port 22 (SSH):</strong> From your IP address (for secure connection).</li><li><strong>Port 80 (HTTP):</strong> From Anywhere (0.0.0.0/0) so users can access the API.</li><li><strong>Port 443 (HTTPS):</strong> From Anywhere (0.0.0.0/0) if you plan to add SSL later.</li><li><strong>Configure Storage:</strong> Default settings are usually fine for this example.</li><li>Review and <strong>Launch Instance</strong>.</li></ul><p>Once the instance is running, note its <strong>Public IPv4 address</strong> or <strong>Public IPv4 DNS</strong>.</p><h3>3.2. Connecting via SSH</h3><p>Use the .pem key file you downloaded to connect to the instance. Replace &lt;your-key.pem&gt; and &lt;your_ec2_public_ip&gt;:</p><pre># Set restrictive permissions for your key file (required by SSH)<br>chmod 400 &lt;your-key.pem&gt;<br># Connect using SSH<br>ssh -i &lt;your-key.pem&gt; ubuntu@&lt;your_ec2_public_ip&gt;</pre><p>You are now logged into your EC2 instance’s terminal.</p><h3>3.3. Installing Necessary Tools</h3><p>On the EC2 instance, install Git (to clone the repository), Docker, and Nginx:</p><pre># Update package list<br>sudo apt update -y<br># Install Git, Docker, and Nginx<br>sudo apt install git docker.io nginx -y<br># Start and enable Docker service (to start on boot)<br>sudo systemctl start docker<br>sudo systemctl enable docker<br># Start and enable Nginx service<br>sudo systemctl start nginx<br>sudo systemctl enable nginx</pre><h3>3.4. Configuring Docker Permissions</h3><p>By default, you need sudo to run Docker commands. To run docker as the ubuntu user without sudo, add the user to the docker group:</p><pre>sudo usermod -aG docker ${USER}</pre><p><strong>Important:</strong> You need to log out of the SSH session and log back in for this group change to take effect.</p><pre>exit<br># Reconnect with the ssh command from step 3.2<br>ssh -i &lt;your-key.pem&gt; ubuntu@&lt;your_ec2_public_ip&gt;</pre><p>Verify by running docker ps without sudo. It should run without permission errors.</p><h3>4. Deploying Manually (Conceptual Steps Covered by Script)</h3><p>Before automating, let’s understand the manual steps involved in deploying the application on the EC2 instance after installing the tools:</p><ol><li><strong>Clone the Repository:</strong> Get your application code onto the server.</li></ol><pre>git clone &lt;your-repository-url&gt; cd &lt;repository-directory&gt;</pre><p>2. <strong>Build the Docker Image:</strong> Build the image on the EC2 instance using the Dockerfile in your repository.</p><pre>docker build -t number-classifier-api .</pre><p>3.<strong> Run the Docker Container:</strong> Start your application container.</p><pre>docker run -d --name number-classifier-container -p 127.0.0.1:8000:8000 --restart always number-classifier-api</pre><ul><li>-d: Run in detached mode (in the background).</li><li>--name number-classifier-container: Assign a name to the container for easy reference.</li><li>-p 127.0.0.1:8000:8000: <strong>Crucial:</strong> Map port 8000 <em>inside</em> the container to port 8000 on the host machine&#39;s <em>localhost interface only</em> (127.0.0.1). This means the app is not directly accessible from the outside world, only from the EC2 instance itself (specifically, by Nginx).</li><li>--restart always: Automatically restart the container if it stops or if the server reboots.</li><li>number-classifier-api: The name of the image to use.</li></ul><p>4.<strong> Configure Nginx:</strong> Set up Nginx to act as a reverse proxy. Create an Nginx configuration file in /etc/nginx/sites-available/. Let&#39;s call it number_api:</p><pre>sudo nano /etc/nginx/sites-available/number_api</pre><ul><li>Paste the following configuration, replacing &lt;your_ec2_public_ip_or_domain&gt; with your actual public IP or domain name:</li></ul><pre># /etc/nginx/sites-available/number_api <br>server {<br>     listen 80; # Listen on port 80 for incoming HTTP requests<br>     server_name &lt;your_ec2_public_ip_or_domain&gt;; # Your server&#39;s public IP or domain<br>     location / {<br>         # Forward requests to the FastAPI app running in Docker<br>         proxy_pass http://127.0.0.1:8000;<br>         # Set headers to pass information about the original request<br>         # Important for logging, rate limiting, and application logic<br>         proxy_set_header Host $host; # The original host requested by the client<br>         proxy_set_header X-Real-IP $remote_addr; # The real IP address of the client<br>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # List of IPs including proxies<br>         proxy_set_header X-Forwarded-Proto $scheme; # http or https<br>     }<br>      # Optional: Add error pages, access logs, etc.<br>      # access_log /var/log/nginx/number_api.access.log;<br>      # error_log /var/log/nginx/number_api.error.log;<br> }</pre><p>5.<strong> Enable the Nginx Site:</strong> Create a symbolic link from sites-available to sites-enabled to activate the configuration. Also, disable the default Nginx site if it exists.</p><pre># Disable default site (if enabled) <br>sudo rm -f /etc/nginx/sites-enabled/default <br># Use -f to avoid error if it doesn&#39;t exist  <br># Enable your site <br>sudo ln -sf /etc/nginx/sites-available/number_api /etc/nginx/sites-enabled/ <br># Use -sf to overwrite if exists  <br># Test Nginx configuration for syntax errors <br>sudo nginx -t  # Restart Nginx to apply changes <br>sudo systemctl restart nginx</pre><p>Now, your API should be accessible via http://&lt;your_ec2_public_ip_or_domain&gt;/api/classify-number?number=....</p><h3>5. Automating Deployment with a Bash Script</h3><p>Performing the manual steps every time is tedious and error-prone. We can automate this entire process using a bash script. The provided deploy_api.sh script does exactly this.</p><p>Create deploy_api.sh in your repository root:</p><pre>#!/bin/bash<br><br># Exit immediately if a command exits with a non-zero status.<br>set -e<br># --- Configuration ---<br>REPO_URL=&quot;https://github.com/sin4ch/number_classification_api.git&quot; # Change if your repo URL is different<br>PROJECT_DIR=&quot;number_classification_api&quot; # Directory name after cloning<br>IMAGE_NAME=&quot;number-classifier-api&quot; # Docker image name<br>CONTAINER_NAME=&quot;number-classifier-container&quot; # Docker container name<br>NGINX_CONF_FILE=&quot;number_api&quot; # Nginx config file name<br># --- Check for Server Name Argument ---<br>if [ -z &quot;$1&quot; ]; then<br>  echo &quot;Usage: $0 &lt;your_domain_or_public_ip&gt;&quot;<br>  exit 1<br>fi<br>SERVER_NAME=$1 # Get the domain/IP from the first argument<br>echo &quot;--- Starting Deployment for $SERVER_NAME ---&quot;<br># --- System Updates and Dependency Installation ---<br>echo &quot;Updating system packages...&quot;<br>sudo apt update -y<br>echo &quot;Installing Git, Docker, and Nginx...&quot;<br># Install quietly to reduce output noise<br>sudo apt install -y git docker.io nginx<br>echo &quot;Starting and enabling Docker service...&quot;<br>sudo systemctl start docker<br>sudo systemctl enable docker<br>echo &quot;Starting and enabling Nginx service...&quot;<br>sudo systemctl start nginx<br>sudo systemctl enable nginx<br><br>echo &quot;Adding current user ($USER) to the docker group (requires logout/login to take effect for interactive use)...&quot;<br># Note: The script uses sudo for docker commands, so logout/login isn&#39;t needed for the script itself.<br>sudo usermod -aG docker $USER || true # Add || true to prevent script exit if user is already in group<br># --- Application Code Setup ---<br>echo &quot;Cloning or updating repository from $REPO_URL...&quot;<br>if [ -d &quot;$PROJECT_DIR&quot; ]; then<br>  echo &quot;Project directory $PROJECT_DIR exists. Removing for fresh clone.&quot;<br>  # Optional: could do git pull instead, but fresh clone ensures clean state<br>  sudo rm -rf &quot;$PROJECT_DIR&quot;<br>fi<br>git clone &quot;$REPO_URL&quot; &quot;$PROJECT_DIR&quot;<br>cd &quot;$PROJECT_DIR&quot;<br>echo &quot;Successfully cloned and entered $PROJECT_DIR&quot;<br># --- Docker Build and Run ---<br>echo &quot;Building Docker image $IMAGE_NAME...&quot;<br># Use sudo because the user might not have logged out/in yet<br>sudo docker build -t &quot;$IMAGE_NAME&quot; .<br>echo &quot;Checking for and stopping/removing existing container $CONTAINER_NAME...&quot;<br># Check if container is running<br>if [ &quot;$(sudo docker ps -q -f name=$CONTAINER_NAME)&quot; ]; then<br>    echo &quot;Stopping existing container $CONTAINER_NAME...&quot;<br>    sudo docker stop &quot;$CONTAINER_NAME&quot;<br>fi<br># Check if container exists (even if stopped)<br>if [ &quot;$(sudo docker ps -aq -f name=$CONTAINER_NAME)&quot; ]; then<br>    echo &quot;Removing existing container $CONTAINER_NAME...&quot;<br>    sudo docker rm &quot;$CONTAINER_NAME&quot;<br>fi<br>echo &quot;Running Docker container $CONTAINER_NAME...&quot;<br>sudo docker run -d \<br>  --name &quot;$CONTAINER_NAME&quot; \<br>  -p 127.0.0.1:8000:8000 \<br>  --restart always \<br>  &quot;$IMAGE_NAME&quot;<br>echo &quot;Container $CONTAINER_NAME started.&quot;<br># --- Nginx Configuration ---<br>echo &quot;Configuring Nginx for $SERVER_NAME...&quot;<br>NGINX_CONFIG_PATH=&quot;/etc/nginx/sites-available/$NGINX_CONF_FILE&quot;<br># Use heredoc (&lt;&lt;EOF) to write the Nginx config file<br># Using sudo bash -c &quot;cat &gt; file&quot; is safer than sudo tee for complex heredocs<br>sudo bash -c &quot;cat &gt; $NGINX_CONFIG_PATH&quot; &lt;&lt;EOF<br>server {<br>    listen 80;<br>    listen [::]:80; # Also listen on IPv6 if available<br>    server_name $SERVER_NAME; # Use the variable passed to the script<br>    location / {<br>        proxy_pass http://127.0.0.1:8000; # Forward to the container<br>        proxy_set_header Host \$host;<br>        proxy_set_header X-Real-IP \$remote_addr;<br>        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto \$scheme;<br>    }<br>}<br>EOF<br>echo &quot;Nginx config created at $NGINX_CONFIG_PATH&quot;<br># --- Enable Nginx Site and Restart ---<br>echo &quot;Enabling Nginx site...&quot;<br># Remove default link if it exists<br>if [ -L &quot;/etc/nginx/sites-enabled/default&quot; ]; then<br>    echo &quot;Removing default Nginx site link...&quot;<br>    sudo rm -f /etc/nginx/sites-enabled/default<br>fi<br># Create link for our site if it doesn&#39;t exist, or update it if it points elsewhere<br># Using -sf ensures the link is correctly pointing to our config file<br>echo &quot;Creating/Updating Nginx site link...&quot;<br>sudo ln -sf &quot;$NGINX_CONFIG_PATH&quot; &quot;/etc/nginx/sites-enabled/&quot;<br><br>echo &quot;Testing Nginx configuration...&quot;<br>sudo nginx -t<br>echo &quot;Restarting Nginx to apply changes...&quot;<br>sudo systemctl restart nginx<br>echo &quot;--- Deployment Complete ---&quot;<br>echo &quot;Your API should be accessible at http://$SERVER_NAME&quot;<br>echo &quot;Consider setting up HTTPS using Certbot for security.&quot;<br>echo &quot;Note: If running docker commands manually later, you may need to log out and back in for group permissions to apply.&quot;</pre><h3>5.1. Using the Deployment Script</h3><ul><li>Make sure the script (deploy_api.sh) is committed and pushed to your Git repository.</li><li>SSH into your prepared EC2 instance.</li><li>Clone your repository:</li></ul><pre>git clone https://github.com/sin4ch/number_classification_api.git # Use your repo URL cd number_classification_api</pre><ul><li>Make the script executable:</li></ul><pre>chmod +x deploy_api.sh</pre><ul><li>Run the script, passing your EC2 instance’s public IP address or domain name as an argument:</li></ul><pre>./deploy_api.sh &lt;your_ec2_public_ip_or_domain&gt;</pre><p>For example:</p><pre>./deploy_api.sh 54.123.45.67 <br># OR if you have a domain pointing to the IP: <br># ./deploy_api.sh api.yourdomain.com</pre><p>The script will execute all the steps: update the system, install tools, configure Docker permissions, clone the code, build the image, stop/remove any old container, run the new container, create the Nginx configuration using the provided domain/IP, enable the site, and restart Nginx.</p><h3>6. Troubleshooting Common Deployment Issues</h3><p>Deployments don’t always go smoothly. Here are some common issues and how to approach them:</p><h4>404 Not Found<strong> Error:</strong></h4><p><strong>Cause:</strong> Nginx is running, but it doesn’t have a configuration matching the requested domain/IP or the specific URL path.</p><p><strong>Troubleshooting:</strong></p><ul><li>Check the server_name in your Nginx config (/etc/nginx/sites-available/number_api). Does it exactly match the domain or IP you&#39;re using in the browser?</li><li>Verify the Nginx site is enabled (check the symbolic link in /etc/nginx/sites-enabled/). Is ls -l /etc/nginx/sites-enabled/ pointing number_api to the correct file in sites-available?</li><li>Check Nginx error logs: sudo tail -f /var/log/nginx/error.log.</li><li>Ensure you restarted Nginx after making changes: sudo systemctl restart nginx.</li></ul><h4>502 Bad Gateway<strong> Error:</strong></h4><p><strong>Cause:</strong> Nginx is running and received the request, but it couldn’t connect to the upstream application (your FastAPI container).</p><p><strong>Troubleshooting:</strong></p><ul><li>Is the Docker container running? Check with docker ps. If not, check its logs: docker logs number-classifier-container. Did it crash on startup due to an error in main.py or missing dependencies?</li><li>Did you correctly map the port in the docker run command (-p 127.0.0.1:8000:8000)?</li><li>Is the proxy_pass directive in your Nginx config correct (http://127.0.0.1:8000)? Ensure the port matches the one exposed by the container <em>on the localhost interface</em>.</li><li>Check application logs within the container for errors: docker logs number-classifier-container.</li></ul><h4><strong>Docker Permission Errors:</strong></h4><p><strong>Cause:</strong> Trying to run docker commands without sudo before logging out and back in after the usermod -aG docker ${USER} command.</p><p><strong>Troubleshooting:</strong> Either use sudo for all Docker commands or log out and log back into your SSH session. The deployment script uses sudo, so it avoids this issue during execution.</p><h4>Dockerfile<strong> Not Found:</strong></h4><p><strong>Cause:</strong> Running docker build from a directory that doesn&#39;t contain the Dockerfile. Docker filenames are case-sensitive (Dockerfile, not dockerfile).</p><p><strong>Troubleshooting:</strong> Ensure you are in the correct directory (the root of your project where the Dockerfile resides) when running docker build -t &lt;name&gt; .. Check the filename casing.</p><h4><strong>Invalid Container Name Error:</strong></h4><p><strong>Cause:</strong> Trying to run a new container with docker run --name some-name when a container (even a stopped one) with that name already exists.</p><p><strong>Troubleshooting:</strong> Stop and remove the existing container before running the new one. The deployment script handles this automatically (docker stop and docker rm). Manually: docker stop some-name &amp;&amp; docker rm some-name.</p><h4><strong>General Debugging Tools:</strong></h4><ul><li>docker ps: List running containers.</li><li>docker ps -a: List all containers (including stopped ones).</li><li>docker logs &lt;container_name_or_id&gt;: View container logs.</li><li>sudo systemctl status nginx: Check Nginx service status.</li><li>sudo nginx -t: Test Nginx configuration syntax.</li><li>sudo journalctl -u nginx: View detailed Nginx service logs.</li><li>curl -v http://&lt;your_ip_or_domain&gt;/...: Make requests with verbose output to see headers and response codes.</li></ul><h3>7. Updating the Deployment</h3><p>If you make changes to your Python code (main.py or helper functions), you need to update the running application:</p><ul><li>Push your code changes to your Git repository.</li><li>SSH into your EC2 instance.</li><li>Navigate into the repository directory (cd number_classification_api).</li><li><strong>The easiest way to apply updates with this setup is to simply re-run the deployment script:</strong></li></ul><pre>./deploy_api.sh &lt;your_ec2_public_ip_or_domain&gt;</pre><p>The script is designed to be idempotent (mostly): it will remove the old project directory, clone the latest code, rebuild the Docker image (incorporating your changes), stop and remove the old container, and start a new one based on the updated image. It will also re-apply the Nginx configuration (which usually doesn’t change unless you modify the script).</p><p>This ensures the entire process is repeated consistently, applying your updates.</p><h3>8. Conclusion</h3><p>Congratulations! You’ve successfully journeyed from writing a local Python FastAPI application to deploying it as a containerized service on an AWS EC2 instance, fronted by an Nginx reverse proxy, with an automated deployment script.</p><p>You’ve learned how to:</p><ul><li>Build APIs quickly with <strong>FastAPI</strong>.</li><li>Handle data validation with <strong>Pydantic</strong>.</li><li>Integrate external APIs using <strong>requests</strong>.</li><li>Package applications reliably with <strong>Docker</strong>.</li><li>Set up a basic cloud server on <strong>AWS EC2</strong>.</li><li>Configure <strong>Nginx</strong> as a reverse proxy.</li><li>Automate deployment tasks with <strong>bash scripting</strong>.</li></ul><p>This setup provides a solid foundation for deploying web applications.</p><p><strong>Next Steps to Consider:</strong></p><ul><li><strong>HTTPS:</strong> Secure your API by adding SSL/TLS encryption using Let’s Encrypt and Certbot with Nginx.</li><li><strong>Domain Name:</strong> Point a proper domain name to your EC2 instance’s IP address using DNS records.</li><li><strong>CI/CD:</strong> Implement a Continuous Integration/Continuous Deployment pipeline (e.g., using GitHub Actions, GitLab CI, Jenkins) to automatically build, test, and deploy your application whenever you push changes to your repository.</li><li><strong>Monitoring and Logging:</strong> Set up more robust logging and monitoring for your application and server (e.g., CloudWatch, Prometheus, Grafana, ELK stack).</li><li><strong>Database Integration:</strong> Add a database to store persistent data.</li><li><strong>Scalability:</strong> Explore techniques for scaling your application, such as running multiple containers behind Nginx or using container orchestration services like AWS ECS or EKS.</li></ul><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe2358ef7835" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Tech Innovation Seems Slower These Days]]></title>
            <link>https://medium.com/@sin4ch/why-tech-innovation-seems-slower-these-days-fe79b14d0f99?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe79b14d0f99</guid>
            <category><![CDATA[amd]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[moores-law]]></category>
            <category><![CDATA[intel]]></category>
            <category><![CDATA[nvidia]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 21:24:40 GMT</pubDate>
            <atom:updated>2025-04-18T22:57:52.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pMFu_xRwKm08bHfJ" /></figure><h3>Introduction</h3><p>I know it’s not just me who feels like tech announcements are no longer as revolutionary as they used to be a few years ago. At that time, with every gadget launch, we usually experienced monumental performance upgrades. Right now, we’d be lucky to see incremental changes. I’d like to talk about how this might not exactly be the companies’ faults (don’t worry, I won’t be playing devil’s advocate here) and some promising stuff that might help fix some of these innovation brick walls we seem to have hit.</p><h3>Moore’s Law</h3><p>One of the main reasons why technology isn’t advancing as quickly as it used to can be attributed to <strong>Moore’s Law, </strong>or the recent/apparent “failures” of the law. I’ll explain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iJEDVutKllTmmsfZ.png" /><figcaption>By Max Roser, Hannah Ritchie — <a href="https://ourworldindata.org/uploads/2020/11/Transistor-Count-over-time.png">ourworldindata.org</a></figcaption></figure><p>This idea was formed by Gordon Moore, the co-founder of Intel, in the 1960s. It says that <strong>the number of transistors on microchips, which are found in electronic devices, doubles about every two years</strong>. If you look through the chart above, you’d see that this law has been somewhat accurate since the early 70’s.</p><p>However, we are now getting close to the physical limits of this law, and the performance increases are becoming much smaller.</p><h3>The Shrinking Transistor and Its Limits</h3><p>For many years, microchips became more powerful by making their individual “transistors” smaller. This allowed more transistors to fit in the same area on the chip. So, smaller transistors meant more transistors, and more transistors meant more power.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*6Xzml6DtRiqoup1Mse_kWQ.png" /></figure><p>But, you can only make transistors so small.</p><h3>The Quantum Hurdle for Electrons</h3><p>If you know anything about quantum mechanics, you’ll understand why there’s a problem. To keep it simple, the rules that govern the everyday world we see (called classical mechanics or general relativity) are very different from the rules that control the world of atoms and electrons (quantum mechanics).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*Ss5y8C9L_707fI0U.png" /><figcaption>EWT — <a href="https://energywavetheory.com/spacetime/mechanics/">energywavetheory.com</a></figcaption></figure><p>Electrons are what carry data in these transistors. As you probably know, computers are digital, meaning they work with ‘bits’: 1s and 0s, the binary system.</p><p>Think of transistors as switches. There are two options to a switch: on or off. If you turn on the switch, light comes on (one, 1). Off, then the light goes off (zero, 0). Each transistor either blocks (representing a zero) or allows (representing a one) the flow of these electrons. The repeated switching of these transistors, billions of times per second, across billions of transistors, on a single chip, is how modern chips process/compute data and turn it into useful information.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYIkMaQJSyP8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYIkMaQJSyP8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYIkMaQJSyP8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/06938c690a6af7a005e0a287eb664201/href">https://medium.com/media/06938c690a6af7a005e0a287eb664201/href</a></iframe><p>These transistors are just a few nanometers across, only a handful of atoms wide. At that scale, electrons can tunnel/phase through the transistors instead of staying put or flowing normally. This quantum tunneling causes unwanted current leaks and extra heat. At the same time, the <strong>Heisenberg Uncertainty Principle</strong> says we cannot know a particle’s exact position and momentum at once. So, at that scale, we can’t accurately predict how these transfers will happen so transistors become hard to control reliably.</p><blockquote>As we continue to <a href="https://builtin.com/hardware/nanotechnology-examples">miniaturize chips</a>, we’ll no doubt bump into <a href="https://en.wikipedia.org/wiki/Uncertainty_principle">Heisenberg’s uncertainty principle</a>, which limits precision at the quantum level, thus limiting our computational capabilities. <a href="https://ieeexplore.ieee.org/document/4567410">James R. Powell calculated</a> that, due to the uncertainty principle alone, Moore’s Law will be obsolete by 2036.</blockquote><blockquote><a href="https://builtin.com/authors/przemek-chojecki">Przemek Chojecki</a> — <a href="https://builtin.com/hardware/moores-law#:~:text=As%20we%20continue%20to%20miniaturize,will%20be%20obsolete%20by%202036">Builtin.</a></blockquote><p>This is why you often hear people online saying that Moore’s Law is “dead.” It’s because we can’t physically double the performance of chips at the same rate as we did in the past.</p><h3>Workarounds: Chiplets and Marketing*</h3><p>One way that chip-producing companies are trying to get around this limit is by using <strong>“chiplets.”</strong> This means that different parts of the processor are made at different nanometer scales. Some parts of a processor don’t need to be made extremely small to get the same or slightly better performance. So, companies combine these different parts into one big <strong>SoC (System on Chip)</strong> and sell it as a processor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0bVILrBKbqz9LH37.jpg" /><figcaption><a href="https://www.techpowerup.com/301071/amd-explains-the-economics-behind-chiplets-for-gpus">TechPowerUp</a></figcaption></figure><p>However, some companies have taken this further with misleading marketing. During their presentations, you might hear big companies say their chips are based on a <strong>3nm node</strong> or <strong>2nm node</strong>, etc. Often, this number comes from only some parts of the CPU being made on that tiny scale. Even if most of the components are made on a <strong>5nm</strong> or even <strong>10nm</strong> node (lower numbers are generally better), if only a small percentage (like 1–20%) uses the smallest nanometer node, they still use that number to impress people.</p><p>They sometimes even go as far as to rebrand older chips as new ones. This is why many chip-making companies are seeing only small and gradual improvements in their products’ performance.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FwxKGFxmwcDo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwxKGFxmwcDo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwxKGFxmwcDo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/680d17a818229e34a02f0322cbc04146/href">https://medium.com/media/680d17a818229e34a02f0322cbc04146/href</a></iframe><p>In a way, it’s not entirely their fault because the physical limitations are real, but they also need to keep their investors happy.</p><h3>The Rise of AI in Performance Enhancement</h3><p>These limitations are also a big reason why many companies, like NVIDIA, have started using <strong>AI</strong> to boost performance. Technologies like <strong>DLSS (Deep Learning Super Sampling)</strong> are examples of this. Anywhere you see terms like “Super Sampling” or “Frame Generation” (which has become very popular with the rise of generative AI and large language models), you should know that these are AI-powered enhancements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q8tJj2IrnzC4kiIE" /><figcaption><a href="https://www.digitaltrends.com/computing/how-dlss-4-actually-works/">Digital Trends</a></figcaption></figure><h3>Promising Future Technologies</h3><p>There are some promising technologies that might help or even completely solve this problem in the future. These include <strong>photonic computing</strong> (using light instead of electrons to carry data) and <strong>quantum computing</strong> (which uses quantum properties to store information). While quantum computers might not be ideal for most of our current everyday tasks, their ability to perform certain complex calculations very quickly is a significant advantage.</p><h3>Conclusion</h3><p>The challenges posed by the slowing of Moore’s Law are undeniable. As we reach the atomic limits of transistor scaling, the traditional path to increased computing power is becoming less effective. While current strategies like chiplets and AI offer some relief, the long-term future likely depends on breakthroughs in areas such as photonic and quantum computing. These emerging technologies represent our best hope for continuing the exponential growth in computing that has defined the past decades.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe79b14d0f99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HNG Stage 0: Serving A Simple Webpage Through NGINX On An Amazon EC2 Instance.]]></title>
            <link>https://medium.com/@sin4ch/hng-stage-0-serving-a-simple-webpage-through-nginx-on-an-amazon-ec2-instance-c885225c3bd7?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/c885225c3bd7</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Fri, 31 Jan 2025 04:05:08 GMT</pubDate>
            <atom:updated>2025-02-23T17:08:11.848Z</atom:updated>
            <content:encoded><![CDATA[<h3>HNG12 Stage 0: Serving A Simple Webpage Through NGINX On An Amazon EC2 Instance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rz-eJIW1isJQZ0zFgxrhyQ.png" /></figure><h3><strong>Introduction</strong></h3><p>This article will guide the reader through my HNG DevOps Stage 0 Task which was to serve a simple HTML page through NGINX server installed on an Amazon EC2 instance.</p><p>By the way, HNG is currently hiring <a href="https://hng.tech/hire/devops-engineers">DevOps</a> and <a href="https://hng.tech/hire/cloud-engineers">cloud</a> engineers.</p><h3>Requirements</h3><ol><li>An AWS Account. Find how to open one <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html">here</a>.</li><li>Fair experience with the Linux CLI.</li></ol><h3>Procedure</h3><p><strong>Step 1: Create an EC2 Instance</strong></p><p>a) To create an EC2 instance, navigate to the search bar on the AWS management console and type in EC2. Wait for the popup beneath the search bar and click on EC2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyeduBqXpySpxxB3UnXvbw.png" /></figure><p>b) On the following page, click on the big, orange “Launch Instance” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--G40Av9zALW2bX8uIXaNA.png" /></figure><p>c) In the form that follows, first fill in your chosen name for the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KePKzOHl4p194ZcWYBJNg.png" /></figure><p>d) Under <em>Application and OS Images (Amazon Machine Image)</em>, select the Linux distro you’d want for your instance. I usually choose Ubuntu (I used Amazon Linux 2 for this task). Go for a free-tier eligible AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1QbR5NKrVYntmrDQlprtQ.png" /></figure><blockquote><em>Note: If you’re just creating an account for the first time, your account should have free tier. This allows you to use certain services to certain extents beyond what older accounts, i.e. accounts beyond one year, can. Try to stay within the free tier bracket unless you want to cry later. You can do you though. 🙂</em></blockquote><p>d) Under <em>Instance type, </em>select t2-micro. It’s the free-tier eligible instance type. However, feel free to do you, ok? 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGmkMhxAlfgMFolnZggw6A.png" /></figure><p>e) Under <em>Key Pair</em>, select a pre-created one. If you don’t have one already, or you’re just creating your account, you can find steps to create one <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-8swMaio4rXZBJbjSARkQ.png" /></figure><p>f) Under <em>Network Settings, </em>you can utilize the default VPC and subnet. In the <em>Firewall (security groups) section</em>, tick the three checks beneath it as shown in the image below. This allows for your instance to be accessible through the internet and remotely through SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHsAHuyOn0mYNX9jbwiAxg.png" /></figure><p>g) Under <em>Configure storage, </em>leave the value as is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-YSpeAH1XDNRfgnmP15Pg.png" /></figure><p>h) On the right hand of the Management Console UI, you’ll see a summary of your about-to-be-created instance. After verifying that you have all you need, then click <em>Launch Instance.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eeCAsci3B2mR3P6z7G2OUA.png" /></figure><p><strong>Step 2: Install and enable NGINX on the instance.</strong></p><p>a) After launching the instance, if the left side bar isn’t already rolled out, click on the hamburger icon on the top right of the AWS Console, beneath the AWS icon, and click on the arrow beside <em>Instances, </em>if it’s not already unrolled<em>, </em>and then click on Instances. Again.</p><p>Ask AWS why they did it like that not me.😪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*LLKbNNazrWJ_u2pNcrSLPQ.png" /></figure><p>b) On the page that appears, a <em>Resources </em>sections appears, usually above others, showcasing vital info about instances. Click on the <em>Instances (running).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTCVoBvLq4VA7uuuMNOG-Q.png" /></figure><p>c) In the following page. You’ll see a list of already started instances. Click on the tick box beside your instance. When you do that, a box beneath showcasing important information about your instance appears, your instance’s public IP address being one of them. Take note of that. At the top menu bar of the Instances, a previously grayed out <em>Connect </em>icon is now lit up. Click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ev62tW0LU35mkXfShzrsFQ.png" /></figure><p>d) This section is to remotely connect to your instance through SSH or Session Manager. Click on the <em>Connect</em> button below the information of your instance. This opens up a CLI window that connects you to your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbp1umZIlC_XTM6Mo7IKVw.png" /></figure><blockquote><em>If you’d rather use a remote CLI to connect, like your local machine’s CLI, check under the SSH Client in the menu bar above.</em></blockquote><p>e) Within it, run the following commands to install and enable NGINX.</p><pre>sudo yum update; sudo apt upgrade -y # Update your binaries<br>sudo yum install nginx # Install NGINX into your instance<br>sudo systemctl enable nginx # Enable NGINX<br>sudo systemctl start nginx #Start NGINX</pre><p><strong>Step 3: Change the default NGINX HTML file to one of your choice.</strong></p><p>a) Now, your instance is now an NGINX server, if you copy and paste the public IP we spoke about some steps back, you’ll be met with NGINX default HTML page. To replace the default index.html file with one of your choice, run the following commands:</p><pre>cd /usr/share/nginx/html # Switch to the directory with the default HTML file<br>sudo mkdir index # Create a new index folder to move the default HTML file into<br>sudo mv ./index.html ./index # Move the default html file into the folder<br>touch index.html # Create a new index.html file<br>vim index.html # Open this index.html file in the Vim editor</pre><p>b) At this point, a blank page opens. This is the Vim editor. Copy the code below, then on the Vim editor, press the “i” key on your keyboard to enter insert mode and paste it. Make sure to make the necessary changes as indicated.</p><pre>&lt;!DOCTYPE HMTL&gt;<br>&lt;html&gt;<br><br>&lt;head&gt;<br>  &lt;title&gt;Welcome to HNG DevOps Stage 0!&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>  Welcome to DevOps Stage 0 - [insert your name here]/[insert your HNG Slack username here]<br>&lt;/body&gt;<br><br>&lt;/html&gt;</pre><p>c) Press the Escape key and then click “:wq” and then press the Enter key. This saves your work and quits from the Vim editor.</p><p>d) Then enter this into the CLI:</p><pre>sudo systemctl restart nginx</pre><p>e) Now go back to Step 2, sub-step (c) above. Copy the IP address there. Paste it in the address bar of your browser. Something like the below should show up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-gVYIDnlOTft0csLENT-w.png" /></figure><blockquote><em>Note: if you use Chrome, be careful to change the “https” before the IP to http, as Chrome automatically switches this and unless the NGINX config says otherwise, your server can only be connected through HTTP not HTTPS</em></blockquote><h3>Challenges and Conclusion</h3><p>The primary challenge I faced with this project was network. As you can see, it’s a pretty simple project and HNG did a good job of properly defining the task. I took longer to complete it than I ordinarily would have.</p><p>Also, the default NGINX HTML file are located in a different location from what was indicated in the task. This is the case for Amazon Linux 2 instances, which are usually the default for AWS.</p><p>Otherwise, this was a great project and helped me appreciate my good understanding of the AWS CLI. Looking forward to more stages and the challenges that come with them.</p><h3>Connect with me</h3><p><a href="https://linktr.ee/osinachiokpara">Linktree</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c885225c3bd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Infrastructure is the Future of AI]]></title>
            <link>https://medium.com/@sin4ch/infrastructure-is-the-future-of-ai-72fd31dd7c03?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/72fd31dd7c03</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 19:20:25 GMT</pubDate>
            <atom:updated>2026-01-06T14:36:18.557Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Az7Zfvy-hn4znEBUznrK3Q.png" /></figure><p><em>This article is the script for my speech at Google Developer Groups’ Benin’s DevFest 2024. Here’s a </em><a href="https://docs.google.com/presentation/d/1_JhTdx2iAf40uR3zB5uHwQ6D7tT9YAzLJo1FrTou61Y/edit#slide=id.g31b9a371621_0_92"><em>link</em></a><em> to the slides for the presentation and the </em><a href="https://drive.google.com/file/d/1-ITqwqv2H7hOGSiBJMQdqhBT-MRUHpbq/view?usp=drivesdk"><em>link</em></a><em> to the recording of the speech. 🧡</em></p><p><strong>Introduction</strong></p><p>Hi, everyone. My name is Osinachi Okpara and, today, I’ll be talking about why I believe infrastructure is the future of AI.</p><p>And what I mean by this is: for us to reach the AGI future we so increasingly aspire for, we might have to rethink how we train, develop and deploy AI models — by looking to the very systems that enable the support of and access to these models, which is the infrastructure.</p><p><strong>The True Reach of Generative AI (GenAI)</strong></p><p>I’ll speak in a bit about what I mean by infrastructure, and the reframing we need to move forward with, but first, I’d like us to really look and appreciate how much AI, particularly GenAI, has developed within the last two years.</p><p>Many of us don’t realize that GenAI has only been around for only about two years, at least in the mainstream. We underestimate how truly magical GenAI is, and by underestimate, I don’t just mean its capabilities but its pervasiveness, how much it has dramatically transformed our societies, industries and life in general today.</p><p>To illustrate the gross levels of pervasion and adoption of these models, this graph shows the time taken in months for the most popular apps today to reach 100M users. It took ChatGPT a whopping 2 months to reach 100M users. That’s about 1.5 million users every single day, getting to encounter the magic that is GenAI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*iaPBZCFxLwAYKO0a" /></figure><p>The CEO of Google, in an interview at the World Economic Forum in 2020, said that the discovery of AI is as profound as fire and electricity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BzvXEGkXSNT2groy" /></figure><p><strong>Big Tech and GenAI</strong></p><p>He believes this so much that at their last I/O event, they counted how many times AI was mentioned in the span of the 2-hour event, and the numbers came out to 120 times. Meaning, AI was mentioned at least once every minute of the showcase 😅😅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y43TYPaQ_yTjMe6o" /></figure><p>Apple’s latest, headline feature is basically a remix of the meaning of AI — they call it Apple Intelligence now. Classic Apple, lol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9E6AHOkgKaoI7CA4" /></figure><p>The richest company in the world right now, Nvidia, is at that height literally because they have properly positioned themselves as the sole provider for the devices powering this entire GenAI rave — the GPU.</p><p><strong>How AI Is Touching Every Facet Of Our Living</strong></p><p>AI is not just a marketing rave, however. It’s effectively revolutionizing every aspect of our lives, from medicine with AlphaFold.</p><p>Now, AlphaFold is an AI model that was developed 2 years ago to predict the folding of all the protein molecules that are known to man currently. Before AlphaFold, a little over 20,000 protein structures had been mapped. Since the launch of AlphaFold 2 in July 2021, around 200 million protein folding structures have been predicted. This has been appraised to be one of the most significant AI discoveries, as this discovery could lead to new drugs and possible entire cures for diseases like cancer and diabetes.</p><p>In education, companies like Chegg, the assignment and study guide site, are having their market share wiped out by up to 99%!</p><p>99%! By ChatGPT!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zBcOVRVC5LruJp_V" /></figure><p>Let that sink in.</p><p>It is even transforming the world of art and content creation. Many of you have come across AI generated images. Many of us saw that incredibly realistic Pope Francis one. Some of us have even encountered these videos with AI narrators on YouTube or TikTok.</p><p>I’d like to pose a challenge to everybody here. Who here can identify which of these faces is a real person’s face?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uVc4f2PTEihr62sc" /></figure><p>Shocker: none of these faces are real!</p><p>I see your jaw dropped. Mine dropped as well when I first came across it.</p><p>AI art is even winning competitions with real people. These kinds of things raise a lot of questions as to what art actually is. A while back people didn’t think AI could ever be creative.</p><p>AI is everywhere and it’s thoroughly exciting. Very scary, considering how good it’s getting and how we have watched way too many AI armageddon movies, but still, as I am a pangloss, extremely exciting.</p><p>However, we’re gradually, slowly and surely, reaching the boundaries of AI advancement. We’re currently at an AI impasse.</p><p><strong>The Problem With Our Current Path To AI Development</strong></p><p>In an article titled: Is AI really at a dead end by Layak Singh, he pretty much lays out the current order of developing the current GenAI models like ChatGPT and Gemini and spells out the reason why this path is leading us nowhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IXzso7f4634sVfTu" /></figure><p>You see, the way AI models are built today is just as simple as this: get big, powerful computers, get huge amounts of data, then funnel that data through models built on top of the most sophisticated machine learning algorithms hosted on these computers, and voila! You have yourself an AI model.</p><p>Ilya Sutskever, former co-founder at OpenAI, who has gone on to start his own company, Safe SuperIntelligence (SSI), is said to be the major proponent of this ideology of big data funneling into powerful computers for powerful GenAI models but recently, in an interview with Reuters, he has come out to say that essentially this means of training is not sustainable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3idCz1LJDFXHy6Lt" /></figure><p>Within Layak’s article, he cites that the model that OpenAI is working on to beat GPT 4, namely Orion, despite being trained on a dataset five times larger than GPT-4, only performs comparably with GPT-4 at 20% of the training data, and nothing more beyond that.</p><p>These devices that we have made to push boundaries are now reaching boundaries of their own.</p><p>I know some of you might be asking, “Osinachi, why exactly is this significant?” Here are the main reasons why:</p><ol><li>We have a goal for AGI, which stands for “Artificial General Intelligence”. Listening to AI leaders, and you realize that, as well as global AI dominance, AGI is the true reason for the ever-increasing pace AI development, and at the rate we’re going, we might never reach it. Plateauing in development might eventually invert our progress curve as we keep throwing as much data into these models expecting better performance, when the “data” shows that doesn’t help. Sam Altman, in his recent blog, is even found using delusional language like a “few thousands of days”. Like bruh, ok let’s say “five” thousand days. 5000 days is 13 years! Albert Einstein calls this mindset insanity — doing something again and again despite feedback that it doesn’t work and expecting a different result.</li><li>We also have the issue of the currently-available data not being enough for the ravenous AI models we have. In other words, we’re running out of data to feed to these models. When we eventually run out, then how do we go ahead? Because, as we have established, our current models rely heavily on big data to be as good and powerful as they are.</li><li>We also have our climate to worry about. All these powerful computers have their heavy toll: they require insane amounts of energy and water to perform the insane amounts of calculations that they do. A lot of big tech companies are now resorting to NUCLEAR ENERGY (yes, that’s how crazy it’s gotten) You heard me right, to sustain their energy needs.</li></ol><p>As you can see, the current path leads to no further progress or, at worst, or best, depending on how you see it, the deceleration of our pace towards AGI.</p><p><strong>Infrastructure Saves The Day</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gWkr61--wrZcKbtY" /></figure><p>This right here is my LinkedIn About section. I wrote this at the beginning of the year because of how enamored of the concept of cloud I was, and I have come to discover the true power of the cloud is its infrastructure.</p><p>My argument, therefore, is we are approaching AI development the wrong way, without taking into account the fact that at the very core of AI is the cloud, and at the very core of cloud is infrastructure.</p><p>I took the liberty of asking ChatGPT conveniently for this talk to describe the cloud and infrastructure to a 12-year-old. And this is the result it gave me…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ltvY5MDjxuv6xAKB" /></figure><p>So, by servers, it means everything from compute, storage, memory, etc.</p><p>Cloud and, essentially, infrastructure are what power AI. The ChatGPT you’ve come to know and love today is sitting in Microsoft Azure servers in Microsoft’s San Antonio, Texas data center filled with Nvidia GPUs and several storage filesystems, thoroughly networked together to bring you an incredibly magical service.</p><p>I think if we want to see more out of these models, we have to look to innovate at the infrastructure level.</p><p><strong>Current Promising Work Around AI Infrastructure</strong></p><p>And we’re already seeing really exciting stuff that already support this idea. We start thinking about “accelerators”, processors that focus on specialized and parallelized processing of data. We talk about accelerators like GPUs, ASICs, FPGAs, and even neumorphic chips, which are chips that mapped out like the brain.</p><p>Companies like SK Hynix and Samsung are also innovating at the storage level to increase performance while reducing the overall energy footprint of these products.</p><p>Companies like Apple, for Apple Intelligence, is already seeking to utilise Google’s ARM chips for their AI development rather than Nvidia GPUs, in an attempt to conserve energy in their training and development. Apple has already seen the ARM light with the M-series chips and their extending this vision to build their AI</p><p>People are even talking about the merger of quantum computing and AI. I don’t know about that, but it’s still nonetheless exciting.</p><p>Another way we could approach this is by switching our focus from cloud-based AI to edge/local AI. By edge, I mean AI, even when it’s not local, that is not housed to distantly from your immediate use device. We see many consumer-focused innovation in this regard to from Intel and AMD investing in NPUs in their laptop chips and Apple investing in Apple Intelligence and Private Cloud Compute, where most of the AI’s work will run on the local device.</p><p>I mean, the list is endless. All these look serious and promising and I think these companies should invest more in this perspective shift.</p><p><strong>Conclusion</strong></p><p>For those of us who think this is the best of AI that we’ll see, I think you’re in for a ride. AI is only just getting started. It’s going to get more creative and more powerful. It’s almost like a baby and it’s still getting to know our world. If, at this infantile stage, AI is making such dramatic changes, just imagine what could happen in the next 5 years, next decade, couple of decades even.</p><p>I’m sincerely looking forward to all the amazing things that AI portends but if we are going to reach that future, for AI to reach it’s teenage and adulthood stages, we just might need to think differently about how WE make it think.</p><p>Thank you for coming to my TED talk.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72fd31dd7c03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Road to My AWS Community Builder Application in January 2025!]]></title>
            <link>https://medium.com/@sin4ch/road-to-my-aws-community-builder-application-in-january-2025-f4626330076d?source=rss-9f17453673aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4626330076d</guid>
            <category><![CDATA[technical-writing]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[community-builders]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Osinachi Okpara]]></dc:creator>
            <pubDate>Sun, 20 Oct 2024 12:39:02 GMT</pubDate>
            <atom:updated>2025-09-27T22:56:02.986Z</atom:updated>
            <content:encoded><![CDATA[<h3>This is My (Very Public) Attempt to Start (Technical) Writing Again</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HB5ykCImhhFoBjhrOOtcHA.png" /></figure><p>Hmm… Finally, I can start writing again…</p><p>Growing up, I wrote a lot. Ok, I won’t say a lot. Mostly fiction, but I really had a very vast imagination (I think I still do. I just might not be putting it to good use.)</p><p>I used to write a lot about space, and I created a lot of characters, distant lands (planets, in this case) and stories, because, then, I aspired to be an aerospace engineer as I was deeply fascinated by the sky and other celestial bodies.</p><p>I also drew (doodled) a lot. So, comic characters and the likes. Like I said, vast imagination.</p><p>That’s why my best color is blue. it’s NOT orange, I assure you ;D</p><p>Right now, I struggle to write at all (or draw, but not today’s point), talk more of articles. Honestly, I won’t say LinkedIn posts count. I have gotten good at doing that because I studied copywriting passively — I read a lot of LinkedIn posts to learn the general structure of good posts: the hook, body and CTA.</p><p>I feel I am good at that because with LinkedIn posts, facts and figures don’t really matter as much. Obviously, some do but I am making a lot of over-generalizations, as you might have already noticed in this post. But, LinkedIn posts usually come with a lot of opinionating and perspective sharing, which is why many revered people there are called “thought leaders”.</p><p>They literally think, therefore they are (who they are).</p><p>Sorry if the joke wasn’t funny. :|</p><p>Article writing, or more specifically, technical writing, however, requires far more research and fact-checking. You are not just expressing opinions as with a regular LinkedIn post. You are also trying to convey knowledge and make the reader learn something new.</p><p>Again, I am making over-generalizations.</p><p>I am severely plagued with perfectionism. This is the major reason why I themed this year, “Resilience” or “Progress over Perfection.” Following these, I would call them, precepts or slogans have helped make my year what it has been: not being afraid of being a novice at something, or of the journey that lies ahead. I have such high expectations for myself that ironically, they get in the way of me doing anything at all and its a whole ouroboros that leads to a massive fear of failure. So I had to step out of that a lot this year.</p><p>I have come to learn, within the past year, that making a goal doesn’t exactly complete it (I mean, duh!). Also, it’s not usually achieved within your set timeline. Life happens sometimes. I have had to deal with a lot of new starts this year, especially surrounding my new career in cloud and DevOps engineering. So, pushing aside perfectionism and moving despite its lurking has helped me achieve a lot.</p><p>Just a minor digress, but have you noticed that every bad habit, or addiction, has it’s own ouroboros of perpetuation? For example, how my fear of failure makes me not do anything, leading to an increased fear of failure? Or, how someone addicted to social media doom-scrolls, wonders what’s wrong with their lives, then to abate those feelings of apparent helplessness or underachievement, they fall back to social media to relieve that pain? It’s something I think about a lot, but back to the idea of this post.</p><p>Sorry for the awful repetition of “this year” and “this past year”. And please bear with me, there’s a point lurking somewhere in this post; we’ll get to it lol.</p><p>One important skill my plague has caused me to not build as soon as I thought I would was technical writing. I literally had a plan at the beginning of the year (please what’s another word for year? Annum?) to start writing articles to help people starting out in cloud or tech, by explaining certain concepts with pretty amazing metaphorical situations and allegories. I joined technical writing bootcamps, reached out to some copywriters I knew, was opportune to join the HNG internships and actually started writing but couldn’t finish the program so I stopped technical writing altogether.</p><p>I have always eyed the AWS Community Builder Program. I have a lot of friends, and mentors (direct and indirect) that are part of the program. It’s something that was on my agenda this annual period — Sorry, I can’t use year again! :’( — and I planned to apply for next year’s cohort.</p><p>And here comes the point: the only way to qualify for it is if you have been writing articles for a while.</p><p>You can imagine my pain.</p><p>Right now, the only way I can qualify for this program is if I started writing yesterday and it’s just so hard to bring myself to do it.</p><p>But hey, I wrote this article. Thinking about it now, this is actually the longest thing I’ve written in a long time, or ever even. So I think I can do something before January.</p><p>So, what can I do NOW?</p><p>Recently, I came across a post on PBL, or Project-based Learning, and it’s something I have been trying to understand how to do. I’m not a famous tutorial finisher, or even an unfamous one at that lol, so I have wanted to learn to learn while building.</p><p><em>2 Learn 2 Learn </em>:D</p><p>(It’s my perfectionism making jest. I’ll leave it like that abeg.)</p><p>The PBL framework from the video was:</p><p>Crash course =&gt; Tutorial-based projects =&gt; Solo Projects</p><p>So, firstly, I’m taking on this framework to build projects that I can document. Then, I’ll document them.</p><p>Wait… That’s it. Why did I put firstly? *face palm</p><p>I intend to do a boat-load of cloud/DevOps projects (like 6 or 7: 4 follow-alongs, 3 solos). Inadvertently, I’ll be building my retarding Git/GitHub skills, possibly take the GitHub Foundation cert that I recommended to everyone but haven’t taken — Perfectionism (Mr. P) is waving at me saying hello.</p><p>Oh yeah. Secondly, there are many topics I’d like to talk about that fascinate me a lot, like virtualization. IBM’s Cloud Computing course really did a number on me and opened my eyes to the beauty of virtualization and I’d like to talk about that too. But that might not be this year.</p><p>A lot of people say we shouldn’t talk about our plans, especially given the Nigerian clime (I think this kind of thinking pertains to any clime but whatever).</p><p>But, yeah, that’s what I want to do. I’m all hyped now but if you don’t see any thing from me anytime soon just know that Mr. P has knocked me on my head and asked me to sit down.</p><p>I’ll keep fighting him though and I might not actually do up to 7 projects but I’ll try.</p><p>Phew. Thanks for coming all this way. If you reached this part of the article, na you dey reign oh. You read this my crap of a post with no storyline or structure (Please, Mr. P might be talking).</p><p>If you found this post good, please applaud, abi clap, and comment. Tell me what I can work on.</p><p>If you’re applying for the AWS Community Builders program too, please comment down below and let’s connect.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4626330076d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>