<?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 Randike on Medium]]></title>
        <description><![CDATA[Stories by Randike on Medium]]></description>
        <link>https://medium.com/@randikej?source=rss-2c10bb2cddc0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*w4PBDI4bURw-MOW7yHsi4w.jpeg</url>
            <title>Stories by Randike on Medium</title>
            <link>https://medium.com/@randikej?source=rss-2c10bb2cddc0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:57:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@randikej/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[The Great Observability Lie: Why Logs, Metrics, and Traces Don’t Actually Work]]></title>
            <link>https://engineering.corzent.com/the-great-observability-lie-why-logs-metrics-and-traces-dont-actually-work-5f18204a76f1?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f18204a76f1</guid>
            <category><![CDATA[wide-events]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 05:43:07 GMT</pubDate>
            <atom:updated>2025-07-07T05:43:07.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSjnNtNBFI19AmSBPD10ow.png" /></figure><h4>Wide events and the end of artificial data boundaries</h4><p>Most observability backends focus on the three signals under observability; logs, metrics and traces. Logs capture records of specific operations in our code, metrics provide measurements that reflect overall application performance, and traces map the journey of a request as it moves through different services. However, these three elements are typically defined and treated as separate, discrete pieces.</p><p>In practice, we specify what to capture in each category based on what we think will help us detect issues. But when a metric appears out of line, we often resort to reading through the logs, guided by our code, to diagnose the problem. This approach helps us catch “known unknowns” — issues we expect and have defined signals for. But what if the problem is something we didn’t anticipate? What if it’s not captured in any of the predefined metrics? These types of issues are known as “unknown unknowns” in the observability space.</p><p>Wide events offer a solution to this overly complicated mess of logs, metrics, and traces. Instead of treating these elements separately, a wide event captures all relevant data for a specific event from start to finish — essentially as a structured JSON object.</p><p>This blog does a great job explaining why wide events are the way forward: <a href="https://boristane.com/blog/observability-wide-events-101/">Observability Wide Events 101 By Boris Tane.</a></p><p>Popularized by Facebook through their “Scuba” observability platform, wide events allow engineers to diagnose issues in a much simpler way. By filtering and clicking through these events, it’s easy to group related incidents, pinpoint failures, and identify deviations from expected behavior.</p><h3>An Example</h3><p>Lets take a specific scenario: users report that items they’ve added to their cart are not appearing at checkout. You check your logs, metrics, and traces, but everything appears to be functioning as expected. Logs indicate that operations are completing successfully, metrics show no bottlenecks, and traces confirm that requests are starting and finishing without errors.</p><p>Yet, the issue persists. This is exactly the kind of problem that traditional observability struggles with — an <strong>unknown unknown</strong>, where something is clearly broken but isn’t captured by predefined metrics or logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zr4gtwwHo5YrIPNP.png" /><figcaption>A Possible Wide Event For This Example</figcaption></figure><p>With wide events, instead of piecing together scattered data points, you can analyze a <strong>comprehensive snapshot of every relevant detail</strong> for each transaction. Here’s how you’d approach the problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Bq3l1oTBG7FRDbP29NM7Q.jpeg" /></figure><p>1.<strong>Identify Patterns Across Users</strong> Using wide events, you filter transactions by affected users and quickly notice that this isn’t an isolated incident — <strong>many users are experiencing the same issue</strong>.</p><p>2. <strong>Drill Down into User Actions</strong> By further filtering the wide events, you notice a common factor: <strong>all affected users applied a coupon code</strong> before proceeding to checkout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrlhiXOAHPpbesc3wnlFIQ.jpeg" /></figure><p>3. <strong>Pinpoint the Root Cause</strong> Since wide events capture full request contexts — including API parameters, database queries, UI interactions, and relevant metadata — you examine the <strong>coupon-related fields</strong> and notice an anomaly.</p><ul><li>The discount is applied, but the system fails to register the item in the final checkout payload.</li><li>A new validation check, recently introduced, is rejecting certain cart items when a coupon is used.</li></ul><p>4. <strong>Determine When the Issue Started</strong> Since wide events can <strong>include commit hashes</strong>, deployment timestamps, and version numbers, you immediately trace the issue back to a specific code change.</p><ul><li>A recent update modified how discounts interact with cart persistence.</li><li>The problematic commit is now <strong>visually correlated</strong> with the rise in failed checkouts.</li></ul><p>5.<strong> Implement a Fast, Targeted Fix</strong> Instead of sifting through logs and guessing where the problem might be, <strong>you have all the context needed</strong> to push a quick fix.</p><p>If you want to learn more about all of the different fields that you can consider including in your wide events <a href="https://jeremymorrell.dev/blog/a-practitioners-guide-to-wide-events/">A Practitioner’s Guide to Wide Events by Jeremy Morrell</a>, does a fantastic job of explaining how extensive these events can be.</p><h3>Where does OpenTelemetry fit in?</h3><p>At its core, OpenTelemetry enables <strong>request propagation</strong> across a distributed system. It assigns a <strong>trace ID</strong> to a request as it travels through different services, ensuring that all logs, metrics, and spans associated with that request remain linked. It’s easy to get frustrated over the complexity of this flexible tool. However, it’s much easier to think of it as a tool that helps us write wide events.</p><p>OTel helps propagate a request ID through a trace, or the entire journey of a request that travels through our services. This creates a span, which you can think of as a log that contains data about different services and operations that the request goes through. Usually, this consists of a parent span (log) and child spans with additional data being added as the request travels.</p><p>Therefore, a span is essentially equivalent to a wide event, and OTel makes it easy for us to set custom attributes to these spans within our code, as opposed to writing a “wide events tracking solution” from scratch.</p><h3>Choosing an Observability Platform</h3><p>Now that we’ve established that wide events are essentially logs containing fields with many possible values (high cardinality) and numerous dimensions (high dimensionality), we face an important challenge. Each “wide event” is quite large, and distributed architectures produce many of them, resulting in substantial observability data volumes.</p><p>This leads us to the biggest criticism of this approach to observability: the cost. Traditional metrics, logs, and traces do not contain such redundant data at every collection point, making them more economical but potentially less insightful for complex troubleshooting scenarios.</p><p>Although any observability backend with a solid OLAP database can support wide events, Honeycomb stands out by fully embracing an event-centric approach. Unlike New Relic or AWS CloudWatch, which organize data into predefined buckets for logs, metrics, and traces, Honeycomb treats each event as a unique entity, allowing for precise, ad-hoc queries without being constrained by a fixed schema. This flexibility is crucial for debugging unknown unknowns, where rigid structures can obscure valuable insights.</p><p>Additionally, Honeycomb eliminates the “cardinality tax” by charging based on the number of events received rather than the amount of data ingested. This pricing model provides a huge advantage for teams leveraging wide events, making it a far more cost-effective and scalable solution compared to traditional observability backends.</p><h3>Conclusion</h3><p>Wide events transform our approach to observability by collapsing the artificial boundaries between logs, metrics, and traces into comprehensive data structures that capture the full context of system behaviors. This unified view gives us powerful tools to tackle not just anticipated issues, but also those frustrating “unknown unknowns” that traditional observability approaches often miss entirely.</p><p>The cost concern is real — these high-cardinality, high-dimensionality events generate substantial data volumes in distributed architectures. However, platforms like Honeycomb have evolved specifically for this approach with event-based pricing that makes economic sense. Teams quickly discover the ROI through drastically faster debugging cycles and the ability to spot previously invisible problems.</p><p>As our systems grow increasingly complex, the combination of wide events and OpenTelemetry offers a pragmatic solution that matches how engineers actually solve problems. Rather than forcing us to mentally stitch together disconnected signals from separate tools, this approach gives us coherent, queryable data that reveals the true interconnected nature of our distributed applications. The observability future isn’t about more data — it’s about better, more contextual data that shows us what’s actually happening.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f18204a76f1" width="1" height="1" alt=""><hr><p><a href="https://engineering.corzent.com/the-great-observability-lie-why-logs-metrics-and-traces-dont-actually-work-5f18204a76f1">The Great Observability Lie: Why Logs, Metrics, and Traces Don’t Actually Work</a> was originally published in <a href="https://engineering.corzent.com/">Corzent</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The IaC Showdown: How Terraform Outshines CloudFormation and AWS CDK]]></title>
            <link>https://engineering.corzent.com/the-iac-showdown-how-terraform-outshines-cloudformation-and-aws-cdk-1a73db062703?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a73db062703</guid>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 05:33:53 GMT</pubDate>
            <atom:updated>2025-06-03T05:37:10.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_K-A1j68jPo191VI98Z0Q.png" /></figure><p>Infrastructure as code (IaC) allows you to do exactly what the name implies: define your entire cloud infrastructure as code.</p><p>Think of it like a recipe that you write and ask a chef to prepare, where the recipe is your IaC files and the chef is a cloud provider of your choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8V40wucn43R8mogwc3Dk7Q.jpeg" /></figure><h3>Advantages of IaC</h3><p>Among clicking around in a console, using a cloud provider’s CLI, and adopting Infrastructure as Code (IaC), the latter provides several advantages. Writing your infrastructure as code inherently allows you to maintain a self-documenting single source of truth for your cloud infrastructure. Moreover, having a clear description of your infrastructure means it can be versioned using Git, reviewed by teammates, used to detect any drift from your expected configurations, and easily created or destroyed, all of which contribute to a much more robust, replicable, and overall cost-saving approach compared to the potential mishaps of the other much slower options.</p><h3>Disadvantages of IaC</h3><p>It’s not all roses though, IaC has its own limitations as well. For one, once the infrastructure is provisioned, the state of your environment must be kept secure and consistent across everyone with access to the IaC code. Any unauthorized changes to the state, which is typically maintained by the IaC tool, can easily throw the entire environment out of whack with just a small misstep. This issue becomes even more pronounced when dealing with a shared state file. Mechanisms to lock and synchronize the state between infrastructure engineers must be implemented to ensure proper infrastructure management by distributed teams.</p><p>There is also the obvious learning curve and initial setup effort required to create a well-architected, forward-thinking IaC manifest. Smaller very short-term projects which require only a solitary cloud instance may not need IaC, although I’d argue that once learned, most people will prefer to use IaC over a cumbersome web UI to provision even small infrastructure projects. And hey, now you could just get your favorite AI tool to write up a complete well-thought-out IaC file especially if it’s a small project — just make sure to check it before deployment or you could torch your life savings.</p><h3>CloudFormation vs Terraform vs AWS CDK</h3><p>Released in 2011, AWS CloudFormation is the oldest Infrastructure as Code (IaC) tool for AWS, so let’s start here. It allows you to define your infrastructure using YAML or JSON, whereas Terraform primarily uses HCL (HashiCorp Configuration Language) but also supports JSON. Between the two, I find Terraform easier to write. Terraform lets you structure your IaC code into a clean file hierarchy without requiring complex import functions to reference properties, as is necessary in CloudFormation.</p><p>Enter the AWS CDK. This IaC tool by AWS allows you to define your architecture using a programming language of your choice — TypeScript, Python, Java, and more. While AWS CDK ultimately compiles down to raw CloudFormation, it provides a more familiar environment for developers to define infrastructure in code rather than YAML or JSON.</p><p>However, even compared to the AWS CDK, Terraform still reigns supreme in my book. Let’s see why.</p><p>First — and arguably Terraform’s biggest selling point — is that it’s cloud-agnostic, enabling multi-cloud deployments within a single project and allowing you to swap out vendors with similar resources.</p><p>In contrast, the AWS CDK is locked into AWS environments. Terraform uses “providers” — vendor-specific or community-maintained resource blocks — that integrate with the Terraform backend. This provider ecosystem extends beyond cloud platforms, enabling Terraform to manage services like GitHub and Datadog, making it a powerful tool for deploying and managing full end-to-end systems.</p><p>Both Terraform and CloudFormation are declarative tools, meaning they aim to ensure your infrastructure configuration remains consistent with the deployed resources. They achieve this by maintaining a state that tracks deployed resources and compares it against your configuration. In CloudFormation, this state is referred to as a <strong>stack</strong> and is managed directly by AWS. This stack can be accessed and interacted with by users within the same AWS environment. On the other hand, Terraform uses a <strong>state file</strong> and supports remote state management, enabling teams to store, version, and share infrastructure state securely. Terraform supports various backends for this purpose, including AWS S3, HashiCorp Consul, and Terraform Cloud.</p><p>The AWS CDK, on the other hand, acts as a hybrid of imperative and declarative approaches. Resources are defined programmatically in your preferred programming language (imperative), but as mentioned earlier, this code is synthesized into a CloudFormation template, which is declarative by nature. This unique approach introduces a significant drawback: each resource specified using the CDK is assigned an auto-generated logical ID unless explicitly defined.</p><p>As a result, changes in your code can lead to CloudFormation destroying and redeploying resources, even if a specific resource hasn’t changed. This behavior can cause challenges, especially with potentially static resources like S3 buckets. For example, suppose you provision an S3 bucket using the CDK then later change the logical ID or reconfigure the resource without explicitly preserving its properties, CloudFormation may destroy the existing bucket and create a new one. This could result in data loss or downtime unless the bucket contents were previously backed up.</p><p>Terraform and the AWS Cloud Development Kit (CDK) both offer official and community-driven Infrastructure as Code (IaC) components that serve as reusable templates encompassing multiple interconnected resources to achieve specific functionalities. In Terraform, these are known as <strong>modules</strong>, while in AWS CDK, they are referred to as <strong>constructs</strong>. Terraform boasts a larger community of active contributors and a more extensive range of modules. It also allows users to publish their own modules publicly.</p><p>Additionally, Terraform’s private registry enables enterprises to create proprietary modules, ensuring consistency across deployments. AWS CDK does not currently offer a private registry feature. However, developers can create custom constructs and share them as reusable modules across projects. Furthermore, the AWS CloudFormation Public Registry provides a collection of extensions, including resource types and modules, published by AWS, APN partners, and the developer community. Therefore, in this context too, Terraform stands out as the better choice due to its larger community, a more extensive catalog of reusable modules, and support for private registries, allowing enterprises to maintain consistency and control over proprietary IaC components.</p><h3>Conclusion</h3><p>To conclude, adopting an Infrastructure as Code (IaC) approach to managing your infrastructure ensures a robust, easily re-deployable, and self-documenting cloud environment for your applications. Regardless of the IaC tool you choose, leveraging IaC is a significant step toward a more efficient and maintainable infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a73db062703" width="1" height="1" alt=""><hr><p><a href="https://engineering.corzent.com/the-iac-showdown-how-terraform-outshines-cloudformation-and-aws-cdk-1a73db062703">The IaC Showdown: How Terraform Outshines CloudFormation and AWS CDK</a> was originally published in <a href="https://engineering.corzent.com/">Corzent</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Precision in the Age of AI Generalists: Tailoring Language Models for Specific Tasks]]></title>
            <link>https://engineering.corzent.com/precision-in-the-age-of-ai-generalists-tailoring-language-models-for-specific-tasks-090917911242?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/090917911242</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 06:59:25 GMT</pubDate>
            <atom:updated>2025-01-17T10:00:14.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZhp0DAAjS1LvNT8CTFTTA.png" /></figure><h4>RAG and Fine-Tuning for Smarter, More Dependable Language Models</h4><p>At this point, it’s near impossible to get any work done without the new version of your favourite tool — now enhanced with cutting-edge AI — being shoved in your face. By now you’ve probably already interacted with Large Language Models (LLMs) like Chat-GPT or image generation using models like DALL-E in some capacity.</p><p>AI models come in many flavours, each specialized for tasks such as forecasting trends, classifying information, generating text and images, or any other data-driven application. However, all these machine learning models operate under the same fundamental idea. They are all, in essence, a network of simple mathematical functions comprised of a large number of weights and biases optimized to produce the desired output.</p><p>Before any model can work its magic, these weights and biases need to be optimized. This involves training the model to “learn” patterns from data without being explicitly programmed for specific tasks, hence where the name ‘Machine Learning’ comes from.</p><p>Before training, no matter the input, your model will spew out nonsense. During the training phase a function at the output end of the network gives each output a score of how good or bad the output being produced is. This clever function is called a loss/cost function, and the model attempts to minimize this loss by making slight alterations to the weights and biases in the system until a reasonable output is achieved.</p><p>This iterative approach performed on carefully structured complex models has produced the seemingly magical results we see today in models such as Chat-GPT.</p><h3>Limitations of Language Models in Domain-Specific Applications</h3><p>A common use case for an LLM is asking research questions, in the hopes of getting a concise accurate answer addressing your exact concerns. For most general questions, a large enough language model such as Chat-GPT is able to synthesize a good enough response using the “patterns” it has “learned” during its training stage. More traditional means of research such as a humble google search on the other hand, queries a database of web pages to give you relevant website listings, without doing any of the work of synthesizing a response.</p><p>Nevertheless, the deeper you try to go into a specific topic using Chat-GPT, the more likely the responses are to be inaccurate. These “Hallucinations” as they are commonly referred, are caused by the incomplete or low-quality data within a specialized domain in the broad spectrum of knowledge used to train the model. As you might reasonably conclude, these large language models, despite their size, will require an unimaginable volume of resources, training data, time, and energy — to gain the necessary context to respond reliably across all domains and their nuances.</p><h3>Strategies for Improving AI Language Model Performance</h3><p>One way to improve your experience is to restrict their responses and provide specific contexts for them to synthesize from by carefully engineering your prompts. However, you may have noticed that the longer you carry a conversation with a language model, the more it seems to “forget” what you spoke of earlier in the chat. This is because the model’s context window may have been exhausted. So how do we get more consistently reliable domain-specific responses? Two solutions present themselves:</p><h4>Fine-tuning</h4><p>This approach involves taking a pre-trained language model and training it slightly further using your domain-specific prompts and expected outputs. This allows us to control not only the knowledge the model is trained on but also the manner in which it responds to queries. The fine-tuning process first involves collecting and cleaning data, and an offline training process with this new data.</p><p>Fine-tuning is well suited for applications that require the model with:</p><ul><li>A more nuanced understanding of specialized terminology, such as medical terminology and legalese.</li><li>Sentiment Analysis, for when the model needs to infer the subtle shades of a user’s opinions to generate appropriate responses.</li><li>Personalization of responses, for instances where a user’s preferences need to be considered when generating a response, or when the model should have a specific tone or personality.</li></ul><p>Fine-tuning, however, isn’t always the optimal choice. As discussed before, this approach is more intensive, requiring labeled data and a compute intensive training stage. Moreover, even a fine-tuned model may produce hallucinations if presented with unfamiliar inputs. Since it needs to be trained before it can be implemented, fine-tuning is better suited for static, or slow-moving data.</p><h4>Retrieval-augmented generation (RAG)</h4><p>RAG was initially proposed by team of researchers at Facebook AI, UCL, and NYU back in 2020 to supplement the factual information stored in a language model’s parameters with data held in non-parametric memory for knowledge-intensive applications. Initial RAG systems utilized vector representations of text blobs from Wikipedia, stored in a vector index. These were accessed using a pre-trained neural retriever, which also formulated appropriate queries with context. Another model then decoded the final vectors into a word sequence, forming the response to the query. This integrated system was trained as a single model to provide domain-specific responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxqVOvm8aIogzRkgalnHEg.png" /></figure><p>The diagram above represents the general flow of a RAG system, it involves taking checks of text from your own external knowledge-base and then querying this data and passing it along with your prompt to provide context for a response. Initially, documents containing information specific to your domain are collected and parsed into a vector or graph database. When a user queries the model, the query is compared to entries in your database. Relevant entries are then retrieved and passed to the language model to generate a final response.</p><p>RAG is best suited for applications that:</p><ul><li>Require the most up to date information, such as in chat bots.</li><li>Rely heavily on the ground truth and the factual accuracy of responses, such as applications which cite medical documents, legal documents, and educational material.</li><li>Require the use of AI agents to act on multiple knowledge banks at once.</li></ul><p>Although this approach seems to offer many advantages over fine tuning, it comes with its own limitations. The similarity search step before passing the prompt to the language model can indeed increase response time per request. Additionally, larger prompts may be necessary compared to fine-tuned models, as fine-tuned models can more efficiently infer context from shorter inputs.</p><h3>Conclusion</h3><p>In conclusion, we’ve seen that all popular generative AI models are essentially networks of mathematical functions optimized to perform specific tasks without explicit programming. While currently publicly available LLMs perform well at general tasks, they often produce inaccurate information in applications requiring specialized knowledge. To address this issue, a base LLM can be fine-tuned to offer nuanced responses in highly specific contexts. However, this approach doesn’t allow for dynamic data integration or guarantee resistance against hallucinations. An alternative method, RAG, extracts data from external sources, providing up-to-date and reliable ground truth that can be cited in LLM responses. Your application may be enhanced by implementing one or a combination of these techniques.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=090917911242" width="1" height="1" alt=""><hr><p><a href="https://engineering.corzent.com/precision-in-the-age-of-ai-generalists-tailoring-language-models-for-specific-tasks-090917911242">Precision in the Age of AI Generalists: Tailoring Language Models for Specific Tasks</a> was originally published in <a href="https://engineering.corzent.com/">Corzent</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up a Containerized React and Flask App on Minikube]]></title>
            <link>https://medium.com/@randikej/setting-up-a-containerized-react-and-flask-app-on-minikube-e1956f6f466c?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1956f6f466c</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Thu, 06 Jun 2024 11:54:20 GMT</pubDate>
            <atom:updated>2024-06-06T11:56:12.782Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Simple Guide to Running a Local Kubernetes Cluster</h4><p>In this tutorial, we will set up a simple containerized React frontend and a containerized Flask backend and deploy them in a Kubernetes cluster on our local machine using Minikube.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FY6Eqg8yJ75L_7nPAbPosg.png" /></figure><h3>Prerequisites</h3><p>Before we get started, there are a few packages you will need:</p><ol><li>Docker Engine: <a href="https://docs.docker.com/engine/install/">Install Docker Engine | Docker Docs</a></li><li>Minikube to host a cluster on your local machine: <a href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Fwindows%2Fx86-64%2Fstable%2F.exe+download">minikube start | minikube (k8s.io)</a></li></ol><p>In addition, if you would like to follow along with this tutorial, feel free to clone <a href="https://github.com/DRSNAJ/flask_contactlist-demo">this repository</a>. The frontend and backend are adapted from <a href="https://www.youtube.com/watch?v=PppslXOR7TA">this tutorial</a>.</p><h3>Overview</h3><p>This project consists of a React frontend served using an NGINX server, which also handles connections to the backend using a reverse proxy. The backend is written in Python on the Flask framework and served using Gunicorn. Data is stored in an SQLite database accessed using SQLAlchemy.</p><p>We will first set up the NGINX server with a reverse proxy and ensure that our code works with this configuration. Next, we will write the Dockerfiles needed to containerize the frontend and backend and push these containers to Docker Hub. Finally, we will write the Kubernetes configuration YAML files to define our cluster to be run on Minikube.</p><h3>Step 1: Setting Up an NGINX Reverse Proxy</h3><p>Our frontend will be served using an NGINX server, which will also handle the connection between our frontend and the API server through a reverse proxy. To facilitate requests from our frontend to the backend, we configure the conf.dfile to forward all requests sent to /contacts_api to the backend’s IP address.</p><pre>server {<br>    listen 80;<br>    server_name localhost;<br><br>    root /usr/share/nginx/html;<br>    index index.html;<br>    error_page 500 502 503 504 /50x.html;<br><br>    location / {<br>        try_files $uri $uri/ =404;<br>        add_header Cache-Control &quot;no-cache&quot;;<br>    }<br><br>    location /contacts_api {<br>        proxy_pass ${APP_API_URL};  # Forward requests to your backend server<br>    }<br>}</pre><p>The API server’s IP address, accessed by this conf.d file, will be stored as an environment variable named APP_API_URL within the frontend pods. This will be specified using the Kubernetes configuration files.</p><p>This conf.d file will be copied into the appropriate directory within our container via our frontend’s Dockerfile. For now, we store it under the frontend directory at ./flask_contactlist-demo/frontend.</p><blockquote>To ensure seamless communication, all requests made within the frontend code should be directed to /contacts_api, as demonstrated in the example below:</blockquote><pre>const response = await fetch(`/contacts_api/contacts`); // Make an API call to fetch contacts</pre><h3>Step 2: Setting Up Our Dockerfiles</h3><h4>2.1 Setting Up Our Backend Container</h4><p>Next, we need to write Dockerfiles to define the images used to create our web app. Each Dockerfile will be placed within a deployments folder inside the respective backend and frontend code directories.</p><pre>├─ backend<br>│  ├─ deployments<br>│  │  └─ Dockerfile<br>│  ├─ instance<br>│  ├─ main.py<br>│  └─ ...<br>...</pre><p>The following Dockerfile is used to create the backend’s Docker image.</p><pre># Defining the base image<br>FROM python:3.11-slim<br><br># Setting the working directory<br>WORKDIR /backend<br><br># Copying the requirements file containing all the dependencies relative to the WORKDIR<br>COPY ./requirements.txt requirements.txt<br><br># Running the install on the dependencies<br>RUN pip install -r requirements.txt<br><br># Copying our source files<br>COPY . .<br><br># Exposing the port for our API to be accessed publicly<br>EXPOSE 5000<br><br># Defining the command to run the application using Gunicorn with the specified configuration<br>CMD [ &quot;gunicorn&quot;, &quot;wsgi:app&quot;, &quot;-b 0.0.0.0:5000&quot;, &quot;-w 2&quot;, &quot;-t 30&quot; ]</pre><p>This Dockerfile exposes port 5000 to be accessed from outside the container from any IP address.</p><h4>Building and pushing the backend container image</h4><p>Next, we need to build a Docker image from this Dockerfile and then push it to DockerHub so that it can be pulled by our Kubernetes cluster.</p><p>First, <strong>make sure you are in the backend code directory</strong> and build the backend container image by running the following command:</p><pre>docker build -t &lt;username&gt;/contactlist_backend:v1.0 -f ./deployments/Dockerfile . </pre><p>Make sure you enter your DockerHub &lt;username&gt; here to ensure that the image is stored in your account’s repository. Before we push to DockerHub, we also need to log in to your DockerHub account. Enter the following command and then enter your password when prompted.</p><pre>docker login -u &lt;username&gt;</pre><p>After logging in, push this image to DockerHub using the following command.</p><pre>docker push &lt;username&gt;/contactlist_backend:v1.0</pre><h4>2.2 Setting Up Our Frontend Container</h4><p>Similar to the backend, we store the frontend’s Dockerfile within a deployments folder inside the frontend code directory.</p><pre>├─ frontend<br>│  ├─ build<br>│  ├─ default.conf<br>│  ├─ deployments<br>│  │  └─ Dockerfile<br>│  ├─ index.html<br>│  └─... <br>...</pre><p>The following Dockerfile is used to create the frontend’s Docker image:</p><pre># Using a base image of Node.js to build our React frontend<br>FROM node:18 as Build<br><br># Setting the Docker working directory; all following instructions will happen here<br>WORKDIR /frontend<br><br># Copying the package.json and package-lock.json files into the Docker working directory<br>COPY package*.json ./ <br><br># Installing dependencies (this will create the node_modules folder)<br>RUN npm install <br><br># Copying everything from the current local directory to the Docker working directory<br>COPY . .<br><br># Building the React application<br>RUN npm run build<br><br># Using a base image of Nginx to serve the built React frontend<br>FROM nginx:stable-alpine<br><br># Exposing port 80 for the Nginx server<br>EXPOSE 80<br><br># Copying the built files from the build stage to the Nginx default public directory<br>COPY --from=Build /frontend/build /usr/share/nginx/html<br><br># Copying the Nginx configuration file<br>COPY ../default.conf /etc/nginx/conf.d/default.conf</pre><p>Similar to the API’s Dockerfile, we expose port 80 on the frontend’s Docker container. Moreover, we copy the built files from our source code into /usr/share/nginx/html so that NGINX can serve them at runtime.</p><p>The default.conf we made earlier to tell NGINX to configure a reverse proxy to the backend is also copied to /etc/nginx/conf.d/default.conf. Keep in mind that the backend’s IP is yet to be configured and will be specified in the Kubernetes config files.</p><h4>Building and pushing the frontend container image</h4><p>Similar to the backend, we need to build and push our frontend container’s image to DockerHub to be pulled later by Kubernetes.</p><p>First, <strong>make sure you are in the frontend code directory</strong> and build the frontend container image by running the following command:</p><pre>docker build -t &lt;username&gt;/contactlist_frontend:v1.0 -f ./deployments/Dockerfile . </pre><p>Make sure you enter your DockerHub &lt;username&gt; here to ensure that the image is stored in your account’s repository. If you aren’t already signed in, we also need to log in to your DockerHub account. Enter the following command and then enter your password when prompted.</p><pre>docker login -u &lt;username&gt;</pre><p>After logging in, push this image to DockerHub using the following command:</p><pre>docker push &lt;username&gt;/contactlist_frontend:v1.0</pre><h3>Step 3: Setting Up Our Kubernetes Configuration Files</h3><h4>3.1 Creating Kubernetes Deployment and Service Files for the Backend</h4><p>Below is the Kubernetes YAML configuration for deploying and servicing the backend of our web application:</p><pre># Defining the API version and kind of Kubernetes resource (Deployment)<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  # Name of the deployment<br>  name: contactlist-backend-deployment<br>spec:<br>  # Number of replicas of the pod to be created<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      # Label to match the pods with this deployment<br>      app: contactlist<br>  template:<br>    metadata:<br>      labels:<br>        # Label applied to the pod template<br>        app: contactlist<br>    spec:<br>      containers:<br>      - name: contactlist<br>        # Docker image for the container<br>        image: drsnaj/contactlist_backend:v1.0<br>        resources:<br>          limits:<br>            # Maximum memory and CPU resources for the container<br>            memory: &quot;128Mi&quot;<br>            cpu: &quot;500m&quot;<br>        ports:<br>        - # Port exposed by the container<br>          containerPort: 5000<br># Defining the API version and kind of Kubernetes resource (Service)<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  # Name of the service<br>  name: contactlist-backend-service<br>spec:<br>  # Type of the service, NodePort in this case<br>  type: NodePort<br>  selector:<br>    # Selector to match the pods with this service<br>    app: contactlist<br>  ports:<br>  - # Port on which the service is exposed<br>    port: 5000<br>    # Target port on the container<br>    targetPort: 5000<br>    # Node port to access the service from outside the cluster<br>    nodePort: 30050</pre><p>The backend deployment specifies the creation of one pod labeled app: contactlist containing our API container. This API container is pulled from the Docker Hub repo we pushed to earlier (drsnaj/contactlist_backend:v1.0).</p><p>Moreover, we define a NodePort service that exposes the backend pod on port 5000, allowing external access via port 30050, and directs traffic to the pods labeled app: contactlist. This will allow our frontend pods to access the backend pods from within the cluster.</p><h4>3.2 Writing the Frontend Kubernetes Deployment and Service Configuration Files</h4><p>Below is the Kubernetes YAML configuration for deploying and servicing the frontend of our web application:</p><pre># Defining the API version and kind for the Deployment<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  # Naming the deployment<br>  name: contactlist-frontend-deployment<br>spec:<br>  # Setting the number of replicas (pods) to be created<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      # Matching the label &#39;app&#39; to identify the pods for this deployment<br>      app: webapp<br>  template:<br>    metadata:<br>      labels:<br>        # Labeling the pods with &#39;app: webapp&#39; for identification<br>        app: webapp<br>    spec:<br>      containers:<br>      - name: contactlist-frontend<br>        # Specifying the container image to be used<br>        image: drsnaj/contactlist_frontend:v1.0<br>        resources:<br>          limits:<br>            # Setting resource limits for the container<br>            memory: &quot;128Mi&quot;<br>            cpu: &quot;500m&quot;<br>        ports:<br>        - containerPort: 80<br>        env:<br>        - name: APP_API_URL<br>          # Using a ConfigMap to set the environment variable for the API URL<br>          valueFrom:<br>            configMapKeyRef:<br>              name: contactlist-config<br>              key: contactlist-api<br><br># Defining the API version and kind for the Service<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  # Naming the service<br>  name: contactlist-frontend-service<br>spec:<br>  # Setting the service type to NodePort to expose the service externally<br>  type: NodePort<br>  selector:<br>    # Selecting pods with the label &#39;app: webapp&#39; to associate with this service<br>    app: webapp<br>  ports:<br>  - protocol: TCP<br>    # Setting the port on which the service will be accessible<br>    port: 80<br>    # Mapping the service port to the container port<br>    targetPort: 80<br>    # Defining the NodePort to expose the service on each node in the cluster<br>    nodePort: 30100</pre><p>This frontend deployment specifies the creation of 2 frontend pods, unlike the backend, which consists of only 1 pod. Additionally, the Service section defines a NodePort service that exposes the pods externally on port 30100. Once the cluster is up, we should be able to access our frontend through Minikube’s IP address on port 30100.</p><p>Each pod is also configured with an environment variable named APP_API_URL sourced from a ConfigMap. APP_API_URL will contain our backend’s IP address.</p><pre>        - name: APP_API_URL<br>          # Using a ConfigMap to set the environment variable for the API URL<br>          valueFrom:<br>            configMapKeyRef:<br>              name: contactlist-config<br>              key: contactlist-api</pre><h4>3.3 Writing the ConfigMap for Our MiniKube Cluster</h4><p>Our backend can be accessed using our Minikube’s IP address followed by the NodePort we defined earlier. In order to get Minikube’s IP, we need to start Minikube. To do this, run the following command in your terminal:</p><pre>minikube start --driver=docker</pre><p>Once Minikube is up, run the following command:</p><pre>minikube ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6OodjLGOF5t1uamqEfWzA.png" /></figure><p>Therefore, our backend API will be available through 192.168.49.2:30050. We will save this in our ConfigMap so our frontend pods can access it later.</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  # Defining the name of the ConfigMap<br>  name: contactlist-config<br>  labels:<br>    # Adding a label to identify the application<br>    app: contactlist<br>data:<br>  # Setting the URL for the contact list API, to be used by our front-end container to interface with the backend<br>  contactlist-api: http://192.168.49.2:30050</pre><h3>Step 4: Deploying Our Minikube Cluster</h3><p>Now it’s finally time to deploy this Kubernetes cluster on Minikube. First, we navigate to the folder named k8s within our project directory, and then apply all of your Kubernetes configuration files using the following command from within this directory:</p><pre>kubectl apply -f .</pre><p>To check if everything is working as it should be, run the following command:</p><pre>kubectl get all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-TPEzdgGCyQc9btOSqkFg.png" /></figure><h3>Step 5: Accessing Our Frontend</h3><p>First, we get our Minikube IP once more:</p><pre>minikube ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6OodjLGOF5t1uamqEfWzA.png" /></figure><p>Since we configured the nodePort of our frontend as 30100, we should be able to access our web application through any web browser by navigating to <a href="http://192.168.49.2:30100/">http://192.168.49.2:30100</a>. This may be different for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*5wQ5kAUG1S2OK4Cb6ktIhA.png" /></figure><h3>Conclusion</h3><p>Thanks for following along! We’ve just gone through setting up a containerized React frontend and Flask backend, and deployed them on a local Kubernetes cluster using Minikube. This setup should give you a good starting point for experimenting with Docker, Kubernetes, and Minikube. Hopefully, you found this guide helpful and now feel more confident in working with these tools.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1956f6f466c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Docker: A Simple Guide to Creating Your First Container]]></title>
            <link>https://medium.com/@randikej/introduction-to-docker-containers-simplifying-application-deployment-3dca7f170cc5?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dca7f170cc5</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Sat, 25 May 2024 10:08:38 GMT</pubDate>
            <atom:updated>2024-05-25T10:11:09.509Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Step-by-Step Guide to Building and Running a Docker Container on Windows</h4><h4>What Is a Container?</h4><p>Think of a container as a portable box that contains all the code and all its dependencies and isolates the software from its environment so that it can run on any computing environment. Docker containers run on the Docker engine are lightweight because they share the machine’s OS kernel, and therefore does not require an OS for each application.</p><p>Building and running a Docker file on Windows:</p><ol><li>Download and install <a href="https://docs.docker.com/get-docker/">Docker Desktop</a></li><li>Write docker file</li><li>Build Docker image</li><li>Run Docker image to create a container of your application</li></ol><blockquote>Before getting started, ensure that you have downloaded and installed <a href="https://docs.docker.com/get-docker/">Docker Desktop</a> and have it running in the background.</blockquote><p>or this demonstration we will be containerizing a simple python file that prints Hello world!when run. If you are following along download the project files from this <a href="https://github.com/DRSNAJ/simple-docker-demo">repository</a>.</p><h3>Writing Our Docker File</h3><p>The contents of the Docker file are run in the order in which they are written. We follow the following steps to generate a Docker image for our python application.</p><ol><li>Create a root directory of our source files named Dockerfile</li></ol><pre>our-project-repo/<br>├── main.py<br>├── requirments.txt<br>├── Dockerfile<br>└── ...</pre><p>2. Get the base image from DockerHub. This base image contains the foundation on which we build our application’s containerized application. Since were running a python-3.11 application we import this base image as:</p><pre>FROM python:3.11-slim</pre><p>3. Next, we must set the working directory of the container. From this point on, the subsequent steps in the docker file will be run from this directory in the container.</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app</pre><p>4. Since our app simply prints Hello world! we do not have any dependencies that need to be installed, therefore this step is optional. If our had any dependencies (it almost always does) we need to install them to ensure our python application runs smoothly. To so this we first import the application’s requirements.txt file into our container’s working directory as using the COPY instruction in the form COPY &lt;local directory to copy from&gt; &lt;container directory to copy to&gt;</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app<br><br>COPY requirements.txt ./</pre><p>5. We install all the dependencies defined in the requirements.txt inside our container by using the RUN instruction that runs commands inside our container.</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app<br><br>COPY requirements.txt ./<br><br>RUN pip install -r requirements.txt</pre><p>6. Next, we copy all of the source files into our containers using another COPY instruction.</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app<br><br>COPY requirements.txt ./<br><br>RUN pip install -r requirements.txt<br><br>COPY . .</pre><p>7. Finally, we use the CMD instruction to define the default command to run when the container starts is python main.py. There is only one CMD instruction per Dockerfile and, unlike the RUNinstruction, it is written in exec form which does not start up a shell session.</p><pre># Use an official Python runtime as a base image<br>FROM python:3.11-slim<br><br># Set the working directory in the container<br>WORKDIR /app<br><br># Copy the requirements file into the working directory<br>COPY requirements.txt ./<br><br># Install the Python dependencies<br>RUN pip install -r requirements.txt<br><br># Copy the rest of the application code into the working directory<br>COPY . .<br><br># Set the command to run the main application<br>CMD [&quot;python&quot;, &quot;main.py&quot;]</pre><h3>Budling An Image</h3><p>Using this Dockerfile we now we need to build an image for our container. This can be done by using the docker build command as follows:</p><pre>docker build -t drsnaj/python_hello_world:v1.0 .</pre><ul><li>-t: Used to define a name tag for our container image</li><li>&lt;dockerhub-username&gt;/&lt;name-of-image&gt;:&lt;version&gt;: The name of the image. Although it is not required, naming the image starting with your docker hub username followed by a / will make it easier to push your images into dockerhub later on.</li><li>&lt;path-to-dockerfile&gt; the location of the dockerfile to generate the image. In our case it is . as we are already in the directory containing the dockerfile.</li></ul><h3>Starting Or Container</h3><p>After building image, we can start our container using the docker run command followed by the image’s ID or the tag name we gave it. In our case, we will run we will run this command as:</p><pre>docker run drsnaj/python_test</pre><p>If all went well running this command should print Hello world! in your terminal</p><h3>Conclusion</h3><p>We’ve explored the basics of Docker containers and how to build and run a Docker container on Windows. By containerizing a simple Python application, we’ve shown how Docker ensures consistent performance across environments. Happy containerizing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dca7f170cc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Creating CI/CD Pipelines on GitHub Actions]]></title>
            <link>https://medium.com/@randikej/getting-started-with-creating-ci-cd-pipelines-on-github-actions-822fd4488ab8?source=rss-2c10bb2cddc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/822fd4488ab8</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Randike]]></dc:creator>
            <pubDate>Sat, 25 May 2024 07:35:09 GMT</pubDate>
            <atom:updated>2024-05-25T07:35:09.456Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lKaULpnrCGxUc2RB" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>GitHub Actions allows you to automate the testing building and deployment of your repositories. The building and tests run on virtual machines in the cloud provided by GitHub.</p><p><a href="https://github.com/DRSNAJ/github-actions-demo">Click here</a> to fork my repo if you want to follow along.</p><h3>Setting Our File Structure</h3><p>A GitHub Actions workflow is defined in a .yaml file. To setup your workflow you must first create the following folders within your project repository:</p><pre>your-project-repo/<br>├── .github/<br>│   └── workflows/<br>│       └── main.yaml<br>└── ...</pre><p>Anything in the workflow&#39;s directory will be picked up by GitHub and setup as a workflow in the cloud. Our YAML file is named main.yaml but you can name it anything you like.</p><h3>Let&#39;s Write Our Pipeline</h3><h4>Naming our workflow</h4><p>Give the workflow a name that describes what it does in concise terms</p><pre>name: Python Calculator Testing Intigration </pre><h4>Setting trigger events for the workflow</h4><p>In our case, we want this workflow to run every time there is a push into the main branch of out repo.</p><pre>name: Python Calculator Testing Intigration <br><br>on:<br>  push:<br>    branches: [&quot;main&quot;]</pre><p>Events cover almost all GitHub activity including opening a pull request to the completion of another workflow. Triggers can even be sent from external sources using an <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch">API</a>.</p><h4>Specifying a runner</h4><p>This is a virtual machine provided by GitHub or self-selfhosted on your own infrastructure to run our jobs within the workflow.</p><p>Below, we define a name for our job (test_on_push in our case), and also specify our runner ubuntu-latest. GitHub also provides windows and MacOS virtual machines.</p><pre>name: Python Calculator Testing Intigration <br><br>on:<br>  push:<br>    branches: [&quot;main&quot;]<br><br>jobs:<br>  test_on_push:<br>    runs-on: ubuntu-latest</pre><h4>Defining the steps of our job</h4><p>These are the specific instructions for what needs to happen to complete our job.</p><ol><li>First, we need to get our source code into the virtual machine, this is done using an officially maintained action called checkout which will bring your code to the current working directory.</li><li>Since we need to setup and use a python environment need another officially maintained action called setup-python. We also specify the python version we are using semantic version range syntax as ”3.11.x”.</li><li>Next, we install the dependencies needed for our code to run smoothly based, but first we must update pip using python -m pip install — upgrade pip as it’s a common practice to keep pip up to date.</li></ol><pre>name: Python Calculator Continuous Intigration<br><br>on:<br>  push:<br>    branches: [&quot;main&quot;]<br><br>jobs:<br>  test_on_push:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v3<br>      - name: Setting up python environment<br>        uses: actions/setup-python@v5<br>        with:<br>          python-version: &quot;3.11.x&quot;<br>      - name: Installing Dependencies<br>        run: |<br>          python -m pip install --upgrade pip <br>          pip install -r requirements.txt<br>      - name: Testing with pytest<br>        run: pytest</pre><h4>Conclusion</h4><p>In conclusion, GitHub Actions provides a robust, flexible platform for automating software workflows directly within GitHub. By setting up actions like the Python Calculator Testing Integration example, developers can automate their testing, building, and deployment processes, significantly enhancing productivity and ensuring consistent quality. Whether you’re working on a small project or managing large-scale deployments, GitHub Actions seamlessly integrates these tasks into your development cycle, making it an indispensable tool for modern development teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822fd4488ab8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>