Upload an image and discover celebrities with AI-powered recognition and interactive Q&A.
Demo:
CI/CD Pipeline:
GKE Deployment Dashboard:
-
Tech stack
- Groq --> LLM
- Gitlab --> Serve as SCM for the project. Also a CI/CD tool for making pipelines
- OpenCV Python --> To deal with image work like conversion of images, scaling, etc
- Flask --> Application backend
- HTML/CSS --> To make UI or frontend of the app
- Docker --> For containerization of the app during deployment
- GCP GAR --> For storing the Docker images
- GCP GKE --> To deploy and run the app on the cloud within a Kubernetes Cluster. It's a service offered by Google Cloud
-
Workflow
Check that you have done the following before moving to the CircleCI deployment part:
- ✅ Dockerfile
- ✅ Kubernetes Deployment file
- ✅ Code Versioning using GitLab
Make an account on GitLab, then create a public project and follow all necessary steps mentioned in the course video.
Now, perform code versioning using GitLab by running the following commands:
git init
git branch -M main
git remote add origin https://gitlab.com/your-username/your-repo.git
git add .
git commit -m "Initial commit"
git push origin main
Go to your GCP account and enable all the following APIs:
Navigation:
In the left pane → APIs & Services → Library
Enable the following:
- Kubernetes Engine API
- Container Registry API
- Compute Engine API
- Cloud Build API
- Cloud Storage API
- IAM API
-
Create GKE Cluster:
- Go to your GCP Console and search for GKE.
- Create a new cluster with a name of your choice.
- In the Networking tab, provide the necessary access/configurations.
-
Create Artifact Registry:
- In the GCP Console, search for Artifact Registry.
- Create a new Artifact Registry with a name of your choice.
-
Create a Service Account in your GCP Console.
-
Assign the following roles:
- Storage Object Admin
- Storage Object Viewer
- Owner
- Artifact Registry Admin
- Artifact Registry Writer
-
Download the key as a
.json
file. -
Place the key file (e.g.,
gcp-key.json
) in the root directory of your project. -
Important: Add
gcp-key.json
to your.gitignore
to prevent it from being pushed to GitHub.
-
Go to your GitLab project → Settings → CI/CD → expand the Variables section.
-
Click Add Variable with the following details:
-
Key:
GCP_SA_KEY
-
Value:
Run the following command in your terminal to get the base64 value of yourgcp-key.json
file:cat gcp-key.json | base64 -w 0
-
Access your GKE cluster:
- Open your GKE Console.
- Open the kubectl terminal.
-
Configure your local terminal to connect with your cluster:
Run the following command, adjusting for your project details:
gcloud container clusters get-credentials llmops-cluster1 \ --region us-central1 \ --project <your project name>
-
Create a Kubernetes secret to store your LLM API key:
kubectl create secret generic llmops-secrets \ --from-literal=GROQ_API_KEY="your_actual_groq_api_key"
This secret will be referenced in your Kubernetes deployment file to securely fetch the
GROQ_API_KEY
.
Create a .gitlab-ci.yml
file in the root of your project directory.
✅ GitLab CI/CD setup complete.
Now Push code to Gitlab ---> Automatically triggers the pipeline or u can manually trigger it using
- Go to Left pane of Gitlab
- Go to Build --> Pipelines
- Trigger pipeline from there
- Note: Your first pipeline might fail if it is your first time in GitLab because u need to verify your account using phone number or credit card Do verify and again trigger the pipeline...
- Now go see ur app on GKE Workloads...