How kubeedge/sedna works
Based on our analysis of both the complete file tree and the README file, Sedna is an edge-cloud synergy framework designed to empower AI applications with distributed training and inference capabilities (joint inference, incremental learning, federated learning, lifelong learning). It leverages KubeEdge’s capabilities to orchestrate applications across cloud and edge nodes. Given the many directories (cmd, pkg, lib, components, examples, docs, build, etc.) and multiple configuration artifacts (CRDs, helm charts, Dockerfiles, etc.), the system is clearly a large-scale, cloud-native project written in Go and leveraging Kubernetes for orchestration.
Main Components
• LocalController – runs on edge nodes. Found under pkg/localcontroller, it handles local process control, model and dataset synchronization, and communicates with GlobalManager.
• Worker – individual processes (or containerized microservices) that perform the training and inference tasks. They are instantiated on both edge and cloud and communicate with the managers. The cmd directories (cmd/sedna-gm and cmd/sedna-lc) and parts of the pkg indicate how these workers are triggered.
• Lib – the exposed library (located in lib/sedna) providing APIs for integrating existing training or inference scripts with Sedna’s edge-cloud mechanisms.
• Kubernetes Custom Resources (CRDs), Helm Charts, and CRD samples – these are visible under build/, pkg/apis, and build/helm which show how Sedna extends Kubernetes with its own resource definitions for handling dataset, model, and various job types.
• Dashboard/Observability components – found in components/dashboard, which include exporters, Grafana setup, and Prometheus configurations for monitoring various metrics.
• Data Sources and External Connectors – see lib/sedna/datasources (for Kafka, OBS, etc.) that handle data ingestion.
• Other supporting components – such as the global websocket messaging layer (in pkg/globalmanager/messagelayer), various algorithm implementations under lib/sedna/algorithms, and integration with popular AI frameworks (TensorFlow, PyTorch, PaddlePaddle, MindSpore).
Relationships and Interactions
• Cloud and Edge Separation: Illustrate the “Cloud” with GlobalManager and supporting centralized components (configuration, orchestration, message routing) and the “Edge” with LocalController and Worker nodes.
– GlobalManager sending configurations and job orchestration commands to LocalControllers.
– LocalControllers coordinating with Workers to execute training/inference tasks.
– Data flow from Workers back to GlobalManager for aggregating model updates and synchronizing results.
– CRD-based interactions where Kubernetes manages Sedna’s custom AI job types.
– Messaging and real-time sync via websocket channels (pkg/globalmanager/messagelayer).
Architectural Patterns and Technologies
• Microservices: Different components (GlobalManager, LocalController, Worker) are isolated and interact via clear API boundaries.
• Containerization and Orchestration: Use of Dockerfiles, helm charts, and Kubernetes CRDs indicates a cloud-native design.
• Extensibility: The lib and algorithms directories suggest a plug-in approach where new AI features or integrations can be added.
• Observability: Inclusion of dashboards (Grafana, Prometheus, Loki) to monitor system health and performance.
Capturing Essential Architectural Elements
• Do not shy away from detailing the interactions between the API layer provided by pkg/apis and how sedna extends Kubernetes.
• It’s helpful to also note where example usage (in the examples directory) fits into the picture, showing that Sedna supports real-world AI application deployment.
• A section on how the library (lib/sedna) and the algorithm implementations plug into the broader ecosystem, enabling different learning strategies.
Final Advice
Happy diagramming!