磁盘健康预测

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

Hard Drive Test Data

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在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值