forked from longtao.wu/droboticflow
296 lines
16 KiB
Go
296 lines
16 KiB
Go
package domain
|
|
|
|
type DataMetricStage string
|
|
|
|
const (
|
|
DataMetricStageCollect DataMetricStage = "collect"
|
|
DataMetricStageProcess DataMetricStage = "process"
|
|
DataMetricStageClean DataMetricStage = "clean"
|
|
DataMetricStageValidate DataMetricStage = "validate"
|
|
DataMetricStageAnnotate DataMetricStage = "annotate"
|
|
DataMetricStageAudit DataMetricStage = "audit"
|
|
DataMetricStageTrain DataMetricStage = "train"
|
|
)
|
|
|
|
var DataMetricStages = []DataMetricStage{
|
|
DataMetricStageCollect,
|
|
DataMetricStageProcess,
|
|
DataMetricStageClean,
|
|
DataMetricStageValidate,
|
|
DataMetricStageAnnotate,
|
|
DataMetricStageAudit,
|
|
DataMetricStageTrain,
|
|
}
|
|
|
|
type DataMetricQuality string
|
|
|
|
const (
|
|
DataMetricQualityExact DataMetricQuality = "exact"
|
|
DataMetricQualityDerived DataMetricQuality = "derived"
|
|
DataMetricQualityEstimated DataMetricQuality = "estimated"
|
|
)
|
|
|
|
type DataVolume struct {
|
|
TrajectoryCount *int64 `json:"trajectoryCount,omitempty" bson:"trajectoryCount,omitempty"`
|
|
DurationSeconds *float64 `json:"durationSeconds,omitempty" bson:"durationSeconds,omitempty"`
|
|
Bytes *int64 `json:"bytes,omitempty" bson:"bytes,omitempty"`
|
|
FileCount *int64 `json:"fileCount,omitempty" bson:"fileCount,omitempty"`
|
|
}
|
|
|
|
type DatasetMetricRef struct {
|
|
DatasetID string `json:"datasetId,omitempty" bson:"datasetId,omitempty"`
|
|
DatasetVersionID string `json:"datasetVersionId,omitempty" bson:"datasetVersionId,omitempty"`
|
|
Name string `json:"name,omitempty" bson:"name,omitempty"`
|
|
Split string `json:"split,omitempty" bson:"split,omitempty"`
|
|
Fingerprint string `json:"fingerprint,omitempty" bson:"fingerprint,omitempty"`
|
|
Kind string `json:"kind,omitempty" bson:"kind,omitempty"`
|
|
DatasetType string `json:"datasetType,omitempty" bson:"datasetType,omitempty"`
|
|
ManifestPath string `json:"manifestPath,omitempty" bson:"manifestPath,omitempty"`
|
|
PayloadPath string `json:"payloadPath,omitempty" bson:"payloadPath,omitempty"`
|
|
PartitionDir string `json:"partitionDir,omitempty" bson:"partitionDir,omitempty"`
|
|
PartitionCount int `json:"partitionCount,omitempty" bson:"partitionCount,omitempty"`
|
|
ItemCount int `json:"itemCount,omitempty" bson:"itemCount,omitempty"`
|
|
}
|
|
|
|
type TrainingInputRecord struct {
|
|
DatasetID string `json:"datasetId,omitempty" bson:"datasetId,omitempty"`
|
|
DatasetVersionID string `json:"datasetVersionId,omitempty" bson:"datasetVersionId,omitempty"`
|
|
Name string `json:"name,omitempty" bson:"name,omitempty"`
|
|
Split string `json:"split,omitempty" bson:"split,omitempty"`
|
|
Volume DataVolume `json:"volume,omitempty" bson:"volume,omitempty"`
|
|
ManifestPath string `json:"manifestPath,omitempty" bson:"manifestPath,omitempty"`
|
|
PartitionDir string `json:"partitionDir,omitempty" bson:"partitionDir,omitempty"`
|
|
External bool `json:"external,omitempty" bson:"external,omitempty"`
|
|
Quality DataMetricQuality `json:"quality,omitempty" bson:"quality,omitempty"`
|
|
}
|
|
|
|
type DataMetricsRecord struct {
|
|
SchemaVersion int `json:"schemaVersion" bson:"schemaVersion"`
|
|
Stage DataMetricStage `json:"stage" bson:"stage"`
|
|
Input DataVolume `json:"input,omitempty" bson:"input,omitempty"`
|
|
Output DataVolume `json:"output,omitempty" bson:"output,omitempty"`
|
|
Rejected DataVolume `json:"rejected,omitempty" bson:"rejected,omitempty"`
|
|
TechnicalValid DataVolume `json:"technicalValid,omitempty" bson:"technicalValid,omitempty"`
|
|
TrainReady DataVolume `json:"trainReady,omitempty" bson:"trainReady,omitempty"`
|
|
DatasetRefs []DatasetMetricRef `json:"datasetRefs,omitempty" bson:"datasetRefs,omitempty"`
|
|
TrainingInputs []TrainingInputRecord `json:"trainingInputs,omitempty" bson:"trainingInputs,omitempty"`
|
|
RejectionReasons map[string]int64 `json:"rejectionReasons,omitempty" bson:"rejectionReasons,omitempty"`
|
|
Quality DataMetricQuality `json:"quality,omitempty" bson:"quality,omitempty"`
|
|
OccurredAt string `json:"occurredAt,omitempty" bson:"occurredAt,omitempty"`
|
|
}
|
|
|
|
type CollectionTaskStatus string
|
|
|
|
const (
|
|
CollectionTaskStatusDraft CollectionTaskStatus = "draft"
|
|
CollectionTaskStatusActive CollectionTaskStatus = "active"
|
|
CollectionTaskStatusPaused CollectionTaskStatus = "paused"
|
|
CollectionTaskStatusCompleted CollectionTaskStatus = "completed"
|
|
CollectionTaskStatusCancelled CollectionTaskStatus = "cancelled"
|
|
)
|
|
|
|
type CollectionTaskMode string
|
|
|
|
const (
|
|
CollectionTaskModeCollectionOnly CollectionTaskMode = "collection_only"
|
|
CollectionTaskModeFullTraining CollectionTaskMode = "full_training"
|
|
)
|
|
|
|
type CollectionTaskRequirements struct {
|
|
RequireTechnicalValidation bool `json:"requireTechnicalValidation" bson:"requireTechnicalValidation"`
|
|
RequireQuality bool `json:"requireQuality" bson:"requireQuality"`
|
|
RequireAnnotation bool `json:"requireAnnotation" bson:"requireAnnotation"`
|
|
RequireAudit bool `json:"requireAudit" bson:"requireAudit"`
|
|
}
|
|
|
|
type CollectionTaskRecord struct {
|
|
ID string `json:"id" bson:"id"`
|
|
OrganizationID string `json:"organizationId,omitempty" bson:"organizationId,omitempty"`
|
|
ProjectID string `json:"projectId" bson:"projectId"`
|
|
ProjectName string `json:"projectName,omitempty" bson:"projectName,omitempty"`
|
|
Name string `json:"name" bson:"name"`
|
|
Description string `json:"description,omitempty" bson:"description,omitempty"`
|
|
RobotModel string `json:"robotModel" bson:"robotModel"`
|
|
RobotVersion string `json:"robotVersion,omitempty" bson:"robotVersion,omitempty"`
|
|
Scene string `json:"scene" bson:"scene"`
|
|
Modalities []string `json:"modalities" bson:"modalities"`
|
|
Format string `json:"format,omitempty" bson:"format,omitempty"`
|
|
Mode CollectionTaskMode `json:"mode" bson:"mode"`
|
|
Status CollectionTaskStatus `json:"status" bson:"status"`
|
|
WorkflowID string `json:"workflowId,omitempty" bson:"workflowId,omitempty"`
|
|
WorkflowName string `json:"workflowName,omitempty" bson:"workflowName,omitempty"`
|
|
StageBindings map[DataMetricStage]string `json:"stageBindings,omitempty" bson:"stageBindings,omitempty"`
|
|
Targets DataVolume `json:"targets" bson:"targets"`
|
|
Requirements CollectionTaskRequirements `json:"requirements" bson:"requirements"`
|
|
SplitRules map[string]int `json:"splitRules,omitempty" bson:"splitRules,omitempty"`
|
|
LastRunID string `json:"lastRunId,omitempty" bson:"lastRunId,omitempty"`
|
|
CreatedAt string `json:"createdAt" bson:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt" bson:"updatedAt"`
|
|
}
|
|
|
|
type CollectionTaskInput struct {
|
|
ProjectID string `json:"projectId"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description,omitempty"`
|
|
RobotModel string `json:"robotModel"`
|
|
RobotVersion string `json:"robotVersion,omitempty"`
|
|
Scene string `json:"scene"`
|
|
Modalities []string `json:"modalities"`
|
|
Format string `json:"format,omitempty"`
|
|
Mode CollectionTaskMode `json:"mode"`
|
|
Status CollectionTaskStatus `json:"status,omitempty"`
|
|
WorkflowID string `json:"workflowId,omitempty"`
|
|
StageBindings map[DataMetricStage]string `json:"stageBindings,omitempty"`
|
|
Targets DataVolume `json:"targets"`
|
|
Requirements CollectionTaskRequirements `json:"requirements"`
|
|
SplitRules map[string]int `json:"splitRules,omitempty"`
|
|
}
|
|
|
|
type DatasetVersionRecord struct {
|
|
ID string `json:"id" bson:"id"`
|
|
OrganizationID string `json:"organizationId,omitempty" bson:"organizationId,omitempty"`
|
|
DatasetID string `json:"datasetId" bson:"datasetId"`
|
|
TaskID string `json:"taskId,omitempty" bson:"taskId,omitempty"`
|
|
ProjectID string `json:"projectId,omitempty" bson:"projectId,omitempty"`
|
|
Name string `json:"name" bson:"name"`
|
|
Split string `json:"split,omitempty" bson:"split,omitempty"`
|
|
Fingerprint string `json:"fingerprint" bson:"fingerprint"`
|
|
Volume DataVolume `json:"volume,omitempty" bson:"volume,omitempty"`
|
|
Storage AssetStorageLocation `json:"storage,omitempty" bson:"storage,omitempty"`
|
|
ManifestPath string `json:"manifestPath,omitempty" bson:"manifestPath,omitempty"`
|
|
PartitionDir string `json:"partitionDir,omitempty" bson:"partitionDir,omitempty"`
|
|
ProducerRunID string `json:"producerRunId,omitempty" bson:"producerRunId,omitempty"`
|
|
ProducerNodeID string `json:"producerNodeId,omitempty" bson:"producerNodeId,omitempty"`
|
|
ArtifactID string `json:"artifactId,omitempty" bson:"artifactId,omitempty"`
|
|
Quality DataMetricQuality `json:"quality" bson:"quality"`
|
|
CreatedAt string `json:"createdAt" bson:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt" bson:"updatedAt"`
|
|
}
|
|
|
|
type DataMetricFactRecord struct {
|
|
ID string `json:"id" bson:"id"`
|
|
SourceKey string `json:"sourceKey" bson:"sourceKey"`
|
|
OrganizationID string `json:"organizationId,omitempty" bson:"organizationId,omitempty"`
|
|
ProjectID string `json:"projectId,omitempty" bson:"projectId,omitempty"`
|
|
ProjectName string `json:"projectName,omitempty" bson:"projectName,omitempty"`
|
|
TaskID string `json:"taskId,omitempty" bson:"taskId,omitempty"`
|
|
TaskName string `json:"taskName,omitempty" bson:"taskName,omitempty"`
|
|
RobotModel string `json:"robotModel,omitempty" bson:"robotModel,omitempty"`
|
|
Scene string `json:"scene,omitempty" bson:"scene,omitempty"`
|
|
WorkflowID string `json:"workflowId,omitempty" bson:"workflowId,omitempty"`
|
|
WorkflowName string `json:"workflowName,omitempty" bson:"workflowName,omitempty"`
|
|
RunID string `json:"runId" bson:"runId"`
|
|
NodeID string `json:"nodeId" bson:"nodeId"`
|
|
NodeLabel string `json:"nodeLabel,omitempty" bson:"nodeLabel,omitempty"`
|
|
Attempt int `json:"attempt" bson:"attempt"`
|
|
Stage DataMetricStage `json:"stage" bson:"stage"`
|
|
Input DataVolume `json:"input,omitempty" bson:"input,omitempty"`
|
|
Output DataVolume `json:"output,omitempty" bson:"output,omitempty"`
|
|
Rejected DataVolume `json:"rejected,omitempty" bson:"rejected,omitempty"`
|
|
TechnicalValid DataVolume `json:"technicalValid,omitempty" bson:"technicalValid,omitempty"`
|
|
TrainReady DataVolume `json:"trainReady,omitempty" bson:"trainReady,omitempty"`
|
|
DatasetRefs []DatasetMetricRef `json:"datasetRefs,omitempty" bson:"datasetRefs,omitempty"`
|
|
TrainingInputs []TrainingInputRecord `json:"trainingInputs,omitempty" bson:"trainingInputs,omitempty"`
|
|
RejectionReasons map[string]int64 `json:"rejectionReasons,omitempty" bson:"rejectionReasons,omitempty"`
|
|
Quality DataMetricQuality `json:"quality" bson:"quality"`
|
|
OccurredAt string `json:"occurredAt" bson:"occurredAt"`
|
|
RecordedAt string `json:"recordedAt" bson:"recordedAt"`
|
|
}
|
|
|
|
type DataOperationsQuery struct {
|
|
From string
|
|
To string
|
|
Timezone string
|
|
ProjectID string
|
|
TaskID string
|
|
RobotModel string
|
|
Scene string
|
|
Stage DataMetricStage
|
|
Limit int
|
|
Cursor string
|
|
}
|
|
|
|
type DataStageSummary struct {
|
|
Stage DataMetricStage `json:"stage"`
|
|
Input DataVolume `json:"input,omitempty"`
|
|
Output DataVolume `json:"output,omitempty"`
|
|
Rejected DataVolume `json:"rejected,omitempty"`
|
|
TechnicalValid DataVolume `json:"technicalValid,omitempty"`
|
|
TrainReady DataVolume `json:"trainReady,omitempty"`
|
|
RunCount int64 `json:"runCount"`
|
|
}
|
|
|
|
type DataOperationsHourlyPoint struct {
|
|
Hour string `json:"hour"`
|
|
Stages map[DataMetricStage]DataVolume `json:"stages"`
|
|
}
|
|
|
|
type DataOperationsTrainingSummary struct {
|
|
Consumed DataVolume `json:"consumed"`
|
|
Unique DataVolume `json:"unique"`
|
|
RunCount int64 `json:"runCount"`
|
|
}
|
|
|
|
type CollectionTaskProgress struct {
|
|
TaskID string `json:"taskId"`
|
|
TaskName string `json:"taskName"`
|
|
Status CollectionTaskStatus `json:"status"`
|
|
Targets DataVolume `json:"targets"`
|
|
Collected DataVolume `json:"collected"`
|
|
Percent float64 `json:"percent"`
|
|
}
|
|
|
|
type DataOperationsSummary struct {
|
|
From string `json:"from"`
|
|
To string `json:"to"`
|
|
Timezone string `json:"timezone"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
Freshness string `json:"freshness"`
|
|
Stages []DataStageSummary `json:"stages"`
|
|
Training DataOperationsTrainingSummary `json:"training"`
|
|
Hourly []DataOperationsHourlyPoint `json:"hourly"`
|
|
RejectionReasons map[string]int64 `json:"rejectionReasons"`
|
|
Tasks []CollectionTaskProgress `json:"tasks"`
|
|
FactCount int64 `json:"factCount"`
|
|
ExactCount int64 `json:"exactCount"`
|
|
DerivedCount int64 `json:"derivedCount"`
|
|
EstimatedCount int64 `json:"estimatedCount"`
|
|
UnknownCount int64 `json:"unknownCount"`
|
|
}
|
|
|
|
type TrainingUsageRecord struct {
|
|
ID string `json:"id"`
|
|
TaskID string `json:"taskId,omitempty"`
|
|
TaskName string `json:"taskName,omitempty"`
|
|
ProjectID string `json:"projectId,omitempty"`
|
|
ProjectName string `json:"projectName,omitempty"`
|
|
WorkflowID string `json:"workflowId,omitempty"`
|
|
WorkflowName string `json:"workflowName,omitempty"`
|
|
RunID string `json:"runId"`
|
|
NodeID string `json:"nodeId"`
|
|
NodeLabel string `json:"nodeLabel,omitempty"`
|
|
Model string `json:"model,omitempty"`
|
|
Inputs []TrainingInputRecord `json:"inputs"`
|
|
Consumed DataVolume `json:"consumed"`
|
|
Quality DataMetricQuality `json:"quality"`
|
|
OccurredAt string `json:"occurredAt"`
|
|
}
|
|
|
|
type TrainingUsagePage struct {
|
|
Items []TrainingUsageRecord `json:"items"`
|
|
NextCursor string `json:"nextCursor,omitempty"`
|
|
HasMore bool `json:"hasMore"`
|
|
}
|
|
|
|
type DataMetricFactPage struct {
|
|
Items []DataMetricFactRecord `json:"items"`
|
|
NextCursor string `json:"nextCursor,omitempty"`
|
|
HasMore bool `json:"hasMore"`
|
|
}
|
|
|
|
type DataOperationsRunPage struct {
|
|
Items []RunRecord
|
|
NextCursor *RunSummaryCursor
|
|
HasMore bool
|
|
}
|