添加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

@ -75,49 +75,49 @@ type PushNoticeResp struct {
} }
type HpcInfo struct { type HpcInfo struct {
Id int64 `json:"id"` // id Id int64 `json:"id"` // id
TaskId int64 `json:"task_id"` // 任务id TaskId int64 `json:"task_id"` // 任务id
JobId string `json:"job_id"` // 作业id(在第三方系统中的作业id) JobId string `json:"job_id"` // 作业id(在第三方系统中的作业id)
AdapterId int64 `json:"adapter_id"` // 执行任务的适配器id AdapterId int64 `json:"adapter_id"` // 执行任务的适配器id
AdapterName string `json:"adapterName,omitempty,optional"` AdapterName string `json:"adapterName,omitempty,optional"`
ClusterId int64 `json:"cluster_id"` // 执行任务的集群id ClusterId int64 `json:"cluster_id"` // 执行任务的集群id
ClusterName string `json:"clusterName,omitempty,optional"` ClusterName string `json:"clusterName,omitempty,optional"`
ClusterType string `json:"cluster_type"` // 执行任务的集群类型 ClusterType string `json:"cluster_type"` // 执行任务的集群类型
Name string `json:"name"` // 名称 Name string `json:"name"` // 名称
Status string `json:"status"` // 状态 Status string `json:"status"` // 状态
CmdScript string `json:"cmd_script"` CmdScript string `json:"cmd_script"`
StartTime string `json:"start_time"` // 开始时间 StartTime string `json:"start_time"` // 开始时间
RunningTime int64 `json:"running_time"` // 运行时间 RunningTime int64 `json:"running_time"` // 运行时间
DerivedEs string `json:"derived_es"` DerivedEs string `json:"derived_es"`
Cluster string `json:"cluster"` Cluster string `json:"cluster"`
BlockId int64 `json:"block_id"` BlockId int64 `json:"block_id"`
AllocNodes int64 `json:"alloc_nodes"` AllocNodes int64 `json:"alloc_nodes"`
AllocCpu int64 `json:"alloc_cpu"` AllocCpu int64 `json:"alloc_cpu"`
CardCount int64 `json:"card_count"` // 卡数 CardCount int64 `json:"card_count"` // 卡数
Version string `json:"version"` Version string `json:"version"`
Account string `json:"account"` Account string `json:"account"`
WorkDir string `json:"work_dir"` // 工作路径 WorkDir string `json:"work_dir"` // 工作路径
AssocId int64 `json:"assoc_id"` AssocId int64 `json:"assoc_id"`
Partition string `json:"partition"` Partition string `json:"partition,omitempty,optional"`
ExitCode int64 `json:"exit_code"` ExitCode int64 `json:"exit_code"`
WallTime string `json:"wall_time"` // 最大运行时间 WallTime string `json:"wall_time"` // 最大运行时间
Result string `json:"result"` // 运行结果 Result string `json:"result"` // 运行结果
DeletedAt sql.NullTime `json:"deleted_at"` // 删除时间 DeletedAt sql.NullTime `json:"deleted_at"` // 删除时间
YamlString string `json:"yaml_string"` YamlString string `json:"yaml_string"`
AppType string `json:"app_type"` // 应用类型 AppType string `json:"app_type"` // 应用类型
AppName string `json:"app_name"` // 应用名称 AppName string `json:"app_name"` // 应用名称
Queue string `json:"queue"` // 队列名称 Queue string `json:"queue"` // 队列名称
SubmitType string `json:"submit_type"` // cmd命令行模式 SubmitType string `json:"submit_type"` // cmd命令行模式
NNode string `json:"n_node"` // 节点个数当指定该参数时GAP_NODE_STRING必须为"" NNode string `json:"n_node"` // 节点个数当指定该参数时GAP_NODE_STRING必须为""
StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j
StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j
StdInput string `json:"std_input"` StdInput string `json:"std_input"`
Environment string `json:"environment"` Environment map[string]string `json:"environment"`
DeletedFlag int64 `json:"deleted_flag"` // 是否删除0-否1-是) DeletedFlag int64 `json:"deleted_flag"` // 是否删除0-否1-是)
CreatedBy int64 `json:"created_by"` // 创建人 CreatedBy int64 `json:"created_by"` // 创建人
CreatedTime time.Time `json:"created_time"` // 创建时间 CreatedTime time.Time `json:"created_time"` // 创建时间
UpdatedBy int64 `json:"updated_by"` // 更新人 UpdatedBy int64 `json:"updated_by"` // 更新人
UpdatedTime time.Time `json:"updated_time"` // 更新时间 UpdatedTime time.Time `json:"updated_time"` // 更新时间
} }
type CloudInfo struct { type CloudInfo struct {

View File

@ -867,6 +867,7 @@ type (
ProducerDict string `json:"producerDict,optional"` ProducerDict string `json:"producerDict,optional"`
RegionDict string `json:"regionDict,optional"` RegionDict string `json:"regionDict,optional"`
RegionName string `json:"regionName,optional"` RegionName string `json:"regionName,optional"`
Environment map[string]string `json:"environment,optional"`
} }
ClusterInfo { ClusterInfo {
Id string `json:"id,omitempty" db:"id"` Id string `json:"id,omitempty" db:"id"`
@ -891,6 +892,7 @@ type (
RegionDict string `json:"regionDict,omitempty" db:"region_dict"` RegionDict string `json:"regionDict,omitempty" db:"region_dict"`
Location string `json:"location,omitempty" db:"location"` Location string `json:"location,omitempty" db:"location"`
CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` 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 ( type (
commitHpcTaskReq { commitHpcTaskReq {
Name string `json:"name"` // paratera:jobName Name string `json:"name"` // paratera:jobName
Account string `json:"account,optional"`
Description string `json:"description,optional"` Description string `json:"description,optional"`
TenantId int64 `json:"tenantId,optional"` TenantId int64 `json:"tenantId,optional"`
TaskId int64 `json:"taskId,optional"` TaskId int64 `json:"taskId,optional"`

View File

@ -387,7 +387,7 @@ service pcm {
@doc "文本识别" @doc "文本识别"
@handler ChatHandler @handler ChatHandler
post /ai/chat (ChatReq) returns (ChatResult) post /ai/chat (ChatReq) returns (ChatResult)
/******chat end***********/ /******chat end***********/
} }
//screen接口 //screen接口
@ -1060,4 +1060,3 @@ service pcm {
@handler scheduleSituationHandler @handler scheduleSituationHandler
get /monitoring/schedule/situation returns (scheduleSituationResp) 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) l := core.NewPullTaskInfoLogic(r.Context(), svcCtx)
resp, err := l.PullTaskInfo((*clientCore.PullTaskInfoReq)(&req)) resp, err := l.PullTaskInfo(&req)
if err != nil { if err != nil {
httpx.ErrorCtx(r.Context(), w, err) httpx.ErrorCtx(r.Context(), w, err)
} else { } 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"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models/cloud" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models/cloud"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/utils/tool"
"gorm.io/gorm" "gorm.io/gorm"
"github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/logx"
@ -50,7 +51,7 @@ func (l *PullTaskInfoLogic) PullTaskInfo(req *clientCore.PullTaskInfoReq) (*clie
} }
var clusterType string var clusterType string
l.svcCtx.DbEngin.Raw("SELECT label FROM `t_cluster` where id = ? ", hpcInfo.ClusterId).Scan(&clusterType) 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 resp.HpcInfoList[i].ClusterType = clusterType
} }
} }

View File

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

File diff suppressed because it is too large Load Diff