models

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BidDisabledStatus    BidStatus = "bidding_disabled"
	BidEnabledStatus     BidStatus = "bidding_enabled"
	BidGpuDisabledStatus BidStatus = "bidding_gpu_disabled"

	ActiveStatus   string = "Active"
	InactiveStatus string = "Inactive"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	OwnerAddress   string
	NodeId         string
	MultiAddresses []string
	UbiFlag        uint8
	Beneficiary    struct {
		BeneficiaryAddress string
		Quota              *big.Int
		Expiration         *big.Int
	}
}

type BidStatus

type BidStatus string

type CacheSpaceDetail

type CacheSpaceDetail struct {
	WalletAddress string
	SpaceName     string
	SpaceUuid     string
	ExpireTime    int64
	JobUuid       string
	TaskType      string
	DeployName    string
	Hardware      string
	Url           string
	TaskUuid      string
	SpaceType     string
}

type CacheUbiTaskDetail

type CacheUbiTaskDetail struct {
	TaskId     string `json:"task_id"`
	TaskType   string `json:"task_type"`
	ZkType     string `json:"zk_type"`
	Tx         string `json:"tx"`
	Status     string `json:"status"`
	Reward     string `json:"reward"`
	CreateTime string `json:"create_time"`
}

type ClusterResource

type ClusterResource struct {
	NodeId        string          `json:"node_id,omitempty"`
	Region        string          `json:"region,omitempty"`
	ClusterInfo   []*NodeResource `json:"cluster_info"`
	PublicAddress string          `json:"public_address,omitempty"`
	MultiAddress  string          `json:"multi_address,omitempty"`
	NodeName      string          `json:"node_name,omitempty"`
	TaskFlag      int             `json:"task_flag,omitempty"`
}

type CollectNodeInfo

type CollectNodeInfo struct {
	Gpu     Gpu    `json:"gpu"`
	CpuName string `json:"cpu_name"`
}

type Commit1Task

type Commit1Task struct {
	SectorNum  int64      `json:"SectorNum"`
	Phase1Out  string     `json:"Phase1Out"`
	SectorSize uint64     `json:"SectorSize"`
	Sid        SectorRef  `json:"Sid"`
	Ticket     string     `json:"Ticket"`
	Cids       SectorCids `json:"Cids"`
	Seed       Seed       `json:"seed"`
}

type Commit2Proof

type Commit2Proof struct {
	TaskUuid  string `json:"task_uuid"`
	CpAddress string `json:"cp_address"`
	NodeId    string `json:"node_id"`
	TaskId    string `json:"task_id"`
	TaskType  string `json:"task_type"`
	Proof     string `json:"proof"`
}

type Common

type Common struct {
	Total string `json:"total"`
	Used  string `json:"used"`
	Free  string `json:"free"`
}

type ComputingProvider

type ComputingProvider struct {
	Name          string `json:"name"`
	NodeId        string `json:"node_id"`
	MultiAddress  string `json:"multi_address"`
	Autobid       int    `json:"autobid"`
	Status        string `json:"status"`
	PublicAddress string `json:"public_address"`
}

type CpuQuota

type CpuQuota struct {
	Quota int64 `json:"quota"`
}

type DeleteJobReq

type DeleteJobReq struct {
	CreatorWallet string `json:"creator_wallet"`
	SpaceName     string `json:"space_name"`
}

type Gpu

type Gpu struct {
	DriverVersion string      `json:"driver_version"`
	CudaVersion   string      `json:"cuda_version"`
	AttachedGpus  int         `json:"attached_gpus"`
	Details       []GpuDetail `json:"details"`
}

type GpuDetail

type GpuDetail struct {
	ProductName     string    `json:"product_name"`
	Status          GpuStatus `json:"status"`
	FbMemoryUsage   Common    `json:"fb_memory_usage"`
	Bar1MemoryUsage Common    `json:"bar1_memory_usage"`
}

type GpuQuota

type GpuQuota struct {
	Name  string `json:"name"`
	Quota int64  `json:"quota"`
}

type GpuStatus

type GpuStatus string
const (
	Occupied  GpuStatus = "occupied"
	Available GpuStatus = "available"
)

type HostInfo

type HostInfo struct {
	SwanProviderVersion string `json:"swan_miner_version"`
	OperatingSystem     string `json:"operating_system"`
	Architecture        string `json:"architecture"`
	CPUCores            int    `json:"cpu_cores"`
}

type Job

type Job struct {
	Uuid   string
	Status JobStatus
	Url    string
}

type JobData

type JobData struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Status   string `json:"status"`
	Duration int    `json:"duration"`
	//Hardware      string `json:"hardware"`
	JobSourceURI                string `json:"job_source_uri"`
	JobResultURI                string `json:"job_result_uri,omitempty"`
	StorageSource               string `json:"storage_source,omitempty"`
	TaskUUID                    string `json:"task_uuid"`
	CreatedAt                   string `json:"created_at"`
	UpdatedAt                   string `json:"updated_at,omitempty"`
	BuildLog                    string `json:"build_log,omitempty"`
	ContainerLog                string `json:"container_log"`
	NodeIdJobSourceUriSignature string `json:"node_id_job_source_uri_signature"`
	JobRealUri                  string `json:"job_real_uri,omitempty"`
}

type JobStatus

type JobStatus string
const (
	JobDownloadSource JobStatus = "downloadSource" // download file form job_resource_uri
	JobUploadResult   JobStatus = "uploadResult"   // upload task result to mcs
	JobBuildImage     JobStatus = "buildImage"     // build images
	JobPushImage      JobStatus = "pushImage"      // push image to registry
	JobPullImage      JobStatus = "pullImage"      // download file form job_resource_uri
	JobDeployToK8s    JobStatus = "deployToK8s"    // deploy image to k8s
)

type NodeResource

type NodeResource struct {
	MachineId string `json:"machine_id"`
	CpuName   string `json:"cpu_name"`
	Cpu       Common `json:"cpu"`
	Vcpu      Common `json:"vcpu"`
	Memory    Common `json:"memory"`
	Gpu       Gpu    `json:"gpu"`
	Storage   Common `json:"storage"`
}

type Quota

type Quota struct {
	Quota int64  `json:"quota"`
	Unit  string `json:"unit"`
}

type Resource

type Resource struct {
	Cpu     Specification
	Memory  Specification
	Gpu     Specification
	Storage Specification
}

type ResourcePolicy

type ResourcePolicy struct {
	Cpu     CpuQuota   `json:"cpu"`
	Gpu     []GpuQuota `json:"gpu"`
	Memory  Quota      `json:"memory"`
	Storage Quota      `json:"storage"`
}

type ResourceStatus

type ResourceStatus struct {
	Request  int64
	Capacity int64
}

type SectorCids

type SectorCids struct {
	Unsealed struct {
		Field1 string `json:"/"`
	} `json:"Unsealed"`
	Sealed struct {
		Field1 string `json:"/"`
	} `json:"Sealed"`
}

type SectorRef

type SectorRef struct {
	ID struct {
		Miner  uint64 `json:"Miner"`
		Number uint64 `json:"Number"`
	} `json:"ID"`
	ProofType int64 `json:"ProofType"`
}

type Seed

type Seed struct {
	Value string `json:"Value"`
	Epoch int    `json:"Epoch"`
}

type SpaceFile

type SpaceFile struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type SpaceHardware

type SpaceHardware struct {
	Description  string `json:"description"`
	HardwareType string `json:"hardware_type"`
	Memory       int    `json:"memory"`
	Name         string `json:"name"`
	Vcpu         int    `json:"vcpu"`
}

type SpaceJSON

type SpaceJSON struct {
	Data 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"`
	} `json:"data"`
	Message string `json:"message"`
	Status  string `json:"status"`
}

type Specification

type Specification struct {
	Quantity int64
	Unit     string
}

type T added in v0.4.6

type T struct {
	Gpu struct {
		DriverVersion string `json:"driver_version"`
		CudaVersion   string `json:"cuda_version"`
		AttachedGpus  int    `json:"attached_gpus"`
		Details       []struct {
			ProductName   string `json:"product_name"`
			FbMemoryUsage struct {
				Total string `json:"total"`
				Used  string `json:"used"`
				Free  string `json:"free"`
			} `json:"fb_memory_usage"`
			Bar1MemoryUsage struct {
				Total string `json:"total"`
				Used  string `json:"used"`
				Free  string `json:"free"`
			} `json:"bar1_memory_usage"`
		} `json:"details"`
	} `json:"gpu"`
	MachineId string `json:"machine_id"`
	CpuName   string `json:"cpu_name"`
	Cpu       struct {
		Total string `json:"total"`
		Used  string `json:"used"`
		Free  string `json:"free"`
	} `json:"cpu"`
	Vcpu struct {
		Total string `json:"total"`
		Used  string `json:"used"`
		Free  string `json:"free"`
	} `json:"vcpu"`
	Memory struct {
		Total string `json:"total"`
		Used  string `json:"used"`
		Free  string `json:"free"`
	} `json:"memory"`
	Storage struct {
		Total string `json:"total"`
		Used  string `json:"used"`
		Free  string `json:"free"`
	} `json:"storage"`
}

type TaskList

type TaskList []CacheUbiTaskDetail

func (TaskList) Len

func (t TaskList) Len() int

func (TaskList) Less

func (t TaskList) Less(i, j int) bool

func (TaskList) Swap

func (t TaskList) Swap(i, j int)

type TaskResource

type TaskResource struct {
	CPU     string `json:"cpu"`
	GPU     string `json:"gpu"`
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type UBITaskReq

type UBITaskReq struct {
	ID         int           `json:"id"`
	Name       string        `json:"name,omitempty"`
	Type       int           `json:"type"`
	ZkType     string        `json:"zk_type"`
	InputParam string        `json:"input_param"`
	Signature  string        `json:"signature"`
	Resource   *TaskResource `json:"resource"`
}

type UbiC2Proof added in v0.4.6

type UbiC2Proof struct {
	TaskId    string `json:"task_id"`
	TaskType  string `json:"task_type"`
	Proof     string `json:"proof"`
	ZkType    string `json:"zk_type"`
	NameSpace string `json:"name_space"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL