Browse Source

Merge pull request 'update octopushttp resourcePool' (#542) from tzwang/pcm-coordinator:master into master

pull/544/head
tzwang 2 months ago
parent
commit
89823bf54e
4 changed files with 9 additions and 13 deletions
  1. +1
    -1
      internal/scheduler/service/aiService.go
  2. +5
    -5
      internal/storeLink/octopusHttp/octopusHttp.go
  3. +1
    -0
      internal/types/types.go
  4. +2
    -7
      version.sql

+ 1
- 1
internal/scheduler/service/aiService.go View File

@@ -87,7 +87,7 @@ func InitAiClusterMap(conf *config.Config, clusters []types.ClusterInfo) (map[st
switch c.Driver { switch c.Driver {
case OCTOPUS: case OCTOPUS:
id, _ := strconv.ParseInt(c.Id, 10, 64) id, _ := strconv.ParseInt(c.Id, 10, 64)
octopus := octopusHttp.NewOctopusHttp(id, c.Nickname, c.Server, c.Address, c.Username, c.Password)
octopus := octopusHttp.NewOctopusHttp(id, c.ResourcePool, c.Nickname, c.Server, c.Address, c.Username, c.Password)
collectorMap[c.Id] = octopus collectorMap[c.Id] = octopus
executorMap[c.Id] = octopus executorMap[c.Id] = octopus
inferenceMap[c.Id] = octopus inferenceMap[c.Id] = octopus


+ 5
- 5
internal/storeLink/octopusHttp/octopusHttp.go View File

@@ -24,7 +24,6 @@ import (
) )


const ( const (
RESOURCE_POOL = "grampus-pool"
Param_Token = "token" Param_Token = "token"
Param_Addr = "addr" Param_Addr = "addr"
Forward_Slash = "/" Forward_Slash = "/"
@@ -95,16 +94,17 @@ type OctopusHttp struct {
platform string platform string
participantId int64 participantId int64
token *Token token *Token
resourcePool string
} }


func NewOctopusHttp(id int64, name, server, host string, user string, pwd string) *OctopusHttp {
func NewOctopusHttp(id int64, resourcePool, name, server, host, user, pwd string) *OctopusHttp {
token := &Token{ token := &Token{
user: user, user: user,
pwd: pwd, pwd: pwd,
server: server, server: server,
host: host, host: host,
} }
return &OctopusHttp{platform: name, participantId: id, server: server, host: host, token: token}
return &OctopusHttp{resourcePool: resourcePool, platform: name, participantId: id, server: server, host: host, token: token}
} }


// executor // executor
@@ -239,7 +239,7 @@ func (o *OctopusHttp) SubmitTask(ctx context.Context, imageId string, cmd string
Name: TASK_NAME_PREFIX + UNDERSCORE + utils.RandomString(10), Name: TASK_NAME_PREFIX + UNDERSCORE + utils.RandomString(10),
ImageId: imageId, ImageId: imageId,
IsDistributed: false, IsDistributed: false,
ResourcePool: RESOURCE_POOL,
ResourcePool: o.resourcePool,
Config: []*omodel.CreateTrainJobConf{ Config: []*omodel.CreateTrainJobConf{
{ {
Command: cmd, Command: cmd,
@@ -304,7 +304,7 @@ func (o *OctopusHttp) resourceSpecs(ctx context.Context) (*entity.OctResp, error
} }


param := omodel.ResourceSpecParam{ param := omodel.ResourceSpecParam{
ResourcePool: RESOURCE_POOL,
ResourcePool: o.resourcePool,
} }


b, _ := json.Marshal(param) b, _ := json.Marshal(param)


+ 1
- 0
internal/types/types.go View File

@@ -780,6 +780,7 @@ type ClusterInfo struct {
ProxyEnable string `json:"proxyEnable,omitempty" db:"proxy_enable"` ProxyEnable string `json:"proxyEnable,omitempty" db:"proxy_enable"`
Driver string `json:"driver,omitempty" db:"driver"` Driver string `json:"driver,omitempty" db:"driver"`
Status string `json:"status,omitempty" db:"status"` Status string `json:"status,omitempty" db:"status"`
ResourcePool string `json:"resourcePool,omitempty" db:"resource_pool"`
} }


type ClusterListResp struct { type ClusterListResp struct {


+ 2
- 7
version.sql View File

@@ -1,8 +1,3 @@
#20250901
alter table t_cluster alter table t_cluster
add private_key varchar(1000) null comment 'PEM格式私钥内容' after sk;

alter table t_cluster
add passphrase varchar(100) null comment ' 私钥的加密口令' after private_key;

alter table t_cluster
modify auth_type tinyint(1) not null comment '认证方式:0->ak,sk;1->user,pwd;2->token;3->ssh密钥认证;';
add resource_pool varchar(100) null comment 'octopus资源池' after status;

Loading…
Cancel
Save