How sweetiu172/nbiot_detector_core works
Project type and purpose
• This is a cloud-native, microservices-style deployment of a Python inference service (“nbiot-detector”) that exposes a REST API for NB-IoT device detection.
• It includes CI/CD (Jenkins), GitOps (ArgoCD), observability (Prometheus/Grafana, Jaeger), logging (ELK), ingress (nginx + Cloudflare Tunnel), and runs on either Minikube (local) or GKE (production, provisioned via Terraform).
High-level components
a. Inference application
• Python FastAPI (app/main.py) in a Docker container
• Model assets loaded from app/saved_assets
• Exposes HTTP endpoints for single/batch prediction
• Docker image built by Jenkins
b. API ingress
• Ingress-NGINX controller (helm chart)
• Cloudflare Tunnel (optional for external access)
• Kubernetes Ingress resources
c. CI/CD and GitOps
• Jenkins (builds, pushes Docker images, triggers Helm / manifests deploy)
• ArgoCD (automatically syncs Helm charts and K8s manifests from Git)
d. Infrastructure provisioning
• Terraform (GKE cluster, networking, DNS, IAM)
• scripts/bootstrap.sh & cleanup.sh (orchestrate Terraform → kubectl → Helm)
e. Monitoring & observability
• kube-prometheus-stack (Prometheus, Alertmanager, Grafana dashboards)
• Jaeger all-in-one (distributed tracing)
f. Logging
• Elasticsearch (stores logs)
• Filebeat (ships logs into Elasticsearch)
• Kibana (log browsing & querying)
Interactions and data flows
• User/client HTTP → Cloudflare Tunnel → Ingress → nbiot-detector service → returns prediction
• nbiot-detector logs → stdout → Filebeat DaemonSet → Elasticsearch → Kibana UI
• nbiot-detector metrics (Prometheus client) scraped by Prometheus → Grafana dashboards
• Traces emitted by nbiot-detector → Jaeger collector → Jaeger UI
• Git push → Jenkins Multibranch Pipeline → builds/pushes Docker image → commits Helm values → triggers ArgoCD sync → Kubernetes Deployment rolling update
Architectural patterns and design principles
• Microservices (single-purpose inference service)
• GitOps for declarative deployments (ArgoCD, Helm charts under kubernetes/helm)
• IaC for infra (Terraform + bootstrap script)
• Sidecar-style logging and metrics collection via DaemonSets and Prometheus operators
• Namespace isolation (e.g., jenkins, monitoring, logging, argocd, app) in Kubernetes
Final checklist
• Critical configuration points: Terraform variables, Helm values, namespace names.
• Helm chart is represented (argocd, cert-manager, nginx-ingress, filebeat, elasticsearch, jaeger, prometheus-stack).