Metronome is a research project that implements an intelligent scheduler for serverless functions with the advanced locality-aware scheduling policy and machine learning-based prediction models. It extends OpenLambda with sophisticated scheduling algorithms and comprehensive experimental frameworks.
.
├── metronome/ # Metronome Core Components
│ ├── experiments/ # Experimental results and analysis data
│ ├── faas-scripts/ # Workload generation and experiment orchestration
│ ├── my-scheduler/ # Metronome intelligent scheduler
│ └── predict-model/ # ML-based execution time prediction service
└── ol/ # OpenLambda (Extended)
├── src/ # OpenLambda source code
├── my-code/ # Serverless function registry
├── docs/ # Documentation
└── scripts/ # Utility scripts- Metronome Scheduler: Implements the delay-aware locality scheduling
- FaaS Scripts: Generates realistic workloads and orchestrates experiments
- Predict Model: Uses Random Forest and other ML models to predict function execution times
- OpenLambda: Extended version with custom APIs and monitoring capabilities
- Function Registry: serverless functions for various experimental scenarios
- Functions:
video-split→video-transcode→video-merge - Data: Video files
- SLA: 7,000ms per stage
- Use case: CPU-intensive multimedia processing
- Functions:
log-split→log-analyze→log-merge - Data: Nginx log files
- SLA: 6,000ms for upload/split, 1,000ms for analyze/merge
- Use case: Data analytics and log processing
- Functions:
ml-normalize→ml-process - SLA: 13,000ms
- Use case: AI/ML model serving
- Functions:
any2md-validate→any2md-process - Data: PDF documents
- SLA: 17,000ms
- Use case: Document transformation and processing
# Node topology (required)
NODE_LIST=node1:100.2.3.100,node2:100.2.3.101,node3:100.2.3.102,node4:100.2.3.103
# OpenLambda integration
OL_REGISTRY_PATH=/root/ol/my-code/registry
OL_ZYGOTE_FILENAME=test-zygotes.json# Current node IP (required)
NODE_IP=100.2.3.100
# Scheduler endpoint
SCHEDULER_ENDPOINT=http://100.2.3.100:5555
# OpenLambda endpoint
OL_RAW_ENDPOINT=http://100.2.3.100:5050-
Install Taskfile: https://taskfile.dev/
# macOS brew install go-task/tap/go-task # Linux wget -O task.tar.gz https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz tar -xzf task.tar.gz && sudo mv task /usr/local/bin/
-
Install Docker: https://docs.docker.com/engine/install/
-
Install Go: Version 1.21+ required
wget -O go.tar.gz https://go.dev/dl/go1.21.5.linux-amd64.tar.gz tar -C /usr/local -xzf go.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
-
Install Python: Version 3.8+ with required packages
pip install pandas scikit-learn grpcio grpcio-tools joblib numpy
Assumes controller node (node1) with IP 100.2.3.100 and worker nodes (node2, node3, node4, etc.)
-
Configure /etc/hosts on all nodes:
100.2.3.100 node1 100.2.3.101 node2 100.2.3.102 node3 100.2.3.103 node4 ... -
Install and configure rclone on all worker nodes:
# Install rclone curl https://rclone.org/install.sh | sudo bash # Configure SFTP backend for each worker node rclone config create node2 sftp host 100.2.3.101 user root rclone config create node3 sftp host 100.2.3.102 user root rclone config create node4 sftp host 100.2.3.103 user root ...
-
SSH Key Setup:
# Generate SSH key pair on controller ssh-keygen -t ed25519 # Copy public key to all worker nodes ssh-copy-id root@node2 ssh-copy-id root@node3 ssh-copy-id root@node4 ...
-
Ensure OpenLambda directory exists at
/root/ol/on all nodes.
The project uses Taskfile for automated build and deployment:
# 1. Build OpenLambda binaries and sync to all nodes
task build-go
# 2. Build Docker images locally
task build-docker
# 3. Initialize Lambda instances on all nodes
task init-lambda
# 4. Update function code across all nodes
task update-my-code
# 5. Start worker processes
task up-workerPlease refer to ol/Taskfile.yml for more details.
On each worker node (node2, node3, node4, etc.):
cd /root/ol
./ol worker upOn the controller node:
cd metronome/my-scheduler
./my-schedulerThe scheduler will:
- Load node topology from
NODE_LIST - Initialize resource monitoring
- Start web API server on port 5555
- Begin scheduling service
On the controller node:
cd metronome/predict-model
python server.pyThe model server provides:
- gRPC service on port 50051
- ML-based execution time prediction
- Incremental learning capabilities
- Model serving for all function types
cd metronome/faas-scripts
./faas-scripts -we # Run workflow experimentsIf you want to generate training data from scratch:
./faas-scripts -gte # Generate training data- Concurrency levels: 1, 3, 5 (configurable)
- Workflow run count: 100 runs per configuration (configurable)
- Background load: Configurable generation
- Scheduler traces:
metronome/my-scheduler/traces/ - Expected results:
metronome/experiments/
- Problem: Cannot connect to worker nodes
- Solution: Check SSH keys, network connectivity, and firewall settings
- Problem: Docker image load failures
- Solution: Ensure Docker daemon is running and images are properly built
- Problem: gRPC connection failures
- Solution: Check if port 50051 is available and model files exist
- Problem: Out of memory or CPU errors
- Solution: Adjust
SlotsPerNodeandTotalMemoryPerNodeconstants
This project is licensed under the MIT License.