Versions in this module Expand all Collapse all v0 v0.3.0 Nov 16, 2023 Changes in this version + const BuildFileName + const PingMsg + const PingPeriod + const ResourceCpu + const ResourceMem + const ResourceStorage + var NotFoundError = errors.New("not found resource") + var NotFoundRedisKey = stErr.New("not found redis key") + func BuildImagesByDockerfile(jobUuid, spaceUuid, spaceName, imagePath string) (string, string) + func BuildSpaceTaskImage(spaceUuid string, files []models.SpaceFile) (bool, string, string, string, error) + func DeleteJob(c *gin.Context) + func DeploySpaceTask(jobSourceURI, hostName string, duration int, jobUuid string) string + func DoProof(c *gin.Context) + func ExtractExposedPort(dockerfilePath string) (string, error) + func GenerateNodeID(cpRepoPath string) (string, string, string) + func GetRedisClient() redis.Conn + func GetServiceProviderInfo(c *gin.Context) + func GetSpaceLog(c *gin.Context) + func InitComputingProvider(cpRepoPath string) string + func ReNewJob(c *gin.Context) + func ReceiveJob(c *gin.Context) + func Reconnect(nodeID string) string + func RedeployJob(c *gin.Context) + func RemoveContainerIfExists(imageName string) error + func RetrieveJobMetadata(key string) (models.CacheSpaceDetail, error) + func RunContainer(imageName, dockerfilePath string) string + func RunSyncTask(nodeId string) + func StatisticalSources(c *gin.Context) + type CeleryService struct + func NewCeleryService() *CeleryService + func (s *CeleryService) DelayTask(taskName string, params ...interface{}) (*gocelery.AsyncResult, error) + func (s *CeleryService) RegisterTask(taskName string, task interface{}) + func (s *CeleryService) Start() + func (s *CeleryService) Stop() + type Deploy struct + DeployName string + SpacePath string + TaskType string + func NewDeploy(jobUuid, hostName, walletAddress, hardwareDesc string, duration int64) *Deploy + func (d *Deploy) DockerfileToK8s() + func (d *Deploy) ModelInferenceToK8s() error + func (d *Deploy) WithDockerfile(image, dockerfilePath string) *Deploy + func (d *Deploy) WithModelSettingFile(modelsSettingFile string) *Deploy + func (d *Deploy) WithSpaceInfo(spaceUuid, spaceName string) *Deploy + func (d *Deploy) WithSpacePath(spacePath string) *Deploy + func (d *Deploy) WithYamlInfo(yamlPath string) *Deploy + func (d *Deploy) YamlToK8s() + type DockerService struct + func NewDockerService() *DockerService + func (ds *DockerService) BuildImage(buildPath, imageName string) error + func (ds *DockerService) CleanResource() + func (ds *DockerService) PushImage(imagesName string) error + func (ds *DockerService) RemoveImage(imageId string) error + type ErrorLine struct + Error string + ErrorDetail struct{ ... } + type K8sService struct + Version string + func NewK8sService() *K8sService + func (s *K8sService) AddNodeLabel(nodeName, key string) error + func (s *K8sService) CreateConfigMap(ctx context.Context, k8sNameSpace, spaceUuid, basePath, configName string) (*coreV1.ConfigMap, error) + func (s *K8sService) CreateDeployment(ctx context.Context, nameSpace string, deploy *appV1.Deployment) (result *appV1.Deployment, err error) + func (s *K8sService) CreateIngress(ctx context.Context, k8sNameSpace, spaceUuid, hostName string, port int32) (*networkingv1.Ingress, error) + func (s *K8sService) CreateNameSpace(ctx context.Context, nameSpace *coreV1.Namespace, opts metaV1.CreateOptions) (result *coreV1.Namespace, err error) + func (s *K8sService) CreateNetworkPolicy(ctx context.Context, namespace string) (*networkingv1.NetworkPolicy, error) + func (s *K8sService) CreateService(ctx context.Context, nameSpace, spaceUuid string, containerPort int32) (result *coreV1.Service, err error) + func (s *K8sService) DeleteDeployRs(ctx context.Context, namespace, spaceUuid string) error + func (s *K8sService) DeleteDeployment(ctx context.Context, namespace, deploymentName string) error + func (s *K8sService) DeleteIngress(ctx context.Context, nameSpace, ingressName string) error + func (s *K8sService) DeleteNameSpace(ctx context.Context, nameSpace string) error + func (s *K8sService) DeletePod(ctx context.Context, namespace, spaceUuid string) error + func (s *K8sService) DeleteService(ctx context.Context, namespace, serviceName string) error + func (s *K8sService) GetDeploymentImages(ctx context.Context, namespace, deploymentName string) ([]string, error) + func (s *K8sService) GetDeploymentStatus(namespace, spaceUuid string) (string, error) + func (s *K8sService) GetNameSpace(ctx context.Context, nameSpace string, opts metaV1.GetOptions) (result *coreV1.Namespace, err error) + func (s *K8sService) GetPodLog(ctx context.Context) (map[string]*strings.Builder, error) + func (s *K8sService) GetPods(namespace, spaceUuid string) (bool, error) + func (s *K8sService) GetServiceByName(ctx context.Context, namespace, serviceName string, opts metaV1.GetOptions) (result *coreV1.Service, err error) + func (s *K8sService) ListNamespace(ctx context.Context) ([]string, error) + func (s *K8sService) ListUsedImage(ctx context.Context, nameSpace string) ([]string, error) + func (s *K8sService) PodDoCommand(namespace, podName, containerName string, podCmd []string) error + func (s *K8sService) StatisticalSources(ctx context.Context) ([]*models.NodeResource, error) + func (s *K8sService) WaitForPodRunning(namespace, spaceUuid, serviceIp string) (string, error) + type ScheduleTask struct + TaskMap sync.Map + func NewScheduleTask() *ScheduleTask + func (s *ScheduleTask) Run() + type StorageService struct + BucketName string + McsAccessToken string + McsApiKey string + NetWork string + func NewStorageService() *StorageService + func (storage *StorageService) CreateBucket(bucketName string) + func (storage *StorageService) CreateFolder(folderName string) + func (storage *StorageService) DeleteBucket(bucketName string) error + func (storage *StorageService) GetGatewayUrl() (*string, error) + func (storage *StorageService) UploadFileToBucket(objectName, filePath string, replace bool) (*bucket.OssFile, error) + type WsClient struct + func NewWsClient(client *websocket.Conn) *WsClient + func (ws *WsClient) Close() + func (ws *WsClient) HandleLogs(reader io.Reader)