A distributed Industrial Control System (ICS) simulation for conveyor systems, incorporating Raft Consensus, Kafka Message Broker, and Kubernetes-based resource management.
This project implements a distributed control system for simulating and managing conveyor belt operations. It demonstrates modern distributed systems architecture with real-time control capabilities.
- Client: Simulates conveyor belt operations and sensor data generation
- Server: Core ICS simulator processing sensor data and system logic
- Kafka Message Broker: Handles inter-component communication
- Raft Consensus Service: Manages distributed consensus and leader election
- Resource Manager: Kubernetes-based workload scheduling
- XR Client: Optional AR/VR integration capability
- LLM Agents: Future AI-driven optimization (planned feature)
graph TD
A["LLM Agents (Future Integration)"] -->|gRPC/Protobuf| B["ICS Simulator (gRPC Server)"]
B -->|gRPC/Protobuf| C["Message Broker (Kafka)"]
C -->|gRPC| D["Consensus Service (Raft + Clocks)"]
B -->|gRPC/Protobuf| E["XR Client"]
C -->|gRPC| F["Resource Manager (K8s Scheduler)"]
classDef service fill:#ADD8E6,stroke:#005A9C,stroke-width:2px,color:#000,font-weight:bold;
classDef broker fill:#FFD700,stroke:#DAA520,stroke-width:2px,color:#000,font-weight:bold;
classDef consensus fill:#98FB98,stroke:#228B22,stroke-width:2px,color:#000,font-weight:bold;
classDef client fill:#FFB6C1,stroke:#FF69B4,stroke-width:2px,color:#000,font-weight:bold;
class A,B,F service;
class C broker;
class D consensus;
class E client;
- Docker Desktop
- Minikube
- kubectl
- Python 3.8+
- gRPC tools
- Protocol Buffers compiler
- Clone the repository:
git clone https://github.com/yourusername/conveyor-system-simulation.git
cd conveyor-system-simulation
- Install dependencies:
# Server dependencies
cd server
pip install -r requirements.txt
# Client dependencies
cd ../client
pip install -r requirements.txt
- Start Minikube:
minikube start
- Configure Docker environment:
# For PowerShell
minikube docker-env | Invoke-Expression
# For Bash
eval $(minikube docker-env)
- Build Docker images:
# Build server image
docker build -t server:latest -f server/Dockerfile server
# Build client image
docker build -t client:latest -f client/Dockerfile client
- Apply Kubernetes configurations:
kubectl apply -f kubernetes/
- Verify deployment:
# Check running pods
kubectl get pods
# Check services
kubectl get svc
Monitor system components:
# View pod logs (replace <pod-name>)
kubectl logs <pod-name>
# Get detailed pod information
kubectl describe pod <pod-name>
# Stream logs from a specific pod
kubectl logs -f <pod-name>
- Access the system dashboard:
minikube service dashboard-service
- Start the simulation:
# In the client directory
python client.py --host localhost --port 50051
- Monitor metrics:
# Access Prometheus metrics
minikube service prometheus-service
- Pods not starting:
# Check pod status
kubectl get pods
kubectl describe pod <pod-name>
- Service connectivity issues:
# Verify service endpoints
kubectl get endpoints
# Test service connectivity
kubectl port-forward service/<service-name> <local-port>:<service-port>
- Resource cleanup:
# Delete all resources
kubectl delete -f kubernetes/
# Delete specific resources
kubectl delete pods --all
kubectl delete deployments --all
kubectl delete services --all
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Integration of LLM agents for predictive maintenance
- Enhanced XR client capabilities
- Advanced anomaly detection
- Real-time optimization algorithms
- Extended monitoring and alerting
This project is licensed under the MIT License - see the LICENSE file for details.
Muhammad Hassan Sohail - @LinkedIn Project Link: https://github.com/hsn07pk/conveyor-system-simulation