ListJob for shuguang

This commit is contained in:
450705171@qq.com 2023-02-20 17:36:43 +08:00
parent ce5fd117ff
commit 8aeb6e44ce
22 changed files with 2264 additions and 294 deletions

View File

@ -0,0 +1,28 @@
package handler
import (
"net/http"
"PCM/adaptor/slurm/slurmCore/api/internal/logic"
"PCM/adaptor/slurm/slurmCore/api/internal/svc"
"PCM/adaptor/slurm/slurmCore/api/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func listJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ListJobReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewListJobLogic(r.Context(), svcCtx)
resp, err := l.ListJob(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}

View File

@ -12,6 +12,11 @@ import (
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/listJob",
Handler: listJobHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/listHistoryJob",

View File

@ -1,7 +1,7 @@
package logic
import (
"PCM/adaptor/slurm/slurmTianhe/rpc/slurmTianhe"
"PCM/adaptor/slurm/slurmShuguang/rpc/slurmShuguang"
"PCM/common/tool"
"PCM/common/xerr"
"context"
@ -30,13 +30,13 @@ func NewListHistoryJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Li
func (l *ListHistoryJobLogic) ListHistoryJob(req *types.ListHistoryJobReq) (resp *types.ListHistoryJobResp, err error) {
//shuguangReq := &slurmShuguang.ListHistoryJobReq{}
//err = copier.CopyWithOption(shuguangReq, req, copier.Option{Converters: tool.Converters})
//listHistoryJobResp, err := l.svcCtx.ShuguangRpc.ListHistoryJob(l.ctx, shuguangReq)
shuguangReq := &slurmShuguang.ListHistoryJobReq{}
err = copier.CopyWithOption(shuguangReq, req, copier.Option{Converters: tool.Converters})
listHistoryJobResp, err := l.svcCtx.ShuguangRpc.ListHistoryJob(l.ctx, shuguangReq)
tianheReq := &slurmTianhe.ListHistoryJobReq{}
err = copier.CopyWithOption(tianheReq, req, copier.Option{Converters: tool.Converters})
listHistoryJobResp, err := l.svcCtx.TianheRpc.ListHistoryJob(l.ctx, tianheReq)
//tianheReq := &slurmTianhe.ListHistoryJobReq{}
//err = copier.CopyWithOption(tianheReq, req, copier.Option{Converters: tool.Converters})
//listHistoryJobResp, err := l.svcCtx.TianheRpc.ListHistoryJob(l.ctx, tianheReq)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db job list"), "Failed to get db job list err : %v ,req:%+v", err, req)
@ -52,7 +52,7 @@ func (l *ListHistoryJobLogic) ListHistoryJob(req *types.ListHistoryJobReq) (resp
return nil, err
}
for i := range resp.HistoryJobs {
resp.HistoryJobs[i].SlurmVersion = "tianhe"
resp.HistoryJobs[i].SlurmVersion = "shuguang"
}
return resp, nil

View File

@ -0,0 +1,61 @@
package logic
import (
"PCM/adaptor/slurm/slurmCore/api/internal/svc"
"PCM/adaptor/slurm/slurmCore/api/internal/types"
"PCM/adaptor/slurm/slurmShuguang/rpc/slurmShuguang"
"PCM/common/tool"
"context"
"github.com/jinzhu/copier"
"github.com/zeromicro/go-zero/core/logx"
)
type ListJobLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewListJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListJobLogic {
return &ListJobLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ListJobLogic) ListJob(req *types.ListJobReq) (resp *types.ListJobResp, err error) {
shuguangReq := &slurmShuguang.ListJobReq{}
err = copier.CopyWithOption(shuguangReq, req, copier.Option{Converters: tool.Converters})
listJobRespShuguang, err := l.svcCtx.ShuguangRpc.ListJob(l.ctx, shuguangReq)
resp = &types.ListJobResp{}
for i := 0; i < len(listJobRespShuguang.Jobs); i++ {
jobShuguang := types.Job{SlurmVersion: "shuguang"}
copier.CopyWithOption(&jobShuguang, &listJobRespShuguang.Jobs[i], copier.Option{Converters: tool.Converters})
resp.Jobs = append(resp.Jobs, jobShuguang)
}
//tianheReq := &slurmTianhe.ListJobReq{}
//err = copier.CopyWithOption(tianheReq, req, copier.Option{Converters: tool.Converters})
//listJobRespTianhe, err := l.svcCtx.TianheRpc.ListJob(l.ctx, tianheReq)
//
//for i := 0; i < len(listJobRespTianhe.Jobs); i++ {
// jobTianhe := types.Job{SlurmVersion: "tianhe"}
// copier.CopyWithOption(&jobTianhe, &listJobRespTianhe, copier.Option{Converters: tool.Converters})
// resp.Jobs = append(resp.Jobs, jobTianhe)
//}
//if listJobRespShuguang.Code == 200 && listJobRespTianhe.Code == 200 {
//
//}
resp.Code = 200
resp.Msg = "success"
resp.RecordCount = int32(len(resp.Jobs))
return resp, nil
}

View File

@ -1,17 +1,99 @@
// Code generated by goctl. DO NOT EDIT.
package types
type Domain struct {
DomainName string `json:"domainName"`
SoftStack string `json:"softStack"`
SlurmNum int32 `json:"slurmNum"`
InterfaceCount int32 `json:"interfaceCount"`
RunningJobs int32 `json:"runningJobs"`
type Job struct {
SlurmVersion string `json:"slurmVersion"`
Account string `json:"account"`
AllocNode string `json:"allocNode"`
AllocSid uint32 `json:"allocSid"`
ArrayJobId uint32 `json:"arrayJobId"`
ArrayTaskId uint32 `json:"arrayTaskId"`
AssocId uint32 `json:"assocId"`
BatchFlag uint32 `json:"batchFlag"`
BatchHost string `json:"batchHost"`
BatchScript string `json:"batchScript"`
Command string `json:"command"`
Comment string `json:"comment"`
Contiguous uint32 `json:"contiguous"`
CpusPerTask uint32 `json:"cpusPerTask"`
Dependency string `json:"dependency"`
DerivedEc uint32 `json:"derivedEc"`
EligibleTime int64 `json:"eligibleTime"`
EndTime int64 `json:"endTime"`
ExcNodes string `json:"excNodes"` //NodeUsed in shuguang
ExcNodeInx int32 `json:"excNodeInx"`
ExitCode uint32 `json:"exitCode"`
Features string `json:"features"`
Gres string `json:"gres"`
GroupId uint32 `json:"groupId"`
JobId uint32 `json:"jobId"` //JobId in shuguang
JobState uint32 `json:"jobState"` //JobStatus in shuguang
Licenses string `json:"licenses"`
MaxCpus uint32 `json:"maxCpus"`
MaxNodes uint32 `json:"maxNodes"`
BoardsPerNode uint32 `json:"boardsPerNode"`
SocketsPerBoard uint32 `json:"socketsPerBoard"`
SocketsPerNode uint32 `json:"socketsPerNode"`
CoresPerSocket uint32 `json:"coresPerSocket"`
ThreadsPerCore uint32 `json:"threadsPerCore"`
Name string `json:"name"` //JobName in shuguang
Network string `json:"network"`
Nodes string `json:"nodes"`
Nice uint32 `json:"nice"`
NodeInx int32 `json:"nodeInx"`
NtasksPerCore uint32 `json:"ntasksPerCore"`
NtasksPerNode uint32 `json:"ntasksPerNode"`
NtasksPerSocket uint32 `json:"ntasksPerSocket"`
NtasksPerBoard uint32 `json:"ntasksPerBoard"`
NumNodes uint32 `json:"numNodes"`
NumCpus uint32 `json:"numCpus"` //ProcNumUsed in shuguang
Partition string `json:"partition"` //Queue in shuguang
PnMinMemory uint32 `json:"pnMinMemory"`
PnMinCpus uint32 `json:"pnMinCpus"`
PnMinTmpDisk uint32 `json:"pnMinTmpDisk"`
PreSusTime int64 `json:"preSusTime"`
Priority uint32 `json:"priority"`
Profile uint32 `json:"profile"`
Qos string `json:"qos"`
ReqNodes string `json:"reqNodes"`
ReqNodeInx int32 `json:"reqNodeInx"`
ReqSwitch uint32 `json:"reqSwitch"`
Requeue uint32 `json:"requeue"`
ResizeTime int64 `json:"resizeTime"`
RestartCnt uint32 `json:"restartCnt"`
ResvName string `json:"resvName"`
Shared uint32 `json:"shared"`
ShowFlags uint32 `json:"showFlags"`
StartTime int64 `json:"startTime"` //JobStartTime in shuguang
StateDesc string `json:"stateDesc"`
StateReason uint32 `json:"stateReason"`
SubmitTime int64 `json:"submitTime"`
SuspendTime int64 `json:"suspendTime"`
TimeLimit uint32 `json:"timeLimit"`
TimeMin uint32 `json:"timeMin"`
UserId uint32 `json:"userId"` //User in shuguang
PreemptTime int64 `json:"preemptTime"`
Wait4Switch uint32 `json:"wait4Switch"`
Wckey string `json:"wckey"`
WorkDir string `json:"workDir"` //WorkDir in shuguang
JobRunTime string `json:"jobRunTime"`
JobmanagerId string `json:"jobmanagerId"`
JobmanagerName string `json:"jobmanagerName"`
JobmanagerType string `json:"jobmanagerType"`
ErrorPath string `json:"errorPath"`
OutputPath string `json:"outputPath"`
Reason string `json:"reason"`
AppType string `json:"appType"`
}
type DomainSummary struct {
DomainCount int32 `json:"domainCount"`
SoftStackCount int32 `json:"softStackCount"`
type ListJobReq struct {
}
type ListJobResp struct {
Code int32 `json:"code"`
Msg string `json:"msg"`
RecordCount int32 `json:"recordCount"`
Jobs []Job `json:"jobs"`
}
type HistoryJob struct {
@ -66,17 +148,17 @@ type HistoryJob struct {
}
type ListHistoryJobReq struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
TimeType string `json:"time_type"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
TimeType string `json:"timeType"`
Start int32 `json:"start"`
Limit int32 `json:"limit"`
IsQueryByQueueTime int32 `json:"is_query_by_queue_time"`
IsQueryByQueueTime int32 `json:"isQueryByQueueTime"`
}
type ListHistoryJobResp struct {
Code int32 `json:"code"`
Msg string `json:"msg"`
RecordCount int32 `json:"record_count"`
HistoryJobs []HistoryJob `json:"history_jobs"`
RecordCount int32 `json:"recordCount"`
HistoryJobs []HistoryJob `json:"historyJobs"`
}

View File

@ -7,18 +7,104 @@ info(
email: "450705171@qq.com"
)
type Domain {
DomainName string `json:"domainName"`
SoftStack string `json:"softStack"`
SlurmNum int32 `json:"slurmNum"`
InterfaceCount int32 `json:"interfaceCount"`
RunningJobs int32 `json:"runningJobs"`
type Job {
SlurmVersion string `json:"slurmVersion"`
Account string `json:"account"`
AllocNode string `json:"allocNode"`
AllocSid uint32 `json:"allocSid"`
ArrayJobId uint32 `json:"arrayJobId"`
ArrayTaskId uint32 `json:"arrayTaskId"`
AssocId uint32 `json:"assocId"`
BatchFlag uint32 `json:"batchFlag"`
BatchHost string `json:"batchHost"`
BatchScript string `json:"batchScript"`
Command string `json:"command"`
Comment string `json:"comment"`
Contiguous uint32 `json:"contiguous"`
CpusPerTask uint32 `json:"cpusPerTask"`
Dependency string `json:"dependency"`
DerivedEc uint32 `json:"derivedEc"`
EligibleTime int64 `json:"eligibleTime"`
EndTime int64 `json:"endTime"`
ExcNodes string `json:"excNodes"` //NodeUsed in shuguang
ExcNodeInx int32 `json:"excNodeInx"`
ExitCode uint32 `json:"exitCode"`
Features string `json:"features"`
Gres string `json:"gres"`
GroupId uint32 `json:"groupId"`
JobId uint32 `json:"jobId"` //JobId in shuguang
JobState uint32 `json:"jobState"` //JobStatus in shuguang
Licenses string `json:"licenses"`
MaxCpus uint32 `json:"maxCpus"`
MaxNodes uint32 `json:"maxNodes"`
BoardsPerNode uint32 `json:"boardsPerNode"`
SocketsPerBoard uint32 `json:"socketsPerBoard"`
SocketsPerNode uint32 `json:"socketsPerNode"`
CoresPerSocket uint32 `json:"coresPerSocket"`
ThreadsPerCore uint32 `json:"threadsPerCore"`
Name string `json:"name"` //JobName in shuguang
Network string `json:"network"`
Nodes string `json:"nodes"`
Nice uint32 `json:"nice"`
NodeInx int32 `json:"nodeInx"`
NtasksPerCore uint32 `json:"ntasksPerCore"`
NtasksPerNode uint32 `json:"ntasksPerNode"`
NtasksPerSocket uint32 `json:"ntasksPerSocket"`
NtasksPerBoard uint32 `json:"ntasksPerBoard"`
NumNodes uint32 `json:"numNodes"`
NumCpus uint32 `json:"numCpus"` //ProcNumUsed in shuguang
Partition string `json:"partition"` //Queue in shuguang
PnMinMemory uint32 `json:"pnMinMemory"`
PnMinCpus uint32 `json:"pnMinCpus"`
PnMinTmpDisk uint32 `json:"pnMinTmpDisk"`
PreSusTime int64 `json:"preSusTime"`
Priority uint32 `json:"priority"`
Profile uint32 `json:"profile"`
Qos string `json:"qos"`
ReqNodes string `json:"reqNodes"`
ReqNodeInx int32 `json:"reqNodeInx"`
ReqSwitch uint32 `json:"reqSwitch"`
Requeue uint32 `json:"requeue"`
ResizeTime int64 `json:"resizeTime"`
RestartCnt uint32 `json:"restartCnt"`
ResvName string `json:"resvName"`
Shared uint32 `json:"shared"`
ShowFlags uint32 `json:"showFlags"`
StartTime int64 `json:"startTime"` //JobStartTime in shuguang
StateDesc string `json:"stateDesc"`
StateReason uint32 `json:"stateReason"`
SubmitTime int64 `json:"submitTime"`
SuspendTime int64 `json:"suspendTime"`
TimeLimit uint32 `json:"timeLimit"`
TimeMin uint32 `json:"timeMin"`
UserId uint32 `json:"userId"` //User in shuguang
PreemptTime int64 `json:"preemptTime"`
Wait4Switch uint32 `json:"wait4Switch"`
Wckey string `json:"wckey"`
WorkDir string `json:"workDir"` //WorkDir in shuguang
/****shuguang****/
JobRunTime string `json:"jobRunTime"`
JobmanagerId string `json:"jobmanagerId"`
JobmanagerName string `json:"jobmanagerName"`
JobmanagerType string `json:"jobmanagerType"`
ErrorPath string `json:"errorPath"`
OutputPath string `json:"outputPath"`
Reason string `json:"reason"`
AppType string `json:"appType"`
/****shuguang****/
}
type DomainSummary {
DomainCount int32 `json:"domainCount"`
SoftStackCount int32 `json:"softStackCount"`
}
type (
listJobReq {
}
listJobResp {
Code int32 `json:"code"`
Msg string `json:"msg"`
RecordCount int32 `json:"recordCount"`
Jobs []Job `json:"jobs"`
}
)
type HistoryJob {
SlurmVersion string `json:"slurmVersion"`
@ -75,22 +161,26 @@ type HistoryJob {
type (
listHistoryJobReq {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
TimeType string `json:"time_type"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
TimeType string `json:"timeType"`
Start int32 `json:"start"`
Limit int32 `json:"limit"`
IsQueryByQueueTime int32 `json:"is_query_by_queue_time"`
IsQueryByQueueTime int32 `json:"isQueryByQueueTime"`
}
listHistoryJobResp {
Code int32 `json:"code"`
Msg string `json:"msg"`
RecordCount int32 `json:"record_count"`
HistoryJobs []HistoryJob `json:"history_jobs"`
RecordCount int32 `json:"recordCount"`
HistoryJobs []HistoryJob `json:"historyJobs"`
}
)
service slurmcore-api {
@handler listJobHandler
get /listJob (listJobReq) returns (listJobResp)
@handler listHistoryJobHandler
get /listHistoryJob (listHistoryJobReq) returns (listHistoryJobResp)
}

View File

@ -12,7 +12,7 @@ import (
"github.com/zeromicro/go-zero/rest"
)
var configFile = flag.String("f", "etc/slurmcore-api.yaml", "the config file")
var configFile = flag.String("f", "adaptor/slurm/slurmCore/api/etc/slurmcore-api.yaml", "the config file")
func main() {
flag.Parse()

View File

@ -0,0 +1,132 @@
package logic
import (
"PCM/adaptor/slurm/slurmShuguang/rpc/internal/util"
"context"
"github.com/bitly/go-simplejson"
"io"
"log"
"net/http"
"net/url"
"strconv"
"time"
"PCM/adaptor/slurm/slurmShuguang/rpc/internal/svc"
"PCM/adaptor/slurm/slurmShuguang/rpc/slurmShuguang"
"github.com/zeromicro/go-zero/core/logx"
)
type ListJobLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewListJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListJobLogic {
return &ListJobLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// ListJob list all jobs
func (l *ListJobLogic) ListJob(in *slurmShuguang.ListJobReq) (*slurmShuguang.ListJobResp, error) {
var resp slurmShuguang.ListJobResp
jobUrl := "hpc/openapi/v2/jobs?"
ClusterId := util.GetClusterId()
Gtoken := util.GetToken()
c := http.Client{Timeout: time.Duration(3) * time.Second}
params := url.Values{}
params.Add("strClusterIDList", strconv.FormatInt(int64(ClusterId), 10))
reqUrl, err := http.NewRequest("GET", "https://api01.hpccube.com:65106/"+jobUrl+params.Encode(), nil)
if err != nil {
log.Fatal(err)
}
var token string
if util.GetTokenState(Gtoken) {
token = Gtoken
} else {
token = util.GetToken()
Gtoken = token
}
reqUrl.Header.Add("token", token)
respUrl, err := c.Do(reqUrl)
if err != nil {
log.Fatal(err)
}
body, err := io.ReadAll(respUrl.Body)
jsonResult, err := simplejson.NewJson(body)
jsonData := jsonResult.Get("data")
if jsonData.Get("total").MustInt() == 0 {
resp.Code = uint32(200)
resp.Msg = "success"
resp.RecordCount = 0
return &resp, nil
}
jobList := jsonResult.Get("data").Get("list")
rows, err := jobList.Array()
if err != nil {
log.Fatal(err)
}
defer func(Body io.ReadCloser) {
err := Body.Close()
if err != nil {
}
}(respUrl.Body)
var Jobs []*slurmShuguang.Job
for index := range rows {
jobShuguang := jobList.GetIndex(index)
var job slurmShuguang.Job
job.AppType = jobShuguang.Get("appType").MustString()
job.ErrorPath = jobShuguang.Get("errorPath").MustString()
job.JobId = jobShuguang.Get("jobId").MustString()
job.JobName = jobShuguang.Get("jobName").MustString()
job.JobRunTime = jobShuguang.Get("jobRunTime").MustString()
job.JobStartTime = jobShuguang.Get("jobStartTime").MustString()
job.JobStatus = jobShuguang.Get("jobState").MustString()
job.JobManagerId = jobShuguang.Get("jobmanagerId").MustString()
job.JobManagerName = jobShuguang.Get("jobmanagerName").MustString()
job.JobManagerType = jobShuguang.Get("jobmanagerType").MustString()
job.NodeUsed = jobShuguang.Get("nodeUsed").MustString()
job.OutputPath = jobShuguang.Get("outputPath").MustString()
job.ProcNumUsed = int32(jobShuguang.Get("procNumUsed").MustInt64())
job.Queue = jobShuguang.Get("queue").MustString()
job.Reason = jobShuguang.Get("reason").MustString()
job.User = jobShuguang.Get("user").MustString()
job.WorkDir = jobShuguang.Get("workDir").MustString()
startTime, err := time.Parse(l.svcCtx.Config.ShuguangConf.Layout, jobShuguang.Get("jobStartTime").MustString())
if err == nil {
job.JobStartTime = startTime.String()
}
Jobs = append(Jobs, &job)
}
if jsonResult.Get("code").MustInt() == 0 {
resp.Code = uint32(200)
}
resp.Msg = jsonResult.Get("msg").MustString()
resp.RecordCount = uint32(jsonData.Get("total").MustInt())
resp.Jobs = Jobs
return &resp, nil
}

View File

@ -22,7 +22,13 @@ func NewSlurmShuguangServer(svcCtx *svc.ServiceContext) *SlurmShuguangServer {
}
}
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
func (s *SlurmShuguangServer) ListJob(ctx context.Context, in *slurmShuguang.ListJobReq) (*slurmShuguang.ListJobResp, error) {
l := logic.NewListJobLogic(ctx, s.svcCtx)
return l.ListJob(in)
}
// ListHistoryJob list all history jobs
func (s *SlurmShuguangServer) ListHistoryJob(ctx context.Context, in *slurmShuguang.ListHistoryJobReq) (*slurmShuguang.ListHistoryJobResp, error) {
l := logic.NewListHistoryJobLogic(ctx, s.svcCtx)
return l.ListHistoryJob(in)

View File

@ -69,10 +69,10 @@ type dataToken struct {
Token string `json:"token"`
}
var configFile = flag.String("flll", "etc/slurmshuguang.yaml", "the config file")
var configFile = flag.String("flll", "adaptor/slurm/slurmShuguang/rpc/etc/slurmshuguang.yaml", "the config file")
func GetClusterId() int {
httpClient := http.Client{Timeout: time.Duration(3) * time.Second}
httpClient := http.Client{Timeout: time.Duration(5) * time.Second}
var cf config.Config
conf.MustLoad(*configFile, &cf)
ctx := svc.NewServiceContext(cf)
@ -118,7 +118,7 @@ func GetClusterId() int {
}
func GetToken() string {
httpClient := http.Client{Timeout: time.Duration(3) * time.Second}
httpClient := http.Client{Timeout: time.Duration(5) * time.Second}
var cf config.Config
conf.MustLoad(*configFile, &cf)
ctx := svc.NewServiceContext(cf)
@ -158,7 +158,7 @@ func GetToken() string {
}
func GetTokenState(token string) bool {
httpClient := http.Client{Timeout: time.Duration(3) * time.Second}
httpClient := http.Client{Timeout: time.Duration(5) * time.Second}
var cf config.Config
conf.MustLoad(*configFile, &cf)
ctx := svc.NewServiceContext(cf)

View File

@ -4,7 +4,41 @@ package slurmShuguang;
option go_package = "/slurmShuguang";
/******************Job(DB) Start*************************/
/******************Job Start*************************/
message job{
string job_id = 1; // @gotags: copier:"JobId"
string job_name = 2; // @gotags: copier:"Name"
string job_status = 3; // @gotags: copier:"JobState"
string queue = 4; // @gotags: copier:"Partition"
string user = 5; // @gotags: copier:"UserId"
string node_used = 6; // @gotags: copier:"ExcNodes"
int32 proc_num_used = 7; // @gotags: copier:"NumCpus"
string job_start_time = 8; // @gotags: copier:"StartTime"
string job_run_time = 9; // @gotags: copier:"JobRunTime"
string job_manager_id = 10; // @gotags: copier:"JobmanagerId"
string job_manager_name = 11; // @gotags: copier:"JobmanagerName"
string job_manager_type = 12; // @gotags: copier:"JobmanagerType"
string error_path = 13; // @gotags: copier:"ErrorPath"
string output_path = 14; // @gotags: copier:"OutputPath"
string work_dir = 15; // @gotags: copier:"WorkDir"
string reason = 16; // @gotags: copier:"Reason"
string app_type = 17; // @gotags: copier:"AppType"
}
message ListJobReq{
}
message ListJobResp{
uint32 code = 1; // @gotags: copier:"Code"
string msg = 2; // @gotags: copier:"Msg"
uint32 record_count = 3; // @gotags: copier:"RecordCount"
repeated job jobs = 4; // @gotags: copier:"Jobs"
}
/******************Job End*************************/
/******************History Job Start*************************/
message historyJob{
string acct_time = 1; // @gotags: copier:"AcctTime"
string app_type = 2; // @gotags: copier:"AppType"
@ -39,13 +73,16 @@ message ListHistoryJobResp{
uint32 record_count = 3; // @gotags: copier:"RecordCount"
repeated historyJob history_jobs = 4; // @gotags: copier:"HistoryJobs"
}
/******************Job(DB) End*************************/
/******************History Job End*************************/
// Slurm Services for Shuguang Branch
service SlurmShuguang {
//ListHistoryJob list all jobs from slurmdb
//ListJob list all jobs
rpc ListJob(ListJobReq) returns (ListJobResp);
//ListHistoryJob list all history jobs
rpc ListHistoryJob(ListHistoryJobReq) returns (ListHistoryJobResp);
}

View File

@ -20,34 +20,319 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// *****************Job(DB) Start************************
// *****************Job Start************************
type Job struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
JobId string `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // @gotags: copier:"JobId"
JobName string `protobuf:"bytes,2,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` // @gotags: copier:"Name"
JobStatus string `protobuf:"bytes,3,opt,name=job_status,json=jobStatus,proto3" json:"job_status,omitempty"` // @gotags: copier:"JobState"
Queue string `protobuf:"bytes,4,opt,name=queue,proto3" json:"queue,omitempty"` // @gotags: copier:"Partition"
User string `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"` // @gotags: copier:"UserId"
NodeUsed string `protobuf:"bytes,6,opt,name=node_used,json=nodeUsed,proto3" json:"node_used,omitempty"` // @gotags: copier:"ExcNodes"
ProcNumUsed int32 `protobuf:"varint,7,opt,name=proc_num_used,json=procNumUsed,proto3" json:"proc_num_used,omitempty"` // @gotags: copier:"NumCpus"
JobStartTime string `protobuf:"bytes,8,opt,name=job_start_time,json=jobStartTime,proto3" json:"job_start_time,omitempty"` // @gotags: copier:"StartTime"
JobRunTime string `protobuf:"bytes,9,opt,name=job_run_time,json=jobRunTime,proto3" json:"job_run_time,omitempty"` // @gotags: copier:"JobRunTime"
JobManagerId string `protobuf:"bytes,10,opt,name=job_manager_id,json=jobManagerId,proto3" json:"job_manager_id,omitempty"` // @gotags: copier:"JobmanagerId"
JobManagerName string `protobuf:"bytes,11,opt,name=job_manager_name,json=jobManagerName,proto3" json:"job_manager_name,omitempty"` // @gotags: copier:"JobmanagerName"
JobManagerType string `protobuf:"bytes,12,opt,name=job_manager_type,json=jobManagerType,proto3" json:"job_manager_type,omitempty"` // @gotags: copier:"JobmanagerType"
ErrorPath string `protobuf:"bytes,13,opt,name=error_path,json=errorPath,proto3" json:"error_path,omitempty"` // @gotags: copier:"ErrorPath"
OutputPath string `protobuf:"bytes,14,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"` // @gotags: copier:"OutputPath"
WorkDir string `protobuf:"bytes,15,opt,name=work_dir,json=workDir,proto3" json:"work_dir,omitempty"` // @gotags: copier:"WorkDir"
Reason string `protobuf:"bytes,16,opt,name=reason,proto3" json:"reason,omitempty"` // @gotags: copier:"Reason"
AppType string `protobuf:"bytes,17,opt,name=app_type,json=appType,proto3" json:"app_type,omitempty"` // @gotags: copier:"AppType"
}
func (x *Job) Reset() {
*x = Job{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Job) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Job) ProtoMessage() {}
func (x *Job) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Job.ProtoReflect.Descriptor instead.
func (*Job) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{0}
}
func (x *Job) GetJobId() string {
if x != nil {
return x.JobId
}
return ""
}
func (x *Job) GetJobName() string {
if x != nil {
return x.JobName
}
return ""
}
func (x *Job) GetJobStatus() string {
if x != nil {
return x.JobStatus
}
return ""
}
func (x *Job) GetQueue() string {
if x != nil {
return x.Queue
}
return ""
}
func (x *Job) GetUser() string {
if x != nil {
return x.User
}
return ""
}
func (x *Job) GetNodeUsed() string {
if x != nil {
return x.NodeUsed
}
return ""
}
func (x *Job) GetProcNumUsed() int32 {
if x != nil {
return x.ProcNumUsed
}
return 0
}
func (x *Job) GetJobStartTime() string {
if x != nil {
return x.JobStartTime
}
return ""
}
func (x *Job) GetJobRunTime() string {
if x != nil {
return x.JobRunTime
}
return ""
}
func (x *Job) GetJobManagerId() string {
if x != nil {
return x.JobManagerId
}
return ""
}
func (x *Job) GetJobManagerName() string {
if x != nil {
return x.JobManagerName
}
return ""
}
func (x *Job) GetJobManagerType() string {
if x != nil {
return x.JobManagerType
}
return ""
}
func (x *Job) GetErrorPath() string {
if x != nil {
return x.ErrorPath
}
return ""
}
func (x *Job) GetOutputPath() string {
if x != nil {
return x.OutputPath
}
return ""
}
func (x *Job) GetWorkDir() string {
if x != nil {
return x.WorkDir
}
return ""
}
func (x *Job) GetReason() string {
if x != nil {
return x.Reason
}
return ""
}
func (x *Job) GetAppType() string {
if x != nil {
return x.AppType
}
return ""
}
type ListJobReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ListJobReq) Reset() {
*x = ListJobReq{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListJobReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListJobReq) ProtoMessage() {}
func (x *ListJobReq) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListJobReq.ProtoReflect.Descriptor instead.
func (*ListJobReq) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{1}
}
type ListJobResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // @gotags: copier:"Code"
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // @gotags: copier:"Msg"
RecordCount uint32 `protobuf:"varint,3,opt,name=record_count,json=recordCount,proto3" json:"record_count,omitempty"` // @gotags: copier:"RecordCount"
Jobs []*Job `protobuf:"bytes,4,rep,name=jobs,proto3" json:"jobs,omitempty"` // @gotags: copier:"Jobs"
}
func (x *ListJobResp) Reset() {
*x = ListJobResp{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListJobResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListJobResp) ProtoMessage() {}
func (x *ListJobResp) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListJobResp.ProtoReflect.Descriptor instead.
func (*ListJobResp) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{2}
}
func (x *ListJobResp) GetCode() uint32 {
if x != nil {
return x.Code
}
return 0
}
func (x *ListJobResp) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
func (x *ListJobResp) GetRecordCount() uint32 {
if x != nil {
return x.RecordCount
}
return 0
}
func (x *ListJobResp) GetJobs() []*Job {
if x != nil {
return x.Jobs
}
return nil
}
// *****************History Job Start************************
type HistoryJob struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AcctTime string `protobuf:"bytes,1,opt,name=acct_time,json=acctTime,proto3" json:"acct_time,omitempty" copier:"AcctTime"` // @gotags: copier:"AcctTime"
AppType string `protobuf:"bytes,2,opt,name=app_type,json=appType,proto3" json:"app_type,omitempty" copier:"AppType"` // @gotags: copier:"AppType"
JobEndTime string `protobuf:"bytes,3,opt,name=job_end_time,json=jobEndTime,proto3" json:"job_end_time,omitempty" copier:"End"` // @gotags: copier:"End"
JobExecHost string `protobuf:"bytes,4,opt,name=job_exec_host,json=jobExecHost,proto3" json:"job_exec_host,omitempty" copier:"Nodes"` // @gotags: copier:"Nodes"
JobExitStatus int32 `protobuf:"varint,5,opt,name=job_exit_status,json=jobExitStatus,proto3" json:"job_exit_status,omitempty" copier:"ExitCode"` // @gotags: copier:"ExitCode"
JobId int64 `protobuf:"varint,6,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty" copier:"JobId"` // @gotags: copier:"JobId"
JobName string `protobuf:"bytes,7,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty" copier:"JobName"` // @gotags: copier:"JobName"
JobQueueTime string `protobuf:"bytes,8,opt,name=job_queue_time,json=jobQueueTime,proto3" json:"job_queue_time,omitempty" copier:"JobQueueTime"` // @gotags: copier:"JobQueueTime"
JobStartTime string `protobuf:"bytes,9,opt,name=job_start_time,json=jobStartTime,proto3" json:"job_start_time,omitempty" copier:"Start"` // @gotags: copier:"Start"
JobState string `protobuf:"bytes,10,opt,name=job_state,json=jobState,proto3" json:"job_state,omitempty" copier:"State"` // @gotags: copier:"State"
JobWalltimeUsed string `protobuf:"bytes,11,opt,name=job_walltime_used,json=jobWalltimeUsed,proto3" json:"job_walltime_used,omitempty" copier:"JobWalltimeUsed"` // @gotags: copier:"JobWalltimeUsed"
JobManagerId int64 `protobuf:"varint,12,opt,name=job_manager_id,json=jobManagerId,proto3" json:"job_manager_id,omitempty" copier:"JobManagerId"` // @gotags: copier:"JobManagerId"
NodeCt int32 `protobuf:"varint,13,opt,name=node_ct,json=nodeCt,proto3" json:"node_ct,omitempty" copier:"AllocNodes"` // @gotags: copier:"AllocNodes"
Queue string `protobuf:"bytes,14,opt,name=queue,proto3" json:"queue,omitempty" copier:"Partition"` // @gotags: copier:"Partition"
UserName string `protobuf:"bytes,15,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty" copier:"User"` // @gotags: copier:"User"
Workdir string `protobuf:"bytes,16,opt,name=workdir,proto3" json:"workdir,omitempty" copier:"WorkDir"` // @gotags: copier:"WorkDir"
AcctTime string `protobuf:"bytes,1,opt,name=acct_time,json=acctTime,proto3" json:"acct_time,omitempty"` // @gotags: copier:"AcctTime"
AppType string `protobuf:"bytes,2,opt,name=app_type,json=appType,proto3" json:"app_type,omitempty"` // @gotags: copier:"AppType"
JobEndTime string `protobuf:"bytes,3,opt,name=job_end_time,json=jobEndTime,proto3" json:"job_end_time,omitempty"` // @gotags: copier:"End"
JobExecHost string `protobuf:"bytes,4,opt,name=job_exec_host,json=jobExecHost,proto3" json:"job_exec_host,omitempty"` // @gotags: copier:"Nodes"
JobExitStatus int32 `protobuf:"varint,5,opt,name=job_exit_status,json=jobExitStatus,proto3" json:"job_exit_status,omitempty"` // @gotags: copier:"ExitCode"
JobId int64 `protobuf:"varint,6,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` // @gotags: copier:"JobId"
JobName string `protobuf:"bytes,7,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` // @gotags: copier:"JobName"
JobQueueTime string `protobuf:"bytes,8,opt,name=job_queue_time,json=jobQueueTime,proto3" json:"job_queue_time,omitempty"` // @gotags: copier:"JobQueueTime"
JobStartTime string `protobuf:"bytes,9,opt,name=job_start_time,json=jobStartTime,proto3" json:"job_start_time,omitempty"` // @gotags: copier:"Start"
JobState string `protobuf:"bytes,10,opt,name=job_state,json=jobState,proto3" json:"job_state,omitempty"` // @gotags: copier:"State"
JobWalltimeUsed string `protobuf:"bytes,11,opt,name=job_walltime_used,json=jobWalltimeUsed,proto3" json:"job_walltime_used,omitempty"` // @gotags: copier:"JobWalltimeUsed"
JobManagerId int64 `protobuf:"varint,12,opt,name=job_manager_id,json=jobManagerId,proto3" json:"job_manager_id,omitempty"` // @gotags: copier:"JobManagerId"
NodeCt int32 `protobuf:"varint,13,opt,name=node_ct,json=nodeCt,proto3" json:"node_ct,omitempty"` // @gotags: copier:"AllocNodes"
Queue string `protobuf:"bytes,14,opt,name=queue,proto3" json:"queue,omitempty"` // @gotags: copier:"Partition"
UserName string `protobuf:"bytes,15,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` // @gotags: copier:"User"
Workdir string `protobuf:"bytes,16,opt,name=workdir,proto3" json:"workdir,omitempty"` // @gotags: copier:"WorkDir"
}
func (x *HistoryJob) Reset() {
*x = HistoryJob{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[0]
mi := &file_slurmShuguang_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -60,7 +345,7 @@ func (x *HistoryJob) String() string {
func (*HistoryJob) ProtoMessage() {}
func (x *HistoryJob) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[0]
mi := &file_slurmShuguang_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -73,7 +358,7 @@ func (x *HistoryJob) ProtoReflect() protoreflect.Message {
// Deprecated: Use HistoryJob.ProtoReflect.Descriptor instead.
func (*HistoryJob) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{0}
return file_slurmShuguang_proto_rawDescGZIP(), []int{3}
}
func (x *HistoryJob) GetAcctTime() string {
@ -193,18 +478,18 @@ type ListHistoryJobReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
StartTime string `protobuf:"bytes,1,opt,name=startTime,proto3" json:"startTime,omitempty" copier:"StartTime"` // @gotags: copier:"StartTime"
EndTime string `protobuf:"bytes,2,opt,name=endTime,proto3" json:"endTime,omitempty" copier:"EndTime"` // @gotags: copier:"EndTime"
TimeType string `protobuf:"bytes,3,opt,name=timeType,proto3" json:"timeType,omitempty" copier:"TimeType"` // @gotags: copier:"TimeType"
Start int32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty" copier:"Start"` // @gotags: copier:"Start"
Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty" copier:"Limit"` // @gotags: copier:"Limit"
IsQueryByQueueTime int32 `protobuf:"varint,6,opt,name=isQueryByQueueTime,proto3" json:"isQueryByQueueTime,omitempty" copier:"IsQueryByQueueTime"` // @gotags: copier:"IsQueryByQueueTime"
StartTime string `protobuf:"bytes,1,opt,name=startTime,proto3" json:"startTime,omitempty"` // @gotags: copier:"StartTime"
EndTime string `protobuf:"bytes,2,opt,name=endTime,proto3" json:"endTime,omitempty"` // @gotags: copier:"EndTime"
TimeType string `protobuf:"bytes,3,opt,name=timeType,proto3" json:"timeType,omitempty"` // @gotags: copier:"TimeType"
Start int32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` // @gotags: copier:"Start"
Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` // @gotags: copier:"Limit"
IsQueryByQueueTime int32 `protobuf:"varint,6,opt,name=isQueryByQueueTime,proto3" json:"isQueryByQueueTime,omitempty"` // @gotags: copier:"IsQueryByQueueTime"
}
func (x *ListHistoryJobReq) Reset() {
*x = ListHistoryJobReq{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[1]
mi := &file_slurmShuguang_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -217,7 +502,7 @@ func (x *ListHistoryJobReq) String() string {
func (*ListHistoryJobReq) ProtoMessage() {}
func (x *ListHistoryJobReq) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[1]
mi := &file_slurmShuguang_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -230,7 +515,7 @@ func (x *ListHistoryJobReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListHistoryJobReq.ProtoReflect.Descriptor instead.
func (*ListHistoryJobReq) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{1}
return file_slurmShuguang_proto_rawDescGZIP(), []int{4}
}
func (x *ListHistoryJobReq) GetStartTime() string {
@ -280,16 +565,16 @@ type ListHistoryJobResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty" copier:"Code"` // @gotags: copier:"Code"
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty" copier:"Msg"` // @gotags: copier:"Msg"
RecordCount uint32 `protobuf:"varint,3,opt,name=record_count,json=recordCount,proto3" json:"record_count,omitempty" copier:"RecordCount"` // @gotags: copier:"RecordCount"
HistoryJobs []*HistoryJob `protobuf:"bytes,4,rep,name=history_jobs,json=historyJobs,proto3" json:"history_jobs,omitempty" copier:"HistoryJobs"` // @gotags: copier:"HistoryJobs"
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // @gotags: copier:"Code"
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // @gotags: copier:"Msg"
RecordCount uint32 `protobuf:"varint,3,opt,name=record_count,json=recordCount,proto3" json:"record_count,omitempty"` // @gotags: copier:"RecordCount"
HistoryJobs []*HistoryJob `protobuf:"bytes,4,rep,name=history_jobs,json=historyJobs,proto3" json:"history_jobs,omitempty"` // @gotags: copier:"HistoryJobs"
}
func (x *ListHistoryJobResp) Reset() {
*x = ListHistoryJobResp{}
if protoimpl.UnsafeEnabled {
mi := &file_slurmShuguang_proto_msgTypes[2]
mi := &file_slurmShuguang_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -302,7 +587,7 @@ func (x *ListHistoryJobResp) String() string {
func (*ListHistoryJobResp) ProtoMessage() {}
func (x *ListHistoryJobResp) ProtoReflect() protoreflect.Message {
mi := &file_slurmShuguang_proto_msgTypes[2]
mi := &file_slurmShuguang_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -315,7 +600,7 @@ func (x *ListHistoryJobResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListHistoryJobResp.ProtoReflect.Descriptor instead.
func (*ListHistoryJobResp) Descriptor() ([]byte, []int) {
return file_slurmShuguang_proto_rawDescGZIP(), []int{2}
return file_slurmShuguang_proto_rawDescGZIP(), []int{5}
}
func (x *ListHistoryJobResp) GetCode() uint32 {
@ -351,70 +636,116 @@ var File_slurmShuguang_proto protoreflect.FileDescriptor
var file_slurmShuguang_proto_rawDesc = []byte{
0x0a, 0x13, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67,
0x75, 0x61, 0x6e, 0x67, 0x22, 0x85, 0x04, 0x0a, 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x4a, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6a,
0x6f, 0x62, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x6a, 0x6f, 0x62, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a,
0x0d, 0x6a, 0x6f, 0x62, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x6f, 0x62, 0x45, 0x78, 0x65, 0x63, 0x48, 0x6f, 0x73,
0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6a, 0x6f, 0x62, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6a, 0x6f, 0x62, 0x45,
0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62,
0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64,
0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6a,
0x6f, 0x62, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x69, 0x6d,
0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74,
0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x53, 0x74,
0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x62, 0x5f, 0x73,
0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x62, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6a, 0x6f, 0x62, 0x5f, 0x77, 0x61, 0x6c, 0x6c,
0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0f, 0x6a, 0x6f, 0x62, 0x57, 0x61, 0x6c, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x64,
0x75, 0x61, 0x6e, 0x67, 0x22, 0x91, 0x04, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x15, 0x0a, 0x06,
0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f,
0x62, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d,
0x0a, 0x0a, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75,
0x65, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65,
0x55, 0x73, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x63, 0x5f, 0x6e, 0x75, 0x6d,
0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x6f,
0x63, 0x4e, 0x75, 0x6d, 0x55, 0x73, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6a, 0x6f, 0x62, 0x5f,
0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20,
0x0a, 0x0c, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6a, 0x6f, 0x62, 0x52, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x24, 0x0a, 0x0e, 0x6a, 0x6f, 0x62, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x4d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63,
0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x74, 0x12,
0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x64, 0x69, 0x72, 0x18, 0x10, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x64, 0x69, 0x72, 0x22, 0xc3, 0x01, 0x0a,
0x11, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52,
0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69,
0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69,
0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d,
0x69, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x69, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x79, 0x51,
0x75, 0x65, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12,
0x69, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x79, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f,
0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12,
0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6a, 0x6f,
0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d,
0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x4a, 0x6f, 0x62, 0x52, 0x0b, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x73,
0x32, 0x66, 0x0a, 0x0d, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e,
0x67, 0x12, 0x55, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75,
0x61, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a,
0x6f, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75,
0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x42, 0x10, 0x5a, 0x0e, 0x2f, 0x73, 0x6c, 0x75,
0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x4d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x6a, 0x6f, 0x62, 0x5f, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0e, 0x6a, 0x6f, 0x62, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x28, 0x0a, 0x10, 0x6a, 0x6f, 0x62, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f,
0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6a, 0x6f, 0x62, 0x4d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x75, 0x74,
0x70, 0x75, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x6f,
0x72, 0x6b, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x6f,
0x72, 0x6b, 0x44, 0x69, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18,
0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x19, 0x0a,
0x08, 0x61, 0x70, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74,
0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x22, 0x7e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f,
0x62, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26,
0x0a, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73,
0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x6a, 0x6f, 0x62,
0x52, 0x04, 0x6a, 0x6f, 0x62, 0x73, 0x22, 0x85, 0x04, 0x0a, 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f,
0x72, 0x79, 0x4a, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x74, 0x5f, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x63, 0x74, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a,
0x0c, 0x6a, 0x6f, 0x62, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x6a, 0x6f, 0x62, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
0x22, 0x0a, 0x0d, 0x6a, 0x6f, 0x62, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x6f, 0x62, 0x45, 0x78, 0x65, 0x63, 0x48,
0x6f, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6a, 0x6f, 0x62, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6a, 0x6f,
0x62, 0x45, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6a,
0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6a, 0x6f, 0x62,
0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a,
0x0e, 0x6a, 0x6f, 0x62, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54,
0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6a, 0x6f, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74,
0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6a, 0x6f, 0x62,
0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x62,
0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f,
0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6a, 0x6f, 0x62, 0x5f, 0x77, 0x61,
0x6c, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0f, 0x6a, 0x6f, 0x62, 0x57, 0x61, 0x6c, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73,
0x65, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6a, 0x6f, 0x62, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6a, 0x6f, 0x62, 0x4d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65,
0x5f, 0x63, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x43,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x64, 0x69, 0x72, 0x18,
0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x64, 0x69, 0x72, 0x22, 0xc3,
0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f,
0x62, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x74, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x74, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72,
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14,
0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c,
0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x69, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42,
0x79, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05,
0x52, 0x12, 0x69, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x79, 0x51, 0x75, 0x65, 0x75, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73,
0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f,
0x6a, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x75,
0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x68, 0x69, 0x73, 0x74, 0x6f,
0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x0b, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f,
0x62, 0x73, 0x32, 0xa8, 0x01, 0x0a, 0x0d, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67,
0x75, 0x61, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x12,
0x19, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x73, 0x6c, 0x75,
0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4a,
0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69,
0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x12, 0x20, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d,
0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73,
0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x73, 0x6c, 0x75,
0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48,
0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x42, 0x10, 0x5a,
0x0e, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x68, 0x75, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -429,21 +760,27 @@ func file_slurmShuguang_proto_rawDescGZIP() []byte {
return file_slurmShuguang_proto_rawDescData
}
var file_slurmShuguang_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_slurmShuguang_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_slurmShuguang_proto_goTypes = []interface{}{
(*HistoryJob)(nil), // 0: slurmShuguang.historyJob
(*ListHistoryJobReq)(nil), // 1: slurmShuguang.ListHistoryJobReq
(*ListHistoryJobResp)(nil), // 2: slurmShuguang.ListHistoryJobResp
(*Job)(nil), // 0: slurmShuguang.job
(*ListJobReq)(nil), // 1: slurmShuguang.ListJobReq
(*ListJobResp)(nil), // 2: slurmShuguang.ListJobResp
(*HistoryJob)(nil), // 3: slurmShuguang.historyJob
(*ListHistoryJobReq)(nil), // 4: slurmShuguang.ListHistoryJobReq
(*ListHistoryJobResp)(nil), // 5: slurmShuguang.ListHistoryJobResp
}
var file_slurmShuguang_proto_depIdxs = []int32{
0, // 0: slurmShuguang.ListHistoryJobResp.history_jobs:type_name -> slurmShuguang.historyJob
1, // 1: slurmShuguang.SlurmShuguang.ListHistoryJob:input_type -> slurmShuguang.ListHistoryJobReq
2, // 2: slurmShuguang.SlurmShuguang.ListHistoryJob:output_type -> slurmShuguang.ListHistoryJobResp
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
0, // 0: slurmShuguang.ListJobResp.jobs:type_name -> slurmShuguang.job
3, // 1: slurmShuguang.ListHistoryJobResp.history_jobs:type_name -> slurmShuguang.historyJob
1, // 2: slurmShuguang.SlurmShuguang.ListJob:input_type -> slurmShuguang.ListJobReq
4, // 3: slurmShuguang.SlurmShuguang.ListHistoryJob:input_type -> slurmShuguang.ListHistoryJobReq
2, // 4: slurmShuguang.SlurmShuguang.ListJob:output_type -> slurmShuguang.ListJobResp
5, // 5: slurmShuguang.SlurmShuguang.ListHistoryJob:output_type -> slurmShuguang.ListHistoryJobResp
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_slurmShuguang_proto_init() }
@ -453,7 +790,7 @@ func file_slurmShuguang_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_slurmShuguang_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HistoryJob); i {
switch v := v.(*Job); i {
case 0:
return &v.state
case 1:
@ -465,7 +802,7 @@ func file_slurmShuguang_proto_init() {
}
}
file_slurmShuguang_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListHistoryJobReq); i {
switch v := v.(*ListJobReq); i {
case 0:
return &v.state
case 1:
@ -477,6 +814,42 @@ func file_slurmShuguang_proto_init() {
}
}
file_slurmShuguang_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListJobResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_slurmShuguang_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HistoryJob); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_slurmShuguang_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListHistoryJobReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_slurmShuguang_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListHistoryJobResp); i {
case 0:
return &v.state
@ -495,7 +868,7 @@ func file_slurmShuguang_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_slurmShuguang_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -22,7 +22,9 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SlurmShuguangClient interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
}
@ -34,6 +36,15 @@ func NewSlurmShuguangClient(cc grpc.ClientConnInterface) SlurmShuguangClient {
return &slurmShuguangClient{cc}
}
func (c *slurmShuguangClient) ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error) {
out := new(ListJobResp)
err := c.cc.Invoke(ctx, "/slurmShuguang.SlurmShuguang/ListJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *slurmShuguangClient) ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error) {
out := new(ListHistoryJobResp)
err := c.cc.Invoke(ctx, "/slurmShuguang.SlurmShuguang/ListHistoryJob", in, out, opts...)
@ -47,7 +58,9 @@ func (c *slurmShuguangClient) ListHistoryJob(ctx context.Context, in *ListHistor
// All implementations must embed UnimplementedSlurmShuguangServer
// for forward compatibility
type SlurmShuguangServer interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(context.Context, *ListJobReq) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error)
mustEmbedUnimplementedSlurmShuguangServer()
}
@ -56,6 +69,9 @@ type SlurmShuguangServer interface {
type UnimplementedSlurmShuguangServer struct {
}
func (UnimplementedSlurmShuguangServer) ListJob(context.Context, *ListJobReq) (*ListJobResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListJob not implemented")
}
func (UnimplementedSlurmShuguangServer) ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListHistoryJob not implemented")
}
@ -72,6 +88,24 @@ func RegisterSlurmShuguangServer(s grpc.ServiceRegistrar, srv SlurmShuguangServe
s.RegisterService(&SlurmShuguang_ServiceDesc, srv)
}
func _SlurmShuguang_ListJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListJobReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SlurmShuguangServer).ListJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/slurmShuguang.SlurmShuguang/ListJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SlurmShuguangServer).ListJob(ctx, req.(*ListJobReq))
}
return interceptor(ctx, in, info, handler)
}
func _SlurmShuguang_ListHistoryJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListHistoryJobReq)
if err := dec(in); err != nil {
@ -97,6 +131,10 @@ var SlurmShuguang_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slurmShuguang.SlurmShuguang",
HandlerType: (*SlurmShuguangServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListJob",
Handler: _SlurmShuguang_ListJob_Handler,
},
{
MethodName: "ListHistoryJob",
Handler: _SlurmShuguang_ListHistoryJob_Handler,

View File

@ -16,7 +16,7 @@ import (
"google.golang.org/grpc/reflection"
)
var configFile = flag.String("f", "etc/slurmshuguang.yaml", "the config file")
var configFile = flag.String("f", "adaptor/slurm/slurmShuguang/rpc/etc/slurmshuguang.yaml", "the config file")
func main() {
flag.Parse()

View File

@ -14,11 +14,16 @@ import (
type (
HistoryJob = slurmShuguang.HistoryJob
Job = slurmShuguang.Job
ListHistoryJobReq = slurmShuguang.ListHistoryJobReq
ListHistoryJobResp = slurmShuguang.ListHistoryJobResp
ListJobReq = slurmShuguang.ListJobReq
ListJobResp = slurmShuguang.ListJobResp
SlurmShuguang interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
}
@ -33,7 +38,13 @@ func NewSlurmShuguang(cli zrpc.Client) SlurmShuguang {
}
}
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
func (m *defaultSlurmShuguang) ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error) {
client := slurmShuguang.NewSlurmShuguangClient(m.cli.Conn())
return client.ListJob(ctx, in, opts...)
}
// ListHistoryJob list all history jobs
func (m *defaultSlurmShuguang) ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error) {
client := slurmShuguang.NewSlurmShuguangClient(m.cli.Conn())
return client.ListHistoryJob(ctx, in, opts...)

View File

@ -0,0 +1,31 @@
package logic
import (
"context"
"PCM/adaptor/slurm/slurmTianhe/rpc/internal/svc"
"PCM/adaptor/slurm/slurmTianhe/rpc/slurmTianhe"
"github.com/zeromicro/go-zero/core/logx"
)
type ListJobLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewListJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListJobLogic {
return &ListJobLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// ListJob list all jobs
func (l *ListJobLogic) ListJob(in *slurmTianhe.ListJobReq) (*slurmTianhe.ListJobResp, error) {
// todo: add your logic here and delete this line
return &slurmTianhe.ListJobResp{}, nil
}

View File

@ -22,7 +22,13 @@ func NewSlurmTianheServer(svcCtx *svc.ServiceContext) *SlurmTianheServer {
}
}
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
func (s *SlurmTianheServer) ListJob(ctx context.Context, in *slurmTianhe.ListJobReq) (*slurmTianhe.ListJobResp, error) {
l := logic.NewListJobLogic(ctx, s.svcCtx)
return l.ListJob(in)
}
// ListHistoryJob list all history jobs
func (s *SlurmTianheServer) ListHistoryJob(ctx context.Context, in *slurmTianhe.ListHistoryJobReq) (*slurmTianhe.ListHistoryJobResp, error) {
l := logic.NewListHistoryJobLogic(ctx, s.svcCtx)
return l.ListHistoryJob(in)

View File

@ -3,8 +3,96 @@ syntax = "proto3";
package slurmTianhe;
option go_package = "/slurmTianhe";
/******************Job Start*************************/
message job{
string account = 1; // @gotags: copier:"Account"
string alloc_node = 2; // @gotags: copier:"AllocNode"
uint32 alloc_sid = 3; // @gotags: copier:"AllocSid"
uint32 array_job_id = 4; // @gotags: copier:"ArrayJobId"
uint32 array_task_id = 5; // @gotags: copier:"ArrayTaskId"
uint32 assoc_id = 6; // @gotags: copier:"AssocId"
uint32 batch_flag = 7; // @gotags: copier:"BatchFlag"
string batch_host = 8; // @gotags: copier:"BatchHost"
string batch_script = 9; // @gotags: copier:"BatchScript"
string command = 10; // @gotags: copier:"Command"
string comment = 11; // @gotags: copier:"Comment"
uint32 contiguous = 12; // @gotags: copier:"Contiguous"
uint32 cpus_per_task = 13; // @gotags: copier:"CpusPerTask"
string dependency = 14; // @gotags: copier:"Dependency"
uint32 derived_ec = 15; // @gotags: copier:"DerivedEc"
int64 eligible_time = 16; // @gotags: copier:"EligibleTime"
int64 end_time = 17; // @gotags: copier:"EndTime"
string exc_nodes = 18; // @gotags: copier:"ExcNodes"
int32 exc_node_inx = 19; // @gotags: copier:"ExcNodeInx"
uint32 exit_code = 20; // @gotags: copier:"ExitCode"
string features = 21; // @gotags: copier:"Features"
string gres = 22; // @gotags: copier:"Gres"
uint32 group_id = 23; // @gotags: copier:"GroupId"
uint32 job_id = 24; // @gotags: copier:"JobId"
uint32 job_state = 25; // @gotags: copier:"JobState"
string licenses = 26; // @gotags: copier:"Licenses"
uint32 max_cpus = 27; // @gotags: copier:"MaxCpus"
uint32 max_nodes = 28; // @gotags: copier:"MaxNodes"
uint32 boards_per_node = 29; // @gotags: copier:"BoardsPerNode"
uint32 sockets_per_board = 30; // @gotags: copier:"SocketsPerBoard"
uint32 sockets_per_node = 31; // @gotags: copier:"SocketsPerNode"
uint32 cores_per_socket = 32; // @gotags: copier:"CoresPerSocket"
uint32 threads_per_core = 33; // @gotags: copier:"ThreadsPerCore"
string name = 34; // @gotags: copier:"Name"
string network = 35; // @gotags: copier:"Network"
string nodes = 36; // @gotags: copier:"Nodes"
uint32 nice = 37; // @gotags: copier:"Nice"
int32 node_inx = 38; // @gotags: copier:"NodeInx"
uint32 ntasks_per_core = 39; // @gotags: copier:"NtasksPerCore"
uint32 ntasks_per_node = 40; // @gotags: copier:"NtasksPerNode"
uint32 ntasks_per_socket = 41; // @gotags: copier:"NtasksPerSocket"
uint32 ntasks_per_board = 42; // @gotags: copier:"NtasksPerBoard"
uint32 num_nodes = 43; // @gotags: copier:"NumNodes"
uint32 num_cpus = 44; // @gotags: copier:"NumCpus"
string partition = 45; // @gotags: copier:"Partition"
uint32 pn_min_memory = 46; // @gotags: copier:"PnMinMemory"
uint32 pn_min_cpus = 47; // @gotags: copier:"PnMinCpus"
uint32 pn_min_tmp_disk = 48; // @gotags: copier:"PnMinTmpDisk"
int64 pre_sus_time = 49; // @gotags: copier:"PreSusTime"
uint32 priority = 50; // @gotags: copier:"Priority"
uint32 profile = 51; // @gotags: copier:"Profile"
string qos = 52; // @gotags: copier:"Qos"
string req_nodes = 53; // @gotags: copier:"ReqNodes"
int32 req_node_inx = 54; // @gotags: copier:"ReqNodeInx"
uint32 req_switch = 55; // @gotags: copier:"ReqSwitch"
uint32 requeue = 56; // @gotags: copier:"Requeue"
int64 resize_time = 57; // @gotags: copier:"ResizeTime"
uint32 restart_cnt = 58; // @gotags: copier:"RestartCnt"
string resv_name = 59; // @gotags: copier:"ResvName"
uint32 shared = 60; // @gotags: copier:"Shared"
uint32 show_flags = 61; // @gotags: copier:"ShowFlags"
int64 start_time = 62; // @gotags: copier:"StartTime"
string state_desc = 63; // @gotags: copier:"StateDesc"
uint32 state_reason = 64; // @gotags: copier:"StateReason"
int64 submit_time = 65; // @gotags: copier:"SubmitTime"
int64 suspend_time = 66; // @gotags: copier:"SuspendTime"
uint32 time_limit = 67; // @gotags: copier:"TimeLimit"
uint32 time_min = 68; // @gotags: copier:"TimeMin"
uint32 user_id = 69; // @gotags: copier:"UserId"
int64 preempt_time = 70; // @gotags: copier:"PreemptTime"
uint32 wait4switch = 71; // @gotags: copier:"Wait4Switch"
string wckey = 72; // @gotags: copier:"Wckey"
string work_dir = 73; // @gotags: copier:"WorkDir"
}
/******************Job(DB) Start*************************/
message ListJobReq{
}
message ListJobResp{
uint32 code = 1; // @gotags: copier:"Code"
string msg = 2; // @gotags: copier:"Msg"
uint32 record_count = 3; // @gotags: copier:"RecordCount"
repeated job jobs = 4; // @gotags: copier:"Jobs"
}
/******************Job End*************************/
/******************History Job Start*************************/
message historyJob{
uint32 alloc_cpu = 1; // @gotags: copier:"AllocCPU"
uint32 alloc_nodes = 2; // @gotags: copier:"AllocNodes"
@ -54,18 +142,21 @@ message ListHistoryJobReq{
message ListHistoryJobResp{
uint32 code = 1; // @gotags: copier:"Code"
string msg = 2; // @gotags: copier:"Msg"
uint32 code = 1; // @gotags: copier:"Code"
string msg = 2; // @gotags: copier:"Msg"
uint32 record_count = 3; // @gotags: copier:"RecordCount"
repeated historyJob history_jobs = 4; // @gotags: copier:"HistoryJobs"
}
/******************Job(DB) End*************************/
/******************History Job End*************************/
// Slurm Services for Shuguang Branch
// Slurm Services for Tianhe Branch
service slurmTianhe {
//ListHistoryJob list all jobs from slurmdb
//ListJob list all jobs
rpc ListJob(ListJobReq) returns (ListJobResp);
//ListHistoryJob list all history jobs
rpc ListHistoryJob(ListHistoryJobReq) returns (ListHistoryJobResp);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.8
// - protoc v3.19.4
// source: slurmTianhe.proto
package slurmTianhe
@ -22,7 +22,9 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SlurmTianheClient interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
}
@ -34,6 +36,15 @@ func NewSlurmTianheClient(cc grpc.ClientConnInterface) SlurmTianheClient {
return &slurmTianheClient{cc}
}
func (c *slurmTianheClient) ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error) {
out := new(ListJobResp)
err := c.cc.Invoke(ctx, "/slurmTianhe.slurmTianhe/ListJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *slurmTianheClient) ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error) {
out := new(ListHistoryJobResp)
err := c.cc.Invoke(ctx, "/slurmTianhe.slurmTianhe/ListHistoryJob", in, out, opts...)
@ -47,7 +58,9 @@ func (c *slurmTianheClient) ListHistoryJob(ctx context.Context, in *ListHistoryJ
// All implementations must embed UnimplementedSlurmTianheServer
// for forward compatibility
type SlurmTianheServer interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(context.Context, *ListJobReq) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error)
mustEmbedUnimplementedSlurmTianheServer()
}
@ -56,6 +69,9 @@ type SlurmTianheServer interface {
type UnimplementedSlurmTianheServer struct {
}
func (UnimplementedSlurmTianheServer) ListJob(context.Context, *ListJobReq) (*ListJobResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListJob not implemented")
}
func (UnimplementedSlurmTianheServer) ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListHistoryJob not implemented")
}
@ -72,6 +88,24 @@ func RegisterSlurmTianheServer(s grpc.ServiceRegistrar, srv SlurmTianheServer) {
s.RegisterService(&SlurmTianhe_ServiceDesc, srv)
}
func _SlurmTianhe_ListJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListJobReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SlurmTianheServer).ListJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/slurmTianhe.slurmTianhe/ListJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SlurmTianheServer).ListJob(ctx, req.(*ListJobReq))
}
return interceptor(ctx, in, info, handler)
}
func _SlurmTianhe_ListHistoryJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListHistoryJobReq)
if err := dec(in); err != nil {
@ -97,6 +131,10 @@ var SlurmTianhe_ServiceDesc = grpc.ServiceDesc{
ServiceName: "slurmTianhe.slurmTianhe",
HandlerType: (*SlurmTianheServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListJob",
Handler: _SlurmTianhe_ListJob_Handler,
},
{
MethodName: "ListHistoryJob",
Handler: _SlurmTianhe_ListHistoryJob_Handler,

View File

@ -16,7 +16,7 @@ import (
"google.golang.org/grpc/reflection"
)
var configFile = flag.String("f", "etc/slurmtianhe.yaml", "the config file")
var configFile = flag.String("f", "adaptor/slurm/slurmTianhe/rpc/etc/slurmtianhe.yaml", "the config file")
func main() {
flag.Parse()

View File

@ -14,11 +14,16 @@ import (
type (
HistoryJob = slurmTianhe.HistoryJob
Job = slurmTianhe.Job
ListHistoryJobReq = slurmTianhe.ListHistoryJobReq
ListHistoryJobResp = slurmTianhe.ListHistoryJobResp
ListJobReq = slurmTianhe.ListJobReq
ListJobResp = slurmTianhe.ListJobResp
SlurmTianhe interface {
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error)
// ListHistoryJob list all history jobs
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
}
@ -33,7 +38,13 @@ func NewSlurmTianhe(cli zrpc.Client) SlurmTianhe {
}
}
// ListHistoryJob list all jobs from slurmdb
// ListJob list all jobs
func (m *defaultSlurmTianhe) ListJob(ctx context.Context, in *ListJobReq, opts ...grpc.CallOption) (*ListJobResp, error) {
client := slurmTianhe.NewSlurmTianheClient(m.cli.Conn())
return client.ListJob(ctx, in, opts...)
}
// ListHistoryJob list all history jobs
func (m *defaultSlurmTianhe) ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error) {
client := slurmTianhe.NewSlurmTianheClient(m.cli.Conn())
return client.ListHistoryJob(ctx, in, opts...)