添加environment变量

Former-commit-id: 0d3eeef29aa9df5c9380874dc41e7a5fd07b3d68
This commit is contained in:
zhangwei 2024-10-12 18:22:32 +08:00
parent f7f46e8561
commit a322bb080a
9 changed files with 6544 additions and 8468 deletions

View File

@ -98,7 +98,7 @@ type HpcInfo struct {
Account string `json:"account"`
WorkDir string `json:"work_dir"` // 工作路径
AssocId int64 `json:"assoc_id"`
Partition string `json:"partition"`
Partition string `json:"partition,omitempty,optional"`
ExitCode int64 `json:"exit_code"`
WallTime string `json:"wall_time"` // 最大运行时间
Result string `json:"result"` // 运行结果
@ -112,7 +112,7 @@ type HpcInfo struct {
StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j
StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j
StdInput string `json:"std_input"`
Environment string `json:"environment"`
Environment map[string]string `json:"environment"`
DeletedFlag int64 `json:"deleted_flag"` // 是否删除0-否1-是)
CreatedBy int64 `json:"created_by"` // 创建人
CreatedTime time.Time `json:"created_time"` // 创建时间

View File

@ -867,6 +867,7 @@ type (
ProducerDict string `json:"producerDict,optional"`
RegionDict string `json:"regionDict,optional"`
RegionName string `json:"regionName,optional"`
Environment map[string]string `json:"environment,optional"`
}
ClusterInfo {
Id string `json:"id,omitempty" db:"id"`
@ -891,6 +892,7 @@ type (
RegionDict string `json:"regionDict,omitempty" db:"region_dict"`
Location string `json:"location,omitempty" db:"location"`
CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
Environment map[string]string `json:"environment,omitempty" db:"environment"`
}
)

View File

@ -11,6 +11,7 @@ info(
type (
commitHpcTaskReq {
Name string `json:"name"` // paratera:jobName
Account string `json:"account,optional"`
Description string `json:"description,optional"`
TenantId int64 `json:"tenantId,optional"`
TaskId int64 `json:"taskId,optional"`

View File

@ -1060,4 +1060,3 @@ service pcm {
@handler scheduleSituationHandler
get /monitoring/schedule/situation returns (scheduleSituationResp)
}

View File

@ -18,7 +18,7 @@ func PullTaskInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := core.NewPullTaskInfoLogic(r.Context(), svcCtx)
resp, err := l.PullTaskInfo((*clientCore.PullTaskInfoReq)(&req))
resp, err := l.PullTaskInfo(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ import (
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models/cloud"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/utils/tool"
"gorm.io/gorm"
"github.com/zeromicro/go-zero/core/logx"
@ -50,7 +51,7 @@ func (l *PullTaskInfoLogic) PullTaskInfo(req *clientCore.PullTaskInfoReq) (*clie
}
var clusterType string
l.svcCtx.DbEngin.Raw("SELECT label FROM `t_cluster` where id = ? ", hpcInfo.ClusterId).Scan(&clusterType)
tool.Convert(hpcInfo.Environment, &resp.HpcInfoList[i].Environment)
resp.HpcInfoList[i].ClusterType = clusterType
}
}

View File

@ -87,6 +87,7 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
Queue: req.Queue,
SubmitType: req.SubmitType,
NNode: req.NNode,
Account: req.Account,
StdOutFile: req.StdOutFile,
StdErrFile: req.StdErrFile,
StdInput: req.StdInput,

File diff suppressed because it is too large Load Diff