Project Setup Guide
This document provides comprehensive step-by-step instructions to deploy Infosys Agentic Foundry in Google Kubernetes Engine(GKE).
Prerequisites
Before setting up the project, ensure you have the following requirements and access permissions:
Ensure users have access to below:
- Python 3.12+ - Required Python version
-
React - Frontend framework
-
Infosys Github Repo: Infosys-Agentic-Foundry
- Ensure users have their Google Cloud Vertex AI / Generative AI Studio API Keys and Speech-to-Text Keys and Endpoints.
- Ensure GCP resources are created, and you have access/connectivity to push and pull from these resources:
- Google Cloud Artifact Registry
- Google Kubernetes Engine (GKE)
- Cloud SQL for PostgreSQL (Instance equivalent: db-custom-2-4096 – 2 vCPUs, 4 GiB memory, 32 GiB SSD storage)
- Google Compute Engine (GCE) Linux Virtual Machine
- Install Docker, gcloud CLI, and kubectl in your GCE VM
- Create a namespace in the GKE cluster as per your requirement (Optional)
kubectl create namespace <namespace>
GCP Deployment
ARIZE PHOENIX
STEPS FOR DEPLOYING ARIZE PHOENIX IN GKE
- Create a yaml file for deploying arize phoenix as a container, you can use the arize phoenix image in the yaml file.
nano filename1.yaml
Info
You can get the image from Docker - Phoenix or any other trusted source which your organization allows
- Now you need to use this command for creating deployment and service:
kubectl apply -f filename1.yaml - You can check the pods deployed using the command below
kubectl get pods -n namespace - You can check the services deployed using the command below
kubectl get svc -n namespace - Note down the load balancer IP for the container. You need to update it in the
.envof your backend and frontend folders before creating the respective docker images.
REDIS
STEPS FOR DEPLOYING REDIS IN GKE
- Create a yaml file for deploying Redis as a container, you can use the redis image in the yaml file.
nano filename2.yaml
Info
You can get the image from Image Layer Details - redis:8.2.1 or any other trusted sources which your organization allows
- Now you need to use this command for creating deployment and service:
kubectl apply -f filename2.yaml - You can check the pods deployed using the command below
kubectl get pods -n namespace - You can check the services deployed using the command below
kubectl get svc -n namespace - Note down the load balancer IP for the container. You need to update it in the
.envof your backend folder before creating the respective docker image.
GRAFANA
STEPS FOR DEPLOYING GRAFANA IN GKE
- Create a yaml file for deploying Grafana as a container, you can use the grafana image in the yaml file.
nano filename3.yaml
Info
You can get the image from Image Layer Details - grafana/grafana:11.2.0 or any other trusted sources which your organization allows
- Now you need to use this command for creating deployment and service:
kubectl apply -f filename3.yaml - You can check the pods deployed using the command below
kubectl get pods -n namespace - You can check the services deployed using the command below
kubectl get svc -n namespace - Note down the load balancer IP for the container. You need to update it in the
.envof your backend and frontend folders before creating the respective docker images.
ELASTIC SEARCH
STEPS FOR DEPLOYING ELASTIC SEARCH IN GKE
- Create a yaml file for deploying elastic search as a container, you can use the elastic search image in the yaml file.
nano filename4.yaml
Info
You can get the image from elasticsearch - Official Image | Docker Hub or any other trusted sources which your organization allows
- Now you need to use this command for creating deployment and service:
kubectl apply -f filename4.yaml - You can check the pods deployed using the command below
kubectl get pods -n namespace - You can check the services deployed using the command below
kubectl get svc -n namespace - Note down the load balancer IP for the container and update it in the OpenTelemetry YAML script.
OPEN-TELEMETRY
STEPS FOR DEPLOYING OPEN-TELEMETRY IN GKE
- Create a yaml file for deploying OpenTelemetry as a container, you can use the OpenTelemetry directly in the yaml file.
nano filename5.yaml
Info
You can get the image from otel/OpenTelemetry-collector-contrib - Docker Image or any other trusted sources your organization allows
- Now you need to use this command for creating deployment and service:
kubectl apply -f filename5.yaml - You can check the pods deployed using the command below
kubectl get pods -n namespace -
You can check the services deployed using the command below
kubectl get svc -n namespace -
Note down the load balancer IP for the container. You need to update it in the
.envof your backend folder before creating the respective docker image.
MODEL SERVER
STEPS TO SETUP MODEL SERVER
For detailed instructions on deploying and configuring your model server, refer to the Model Server Deployment guide.
Note
You need to update the URL for the model server in the .env of the backend folder
BACKEND
STEPS TO SETUP BACKEND
Download Backend code from GitHub. For detailed instructions, see Download the Backend Project Code.
- Login in to Login into Google Compute Engine (GCE) VM.
- Download Backend source code folder into GCE VM
- Before starting backend image creation make sure that arize phoenix, OpenTelemetry, Grafana, Elastic Search, Redis and Model server are setup as per instructions provided above. Update the respective urls of all these services in
.envfile. - Update the remaining values for the variables in the
.envfile. - Change working directory to the Backend Folder:
cd `<BE foldername>` - Create Dockerfile inside Backend folder to create docker image for Backend code.
- Create backend image:
docker build -f `<dockerfile-name>` -t `<tag-name>` - Retag the created image to Artifact Registry name:
docker tag localhost/<imagename>:<tag> <region>-docker.pkg.dev/<project-id>/<repository-name>/<imagename>:<tag> - Configure Docker to use GCR credentials & Login to Artifact Registry:
gcloud auth configure-docker <region>-docker.pkg.dev - Push the retagged image to Artifact Registry:
docker push <region>-docker.pkg.dev/<project-id>/<repository>/<imagename>:<tag> - Create backend deployment file:
nano <deployment filename.yaml> - Login to Google Kubernetes Engine (GKE)
- Execute the deployment file:
kubectl apply -f <deployment filename.yaml> - Check if the pods is deployed successfully:
kubectl get pods -n <namespace> - Check if the service is up & running successfully:
kubectl get svc -n <namespace>
FRONTEND
STEPS TO SETUP FRONTEND
Download Frontend code from GitHub. For detailed instructions, see Download the Frontend Project Code.
- Login in to Google Cloud Platform(GCP VM)
- Download Frontend source code folder into Google Cloud Platform (GCP VM)
- Before starting frontend image creation make sure that arize phoenix, Grafana are setup as per instructions provided above. Update the respective urls of all these services in
.envfile. - Change working directory to the Frontend Folder:
cd <Frontend foldername> - Create Dockerfile inside Frontend folder to create docker image from Frontend code.
- Change the name of
.env-examplefile of Frontend to.env. - Create Frontend image:
docker build -f <dockerfile-name> -t <tag-name> - Retag the created image to Artifact Registry:
docker tag localhost/<imagename>:<tag> <region>-docker.pkg.dev/<project-id>/<repository>/<imagename>:<tag> - Login to GCP VM and then login to Artifact Registry:
gcloud auth configure-docker <region>-docker.pkg.dev - Push the retagged image to Artifact Registry:
docker push <region>-docker.pkg.dev/<project-id>/<repository>/<imagename>:<tag> -
Create Frontend deployment file:
Pass/override the load balancer URLs which were generated after deployment of Backend server in Google Kubernetes Engine (GKE) vianano <deployment filename.yaml>envsection of deployment file for below listed servicesREACT_APP_BASE_URL(use Backend URL),REACT_APP_MKDOCS_BASE_URL(use mkdocs public URL),REACT_APP_LIVE_TRACKING_URL(use Arize phoenix URL),REACT_APP_GRAFANA_DASHBOARD_URL(use Grafana URL)
-
Login to Google Kubernetes Engine
- Execute the deployment file:
kubectl apply -f <deployment filename.yaml> - Check if the pods is deployed successfully:
kubectl get pods -n <namespace> - Check if the service is up & running successfully:
kubectl get svc -n <namespace>
Troubleshooting
Virtual Environment Activation Fails
- Permissions Error: Try running command prompt as administrator
Dependency Installation Errors
Update pip to the latest version:
python -m pip install --upgrade pip
Server or UI Not Starting
- Verify the virtual environment is active
- Check for typos in commands or file names
- Ensure all dependencies are properly installed
- To troubleshoot check pod logs in Kubernetes, By using below commands:
kubectl describe pods <pod_name> -n <namespace> kubectl logs <pod_name> -n <namespace>