Documentation
¶
Index ¶
- Constants
- func GetDeployStatusStr(deployStatus int) string
- func GetJobStatus(status int) string
- func GetResourceTypeStr(resourceType int) string
- func JobOnChainStatus(status int) string
- func TaskStatusStr(status int) string
- func TaskTypeStr(taskType int) string
- func UbiTaskTypeStr(typeInt int) string
- type Account
- type ClusterResource
- type CollateralContractInfoForECP
- type CollectNodeInfo
- type Commit1Task
- type Commit2Proof
- type Common
- type CpCollateralInfoForECP
- type CpCollateralInfoForFCP
- type CpInfoEntity
- type CpuQuota
- type EcpTaskInfo
- type Gpu
- type GpuDetail
- type GpuQuota
- type GpuStatus
- type HostInfo
- type Job
- type JobData
- type JobEntity
- type NodeResource
- type Quota
- type Resource
- type ResourcePolicy
- type ResourcePrice
- type ResourceStatus
- type SectorCids
- type SectorRef
- type Seed
- type SpaceFile
- type SpaceHardware
- type SpaceJSON
- type SpaceJsonWithNoData
- type Specification
- type TaskEntity
- type TaskInfoOnChain
- type TaskResource
- type UBITaskReq
- type UbiC2Proof
- type WithdrawRequest
Constants ¶
View Source
const ( NOT_ASSIGNED = iota IN_PROGRESS COMPLETED TERMINATED )
View Source
const ( FIL_C2_CPU512 = 1 FIL_C2_CPU32G = 2 FIL_C2_GPU512 = 3 FIL_C2_GPU32G = 4 )
View Source
const ( TASK_RECEIVED_STATUS = iota + 1 TASK_RUNNING_STATUS TASK_SUBMITTED_STATUS TASK_FAILED_STATUS TASK_VERIFIED_STATUS TASK_INVALID_STATUS TASK_VERIFYFAILED_STATUS TASK_REWARDED_STATUS TASK_TIMEOUT_STATUS TASK_REPEATED_STATUS TASK_NSC_STATUS TASK_UNKNOWN_STATUS )
View Source
const ( RESOURCE_TYPE_CPU = 0 RESOURCE_TYPE_GPU = 1 )
View Source
const ( All_FLAG = -1 UN_DELETEED_FLAG = 0 DELETED_FLAG = 1 )
View Source
const ( POD_UNKNOWN_STATUS = 0 POD_RUNNING_STATUS = 1 POD_DELETE_STATUS = 2 )
View Source
const ( JOB_RECEIVED_STATUS = 0 JOB_DEPLOY_STATUS = 1 JOB_RUNNING_STATUS = 2 JOB_TERMINATED_STATUS = 3 JOB_COMPLETED_STATUS = 4 )
View Source
const ( DEPLOY_RECEIVE_JOB = iota + 1 DEPLOY_DOWNLOAD_SOURCE DEPLOY_UPLOAD_RESULT DEPLOY_BUILD_IMAGE DEPLOY_PUSH_IMAGE DEPLOY_PULL_IMAGE DEPLOY_TO_K8S )
View Source
const ( Task_TYPE_FIL_C2_512 = iota + 1 Task_TYPE_ALEO Task_TYPE_AI Task_TYPE_FIL_C2_32 )
Variables ¶
This section is empty.
Functions ¶
func GetDeployStatusStr ¶ added in v0.5.0
func GetJobStatus ¶ added in v0.6.2
func GetResourceTypeStr ¶ added in v0.6.2
func JobOnChainStatus ¶ added in v0.6.4
func TaskStatusStr ¶ added in v0.5.0
func TaskTypeStr ¶ added in v0.5.0
func UbiTaskTypeStr ¶ added in v0.5.0
Types ¶
type ClusterResource ¶
type ClusterResource struct {
NodeId string `json:"node_id,omitempty"`
CpAccountAddress string `json:"cpAccount_address"`
Region string `json:"region,omitempty"`
ClusterInfo []*NodeResource `json:"cluster_info"`
NodeName string `json:"node_name,omitempty"`
Runtime string `json:"runtime,omitempty"`
}
type CollateralContractInfoForECP ¶ added in v0.6.2
type CollectNodeInfo ¶
type Commit1Task ¶
type Commit2Proof ¶
type CpCollateralInfoForECP ¶ added in v0.6.2
type CpCollateralInfoForFCP ¶ added in v0.6.2
type CpInfoEntity ¶ added in v0.5.0
type CpInfoEntity struct {
Id int64 `json:"id" gorm:"primaryKey;autoIncrement"`
NodeId string `json:"node_id" gorm:"node_id"`
OwnerAddress string `json:"owner_address" gorm:"owner_address"`
Beneficiary string `json:"beneficiary" gorm:"beneficiary"`
WorkerAddress string `json:"worker_address" gorm:"worker_address"`
Version string `json:"version" gorm:"version"`
ContractAddress string `json:"contract_address" gorm:"contract_address"`
MultiAddressesJSON string `gorm:"multi_addresses_json;type:text" json:"-"`
TaskTypesJSON string `gorm:"task_types_json; type:text" json:"-"`
CreateAt string `json:"create_at" gorm:"create_at"`
UpdateAt string `json:"update_at" gorm:"update_at"`
MultiAddresses []string `json:"multi_addresses" gorm:"-"`
TaskTypes []uint8 `json:"task_types" gorm:"-"` // 1:Fil-C2-512M, 2:Aleo, 3: AI, 4:Fil-C2-32G
}
func (*CpInfoEntity) AfterFind ¶ added in v0.5.0
func (c *CpInfoEntity) AfterFind(tx *gorm.DB) (err error)
func (*CpInfoEntity) BeforeSave ¶ added in v0.5.0
func (c *CpInfoEntity) BeforeSave(tx *gorm.DB) (err error)
func (*CpInfoEntity) TableName ¶ added in v0.5.0
func (*CpInfoEntity) TableName() string
type EcpTaskInfo ¶ added in v0.6.2
type JobData ¶
type JobData struct {
UUID string `json:"uuid"`
Name string `json:"name"`
Duration int `json:"duration"`
JobSourceURI string `json:"job_source_uri"`
JobResultURI string `json:"job_result_uri,omitempty"`
StorageSource string `json:"storage_source,omitempty"`
TaskUUID string `json:"task_uuid"`
BuildLog string `json:"build_log,omitempty"`
ContainerLog string `json:"container_log"`
NodeIdJobSourceUriSignature string `json:"node_id_job_source_uri_signature,omitempty"`
JobRealUri string `json:"job_real_uri,omitempty"`
}
type JobEntity ¶ added in v0.5.0
type JobEntity struct {
Id int64 `json:"id" gorm:"primaryKey;autoIncrement"`
Source string `json:"source" gorm:"source"` // market name
Name string `json:"name" gorm:"name"`
SpaceUuid string `json:"space_uuid" gorm:"space_uuid"`
JobUuid string `json:"job_uuid" gorm:"job_uuid"`
TaskUuid string `json:"task_uuid" gorm:"task_uuid"`
ResourceType string `json:"resource_type" gorm:"resource_type"`
SpaceType int `json:"space_type" gorm:"space_type"` // 0: public; 1: private
SourceUrl string `json:"source_url" gorm:"source_url"`
Hardware string `json:"hardware" gorm:"hardware"`
Duration int `json:"duration" gorm:"duration"`
DeployStatus int `json:"deploy_status" gorm:"deploy_status"`
WalletAddress string `json:"wallet_address" gorm:"wallet_address"`
ResultUrl string `json:"result_url" gorm:"result_url"`
RealUrl string `json:"real_url" gorm:"real_url"`
K8sDeployName string `json:"k8s_deploy_name" gorm:"k8s_deploy_name"`
K8sResourceType string `json:"k8s_resource_type" gorm:"k8s_resource_type"`
NameSpace string `json:"name_space" gorm:"name_space"`
ImageName string `json:"image_name" gorm:"image_name"`
BuildLog string `json:"build_log" gorm:"build_log"`
ContainerLog string `json:"container_log" gorm:"container_log"`
Reward string `json:"reward" gorm:"reward"`
ExpireTime int64 `json:"expire_time" gorm:"expire_time"`
CreateTime int64 `json:"create_time" gorm:"create_time"`
Error string `json:"error" gorm:"error"`
DeleteAt int `json:"delete_at" gorm:"delete_at; default:0"` // 1 deleted
PodStatus int `json:"pod_status"`
Status int `json:"status"`
StartedBlock uint64 `json:"started_block" gorm:"column:started_block;not null;default:0"`
ScannedBlock uint64 `json:"scanned_block" gorm:"column:scanned_block;not null;default:0"`
EndedBlock uint64 `json:"ended_block" gorm:"column:ended_block;not null;default:0"`
}
type NodeResource ¶
type Resource ¶
type Resource struct {
Cpu Specification
Memory Specification
Gpu Specification
Storage Specification
}
type ResourcePolicy ¶
type ResourcePrice ¶ added in v0.6.5
type ResourcePrice struct {
CpuPrice string `json:"cpu_price"`
MemoryPrice string `json:"memory_price"`
HdEphemeralPrice string `json:"hd_ephemeral_price"`
HdPersHddPrice string `json:"hd_pers_hdd_price"`
HdPersSsdPrice string `json:"hd_pers_ssd_price"`
HdPersNvmePrice string `json:"hd_pers_nvme_price"`
GpuDefaultPrice string `json:"gpu_default_price"`
GpusPrice map[string]string `json:"gpus_price"`
}
type ResourceStatus ¶
type SectorCids ¶
type SpaceHardware ¶
type SpaceJSON ¶
type SpaceJSON struct {
Data SpaceJsonWithNoData `json:"data"`
Message string `json:"message"`
Status string `json:"status"`
}
type SpaceJsonWithNoData ¶ added in v0.6.4
type SpaceJsonWithNoData struct {
Files []SpaceFile `json:"files"`
Owner struct {
PublicAddress string `json:"public_address"`
} `json:"owner"`
Space struct {
Uuid string `json:"uuid"`
Name string `json:"name"`
ActiveOrder struct {
Config SpaceHardware `json:"config"`
} `json:"activeOrder"`
} `json:"space"`
}
type Specification ¶
type TaskEntity ¶ added in v0.5.0
type TaskEntity struct {
Id int64 `json:"id" gorm:"primaryKey;id"`
Type int `json:"type" gorm:"type"`
Name string `json:"name" gorm:"name"`
Contract string `json:"contract" gorm:"contract"`
ResourceType int `json:"resource_type" gorm:"resource_type"` // 1
InputParam string `json:"input_param" gorm:"input_param"`
VerifyParam string `json:"verify_param" gorm:"verify_param"`
TxHash string `json:"tx_hash" gorm:"tx_hash"`
Status int `json:"status" gorm:"status"`
CreateTime int64 `json:"create_time" gorm:"create_time"`
EndTime int64 `json:"end_time" gorm:"end_time"`
Error string `json:"error" gorm:"error"`
Deadline int64 `json:"deadline"`
CheckCode string `json:"check_code"`
BlockHash string `json:"block_hash"`
Sign string `json:"sign"`
Reward string `json:"reward"`
SequenceCid string `json:"sequence_cid"`
SettlementCid string `json:"settlement_cid"`
SequenceTaskAddr string `json:"sequence_task_addr"`
SettlementTaskAddr string `json:"settlement_task_addr"`
Sequencer int `json:"sequencer" gorm:"default:-1"`
Proof string
}
func (*TaskEntity) TableName ¶ added in v0.5.0
func (task *TaskEntity) TableName() string
type TaskInfoOnChain ¶ added in v0.6.2
type TaskResource ¶
type UBITaskReq ¶
type UBITaskReq struct {
ID int `json:"id"`
Name string `json:"name,omitempty"`
Type int `json:"type"`
InputParam string `json:"input_param"`
VerifyParam string `json:"verify_param"`
Signature string `json:"signature"`
Resource *TaskResource `json:"resource"`
ResourceType int `json:"resource_type"`
DeadLine int64 `json:"deadline"`
CheckCode string `json:"check_code"`
}
type UbiC2Proof ¶ added in v0.4.6
type WithdrawRequest ¶ added in v0.6.2
Click to show internal directories.
Click to hide internal directories.