Documentation
¶
Index ¶
- Constants
- func ExistResource(name string) bool
- 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 CpBalanceEntity
- type CpCollateralInfoForECP
- type CpCollateralInfoForFCP
- type CpInfoEntity
- type CpuQuota
- type DeployConfig
- type DeployJobParam
- type EcpImageJobReq
- type EcpImageResp
- type EcpJobEntity
- type EcpJobStatusResp
- type EcpTaskInfo
- type FcpDeployImageReq
- type FcpDeployImageResp
- type Gpu
- type GpuDetail
- type GpuQuota
- type GpuStatus
- type HostInfo
- type Job
- type JobData
- type JobEntity
- type K8sResourceForImage
- type NodeResource
- type PodGpu
- type PortMap
- type Quota
- type ReqGpu
- type Resource
- type ResourceInfo
- type ResourcePolicy
- type ResourcePrice
- type ResourceStatus
- type ScanChainEntity
- 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
- type YamlContent
- type ZkTaskReq
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 Mining = 5 )
View Source
const ( TASK_REJECTED_STATUS = iota TASK_RECEIVED_STATUS 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_REJECTED_STATUS = -1 JOB_RECEIVED_STATUS = 0 JOB_DEPLOY_STATUS = 1 JOB_RUNNING_STATUS = 2 JOB_TERMINATED_STATUS = 3 JOB_COMPLETED_STATUS = 4 JOB_FAILED_STATUS = 5 )
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 = iota + 1 Task_TYPE_MINING Task_TYPE_AI Task_TYPE_INFERENCE Task_TYPE_NODE_PORT Task_TYPE_EXIT = 100 )
View Source
const ( NetworkNetset = "netset-2300e518e9ad45" NetworkGlobalSubnet = "global-e59cad59af9c65" NetworkGlobalOutAccess = "global-pd6sdo8cjd61yd" NetworkGlobalInAccess = "global-01kls78xh7dk4n" NetworkGlobalNamespace = "global-ao9kq72mjc0sl3" NetworkGlobalDns = "global-s92ms87dl3j6do" NetworkGlobalPodInNamespace = "global-pod1namespace1" )
View Source
const ( MiningJobType = 1 InferenceJobType = 2 )
View Source
const ( FailedStatus = "failed" RejectStatus = "rejected" CreatedStatus = "created" RunningStatus = "running" TerminatedStatus = "terminated" )
View Source
const ( ScannerTaskPaymentId = 1 ScannerFcpTaskManagerId = 2 )
View Source
const (
TaskSequencer = 1
)
Variables ¶
This section is empty.
Functions ¶
func ExistResource ¶ added in v0.7.0
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"`
ClientType string `json:"client_type"`
}
type CollateralContractInfoForECP ¶ added in v0.6.2
type CollectNodeInfo ¶
type Commit1Task ¶
type Commit2Proof ¶
type CpBalanceEntity ¶ added in v1.0.1
type CpBalanceEntity struct {
Id int64 `json:"id" gorm:"primaryKey"`
CpAccount string `json:"cp_account" gorm:"cp_account"`
WorkerBalance float64 `json:"worker_balance" gorm:"worker_balance"`
SequencerBalance float64 `json:"sequencer_balance" gorm:"sequencer_balance"`
}
func (*CpBalanceEntity) TableName ¶ added in v1.0.1
func (*CpBalanceEntity) TableName() string
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:mining, 3: AI, 4:Fil-C2-32G, 5:NodePort, 100:Exit
}
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 DeployConfig ¶ added in v1.0.0
type DeployJobParam ¶ added in v1.0.0
type DeployJobParam struct {
JobType int // 1 mining; 2: inference
Uuid string
Name string
Image string
Cmd []string
Ports []int
HealthPath string
Envs []string
NeedResource container.Resources
K8sResourceForImage K8sResourceForImage
BuildImagePath string
BuildImageName string
IpWhiteList []string `json:"ip_white_list"`
PrepareG []PodGpu
}
type EcpImageJobReq ¶ added in v1.0.0
type EcpImageJobReq struct {
Uuid string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Price string `json:"price,omitempty"`
Duration int `json:"duration,omitempty"`
JobType int `json:"job_type,omitempty"`
HealthPath string `json:"health_path,omitempty"`
Sign string `json:"sign,omitempty"`
WalletAddress string `json:"wallet_address,omitempty"`
Resource *ResourceInfo `json:"resource,omitempty"`
Image string `json:"image,omitempty"`
Cmd []string `json:"cmd,omitempty"`
Ports map[string][]int `json:"ports,omitempty"`
Envs map[string]string `json:"envs,omitempty"`
RunCommands []string `json:"run_commands,omitempty"`
ResourceUrl string `json:"resource_url,omitempty"`
WorkDir string `json:"work_dir,omitempty"`
IpWhiteList []string `json:"ip_white_list"`
DeployType int `json:"deploy_type"` // 0: field; 1: dockerfile; 2: yaml
DeployContent string `json:"deploy_content"`
}
type EcpImageResp ¶ added in v1.0.0
type EcpJobEntity ¶ added in v0.7.0
type EcpJobEntity struct {
Id int64 `json:"id" gorm:"primaryKey;autoIncrement"`
Uuid string `json:"uuid" gorm:"uuid"`
Name string `json:"name" gorm:"name"`
Image string `json:"image" gorm:"image"`
Env string `json:"env" gorm:"env"`
Cmd string `json:"cmd" gorm:"type:json"`
Status string `json:"status"` // created|restarting|running|removing|paused|exited|dead
Message string `json:"message"`
Reward float64 `json:"reward"`
Cpu int64 `json:"cpu"`
JobType int `json:"job_type"`
Memory int64 `json:"memory"`
Storage int64 `json:"storage"`
GpuName string `json:"gpu_name"`
GpuIndex string `json:"gpu_index" gorm:"type:json"` // =
ContainerName string `json:"container_name" gorm:"container_name"` // =
HealthUrlPath string `json:"health_url_path"`
ServiceUrl string `json:"service_url" gorm:"service_url"`
PortMap string `json:"port_map" gorm:"port_map"`
LastBlockNumber int64 `json:"last_block_number" gorm:"last_block_number"`
CreateTime int64 `json:"create_time" gorm:"create_time"`
DeleteAt int `json:"delete_at" gorm:"delete_at; default:0"` // 1 deleted
}
func (*EcpJobEntity) TableName ¶ added in v0.7.0
func (*EcpJobEntity) TableName() string
type EcpJobStatusResp ¶ added in v0.7.0
type EcpJobStatusResp struct {
Uuid string `json:"uuid"`
Status string `json:"status"`
ServiceUrl string `json:"service_url,omitempty"`
HealthPath string `json:"health_path,omitempty"`
Price float64 `json:"price"`
ServicePortMapping []PortMap `json:"service_port_mapping,omitempty"`
Message string `json:"message,omitempty"`
}
type EcpTaskInfo ¶ added in v0.6.2
type FcpDeployImageReq ¶ added in v1.0.0
type FcpDeployImageReq struct {
Uuid string `json:"uuid"`
TaskUuid string `json:"task_uuid"`
Name string `json:"name"`
InstanceName string `json:"instance_name"`
Duration int `json:"duration"`
Sign string `json:"sign"`
WalletAddress string `json:"wallet_address"`
IpWhitelist []string `json:"ip_whitelist"`
DeployConfig DeployConfig `json:"deploy_config"`
Resource K8sResourceForImage `json:"resource"`
IpWhiteList []string `json:"ip_white_list"`
BidPrice string `json:"bid_price"` // Amount users are willing to pay
JobType int `json:"job_type"`
DeployType int `json:"deploy_type"` // 0: field; 1: docker; 2: yaml
DeployContent string `json:"deploy_content"`
HealthPath string `json:"health_path"` // deploy_type=1 or 2, used
}
type FcpDeployImageResp ¶ added in v1.0.0
type FcpDeployImageResp struct {
UUID string `json:"uuid,omitempty"`
ServiceUrl string `json:"service_url,omitempty"`
HealthPath string `json:"health_path,omitempty"`
Price float64 `json:"price"`
ServicePortMapping []PortMap `json:"service_port_mapping,omitempty"`
ContainerLog string `json:"container_log"`
BuildLog string `json:"build_log"`
}
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"`
JobType int `json:"job_type"` // 0: Standard job; 1: Custom job
BidPrice string `json:"bid_price"` // Amount users are willing to pay
IpWhiteList []string `json:"ip_white_list"`
}
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"`
BuildLogPath string `json:"build_log_path"`
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
IpWhiteList string `json:"ip_white_list"`
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 K8sResourceForImage ¶ added in v1.1.0
type NodeResource ¶
type Resource ¶
type Resource struct {
Cpu Specification
Memory Specification
Gpu Specification
Storage Specification
}
type ResourceInfo ¶ added in v1.1.0
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,omitempty"`
HdPersSsdPrice string `json:"hd_pers_ssd_price,omitempty"`
HdPersNvmePrice string `json:"hd_pers_nvme_price,omitempty"`
GpuDefaultPrice string `json:"gpu_default_price"`
GpusPrice map[string]string `json:"gpus_price"`
Pricing bool `json:"pricing"`
}
type ResourceStatus ¶
type ScanChainEntity ¶ added in v0.7.1
type ScanChainEntity struct {
Id int64 `json:"id" gorm:"primaryKey"`
BlockNumber int64 `json:"block_number" gorm:"block_number"`
UpdateTime string `json:"update_time" gorm:"update_time"`
}
func (*ScanChainEntity) TableName ¶ added in v0.7.1
func (*ScanChainEntity) TableName() string
type SectorCids ¶
type SpaceHardware ¶
type SpaceHardware struct {
Description string `json:"description"`
HardwareType string `json:"hardware_type"`
Hardware string `json:"hardware"` // Nvidia 3080 CPU only
Memory int64 `json:"memory"` // unit bytes
Name string `json:"name"`
Vcpu int64 `json:"vcpu"`
Storage int64 `json:"storage"` // unit bytes
Gpu int64 `json:"gpu"`
}
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"`
Uuid string `json:"uuid"`
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
type YamlContent ¶ added in v1.1.0
type ZkTaskReq ¶ added in v1.1.0
type ZkTaskReq struct {
Id int `json:"id"`
Uuid string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
TaskType int `json:"task_type"` // 1: fil-c2-512-cpu; 2:fil-c2-32-cpu; 3: fil-c2-512-gpu; 4: fil-c2-32-gpu; 5: mining
InputParam string `json:"input_param"`
VerifyParam string `json:"verify_param"`
Signature string `json:"signature"`
Resource *ResourceInfo `json:"resource"`
DeadLine int64 `json:"deadline"`
CheckCode string `json:"check_code"`
Image string `json:"image,omitempty"`
Cmd []string `json:"cmd,omitempty"`
Ports map[string][]int `json:"ports,omitempty"`
Envs map[string]string `json:"envs,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.