EdgeWise Resource Manager is a dynamic resource allocation tool designed for edge computing devices. It monitors resource usage in real-time and adjusts resource allocation based on predefined policies to ensure optimal performance and efficiency.
- Real-time monitoring of CPU, memory, and disk usage.
- Dynamic resource allocation based on predefined policies.
- Containerized deployment using Docker.
- Orchestration with Kubernetes.
Before you begin, ensure you have the following installed:
- Docker
- Kubernetes
- Python 3.8+
- kubectl (Kubernetes command-line tool)
-
Clone the repository:
git clone https://github.com/abhaypawar/edgewise.git cd edgewise ./deploy.sh
-
Deploy to Kubernetes:
kubectl apply -f k8s-deployment.yaml
The deploy.sh script handles the building and pushing of Docker images to Docker Hub. Ensure you replace your-dockerhub-username in the deploy.sh script and the Kubernetes deployment file with your actual Docker Hub username.
#!/bin/bash
# deploy.sh
# Build Docker images
docker build -t edge-monitor -f Dockerfile.monitor .
docker build -t resource-allocator -f Dockerfile.allocator .
# Push Docker images to a registry (Docker Hub in this case)
docker tag edge-monitor your-dockerhub-username/edge-monitor
docker tag resource-allocator your-dockerhub-username/resource-allocator
docker push your-dockerhub-username/edge-monitor
docker push your-dockerhub-username/resource-allocator
# Deploy to Kubernetes
kubectl apply -f k8s-deployment.yaml
Apply the Kubernetes deployment file to set up the EdgeWise Resource Manager on your cluster.
# k8s-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: edge-computing-manager
spec:
replicas: 1
selector:
matchLabels:
app: edge-computing-manager
template:
metadata:
labels:
app: edge-computing-manager
spec:
containers:
- name: monitor
image: your-dockerhub-username/edge-monitor
volumeMounts:
- mountPath: /app/metrics.json
name: metrics-volume
- name: allocator
image: your-dockerhub-username/resource-allocator
volumeMounts:
- mountPath: /app/metrics.json
name: metrics-volume
volumes:
- name: metrics-volume
emptyDir: {}
kubectl apply -f k8s-deployment.yaml
edgewise-resource-manager/
monitor.py: Script to monitor CPU, memory, and disk usage.
allocate_resources.py: Script to allocate resources based on monitored metrics.
Dockerfile.monitor: Dockerfile for the monitoring module.
Dockerfile.allocator: Dockerfile for the resource allocation module.
deploy.sh: Bash script to build, tag, and push Docker images, and deploy to Kubernetes.
k8s-deployment.yaml: Kubernetes deployment configuration.
We welcome contributions! Please follow these steps:
Fork the repository.
Create a new branch (git checkout -b feature-branch).
Commit your changes (git commit -am 'Add new feature').
Push to the branch (git push origin feature-branch).
Create a new Pull Request.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
- Replace Placeholders: Ensure you replace
your-github-username
andyour-dockerhub-username
with your actual GitHub and Docker Hub usernames. - Monitoring Script: Adjust the
time.sleep(10)
interval inmonitor.py
if needed for more or less frequent monitoring. - Resource Allocation Policy: Update the resource allocation logic in
allocate_resources.py
to match your specific requirements or policies.
This updated README provides a complete overview and detailed instructions to set up and use the EdgeWise Resource Manager.