ai-disk-health
AI disk health is used to predict whether a disk is healthy
https://github.com/hwameistor/hwameistor/ai-disk-health
Dependency Package Installation
pip install requirements.txt
Model Training
Disk-Dataset URL
Download the corresponding dataset
Dataset preprocessing
python data_split.py [argv1] [argv2]
Argv1: Dataset path,default to “./data/dataset”
Argv2:The manufacturer and model of the disk, default to “ST12000NM0007”
Started Training
python dml_training.py
Disk-Health Prediction
Supports Windows, Linux, k8s environments
Windows/Linux
python predict_file.py [argv1] [argv2]
How to use
Argv1: predict-data.csv path
predict file example: predict_data.csv in directory ./data/example
Argv2:prdict-result.csv path
resulte file example:predict_result.csv in directory ./data/example
K8s
Use default model
apiVersion: batch/v1
kind: Job
metadata:
name: predict-disk
spec:
template:
spec:
containers:
- name: ai-disk-health
image: ghcr.io/hwameistor/ai-disk-health:v1.0.0-01
command: ["python", "predict_cm.py"]
restartPolicy: Never
backoffLimit: 0
To use a custom model, it is necessary to mount the model directory to the job
apiVersion: batch/v1
kind: Job
metadata:
name: predict-disk
spec:
template:
spec:
containers:
- name: ai-disk-health
image: ghcr.io/hwameistor/ai-disk-health:v1.0.0-01
command: ["python", "predict_cm.py"]
volumeMounts:
- mountPath: /app/model/
name: model-volume
restartPolicy: Never
volumes:
- hostPath:
name: model-volume
path: /root/disk_model/model
backoffLimit: 0
Note: The following model files need to be placed in volume
weights.pth,
scaler.pkl,
config.json
How to use
You should convert CSV file data into strings and store them in configmap:
namespace=default
name-prefix=“predict-data-”
data k-v
KEY=“CSV”
VALUE:读取csv文件内容,将文件内容content 转化为string存入
Explanation of prediction results:
namespace=default
name-prefix=“predict-tmp-result-”
data k-v
KEY=“result”
disk-health-prediction