storeLink

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MulanPSL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMG_NAME_PREFIX    = "oct_"
	IMG_VERSION_PREFIX = "version_"
	TASK_NAME_PREFIX   = "trainJob"
	RESOURCE_POOL      = "common-pool"
)
View Source
const (
	GAP_WALL_TIME_24H    = "24:00:00"
	TASK_SHUGUANG_PREFIX = "ShuguangHPC"
	NEWLINE              = "\n"
	JOBNAME              = "JOBNAME"
	GAP_CMD_FILE         = "cmd"
	GAP_NNODE            = "1" // 节点个数
	GAP_NODE_STRING      = ""
	GAP_APPNAME          = "BASE"
	GAP_QUEUE            = "wzhdtest"
	GAP_WORK_DIR         = "/work/home/acgnnmfbwo/BASE/JOBNAME"
	GAP_STD_OUT_FILE     = "/work/home/acgnnmfbwo/BASE/JOBNAME/std.out.%j"
	GAP_STD_ERR_FILE     = "/work/home/acgnnmfbwo/BASE/JOBNAME/std.err.%j"
	StrJobManagerID      = 1637920656
	Apptype              = "BASIC"
	EXPORT               = "export"
	GAP_NPROC            = "1"
	GAP_NDCU             = "1"
	GAP_EXCLUSIVE        = ""
	GAP_PPN              = ""
	GAP_NGPU             = ""
	GAP_MULTI_SUB        = ""
	StrJobInfoMap        = "%d,%s:%s:"
	Username             = "acgnnmfbwo"
)
View Source
const (
	WORKER_RAM_SIZE                 = 10240 // 10G
	WORKER_NUMBER                   = 1
	WORKER_CPU_NUMBER               = 5
	WORKER_GPU_NUMBER               = 1
	SHUGUANGAI_CUSTOM_RESOURCE_ID   = "WodTB2rJ8SobMgQ1nrtR245jxOrsovFi"
	SHUGUANGAI_CUSTOM_RESOURCE_NAME = "1*DCU, CPU:5, 内存:10GB"
	DCU                             = "dcu"
	PYTORCH                         = "Pytorch"
	TASK_PYTORCH_PREFIX             = "PytorchTask"
	TENSORFLOW                      = "Tensorflow"
	RESOURCE_GROUP                  = "wzhdtest"
	WorkPath                        = "/work/home/acgnnmfbwo/111111/py/"
	TimeoutLimit                    = "10:00:00"
	PythonCodePath                  = "/work/home/acgnnmfbwo/111111/py/test.py"
)
View Source
const (
	PY_PARAM_PREFIX  = "--"
	SPACE            = " "
	UNDERSCORE       = "_"
	EQUAL            = "="
	COMMA            = ","
	TYPE_OCTOPUS     = "1"
	TYPE_MODELARTS   = "2"
	TYPE_SHUGUANGAI  = "3"
	TYPE_SHUGUANGHPC = "4"
	OCTOPUS          = "Octopus"
	MODELARTS        = "Modelarts"
	SHUGUANGAI       = "ShuguangAi"
	SHUGUANGHPC      = "ShuguangHpc"
)

Variables

View Source
var (
	OctImgStatus = map[int32]string{
		1: "未上传",
		3: "制作完成",
		4: "制作失败",
	}
	AITYPE = map[string]string{
		"1": OCTOPUS,
		"2": MODELARTS,
		"3": SHUGUANGAI,
		"4": SHUGUANGHPC,
	}
)
View Source
var AcStatus = map[string]string{
	"statQ": "Pending",
	"statR": "Running",
	"statE": "Pending",
	"statC": "Completed",
	"statH": "Pending",
	"statS": "Pending",
	"statW": "Pending",
	"statX": "Other",
}
View Source
var RESOURCEMAP = map[string]ResourceSpec{
	"FPOqD5Cx8iNYqawEgDrAxLdrszp4Tmhl": {
		GAP_NNODE: "1",
		GAP_NPROC: "1",
		GAP_NDCU:  "1",
	},
	"Nd99eGNoBFC2ZTycKDlqD37heWTOmrMS": {
		GAP_NNODE: "1",
		GAP_NPROC: "2",
		GAP_NDCU:  "1",
	},
	"uAmLkz6jgSZkC6o8JywG7Yo2aiFPPOBO": {
		GAP_NNODE: "1",
		GAP_NPROC: "4",
		GAP_NDCU:  "2",
	},
	"D71OZQYrRabJc2nfL2GDWOdLEfbiMzYH": {
		GAP_NNODE: "1",
		GAP_NPROC: "8",
		GAP_NDCU:  "4",
	},
	"sXUMrGmgMDFJaLi6dPiB9LkHjFb3lvL5": {
		GAP_NNODE: "1",
		GAP_NPROC: "16",
		GAP_NDCU:  "4",
	},
	"ZfCKQKbNbQl9RPwlSyWLah1Gf7Ti7uJA": {
		GAP_NNODE: "1",
		GAP_NPROC: "32",
		GAP_NDCU:  "4",
	},
	"cfEI4ulTNo2gYUozzdG59URByUjwLl3x": {
		GAP_NNODE: "2",
		GAP_NPROC: "4",
		GAP_NDCU:  "2",
	},
	"vtbkaks8bErhpLRkUDiPDUHq6ssotFpD": {
		GAP_NNODE: "2",
		GAP_NPROC: "8",
		GAP_NDCU:  "4",
	},
	"QJXZFJSReVWWQfkvQjGyEq1JpDHN55Oh": {
		GAP_NNODE: "2",
		GAP_NPROC: "16",
		GAP_NDCU:  "4",
	},
	"79xSdy48yLbVLl9DqEV6tQ2J6jaHe5KO": {
		GAP_NNODE: "2",
		GAP_NPROC: "32",
		GAP_NDCU:  "8",
	},
}
View Source
var RESOURCESPECS = map[string]string{
	"FPOqD5Cx8iNYqawEgDrAxLdrszp4Tmhl": "1*NODE, CPU:1, 1*DCU",
	"Nd99eGNoBFC2ZTycKDlqD37heWTOmrMS": "1*NODE, CPU:2, 1*DCU",
	"uAmLkz6jgSZkC6o8JywG7Yo2aiFPPOBO": "1*NODE, CPU:4, 2*DCU",
	"D71OZQYrRabJc2nfL2GDWOdLEfbiMzYH": "1*NODE, CPU:8, 4*DCU",
	"sXUMrGmgMDFJaLi6dPiB9LkHjFb3lvL5": "1*NODE, CPU:16, 4*DCU",
	"ZfCKQKbNbQl9RPwlSyWLah1Gf7Ti7uJA": "1*NODE, CPU:32, 4*DCU",
	"cfEI4ulTNo2gYUozzdG59URByUjwLl3x": "2*NODE, CPU:4, 2*DCU",
	"vtbkaks8bErhpLRkUDiPDUHq6ssotFpD": "2*NODE, CPU:8, 4*DCU",
	"QJXZFJSReVWWQfkvQjGyEq1JpDHN55Oh": "2*NODE, CPU:16, 4*DCU",
	"79xSdy48yLbVLl9DqEV6tQ2J6jaHe5KO": "2*NODE, CPU:32, 8*DCU",
}

Functions

func ConvertType

func ConvertType[T any](in *T, participant *models.StorelinkCenter) (interface{}, error)

func GetParticipantById

func GetParticipantById(partId int64, dbEngin *gorm.DB) *models.StorelinkCenter

func GetParticipants

func GetParticipants(dbEngin *gorm.DB) []*models.StorelinkCenter

Types

type Linkage

type Linkage interface {
	UploadImage(path string) (interface{}, error)
	DeleteImage(imageId string) (interface{}, error)
	QueryImageList() (interface{}, error)
	SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string) (interface{}, error)
	QueryTask(taskId string) (interface{}, error)
	QuerySpecs() (interface{}, error)
	DeleteTask(taskId string) (interface{}, error)
}
type ModelArtsLink struct {
	// contains filtered or unexported fields
}
func NewModelArtsLink(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *ModelArtsLink

func (*ModelArtsLink) DeleteImage

func (o *ModelArtsLink) DeleteImage(imageId string) (interface{}, error)

func (*ModelArtsLink) DeleteTask

func (o *ModelArtsLink) DeleteTask(taskId string) (interface{}, error)

func (*ModelArtsLink) QueryImageList

func (o *ModelArtsLink) QueryImageList() (interface{}, error)

func (*ModelArtsLink) QuerySpecs

func (o *ModelArtsLink) QuerySpecs() (interface{}, error)

func (*ModelArtsLink) QueryTask

func (o *ModelArtsLink) QueryTask(taskId string) (interface{}, error)

func (*ModelArtsLink) SubmitTask

func (o *ModelArtsLink) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string) (interface{}, error)

func (*ModelArtsLink) UploadImage

func (o *ModelArtsLink) UploadImage(path string) (interface{}, error)
type OctopusLink struct {
	// contains filtered or unexported fields
}
func NewOctopusLink(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *OctopusLink

func (*OctopusLink) DeleteImage

func (o *OctopusLink) DeleteImage(imageId string) (interface{}, error)

func (*OctopusLink) DeleteTask

func (o *OctopusLink) DeleteTask(taskId string) (interface{}, error)

func (*OctopusLink) QueryImageList

func (o *OctopusLink) QueryImageList() (interface{}, error)

func (*OctopusLink) QuerySpecs

func (o *OctopusLink) QuerySpecs() (interface{}, error)

func (*OctopusLink) QueryTask

func (o *OctopusLink) QueryTask(taskId string) (interface{}, error)

func (*OctopusLink) SubmitTask

func (o *OctopusLink) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string) (interface{}, error)

func (*OctopusLink) UploadImage

func (o *OctopusLink) UploadImage(path string) (interface{}, error)

type ResourceSpec added in v0.1.14

type ResourceSpec struct {
	GAP_NNODE string
	GAP_NPROC string
	GAP_NDCU  string
}

type ShuguangAi

type ShuguangAi struct {
	// contains filtered or unexported fields
}

func NewShuguangAi

func NewShuguangAi(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *ShuguangAi

func (*ShuguangAi) DeleteImage

func (s *ShuguangAi) DeleteImage(imageId string) (interface{}, error)

func (*ShuguangAi) DeleteTask

func (s *ShuguangAi) DeleteTask(taskId string) (interface{}, error)

func (*ShuguangAi) QueryImageList

func (s *ShuguangAi) QueryImageList() (interface{}, error)

func (*ShuguangAi) QuerySpecs

func (o *ShuguangAi) QuerySpecs() (interface{}, error)

func (*ShuguangAi) QueryTask

func (s *ShuguangAi) QueryTask(taskId string) (interface{}, error)

func (*ShuguangAi) SubmitTask

func (s *ShuguangAi) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string) (interface{}, error)

func (*ShuguangAi) UploadImage

func (s *ShuguangAi) UploadImage(path string) (interface{}, error)

type ShuguangHpc added in v0.1.13

type ShuguangHpc struct {
	// contains filtered or unexported fields
}

func NewShuguangHpc added in v0.1.13

func NewShuguangHpc(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *ShuguangHpc

func (ShuguangHpc) DeleteImage added in v0.1.13

func (s ShuguangHpc) DeleteImage(imageId string) (interface{}, error)

func (ShuguangHpc) DeleteTask added in v0.1.13

func (s ShuguangHpc) DeleteTask(taskId string) (interface{}, error)

func (ShuguangHpc) QueryImageList added in v0.1.13

func (s ShuguangHpc) QueryImageList() (interface{}, error)

func (ShuguangHpc) QuerySpecs added in v0.1.13

func (s ShuguangHpc) QuerySpecs() (interface{}, error)

func (ShuguangHpc) QueryTask added in v0.1.13

func (s ShuguangHpc) QueryTask(taskId string) (interface{}, error)

func (ShuguangHpc) SubmitTask added in v0.1.13

func (s ShuguangHpc) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string) (interface{}, error)

func (ShuguangHpc) UploadImage added in v0.1.13

func (s ShuguangHpc) UploadImage(path string) (interface{}, error)
type StoreLink struct {
	ILinkage Linkage
}
func NewStoreLink(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *StoreLink

Jump to

Keyboard shortcuts

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