Skip to content

Latest commit

 

History

History
96 lines (64 loc) · 4.37 KB

File metadata and controls

96 lines (64 loc) · 4.37 KB

Dynamic Scoring Framework

Dynamic Scoring Framework is a framework for automating resource scoring in multi-cluster environments using Prometheus metrics.
It calculates dynamic scores for each cluster and provides foundational information for resource optimization and automated control.

Repository: https://github.com/open-cluster-management-io/dynamic-scoring-framework

Note: The Git repository is named dynamic-scoring-framework, but the Go module path is open-cluster-management.io/dynamic-scoring. Import the module by module path, not by repository name.

Clone

git clone https://github.com/open-cluster-management-io/dynamic-scoring-framework.git
cd dynamic-scoring-framework

Features

  • Multi-cluster support: Automates scoring across multiple clusters using OCM (Open Cluster Management)
  • Flexible Scoring API integration: Register and use any scoring API
  • Prometheus integration: Collects metrics from each cluster's Prometheus for scoring
  • Extensible: CRD-based configuration and management, supports external APIs and authentication

Architecture Overview

  1. DynamicScorer
    Registers scoring API information as a CRD

  2. DynamicScoringConfig
    Aggregates registered DynamicScorers and distributes them as ConfigMaps to each cluster

  3. DynamicScoringAgent
    Watches ConfigMaps in each cluster, fetches metrics from Prometheus, calls the scoring API, and exports results as metrics

For more details, refer to the design document.


Quick Start

Please refer to the quick start guide for instructions on deploying the Dynamic Scoring Framework in your environment.

Further Reading

Scoring API Samples

Example Scoring API implementations are available in the samples directory.
Refer to the Scoring API Samples for an overview of all available scorers.

Each sample has its own README with details on the directory structure, endpoints, and how to run it locally with podman:

Scorer README Description
Sample Scorer samples/sample-scorer Basic CPU-based scoring (time series input)
LLM Forecast Scorer samples/llm-forecast-scorer LLM-powered time series forecasting
Simple Prediction Scorer samples/simple-prediction-scorer CPU usage prediction with Darts linear regression
Static Scorer samples/static-scorer Pre-defined performance/power scores (no input required)
AI Workload Scorer samples/ai-workload-scorer GPU power and performance scoring for AI workloads
Policy Watcher samples/policy-watcher OCM Policy compliance watcher for ClusterClaim updates
DSF MCP Server samples/dynamic-scoring-framework-mcp Operation API server with MCP integration for AI-assisted optimization

Optimization Using DSF

Refer to the Optimization Using DSF documentation for examples of how to use the scores generated by the Dynamic Scoring Framework for workload placement optimization in multi-cluster environments.


Development Environment Setup

Please refer to the development guide for instructions on setting up your local development environment.

Run verification checks before submitting changes:

make verify
make test-unit
make test-chart

See CONTRIBUTING.md for contribution guidelines.

Directory Structure

  • api/: API definitions for CRDs
  • internal/controller/: Controllers for managing CRDs (DynamicScorer, DynamicScoringConfig)
  • config/: Configuration files for deploying the operator
  • docs/: Documentation files
  • pkg/: Package source code. It contains the common and addon agents implementation.
    • pkg/common/: Common utilities and types used across the project.
    • pkg/dynamic_scoring/: Implementation of the DynamicScoring addon controller in hub cluster.
    • pkg/dynamic_scoring_agent/: Implementation of the DynamicScoringAgent that runs in managed clusters.
  • samples/: Sample CRDs and Scoring APIs for testing and demonstration