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.
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...
Directory buckets organize data hierarchically into directories as opposed to the flat storage structure of general purpose buckets. There aren't prefix limits for directory buckets, and individual directories can scale horizontally. Directory buckets support bucket creation in the following bucket location types : Availability Zone or Local Zone. For low latency use cases, you can create a directory bucket in a single Availability Zone to store data. Amazon S3 Express One Zone is a high-performance, single-zone Amazon S3 storage class that is purpose-built to deliver consistent, single-digit millisecond data access for your most latency-sensitive applications. S3 Express One Zone is the lowest latency cloud-object storage class available today, with data access speeds up to 10x faster and with request costs 50 percent lower than S3 Standard. With S3 Express One Zone, your data is redundantly stored on multiple devices within a single Availability Zone. You can ac...
Comments
Post a Comment