models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 0 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 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
}

type ClusterResource

type ClusterResource struct {
	NodeId      string          `json:"node_id"`
	Region      string          `json:"region"`
	ClusterInfo []*NodeResource `json:"cluster_info"`
}

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"`
	WalletAddress int    `json:"wallet_address"`
	Status        string `json:"status"`
}

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
	Count  int
}

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"`
	StorageSource string `json:"storage_source"`
	TaskUUID      string `json:"task_uuid"`
	CreatedAt     string `json:"created_at"`
	UpdatedAt     string `json:"updated_at"`
	BuildLog      string `json:"build_log"`
	ContainerLog  string `json:"container_log"`
}

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"`
	Model     string `json:"model"`
	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 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
}

Jump to

Keyboard shortcuts

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