-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: JeffMboya <[email protected]> Revert docs Signed-off-by: JeffMboya <[email protected]> Revert docs Signed-off-by: JeffMboya <[email protected]> Revert docs Signed-off-by: JeffMboya <[email protected]>
- Loading branch information
Showing
9 changed files
with
161 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,52 @@ | ||
# 🚀 Propeller | ||
# 🚀 Propeller | ||
|
||
**Propeller** is a cutting-edge orchestrator for **WebAssembly (Wasm)** workloads across the **Cloud-Edge continuum**. It enables seamless deployment of Wasm applications from powerful cloud servers to constrained microcontrollers, combining flexibility, security, and performance. | ||
**Propeller** is a cutting-edge orchestrator for **WebAssembly (Wasm)** workloads across the **Cloud-Edge continuum**. It enables seamless deployment of Wasm applications from powerful cloud servers to constrained microcontrollers, combining flexibility, security, and performance. | ||
|
||
--- | ||
|
||
## 🌟 Features | ||
## 🌟 Features | ||
|
||
- 🌐 **Cloud-Edge Orchestration**: Deploy Wasm workloads effortlessly across diverse environments, from robust cloud servers to lightweight microcontrollers. | ||
- ⚡ **Fast Boot Times**: Take advantage of Wasm's near-instant startup for efficient workload execution. | ||
- 📦 **FaaS Deployment**: Enable Function-as-a-Service (FaaS) capabilities for scalable and event-driven applications. | ||
- 🖥️ **OCI Registry Support**: Push and pull Wasm workloads from OCI-compliant registries for streamlined workflow integration. | ||
- 🔧 **WAMR on Zephyr RTOS**: Deploy lightweight Wasm workloads on constrained devices running Zephyr RTOS via the WebAssembly Micro Runtime (WAMR). | ||
- 🛠️ **Powerful Service Mesh**: Integrates with **[SuperMQ](https://github.com/absmach)** for secure, efficient IoT device communication. | ||
- 🔒 **Security at the Core**: Propeller ensures secure workload execution and communication for IoT environments. | ||
- 🌐 **Cloud-Edge Orchestration**: Deploy Wasm workloads effortlessly across diverse environments, from robust cloud servers to lightweight microcontrollers. | ||
- ⚡ **Fast Boot Times**: Take advantage of Wasm's near-instant startup for efficient workload execution. | ||
- 📦 **FaaS Deployment**: Enable Function-as-a-Service (FaaS) capabilities for scalable and event-driven applications. | ||
- 🖥️ **OCI Registry Support**: Push and pull Wasm workloads from OCI-compliant registries for streamlined workflow integration. | ||
- 🔧 **WAMR on Zephyr RTOS**: Deploy lightweight Wasm workloads on constrained devices running Zephyr RTOS via the WebAssembly Micro Runtime (WAMR). | ||
- 🛠️ **Powerful Service Mesh**: Integrates with **[SuperMQ](https://github.com/absmach)** for secure, efficient IoT device communication. | ||
- 🔒 **Security at the Core**: Propeller ensures secure workload execution and communication for IoT environments. | ||
|
||
--- | ||
|
||
## 🏗️ Architecture Overview | ||
## 🛠️ How It Works | ||
|
||
Propeller's architecture consists of three key components: | ||
|
||
### 1. 🖥️ **User Interface (CLI/API)** | ||
|
||
- Provides users with tools to interact with Propeller, whether via a command-line interface (CLI) or RESTful API. | ||
|
||
### 2. 🚀 **Manager** | ||
|
||
- Acts as the control hub, responsible for workload scheduling and orchestration. | ||
- Integrates a **scheduler** for efficient resource allocation and workload distribution. | ||
- Maintains an internal database for tracking workloads, worker states, and metadata. | ||
- Currently, the system supports **1 manager : multiple workers** as shown in (a). In the future, the system will be expanded to support **multiple managers : multiple workers** as shown in (b). | ||
|
||
### 3. ⚙️ **Workers** | ||
|
||
- Responsible for executing workloads based on instructions from the manager. | ||
- All workers operate within the same communication channel. | ||
- Two worker types are supported: | ||
- **Golang Workers**: Designed for general-purpose workloads on cloud or edge devices. | ||
- **C & Rust Workers**: Optimized for constrained microcontroller environments, enabling lightweight and efficient task execution. | ||
- Workers communicate using multiple protocols: | ||
- MQTT and CoAP for constrained devices. | ||
- WebSocket (WS) for other devices. | ||
- At present, the system is configured to support a **1 worker : 1 task** execution model as shown in (a). In the future, the system will be expanded to support **1 worker : multiple tasks** as shown in (b). | ||
|
||
![Propeller Orchestration Diagram](architecture.svg) | ||
|
||
--- | ||
|
||
## 🛠️ How It Works | ||
|
||
1. **Develop in WebAssembly**: Write portable, lightweight Wasm workloads for your application. | ||
2. **Register Workloads**: Push your workloads to an OCI-compliant registry for easy deployment. | ||
3. **Deploy Anywhere**: Use Propeller to orchestrate and manage workload deployment across the cloud, edge, and IoT devices. | ||
4. **Monitor & Scale**: Leverage real-time monitoring and dynamic scaling to optimize your system's performance. | ||
1. **Develop in WebAssembly**: Write portable, lightweight Wasm workloads for your application. | ||
2. **Register Workloads**: Push your workloads to an OCI-compliant registry for easy deployment. | ||
3. **Deploy Anywhere**: Use Propeller to orchestrate and manage workload deployment across the cloud, edge, and IoT devices. | ||
4. **Monitor & Scale**: Leverage real-time monitoring and dynamic scaling to optimize your system's performance. | ||
|
||
--- | ||
|
||
## 📖 Documentation | ||
## 📖 Documentation | ||
|
||
For setup instructions, API references, and usage examples, see the documentation: | ||
🔗 [Documentation Link](#) | ||
🔗 [Documentation Link](#) | ||
|
||
--- | ||
|
||
## 💡 Use Cases | ||
## 💡 Use Cases | ||
|
||
- 🏭 **Industrial IoT**: Deploy analytics or control applications to edge devices in factories. | ||
- 🛡️ **Secure Workloads**: Run isolated, portable workloads securely on cloud or edge devices. | ||
- 🌎 **Smart Cities**: Power scalable IoT networks with efficient communication and dynamic workloads. | ||
- ☁️ **Serverless Applications**: Deploy FaaS applications leveraging Propeller's Wasm orchestration capabilities. | ||
- 🏭 **Industrial IoT**: Deploy analytics or control applications to edge devices in factories. | ||
- 🛡️ **Secure Workloads**: Run isolated, portable workloads securely on cloud or edge devices. | ||
- 🌎 **Smart Cities**: Power scalable IoT networks with efficient communication and dynamic workloads. | ||
- ☁️ **Serverless Applications**: Deploy FaaS applications leveraging Propeller's Wasm orchestration capabilities. | ||
|
||
--- | ||
|
||
## 🤝 Contributing | ||
## 🤝 Contributing | ||
|
||
Contributions are welcome! Please check the [CONTRIBUTING.md](#) for details on how to get started. | ||
Contributions are welcome! Please check the [CONTRIBUTING.md](#) for details on how to get started. | ||
|
||
--- | ||
|
||
## 📜 License | ||
## 📜 License | ||
|
||
Propeller is licensed under the **Apache-2.0 License**. See the [LICENSE](LICENSE) file for more details. | ||
Propeller is licensed under the **Apache-2.0 License**. See the [LICENSE](LICENSE) file for more details. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/absmach/propeller/worker" | ||
"github.com/go-kit/kit/endpoint" | ||
) | ||
|
||
func MakeGetWorkerStatEndpoint(svc worker.WorkerService) endpoint.Endpoint { | ||
return func(ctx context.Context, request interface{}) (interface{}, error) { | ||
req := request.(WorkerRequestDTO) | ||
return svc.GetWorkerStats(ctx, req.WorkerID) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package api | ||
|
||
type WorkerRequestDTO struct { | ||
WorkerID string `json:"worker_id"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package api | ||
|
||
import "time" | ||
|
||
type WorkerResponseDTO struct { | ||
WorkerID string `json:"worker_id"` | ||
Name string `json:"name"` | ||
State string `json:"state"` | ||
Function string `json:"function"` | ||
RestartPolicy string `json:"restart_policy"` | ||
RestartCount int `json:"restart_count"` | ||
StartTime time.Time `json:"start_time"` | ||
FinishTime time.Time `json:"finish_time"` | ||
CPUUsage float64 `json:"cpu_usage"` | ||
MemoryUsage float64 `json:"memory_usage"` | ||
TaskCount int `json:"task_count"` | ||
RunningTasks int `json:"running_tasks"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"errors" | ||
"net/http" | ||
"strings" | ||
|
||
"github.com/absmach/propeller/worker" | ||
|
||
"github.com/go-chi/chi/v5" | ||
kithttp "github.com/go-kit/kit/transport/http" | ||
) | ||
|
||
func MakeHandler(svc worker.WorkerService) http.Handler { | ||
opts := []kithttp.ServerOption{} | ||
|
||
mux := chi.NewRouter() | ||
|
||
mux.Route("/workers", func(r chi.Router) { | ||
r.Get("/{worker_id}", kithttp.NewServer( | ||
MakeGetWorkerStatEndpoint(svc), | ||
decodeWorkerRequest, | ||
encodeWorkerResponse, | ||
opts..., | ||
).ServeHTTP) | ||
}) | ||
|
||
return mux | ||
} | ||
|
||
func decodeWorkerRequest(_ context.Context, r *http.Request) (interface{}, error) { | ||
if !strings.Contains(r.Header.Get("Content-Type"), "application/json") { | ||
return nil, errors.New("unsupported content type") | ||
} | ||
|
||
workerID := chi.URLParam(r, "worker_id") | ||
if workerID == "" { | ||
return nil, errors.New("worker_id is required") | ||
} | ||
|
||
return WorkerRequestDTO{WorkerID: workerID}, nil | ||
} | ||
|
||
func encodeWorkerResponse(_ context.Context, w http.ResponseWriter, response interface{}) error { | ||
w.Header().Set("Content-Type", "application/json") | ||
return json.NewEncoder(w).Encode(response) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package worker | ||
|
||
import ( | ||
"context" | ||
"time" | ||
) | ||
|
||
type WorkerService interface { | ||
GetWorkerStats(ctx context.Context, workerID string) (WorkerResponseDTO, error) | ||
} | ||
|
||
type workerService struct{} | ||
|
||
func NewWorkerService() WorkerService { | ||
return &workerService{} | ||
} | ||
|
||
func (s *workerService) GetWorkerStats(ctx context.Context, workerID string) (WorkerResponseDTO, error) { | ||
return WorkerResponseDTO{ | ||
WorkerID: workerID, | ||
Name: "WorkerName", | ||
State: "Running", | ||
Function: "Compute", | ||
RestartPolicy: "Always", | ||
RestartCount: 1, | ||
StartTime: time.Now().Add(-2 * time.Hour), | ||
FinishTime: time.Now().Add(1 * time.Hour), | ||
CPUUsage: 0.75, | ||
MemoryUsage: 0.65, | ||
TaskCount: 10, | ||
RunningTasks: 3, | ||
}, nil | ||
} |