MLflow Cleanup Job
Automated Kubernetes CronJob to delete old MLflow runs from specific experiments, helping you manage storage space. Features
- Automatically delete runs older than N days
- Targets specific experiments
- Safe - only touches experiments specified
- Scheduled cleanup via Kubernetes CronJob
- Containerized and easy to deploy
Quick Start
-
Build & Push Image The Docker image is automatically built and pushed to GitHub Container Registry on every commit to main.
-
Configure and edit configmap.yaml with your settings:
apiVersion: v1
kind: ConfigMap
metadata:
name: mlflow-cleanup-config
namespace: mlflow
data:
DAYS_TO_KEEP: "7" # Delete runs older than 7 days
MLFLOW_TRACKING_URI: "http://mlflow-server:5000" # Your MLflow server
EXPERIMENTS_TO_CLEAN: "exp1,exp2,training-runs" # Comma-separated experiment names
- Deploy
# Apply configuration
kubectl apply -f configmap.yaml
# Test with one-time job first
kubectl apply -f job.yaml
kubectl logs -l app=mlflow-cleanup
# Deploy scheduled cleanup (runs daily at 2 AM)
kubectl apply -f cronjob.yaml