43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package task
|
|
|
|
import (
|
|
schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler"
|
|
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
|
|
schmod "gitlink.org.cn/cloudream/scheduler/common/models"
|
|
)
|
|
|
|
type SchedulerDataPreprocess struct {
|
|
TaskInfoBase
|
|
CMD string `json:"cmd"`
|
|
Envs []schsdk.KVPair `json:"envs"`
|
|
UserID cdssdk.UserID `json:"userID"`
|
|
ObjectStorage schmod.ObjectStorage `json:"objectStorage"`
|
|
//ModelResource schmod.ModelResource `json:"modelResource"`
|
|
}
|
|
|
|
type SchedulerDataPreprocessStatus struct {
|
|
TaskStatusBase
|
|
InstanceID string `json:"instanceID"`
|
|
Error error `json:"error"`
|
|
}
|
|
|
|
func NewSchedulerDataPreprocess(userID cdssdk.UserID, command string, envs []schsdk.KVPair, objectStorage schmod.ObjectStorage) *SchedulerDataPreprocess {
|
|
return &SchedulerDataPreprocess{
|
|
CMD: command,
|
|
Envs: envs,
|
|
UserID: userID,
|
|
ObjectStorage: objectStorage,
|
|
}
|
|
}
|
|
|
|
func NewSchedulerDataPreprocessStatus(instanceID string, err error) *SchedulerDataPreprocessStatus {
|
|
return &SchedulerDataPreprocessStatus{
|
|
InstanceID: instanceID,
|
|
Error: err,
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
Register[*SchedulerDataPreprocess, *SchedulerDataPreprocessStatus]()
|
|
}
|