AWS Code Commit is a fully managed, secure, private Git repository service used to store, version, and collaborate on source code and other assets. It eliminates the need to host your own Git server and integrates tightly with AWS services.
Let's start with creating a code commit repository from the AWS Console:
Repository name is "book" and I am going to create a file from the console by the name called "facts.txt" with the below content.
Here is the commit message for the file.
Now, our file is ready.
Take a note at the "Reference" as "main" which shows the file is created under main branch.
No need to worry about the terms branch, commit and others. This series covers it.
Now, our file is ready. Consider the file under the "main" branch is the ONE VIEWED/USED by everyone.
Now, we have been asked to make changes to the file. Change the numbers from 8,848.86
to ~ 9,000 meters.
In real, no organization allows to make changed to file in the "Main" branch. So, we have create a new branch out of the main branch.
In Git, a branch is a lightweight, movable pointer to a commit that lets you work on features, fixes, or experiments independently from the main line of development. It’s like creating a parallel timeline for your code — you can make changes safely without affecting the main branch until you merge them back.
I can make the updates from the console by create a branch from the AWS console. But, I will showing how to create a branch, make updates and other activities using GIT CLI.
The Git CLI (Command Line Interface) is the most powerful way to interact with Git, allowing developers to perform every version‑control operation directly from the terminal — including repository management, branching, merging, and collaboration.
Download git cli from https://git-scm.com/install/
I also recommend to check https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html on how to configure SSH - Password less authentication for interacting with Code Commit Repo.
I completed the above steps. Hence, I am walking directly to CLI.
First, I need to CLONE the repo from AWS Console using the command # git clone <REPO URL>
Repo URL can be fetched from the AWS Console.
Here are the five steps process which we are going to cover.
Clone command creates a copy of the entire repo to the local folder.
$ git branch : Shows the current branch you are in.
The main branch (formerly often called master) is the default, primary branch in a Git repository that holds the stable, production-ready code
I am creating a new branch (feature-change) using $ git checkout command:
And confirm that I am in the "feature-change" branch. So, that any changes to the file will be under "feature-change" branch.
Now, we have successfully cloned the remote repo, created a branch locally and switched to the branch.
I made the changes to the file using "vi" editor.
git add (The Staging Area)
The git add command moves changes from your Working Directory (where you edit files) to a temporary holding area called the Staging Area (or "index").
Purpose: It allows you to select exactly which changes you want to include in your next snapshot. For example, if you modified five files but only want to save the changes for two of them right now, you would only "add" those two.
git commit (The Snapshot)
The git commit command takes everything currently in the Staging Area and records it as a permanent snapshot in your Local Repository.
The git push command is used to upload local repository content to remote repository.
After the file is updated, we proceed to add, commit.
$ git log --oneline will shows the changes happened to the file and the associated commit id.
A Git commit ID (or SHA-1 hash) is a unique 40-character hexadecimal string that serves as a permanent, immutable identifier for a specific snapshot of a repository. It tracks changes, enables exact version restoration, identifies contributors, and ensures code integrity by changing if any content or metadata is altered.
Now, we can see 2 commit ID. One if the original file and the top one is the commit id of my change.
To see the difference between the commits use the below command.
Finally, I push my local change from "feature-change" branch to the remote repo (AWS)'s feature branch.
Let's verify the file is updated from the AWS Code Commit repo.
Looks look. But the file under "main" branch is the one which is actually used.
So, we need to merge the change from the feature branch to main branch.
To do this, we create something called "PR - Pull Request".
Pull requests are proposals to merge code changes into a project. A pull request is GitHub's foundational collaboration feature, letting you discuss and review changes before merging them. This helps teams work together, catch issues early, and maintain code quality.
I am creating the PR from AWS console:
Take a look at the "Source" and "Destination", it shows we are merging the change from "feature-change" branch to "main" branch".
We can also, what really changed in the PR.
Finally, we merge the PR.
Once the PR is merged. Verify the file from the main branch. It must have the changes we made in the feature-change branch.
In the next series, We will discuss on reverting the change.
etcd is a "strongly consistent , distributed key-value store". Why etcd? 1. Consistency : Since the API server is the central coordination point of the entire cluster; strong consistency is essential. It would be a disaster if, say, two nodes tried to attach the same persistent volume over iSCSI because the API server told them both that it was available. 2. Availability: API downtime means that the entire Kubernetes control plane comes to a halt, which is undesirable for production clusters. The CAP theorem says that 100% availability is impossible with strong consistency, but minimizing downtime is still a critical goal. 3. Consistent Performance: The API server for a busy Kubernetes cluster receives a fair amount of read and write traffic. The secret behind etcd's balance of strong consistency and high availability is the Raft algorithm . Raft solves a particular problem: how can multiple independent processes decide on a single value for somethin...
In this blog we will see how to build a simple agent without using any LLM model. Simple flow of an agent: Agent takes input -> Based on the input, it decides which tool to use -> Performs operation and send the output back to the user. An AI agent framework is a set of tools, libraries, and structures that simplifies building, deploying, and managing autonomous AI agents. But, here we are going to build an agent without using any framework and LLM's. Agent functionality is to perform "Addition" and "Subtraction". Agent uses 2 python functions (Tools) to perform addition and subtraction operations. Finally, it send the output to the user. We are going to implement the above discussed functionality vi...
In this blog, will how to create a simple agent using AI framework like Langchain with a simple LLM model gpt-4o-mini. from langchain_openai import ChatOpenAI from langchain_core . tools import tool import os # Creating a tool @ tool def add_numbers ( x : int , y : int ) -> int : "Add two numbers" return x + y @tool is a decorator to define a tool. This is a simple tool to add 2 numbers. The below line creates a Langchain LLM wrapper around on the OpenAI chat mode 'gpt-4o-mini' # Binding the tool to a model llm = ChatOpenAI( model = "gpt-4o-mini" ).bind_tools([add_numbers]) response = llm .invoke( "What is 5 + 7?" ) When we print response, is the expected outcome? Is it 12. NO...
Comments
Post a Comment