Documentation ¶
Index ¶
- Variables
- func Aggregate(out, model, query interface{}, cond string, args ...interface{}) *gorm.DB
- func CheckSuffix(path string) string
- func Client() *minio.Client
- func Count(model, out, query interface{}, args ...interface{}) *gorm.DB
- func Delete(value interface{}, where ...interface{}) *gorm.DB
- func Find(out interface{}, where ...interface{}) *gorm.DB
- func First(out interface{}, where ...interface{}) *gorm.DB
- func GetMacByName(name string) string
- func GetTempDownloadPath(bucketName string, objectName string) (tempDownloadPath *url.URL)
- func HasNvDriver() bool
- func Init()
- func Insert(value interface{}) *gorm.DB
- func MakePath(path string) string
- func Shutdown()
- func UUID() string
- func Update(value interface{}) *gorm.DB
- func Updates(value, where, updateValue interface{}) *gorm.DB
- func WriteFile(prefix, filename, content string) error
- type CPUStat
- type CWA
- type CurrentGpu
- type Db
- type DiskStat
- type EdgeCmJob
- type FailedMessage
- type GPUStat
- type HardwareGenerate
- type HardwareStat
- type JobStatus
- type Log
- type MemoryStat
- type PeakValue
Constants ¶
This section is empty.
Variables ¶
var Logger *zap.Logger
Functions ¶
func Aggregate ¶
aggregate search search table bb into AA struct e.g: Aggregate(&AA{}, &BB{}, "id <= ?", "Max(a) as max_a, Max(b) as max_b, Min(c) as min_c", 4) select Max(a) as max_a, Max(b) as max_b, Min(c) as min_c from bb where id <= 4;
func CheckSuffix ¶
func GetTempDownloadPath ¶
Types ¶
type CPUStat ¶
type CPUStat struct { Cores int `json:"cores"` Index int `json:"index"` UsedPercent float64 `json:"usedPercent"` }
CPU stat information struct
type CWA ¶
type CWA struct { ID uint `gorm:"primary_key AUTO_INCREMENT;not null;column:id" json:"-"` CPU float64 `gorm:"column:cpu" json:"cpu"` GPU uint64 `gorm:"column:gpu" json:"gpu"` MEM uint64 `gorm:"column:mem" json:"mem"` Disk uint64 `gorm:"column:disk" json:"disk"` JobId string `gorm:"column:jobid" json:"jobid"` CpuCores int `gorm:"column:cpu_cores" json:"cpu_cores"` MemTotal uint64 `gorm:"column:mem_total" json:"mem_total"` GpuTotal uint64 `gorm:"column:gpu_total" json:"gpu_total"` ImageSize int64 `gorm:"column:image_size" json:"image_size"` DiskTotal uint64 `gorm:"column:disk_total" json:"disk_total"` DetectionTime int64 `gorm:"column:detection_time" json:"detection_time"` Numerator uint `gorm:"column:gpu_numerator" json:"gpu_numerator"` Denominator uint `gorm:"column:gpu_denominator" json:"gpu_denominator"` }
////////////////////// CWA info /////////////////////
type CurrentGpu ¶
////////////////////// current gpu stat count /////////////////////
type DiskStat ¶
type DiskStat struct { Total uint64 `json:"total"` Free uint64 `json:"free"` Path string `json:"path"` Used uint64 `json:"used"` UsedPercent float64 `json:"usedPercent"` }
Disk stat information struct
type EdgeCmJob ¶
type EdgeCmJob struct { ID uint `gorm:"primary_key AUTO_INCREMENT;not null;column:id" json:"-"` Mac string `gorm:"-" json:"mac"` // mac 地址 RDS string `gorm:"column:rds" json:"rds"` // 结果数据存放路径 DDM string `gorm:"column:ddm" json:"ddm"` // 拆分类型 DDS string `gorm:"column:dds" json:"dds"` // 数据集文件地址 NCP string `gorm:"column:ncp" json:"ncp"` // 用户程序名称 Type string `gorm:"column:type" json:"type"` // 任务类型 Index int `gorm:"column:index" json:"index"` // 索引 Count int `gorm:"column:count" json:"count"` // 拆分数量 JobId string `gorm:"column:jobid;not null;unique" json:"jobId"` TaskId string `gorm:"column:taskid;not null;" json:"taskId"` NcpArgs string `gorm:"column:ncp_args" json:"ncpArgs"` // 用户程序参数 JobStatus int `gorm:"column:job_status;default:0" json:"-"` Dockerfile string `gorm:"column:dockerfile;not null" json:"dockerfile"` NcpCommand string `gorm:"ncp_command" json:"ncpCommand"` // 用户启动命令 DsmCommand string `gorm:"dsm_command" json:"dsmCommand"` // 数据拆分启动命令 RdsFileLocal string `gorm:"rds_file_local" json:"rds_file_local"` // 结果集本地输出路径 SdsFileLocal string `gorm:"sds_file_local" json:"sds_file_local"` // 数据集本地拆分路径 ReceiveTimestamp int64 `gorm:"receive_timestamp" json:"receive_timestamp"` // 接收到任务的时间戳 }
////////////////////// job info /////////////////////
type FailedMessage ¶
type FailedMessage struct { ID uint `gorm:"primary_key AUTO_INCREMENT;not null;column:id" json:"-"` Message []byte `gorm:"column:message" json:"message"` Topic string `gorm:"column:topic" json:"topic"` }
////////////////////// failed message /////////////////////
type GPUStat ¶
type GPUStat struct { Index uint `json:"index"` Model string `json:"model"` Power uint `json:"power"` Temperature uint `json:"temperature"` TotalMemory uint64 `json:"totalMemory"` UsedMemory uint64 `json:"usedMemory"` FreeMemory uint64 `json:"freeMemory"` UtilizationGPU uint `json:"gpuUtilization"` UtilizationMemory uint `json:"memoryUtilization"` }
GPU stat information struct
type HardwareGenerate ¶
type HardwareGenerate struct {
C <-chan *HardwareStat
}
Hardware generator get hardware information e.g: <- hardware.C
func HardwareGenerator ¶
func HardwareGenerator(d time.Duration) *HardwareGenerate
generate hardware information
type HardwareStat ¶
type HardwareStat struct { MemoryStat *MemoryStat `json:"memory"` DickStat []*DiskStat `json:"disk"` GPUStat []*GPUStat `json:"gpu"` CPUStat []*CPUStat `json:"cpu"` Timestamp int64 `json:"timestamp"` Mac string `json:"mac"` }
Hardware stat information struct
type JobStatus ¶
type JobStatus struct { Msg string `json:"msg"` Mac string `json:"mac"` Code int `json:"code"` Status int `json:"status"` TaskId string `json:"taskId"` JobId string `json:"jobId"` PeakInfo *PeakValue `json:"peakInfo"` Timestamp int64 `json:"timestamp"` }
////////////////////// job status /////////////////////
type MemoryStat ¶
type MemoryStat struct { Total uint64 `json:"total"` Free uint64 `json:"free"` Used uint64 `json:"used"` UsedPercent float64 `json:"usedPercent"` }
Memory stat information struct
type PeakValue ¶
type PeakValue struct { GpuMax uint `gorm:"column:gpuMax" json:"gpuMax"` GpuMin uint `gorm:"column:gpuMin" json:"gpuMin"` CpuMax float64 `gorm:"column:cpuMax" json:"cpuMax"` CpuMin float64 `gorm:"column:cpuMin" json:"cpuMin"` MemMax float64 `gorm:"column:memMax" json:"memMax"` MemMin float64 `gorm:"column:memMin" json:"memMin"` DiskMax float64 `gorm:"column:diskMax" json:"diskMax"` DiskMin float64 `gorm:"column:diskMin" json:"diskMin"` CpuCores int `gorm:"column:cpuCores" json:"cpuCores"` MemTotal uint64 `gorm:"column:memTotal" json:"memTotal"` GpuTotal uint64 `gorm:"column:gpuTotal" json:"gpuTotal"` ImageSize int64 `gorm:"column:imageSize" json:"imageSize"` DiskTotal uint64 `gorm:"column:diskTotal" json:"diskTotal"` Denominator uint `gorm:"column:gpuDenominator" json:"gpuDenominator"` NumeratorMax uint `gorm:"column:numeratorMax" json:"gpuNumeratorMax"` NumeratorMin uint `gorm:"column:numeratorMin" json:"gpuNumeratorMin"` }
cpu,gpu peak value