π Introduction to Continuous Integration (CI) and ArgoCD for GitOps-driven MLOps

I am Bittu Sharma, a DevOps & AI Engineer with a keen interest in building intelligent, automated systems. My goal is to bridge the gap between software engineering and data science, ensuring scalable deployments and efficient model operations in production.! ππ²π'π ππΌπ»π»π²π°π I would love the opportunity to connect and contribute. Feel free to DM me on LinkedIn itself or reach out to me at bittush9534@gmail.com. I look forward to connecting and networking with people in this exciting Tech World.
Introduction: CI/CD in the World of MLOps
In todayβs Machine Learning Operations (MLOps) ecosystem, managing code, models, and infrastructure efficiently is key to faster and more reliable delivery.
To achieve this, modern teams adopt:
Continuous Integration (CI) β to build, test, and validate ML pipelines automatically
Continuous Delivery/Deployment (CD) β to deploy model services automatically into Kubernetes
This blog introduces you to ArgoCD, a GitOps-based CD tool that automates deployment directly from your Git repository, making the process declarative, traceable, and scalable.
βοΈ What is Continuous Integration (CI)?
Continuous Integration (CI) is the practice of frequently merging small code changes into a shared repository and validating them automatically through builds and tests.
πΉ In an MLOps Context
CI ensures that:
Model training scripts and pipeline code work consistently
Code changes are tested automatically before being merged
ML artifacts (data, models, and pipelines) are version-controlled
π§© Typical CI Workflow
Developer commits new code to GitHub
GitHub Actions or Jenkins builds and tests the pipeline
Model or container image is created and pushed to a registry (like DockerHub or ECR)
ArgoCD automatically deploys the new version into Kubernetes
π Overview of ArgoCD for GitOps
ArgoCD is a declarative, GitOps-based continuous delivery tool for Kubernetes.
It continuously monitors your Git repository for configuration changes and syncs them to your Kubernetes cluster.
πΉ Why GitOps?
GitOps ensures that Git is the single source of truth for your infrastructure and applications.
If a deployment differs from whatβs in Git, ArgoCD automatically reconciles it.
πΉ Benefits of ArgoCD
β Automated and consistent deployments
β Rollbacks to previous versions easily
β Real-time sync between Git and Kubernetes
β Built-in UI and CLI for visualization
β Secure and audit-friendly
π§© Setting Up CI Pipelines with ArgoCD
Letβs integrate Continuous Integration and Continuous Delivery with GitOps.
πΉ Step 1: Build and Test your ML Code (CI)
Use any CI tool β GitHub Actions, Jenkins, Tekton, or GitLab CI β to automate testing.
Example GitHub Workflow (.github/workflows/ci.yml):
name: Build and Test ML App
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Run Unit Tests
run: pytest tests/
- name: Build Docker Image
run: docker build -t my-ml-app:${{ github.sha }} .
- name: Push Image to Registry
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push my-ml-app:${{ github.sha }}
πΉ Step 2: Update Kubernetes Manifests in Git
Once the image is built, the pipeline updates the Kubernetes YAML manifest in a GitOps repo:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ml-model-api
spec:
replicas: 2
selector:
matchLabels:
app: ml-model-api
template:
metadata:
labels:
app: ml-model-api
spec:
containers:
- name: ml-model-api
image: my-ml-app:<VERSION_TAG>
ports:
- containerPort: 5000
This Git update triggers ArgoCD to automatically deploy the latest version.
β‘ Automating Model Deployment with ArgoCD
πΉ Step 1: Install ArgoCD
Install ArgoCD in your Kubernetes cluster:
kubectl create namespace argocd
kubectl apply -n argocd \
-f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Expose the ArgoCD API server:
kubectl port-forward svc/argocd-server -n argocd 8080:443
Login using the CLI:
argocd login localhost:8080
πΉ Step 2: Create an Application in ArgoCD
argocd app create ml-model-app \
--repo https://github.com/your-org/mlops-deployments.git \
--path manifests \
--dest-server https://kubernetes.default.svc \
--dest-namespace mlops
Sync the application:
argocd app sync ml-model-app
Now ArgoCD will automatically deploy whenever your Git repo changes.
π Integrating ArgoCD with GitHub for Continuous Delivery
πΉ Step 1: Connect GitHub Repository
In the ArgoCD UI:
Go to Settings β Repositories β Connect Repo
Add your GitHub repository URL and credentials
Choose Auto-Sync mode for continuous delivery
πΉ Step 2: Configure Webhooks
Enable GitHub Webhooks to notify ArgoCD on every push:
https://argocd-server-url/api/webhook
Each new commit or PR automatically triggers synchronization, ensuring Git β Cluster consistency.
π Managing Deployments with ArgoCD
πΉ From the ArgoCD UI
You can visually see:
Current vs desired states
Application health (Healthy, Degraded, Missing)
Sync status (Synced, OutOfSync)
πΉ Managing with CLI
argocd app list
argocd app get ml-model-app
argocd app sync ml-model-app
argocd app delete ml-model-app
πΉ Example Deployment Workflow
Commit a change to the deployment manifest
GitHub triggers ArgoCD
ArgoCD syncs the update
New model image is deployed automatically
βͺ Rolling Back and Updating Deployments in Kubernetes
ArgoCD maintains a complete deployment history.
You can roll back with a single command:
argocd app rollback ml-model-app <REVISION_ID>
Or manually redeploy a specific Git commit:
argocd app sync ml-model-app --revision <GIT_COMMIT_SHA>
This ensures rapid rollback in case of performance issues or model drift.
π Monitoring Deployment Status with ArgoCD
πΉ UI Monitoring
The ArgoCD dashboard gives you a live visual representation of:
Pods and services
Deployment health
Sync status
Errors and drift detection
πΉ CLI Monitoring
argocd app health ml-model-app
argocd app history ml-model-app
πΉ Integration with Observability Tools
You can integrate Prometheus, Grafana, or OpenTelemetry for:
Pipeline performance metrics
Deployment latency
Model serving status
π§© Example: End-to-End MLOps CI/CD Flow
Developer β GitHub (Code Commit)
β
GitHub Actions (CI Build/Test)
β
Docker Image Push β Container Registry
β
GitOps Repo Update β YAML Manifests
β
ArgoCD Auto-Sync β Kubernetes Deployment
β
ArgoCD Dashboard β Monitor & Rollback
π§ Best Practices for CI/CD with ArgoCD
| Best Practice | Description |
| Keep Git as Source of Truth | All deployment manifests live in Git |
| Use Auto-Sync | For faster delivery cycles |
| Enable RBAC | Secure access and permissions |
| Tag Docker Images | Use commit SHA or version tags |
| Integrate Monitoring | Use Prometheus and Grafana |
| Document Workflow | Keep a Confluence record of model updates |
π§ Key Takeaways
β
CI ensures code quality and test automation
β
ArgoCD delivers GitOps-based deployment automation
β
Rollbacks and updates are instant and version-controlled
β
Integrating GitHub + ArgoCD creates a seamless delivery pipeline
β
Perfect setup for data-driven, model-driven, or inference-driven deployments
π Conclusion
With Continuous Integration (CI) validating every model and ArgoCD automating its deployment, your MLOps lifecycle becomes fully automated, reproducible, and observable.
From code commit to production rollout β every step is tracked, versioned, and reversible.
Thatβs the true power of GitOps with ArgoCD π
Follow me on LinkedIn
Follow me on GitHub
Keep Learningβ¦β¦




