Translate

Git Repo, Docker and hosting on local and on AWS Ubuntu EC2 instance

 =========

STEP-1

=========

git init

git remote add origin https://github.com/rakeshsofteng/ReActAgentDemo.git

git add .

git commit -m "Initial commit for ChatBotWithUI"

git branch -M main

git push -u origin main


===================================

==> if you want to delete REPO


git push origin --delete main

git reset --soft HEAD~1

git restore --staged .

git remote remove origin

rm -rf .git

rmdir /s /q .git


====================================

==> Rest global settings


git config --global --unset user.name

git config --global --unset user.email

git config --global --unset credential.helper


git config --global credential.helper manager




git config --global user.name "rakeshsofteng"

git config --global user.email "rakeshmca@live.com"


============================================================

=> now Proper comamnds are :


# Initialize git repository

git init


# Add and commit project files

git add .

git commit -m "Initial commit - Streamlit LangGraph App"


# Create a repository on GitHub.com, then connect and push:

git branch -M main

git remote add origin https://github.com/rakeshsofteng/ReActAgentDemo.git

git push -u origin main



Imp=> to check which url is attached with origin


git remote -v





=========

STEP-2

=========

+++++++++++++++++++++++++++  Docker: +++++++++++++++++++++++++++++

=> you must first install wsl2 


wsl --version     =>Check for version if it already exists 


wsl --install        =>Install it 


wsl --update       =>Update it for latest.



=> below command will install Docker using cmd process: only add correct path of exe in below command 

  

Start-Process 'C:\DATA-1\Softwares\Docker Desktop Installer.exe' -Wait -ArgumentList 'install', '--accept-license'






++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

=> Docker  UI and engine was not starting - after following comamnd it worked

=> open power shell with administrator privilages and then run following command: 



1)

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V /all /norestart

bcdedit /set hypervisorlaunchtype auto


2) apart from above  open  %APPDATA%\Docker\

now open settings-store.json file

now add "wslEngineEnabled": false  as first entry in json with in braces{ }


3) in add and remove > windows features > enable > "Windows Subsystem for LINUX"


4) do not forget to restart machine after each change, else it will not reflect. 



=========

STEP-3

=========


=======On my local ===== Now create docker image and then container ==================

# Build the Docker image

docker build -t langgraph-streamlit-app .


# Run container locally on port 8501

docker run -p 8501:8501 --env-file .env langgraph-streamlit-app



=========

STEP-4

=========


===================Host build on Ubuntu server using docker ================


# Update package list and install prerequisites

sudo apt update && sudo apt upgrade -y

sudo apt install -y docker.io git


# Start Docker and enable it on boot

sudo systemctl enable --now docker


# Add Ubuntu user to the Docker group

sudo usermod -aG docker $USER


# Apply group membership changes immediately

newgrp docker


===> check if GIT and docker installed successfully.


git --version

sudo systemctl status docker




=========

STEP-5

=========

=====================================================================

==> now clone the code from GIT to LIVE ubuntu server  


# Clone your repository

git clone https://github.com/rakeshsofteng/ReActAgentDemo.git


cd YOUR_REPOSITORY_NAME  <= Enter into  code folder.  

ls                       <= now write ls and you will see all files listed there.  


# Create production .env file  [only if you want to add PROD keys to your hosted project]

nano .env


Before moving next also check which port your docker is listening currently [default is 22]:


sudo ss -tulpn | grep 22

sudo ss -tulpn | grep 80 


docker ps   <==   lists all currently running Docker containers on your machine. 



=========

STEP-6

=========

====================================================================

=> create docker image and host it now on LIVE serever ubentu.


# Build Docker image

docker build -t langgraph-app .


# Launch container in detached background mode with auto-restart

docker run -d \

  --name streamlit-langgraph \

  -p 80:8501 \

  --restart always \

  --env-file .env \

  langgraph-app


  



Important links - must check

 


---GEN AI--

https://www.udemy.com/course/build-end-to-end-genai-project-production-ready-agent-with-python/?couponCode=KEEPLEARNING

https://www.udemy.com/course/ai-workflows-agents-langchain-langgraph-gemini-openai/?couponCode=KEEPLEARNING

https://www.udemy.com/course/complete-generative-ai-course-with-langchain-and-huggingface/?couponCode=CP250105G1



---RAG---

https://www.udemy.com/course/rag-for-professionals-with-langgraph-python-and-openai/?couponCode=CP250105G1

https://www.udemy.com/course/agentic-ai-private-agentic-rag-with-langgraph-and-ollama/?couponCode=CP250105G1

https://www.udemy.com/course/ultimate-rag-bootcamp-using-langchainlanggraph-langsmith/?couponCode=CP250105G1

https://docs.langchain.com/oss/python/langgraph/agentic-rag#2-create-a-retriever-tool

https://github.com/JEELGANDHI21/AI-Learning/blob/main/LangGraph/03_LangGraph_Agents.ipynb


******** RAG application using OPENAI and Ollama ********

https://medium.com/@senol.isci/building-q-a-llm-applications-using-retrieval-augmented-generation-rag-for-local-document-7e51203c01ff


***********RAG with advanced LLM-**********   PAID*************

https://medium.com/@yashwanths_29644/rag-series-02-demo-to-build-rag-using-open-source-frameworks-4e381e84b992

Install and activate UV package using pip

 1) Use below command  to install UV at very first  time

pip install uv


2)  Now you need to create project using UV package command 

uv init MyProject


3) now go ahead and install all packages from requirements.txt file 

   uv add -r requirements.txt


Ipyketnal to start  with Jupyter notebook


Popular Posts