tianhe rpc
This commit is contained in:
parent
5cec5af3e2
commit
dacda8d981
|
@ -0,0 +1 @@
|
|||
/.idea/
|
|
@ -7,3 +7,9 @@ ShuguangRpcConf:
|
|||
Endpoints:
|
||||
- 127.0.0.1:2001
|
||||
NonBlock: true
|
||||
|
||||
#rpc
|
||||
TianheRpcConf:
|
||||
Endpoints:
|
||||
- 127.0.0.1:2002
|
||||
NonBlock: true
|
|
@ -9,4 +9,5 @@ type Config struct {
|
|||
rest.RestConf
|
||||
|
||||
ShuguangRpcConf zrpc.RpcClientConf
|
||||
TianheRpcConf zrpc.RpcClientConf
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"PCM/app/slurm/slurmShuguang/rpc/slurmShuguang"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmTianhe"
|
||||
"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})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//copier.Copy(shuguangReq, req)
|
||||
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)
|
||||
|
||||
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 = "shuguang"
|
||||
resp.HistoryJobs[i].SlurmVersion = "tianhe"
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
|
|
@ -3,6 +3,7 @@ package svc
|
|||
import (
|
||||
"PCM/app/slurm/slurmCore/api/internal/config"
|
||||
"PCM/app/slurm/slurmShuguang/rpc/slurmshuguangclient"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmtianheclient"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
)
|
||||
|
||||
|
@ -10,6 +11,7 @@ type ServiceContext struct {
|
|||
Config config.Config
|
||||
|
||||
ShuguangRpc slurmshuguangclient.SlurmShuguang
|
||||
TianheRpc slurmtianheclient.SlurmTianhe
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
|
@ -17,5 +19,6 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
|||
Config: c,
|
||||
|
||||
ShuguangRpc: slurmshuguangclient.NewSlurmShuguang(zrpc.MustNewClient(c.ShuguangRpcConf)),
|
||||
TianheRpc: slurmtianheclient.NewSlurmTianhe(zrpc.MustNewClient(c.TianheRpcConf)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
// C:\Users\Administrator\GolandProjects\PCM\app\slurm\slurmShuguang\rpc
|
||||
var configFile = flag.String("f", "C:\\Users\\Administrator\\GolandProjects\\PCM\\app\\slurm\\slurmCore\\api\\etc\\slurmcore-api.yaml", "the config file")
|
||||
var configFile = flag.String("f", "app/slurm/slurmCore/api/etc/slurmcore-api.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Name: slurmtianhe.rpc
|
||||
ListenOn: 0.0.0.0:2002
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package config
|
||||
|
||||
import "github.com/zeromicro/go-zero/zrpc"
|
||||
|
||||
type Config struct {
|
||||
zrpc.RpcServerConf
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
package logic
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -lslurmdb
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <slurm/slurm.h>
|
||||
#include <slurm/slurmdb.h>
|
||||
#include <slurm/slurm_errno.h>
|
||||
#include <memory.h>
|
||||
#include <malloc.h>
|
||||
|
||||
slurmdb_job_rec_t *get_all_slurmdb_job() {
|
||||
|
||||
slurmdb_job_cond_t *job_cond = NULL;
|
||||
void *conn = slurmdb_connection_get();
|
||||
|
||||
List joblist = slurmdb_jobs_get(conn, job_cond);
|
||||
|
||||
uint16_t listsize = slurm_list_count(joblist);
|
||||
//qosinfo.record_count = size;
|
||||
slurmdb_job_rec_t *jobarray = malloc(listsize * sizeof(slurmdb_job_rec_t));
|
||||
|
||||
ListIterator itr = slurm_list_iterator_create(joblist);
|
||||
|
||||
slurmdb_job_rec_t *rec = NULL;
|
||||
int i = 0;
|
||||
while ((rec = slurm_list_next(itr))) {
|
||||
jobarray[i] = *rec;
|
||||
i++;
|
||||
}
|
||||
slurmdb_connection_close(&conn);
|
||||
slurm_list_destroy(joblist);
|
||||
//int arraysize = sizeof(jobarray);
|
||||
//printf("%d\n", arraysize);
|
||||
return jobarray;
|
||||
}
|
||||
|
||||
slurmdb_job_rec_t *job_from_array(slurmdb_job_rec_t *job_rec_array, int i) {
|
||||
return (slurmdb_job_rec_t *) &(job_rec_array[i]);
|
||||
}
|
||||
|
||||
slurmdb_job_rec_t *job_from_array_by_id(slurmdb_job_rec_t *job_rec_array, int job_id) {
|
||||
int i;
|
||||
int arraysize = sizeof(job_rec_array);
|
||||
for (i=0; i<arraysize; i++)
|
||||
{
|
||||
//printf("var: %d : %p : %d \n", var, &(job_rec_array[var]), (job_rec_array[var]).stats.cpu_min);
|
||||
//printf("%d \n",(job_rec_array[i]).stats.cpu_min);
|
||||
//printf("var: %d : %p : %d \n", var, &(job_rec_array[var]), (job_rec_array[var]).jobid);
|
||||
if (job_id==(job_rec_array[i]).jobid)
|
||||
{
|
||||
break;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return (slurmdb_job_rec_t *) &(job_rec_array[i]);
|
||||
|
||||
}
|
||||
int getLength(slurmdb_job_rec_t *job_rec_array) {
|
||||
return sizeof(job_rec_array);
|
||||
}
|
||||
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/svc"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmTianhe"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type ListHistoryJobLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewListHistoryJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListHistoryJobLogic {
|
||||
return &ListHistoryJobLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// ListHistoryJob list all jobs from slurmdb
|
||||
func (l *ListHistoryJobLogic) ListHistoryJob(in *slurmTianhe.ListHistoryJobReq) (*slurmTianhe.ListHistoryJobResp, error) {
|
||||
|
||||
var dbJobResp slurmTianhe.ListHistoryJobResp
|
||||
jobInfos := C.get_all_slurmdb_job()
|
||||
size := uint32(C.getLength(jobInfos))
|
||||
dbJobResp.RecordCount = size
|
||||
for i := uint32(0); i < size; i++ {
|
||||
cJob := C.job_from_array(jobInfos, C.int(i))
|
||||
goJob := SlurmdbJobConvertCToGo(cJob)
|
||||
dbJobResp.HistoryJobs = append(dbJobResp.HistoryJobs, &goJob)
|
||||
}
|
||||
dbJobResp.Code = 200
|
||||
dbJobResp.Msg = "success"
|
||||
|
||||
return &dbJobResp, nil
|
||||
}
|
||||
|
||||
func SlurmdbJobConvertCToGo(cStructJob *C.slurmdb_job_rec_t) slurmTianhe.HistoryJob {
|
||||
var goStruct slurmTianhe.HistoryJob
|
||||
|
||||
goStruct.Account = C.GoString(cStructJob.account)
|
||||
goStruct.Associd = uint32(cStructJob.associd)
|
||||
goStruct.AllocCpu = uint32(cStructJob.alloc_cpus)
|
||||
goStruct.AllocNodes = uint32(cStructJob.alloc_nodes)
|
||||
goStruct.Blockid = C.GoString(cStructJob.blockid)
|
||||
goStruct.Cluster = C.GoString(cStructJob.cluster)
|
||||
goStruct.DerivedEs = C.GoString(cStructJob.derived_es)
|
||||
goStruct.DerivedEc = uint32(cStructJob.derived_ec)
|
||||
goStruct.End = int64(cStructJob.end)
|
||||
goStruct.Elapsed = uint32(cStructJob.elapsed)
|
||||
goStruct.Eligible = int64(cStructJob.eligible)
|
||||
goStruct.Exitcode = uint32(cStructJob.exitcode)
|
||||
goStruct.Gid = uint32(cStructJob.gid)
|
||||
goStruct.Jobid = uint32(cStructJob.jobid)
|
||||
goStruct.Jobname = C.GoString(cStructJob.jobname)
|
||||
goStruct.Lft = uint32(cStructJob.lft)
|
||||
goStruct.Nodes = C.GoString(cStructJob.nodes)
|
||||
goStruct.Priority = uint32(cStructJob.priority)
|
||||
goStruct.Partition = C.GoString(cStructJob.partition)
|
||||
goStruct.Qosid = uint32(cStructJob.qosid)
|
||||
goStruct.Resvid = uint32(cStructJob.resvid)
|
||||
goStruct.Requid = uint32(cStructJob.requid)
|
||||
goStruct.ReqCpus = uint32(cStructJob.req_cpus)
|
||||
goStruct.ReqMem = uint32(cStructJob.req_mem)
|
||||
goStruct.Start = int64(cStructJob.start)
|
||||
goStruct.State = uint32(cStructJob.state)
|
||||
goStruct.SysCpuUsec = uint32(cStructJob.sys_cpu_usec)
|
||||
goStruct.SysCpuSec = uint32(cStructJob.sys_cpu_sec)
|
||||
goStruct.Submit = int64(cStructJob.submit)
|
||||
goStruct.Suspended = uint32(cStructJob.suspended)
|
||||
goStruct.ShowFull = uint32(cStructJob.show_full)
|
||||
|
||||
//var stats_adrs []*pbslurm.SlurmdbStatsT
|
||||
//var stats pbslurm.SlurmdbStatsT
|
||||
//stat.ActCpufreq = float64(c_struct_job.stats.act_cpufreq)
|
||||
//stats.CpuMin = uint32((c_struct_job.stats).cpu_min)
|
||||
//stat.CpuAve = float64(c_struct_job.stats.cpu_ave)
|
||||
//stats_adrs = append(stats_adrs, &stats)
|
||||
//go_struct.Stats = stats
|
||||
|
||||
return goStruct
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Code generated by goctl. DO NOT EDIT.
|
||||
// Source: slurmTianhe.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/logic"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/svc"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmTianhe"
|
||||
)
|
||||
|
||||
type SlurmTianheServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
slurmTianhe.UnimplementedSlurmTianheServer
|
||||
}
|
||||
|
||||
func NewSlurmTianheServer(svcCtx *svc.ServiceContext) *SlurmTianheServer {
|
||||
return &SlurmTianheServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// ListHistoryJob list all jobs from slurmdb
|
||||
func (s *SlurmTianheServer) ListHistoryJob(ctx context.Context, in *slurmTianhe.ListHistoryJobReq) (*slurmTianhe.ListHistoryJobResp, error) {
|
||||
l := logic.NewListHistoryJobLogic(ctx, s.svcCtx)
|
||||
return l.ListHistoryJob(in)
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package svc
|
||||
|
||||
import "PCM/app/slurm/slurmTianhe/rpc/internal/config"
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
}
|
||||
}
|
|
@ -6,22 +6,47 @@ option go_package = "/slurmTianhe";
|
|||
|
||||
/******************Job(DB) Start*************************/
|
||||
message historyJob{
|
||||
string acct_time = 1; // @gotags: copier:"AcctTime"
|
||||
string app_type = 2; // @gotags: copier:"AppType"
|
||||
string job_end_time = 3; // @gotags: copier:"End"
|
||||
string job_exec_host = 4; // @gotags: copier:"Nodes"
|
||||
int32 job_exit_status = 5; // @gotags: copier:"ExitCode"
|
||||
int32 job_id = 6; // @gotags: copier:"JobId"
|
||||
string job_name = 7; // @gotags: copier:"JobName"
|
||||
string job_queue_time = 8; // @gotags: copier:"JobQueueTime"
|
||||
string job_start_time = 9; // @gotags: copier:"Start"
|
||||
string job_state = 10; // @gotags: copier:"State"
|
||||
string job_walltime_used = 11; // @gotags: copier:"JobWalltimeUsed"
|
||||
int32 job_manager_id = 12; // @gotags: copier:"JobManagerId"
|
||||
int32 node_ct = 13; // @gotags: copier:"AllocNodes"
|
||||
string queue = 14; // @gotags: copier:"Partition"
|
||||
string user_name = 15; // @gotags: copier:"User"
|
||||
string workdir = 16; // @gotags: copier:"WorkDir"
|
||||
uint32 alloc_cpu = 1; // @gotags: copier:"AllocCPU"
|
||||
uint32 alloc_nodes = 2; // @gotags: copier:"AllocNodes"
|
||||
string account = 3; // @gotags: copier:"Account"
|
||||
uint32 associd = 4; // @gotags: copier:"AssocId"
|
||||
string blockid = 5; // @gotags: copier:"BlockId"
|
||||
string cluster = 6; // @gotags: copier:"Cluster"
|
||||
uint32 derived_ec = 7; // @gotags: copier:"DerivedEc"
|
||||
string derived_es = 8; // @gotags: copier:"DerivedEs"
|
||||
uint32 elapsed = 9; // @gotags: copier:"Elapsed"
|
||||
int64 eligible = 10;// @gotags: copier:"Eligible"
|
||||
int64 end = 11;// @gotags: copier:"End"
|
||||
uint32 exitcode = 12;// @gotags: copier:"ExitCode"
|
||||
uint32 gid = 13;// @gotags: copier:"Gid"
|
||||
uint32 jobid = 14;// @gotags: copier:"JobId"
|
||||
string jobname = 15;// @gotags: copier:"JobName"
|
||||
uint32 lft = 16;// @gotags: copier:"Lft"
|
||||
string partition = 17;// @gotags: copier:"Partition"
|
||||
string nodes = 18;// @gotags: copier:"Nodes"
|
||||
uint32 priority = 19;// @gotags: copier:"Priority"
|
||||
uint32 qosid = 20;// @gotags: copier:"Qosid"
|
||||
uint32 req_cpus = 21;// @gotags: copier:"ReqCpus"
|
||||
uint32 req_mem = 22;// @gotags: copier:"ReqMem"
|
||||
uint32 requid = 23;// @gotags: copier:"Requid"
|
||||
uint32 resvid = 24;// @gotags: copier:"Resvid"
|
||||
uint32 show_full = 25;// @gotags: copier:"ShowFull"
|
||||
int64 start = 26;// @gotags: copier:"Start"
|
||||
uint32 state = 27;// @gotags: copier:"State"
|
||||
int64 submit = 28;// @gotags: copier:"Submit"
|
||||
uint32 suspended = 29;// @gotags: copier:"Suspended"
|
||||
uint32 sys_cpu_sec = 30;// @gotags: copier:"SysCpuSec"
|
||||
uint32 sys_cpu_usec = 31;// @gotags: copier:"SysCpuUsec"
|
||||
uint32 timelimit = 32;// @gotags: copier:"Timelimit"
|
||||
uint32 tot_cpu_sec = 33;// @gotags: copier:"TotCpuSec"
|
||||
uint32 tot_cpu_usec = 34;// @gotags: copier:"TotCpuUsec"
|
||||
uint32 track_steps = 35;// @gotags: copier:"TrackSteps"
|
||||
uint32 uid = 36;// @gotags: copier:"Uid"
|
||||
string user = 37;// @gotags: copier:"User"
|
||||
uint32 user_cpu_sec = 38;// @gotags: copier:"UserCpuSec"
|
||||
uint32 user_cpu_usec = 39;// @gotags: copier:"UserCpuUsec"
|
||||
string wckey = 40;// @gotags: copier:"Wckey"
|
||||
uint32 wckeyid = 41;// @gotags: copier:"Wckeyid"
|
||||
}
|
||||
|
||||
message ListHistoryJobReq{
|
||||
|
|
|
@ -0,0 +1,685 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.8
|
||||
// source: slurmTianhe.proto
|
||||
|
||||
package slurmTianhe
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// *****************Job(DB) Start************************
|
||||
type HistoryJob struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AllocCpu uint32 `protobuf:"varint,1,opt,name=alloc_cpu,json=allocCpu,proto3" json:"alloc_cpu,omitempty"` // @gotags: copier:"AllocCPU"
|
||||
AllocNodes uint32 `protobuf:"varint,2,opt,name=alloc_nodes,json=allocNodes,proto3" json:"alloc_nodes,omitempty"` // @gotags: copier:"AllocNodes"
|
||||
Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` // @gotags: copier:"Account"
|
||||
Associd uint32 `protobuf:"varint,4,opt,name=associd,proto3" json:"associd,omitempty"` // @gotags: copier:"AssocId"
|
||||
Blockid string `protobuf:"bytes,5,opt,name=blockid,proto3" json:"blockid,omitempty"` // @gotags: copier:"BlockId"
|
||||
Cluster string `protobuf:"bytes,6,opt,name=cluster,proto3" json:"cluster,omitempty"` // @gotags: copier:"Cluster"
|
||||
DerivedEc uint32 `protobuf:"varint,7,opt,name=derived_ec,json=derivedEc,proto3" json:"derived_ec,omitempty"` // @gotags: copier:"DerivedEc"
|
||||
DerivedEs string `protobuf:"bytes,8,opt,name=derived_es,json=derivedEs,proto3" json:"derived_es,omitempty"` // @gotags: copier:"DerivedEs"
|
||||
Elapsed uint32 `protobuf:"varint,9,opt,name=elapsed,proto3" json:"elapsed,omitempty"` // @gotags: copier:"Elapsed"
|
||||
Eligible int64 `protobuf:"varint,10,opt,name=eligible,proto3" json:"eligible,omitempty"` // @gotags: copier:"Eligible"
|
||||
End int64 `protobuf:"varint,11,opt,name=end,proto3" json:"end,omitempty"` // @gotags: copier:"End"
|
||||
Exitcode uint32 `protobuf:"varint,12,opt,name=exitcode,proto3" json:"exitcode,omitempty"` // @gotags: copier:"ExitCode"
|
||||
Gid uint32 `protobuf:"varint,13,opt,name=gid,proto3" json:"gid,omitempty"` // @gotags: copier:"Gid"
|
||||
Jobid uint32 `protobuf:"varint,14,opt,name=jobid,proto3" json:"jobid,omitempty"` // @gotags: copier:"JobId"
|
||||
Jobname string `protobuf:"bytes,15,opt,name=jobname,proto3" json:"jobname,omitempty"` // @gotags: copier:"JobName"
|
||||
Lft uint32 `protobuf:"varint,16,opt,name=lft,proto3" json:"lft,omitempty"` // @gotags: copier:"Lft"
|
||||
Partition string `protobuf:"bytes,17,opt,name=partition,proto3" json:"partition,omitempty"` // @gotags: copier:"Partition"
|
||||
Nodes string `protobuf:"bytes,18,opt,name=nodes,proto3" json:"nodes,omitempty"` // @gotags: copier:"Nodes"
|
||||
Priority uint32 `protobuf:"varint,19,opt,name=priority,proto3" json:"priority,omitempty"` // @gotags: copier:"Priority"
|
||||
Qosid uint32 `protobuf:"varint,20,opt,name=qosid,proto3" json:"qosid,omitempty"` // @gotags: copier:"Qosid"
|
||||
ReqCpus uint32 `protobuf:"varint,21,opt,name=req_cpus,json=reqCpus,proto3" json:"req_cpus,omitempty"` // @gotags: copier:"ReqCpus"
|
||||
ReqMem uint32 `protobuf:"varint,22,opt,name=req_mem,json=reqMem,proto3" json:"req_mem,omitempty"` // @gotags: copier:"ReqMem"
|
||||
Requid uint32 `protobuf:"varint,23,opt,name=requid,proto3" json:"requid,omitempty"` // @gotags: copier:"Requid"
|
||||
Resvid uint32 `protobuf:"varint,24,opt,name=resvid,proto3" json:"resvid,omitempty"` // @gotags: copier:"Resvid"
|
||||
ShowFull uint32 `protobuf:"varint,25,opt,name=show_full,json=showFull,proto3" json:"show_full,omitempty"` // @gotags: copier:"ShowFull"
|
||||
Start int64 `protobuf:"varint,26,opt,name=start,proto3" json:"start,omitempty"` // @gotags: copier:"Start"
|
||||
State uint32 `protobuf:"varint,27,opt,name=state,proto3" json:"state,omitempty"` // @gotags: copier:"State"
|
||||
Submit int64 `protobuf:"varint,28,opt,name=submit,proto3" json:"submit,omitempty"` // @gotags: copier:"Submit"
|
||||
Suspended uint32 `protobuf:"varint,29,opt,name=suspended,proto3" json:"suspended,omitempty"` // @gotags: copier:"Suspended"
|
||||
SysCpuSec uint32 `protobuf:"varint,30,opt,name=sys_cpu_sec,json=sysCpuSec,proto3" json:"sys_cpu_sec,omitempty"` // @gotags: copier:"SysCpuSec"
|
||||
SysCpuUsec uint32 `protobuf:"varint,31,opt,name=sys_cpu_usec,json=sysCpuUsec,proto3" json:"sys_cpu_usec,omitempty"` // @gotags: copier:"SysCpuUsec"
|
||||
Timelimit uint32 `protobuf:"varint,32,opt,name=timelimit,proto3" json:"timelimit,omitempty"` // @gotags: copier:"Timelimit"
|
||||
TotCpuSec uint32 `protobuf:"varint,33,opt,name=tot_cpu_sec,json=totCpuSec,proto3" json:"tot_cpu_sec,omitempty"` // @gotags: copier:"TotCpuSec"
|
||||
TotCpuUsec uint32 `protobuf:"varint,34,opt,name=tot_cpu_usec,json=totCpuUsec,proto3" json:"tot_cpu_usec,omitempty"` // @gotags: copier:"TotCpuUsec"
|
||||
TrackSteps uint32 `protobuf:"varint,35,opt,name=track_steps,json=trackSteps,proto3" json:"track_steps,omitempty"` // @gotags: copier:"TrackSteps"
|
||||
Uid uint32 `protobuf:"varint,36,opt,name=uid,proto3" json:"uid,omitempty"` // @gotags: copier:"Uid"
|
||||
User string `protobuf:"bytes,37,opt,name=user,proto3" json:"user,omitempty"` // @gotags: copier:"User"
|
||||
UserCpuSec uint32 `protobuf:"varint,38,opt,name=user_cpu_sec,json=userCpuSec,proto3" json:"user_cpu_sec,omitempty"` // @gotags: copier:"UserCpuSec"
|
||||
UserCpuUsec uint32 `protobuf:"varint,39,opt,name=user_cpu_usec,json=userCpuUsec,proto3" json:"user_cpu_usec,omitempty"` // @gotags: copier:"UserCpuUsec"
|
||||
Wckey string `protobuf:"bytes,40,opt,name=wckey,proto3" json:"wckey,omitempty"` // @gotags: copier:"Wckey"
|
||||
Wckeyid uint32 `protobuf:"varint,41,opt,name=wckeyid,proto3" json:"wckeyid,omitempty"` // @gotags: copier:"Wckeyid"
|
||||
}
|
||||
|
||||
func (x *HistoryJob) Reset() {
|
||||
*x = HistoryJob{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_slurmTianhe_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HistoryJob) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HistoryJob) ProtoMessage() {}
|
||||
|
||||
func (x *HistoryJob) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_slurmTianhe_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 HistoryJob.ProtoReflect.Descriptor instead.
|
||||
func (*HistoryJob) Descriptor() ([]byte, []int) {
|
||||
return file_slurmTianhe_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetAllocCpu() uint32 {
|
||||
if x != nil {
|
||||
return x.AllocCpu
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetAllocNodes() uint32 {
|
||||
if x != nil {
|
||||
return x.AllocNodes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetAccount() string {
|
||||
if x != nil {
|
||||
return x.Account
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetAssocid() uint32 {
|
||||
if x != nil {
|
||||
return x.Associd
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetBlockid() string {
|
||||
if x != nil {
|
||||
return x.Blockid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetCluster() string {
|
||||
if x != nil {
|
||||
return x.Cluster
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetDerivedEc() uint32 {
|
||||
if x != nil {
|
||||
return x.DerivedEc
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetDerivedEs() string {
|
||||
if x != nil {
|
||||
return x.DerivedEs
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetElapsed() uint32 {
|
||||
if x != nil {
|
||||
return x.Elapsed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetEligible() int64 {
|
||||
if x != nil {
|
||||
return x.Eligible
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetEnd() int64 {
|
||||
if x != nil {
|
||||
return x.End
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetExitcode() uint32 {
|
||||
if x != nil {
|
||||
return x.Exitcode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetGid() uint32 {
|
||||
if x != nil {
|
||||
return x.Gid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetJobid() uint32 {
|
||||
if x != nil {
|
||||
return x.Jobid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetJobname() string {
|
||||
if x != nil {
|
||||
return x.Jobname
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetLft() uint32 {
|
||||
if x != nil {
|
||||
return x.Lft
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetPartition() string {
|
||||
if x != nil {
|
||||
return x.Partition
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetNodes() string {
|
||||
if x != nil {
|
||||
return x.Nodes
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetPriority() uint32 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetQosid() uint32 {
|
||||
if x != nil {
|
||||
return x.Qosid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetReqCpus() uint32 {
|
||||
if x != nil {
|
||||
return x.ReqCpus
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetReqMem() uint32 {
|
||||
if x != nil {
|
||||
return x.ReqMem
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetRequid() uint32 {
|
||||
if x != nil {
|
||||
return x.Requid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetResvid() uint32 {
|
||||
if x != nil {
|
||||
return x.Resvid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetShowFull() uint32 {
|
||||
if x != nil {
|
||||
return x.ShowFull
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetStart() int64 {
|
||||
if x != nil {
|
||||
return x.Start
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetState() uint32 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetSubmit() int64 {
|
||||
if x != nil {
|
||||
return x.Submit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetSuspended() uint32 {
|
||||
if x != nil {
|
||||
return x.Suspended
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetSysCpuSec() uint32 {
|
||||
if x != nil {
|
||||
return x.SysCpuSec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetSysCpuUsec() uint32 {
|
||||
if x != nil {
|
||||
return x.SysCpuUsec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetTimelimit() uint32 {
|
||||
if x != nil {
|
||||
return x.Timelimit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetTotCpuSec() uint32 {
|
||||
if x != nil {
|
||||
return x.TotCpuSec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetTotCpuUsec() uint32 {
|
||||
if x != nil {
|
||||
return x.TotCpuUsec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetTrackSteps() uint32 {
|
||||
if x != nil {
|
||||
return x.TrackSteps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetUid() uint32 {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetUser() string {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetUserCpuSec() uint32 {
|
||||
if x != nil {
|
||||
return x.UserCpuSec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetUserCpuUsec() uint32 {
|
||||
if x != nil {
|
||||
return x.UserCpuUsec
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetWckey() string {
|
||||
if x != nil {
|
||||
return x.Wckey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HistoryJob) GetWckeyid() uint32 {
|
||||
if x != nil {
|
||||
return x.Wckeyid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListHistoryJobReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobReq) Reset() {
|
||||
*x = ListHistoryJobReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_slurmTianhe_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListHistoryJobReq) ProtoMessage() {}
|
||||
|
||||
func (x *ListHistoryJobReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_slurmTianhe_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 ListHistoryJobReq.ProtoReflect.Descriptor instead.
|
||||
func (*ListHistoryJobReq) Descriptor() ([]byte, []int) {
|
||||
return file_slurmTianhe_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type ListHistoryJobResp 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"
|
||||
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_slurmTianhe_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListHistoryJobResp) ProtoMessage() {}
|
||||
|
||||
func (x *ListHistoryJobResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_slurmTianhe_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 ListHistoryJobResp.ProtoReflect.Descriptor instead.
|
||||
func (*ListHistoryJobResp) Descriptor() ([]byte, []int) {
|
||||
return file_slurmTianhe_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobResp) GetCode() uint32 {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobResp) GetMsg() string {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobResp) GetRecordCount() uint32 {
|
||||
if x != nil {
|
||||
return x.RecordCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListHistoryJobResp) GetHistoryJobs() []*HistoryJob {
|
||||
if x != nil {
|
||||
return x.HistoryJobs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_slurmTianhe_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_slurmTianhe_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61, 0x6e, 0x68, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61, 0x6e, 0x68, 0x65,
|
||||
0x22, 0xd0, 0x08, 0x0a, 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x6f, 0x62, 0x12,
|
||||
0x1b, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x5f, 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x43, 0x70, 0x75, 0x12, 0x1f, 0x0a, 0x0b,
|
||||
0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x73, 0x73, 0x6f, 0x63,
|
||||
0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69,
|
||||
0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63,
|
||||
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c,
|
||||
0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64,
|
||||
0x5f, 0x65, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x64, 0x65, 0x72, 0x69, 0x76,
|
||||
0x65, 0x64, 0x45, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x5f,
|
||||
0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65,
|
||||
0x64, 0x45, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x18, 0x09,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x08, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64,
|
||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65,
|
||||
0x78, 0x69, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65,
|
||||
0x78, 0x69, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x0d,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6a, 0x6f, 0x62,
|
||||
0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x69, 0x64, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x6a, 0x6f, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x07, 0x6a, 0x6f, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x66, 0x74,
|
||||
0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6c, 0x66, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70,
|
||||
0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
||||
0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x64,
|
||||
0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12,
|
||||
0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x71,
|
||||
0x6f, 0x73, 0x69, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x71, 0x6f, 0x73, 0x69,
|
||||
0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x5f, 0x63, 0x70, 0x75, 0x73, 0x18, 0x15, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x65, 0x71, 0x43, 0x70, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x07,
|
||||
0x72, 0x65, 0x71, 0x5f, 0x6d, 0x65, 0x6d, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72,
|
||||
0x65, 0x71, 0x4d, 0x65, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x71, 0x75, 0x69, 0x64, 0x18,
|
||||
0x17, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x71, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x72, 0x65, 0x73, 0x76, 0x69, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72,
|
||||
0x65, 0x73, 0x76, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x66, 0x75,
|
||||
0x6c, 0x6c, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x46, 0x75,
|
||||
0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x1a, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74,
|
||||
0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
|
||||
0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x73, 0x70, 0x65, 0x6e,
|
||||
0x64, 0x65, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x75, 0x73, 0x70, 0x65,
|
||||
0x6e, 0x64, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x5f, 0x63, 0x70, 0x75, 0x5f,
|
||||
0x73, 0x65, 0x63, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x79, 0x73, 0x43, 0x70,
|
||||
0x75, 0x53, 0x65, 0x63, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x79, 0x73, 0x5f, 0x63, 0x70, 0x75, 0x5f,
|
||||
0x75, 0x73, 0x65, 0x63, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x43,
|
||||
0x70, 0x75, 0x55, 0x73, 0x65, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69,
|
||||
0x6d, 0x69, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x6c,
|
||||
0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x5f, 0x63, 0x70, 0x75, 0x5f,
|
||||
0x73, 0x65, 0x63, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x43, 0x70,
|
||||
0x75, 0x53, 0x65, 0x63, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x5f, 0x63, 0x70, 0x75, 0x5f,
|
||||
0x75, 0x73, 0x65, 0x63, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x43,
|
||||
0x70, 0x75, 0x55, 0x73, 0x65, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f,
|
||||
0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x72, 0x61,
|
||||
0x63, 0x6b, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x24,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65,
|
||||
0x72, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x20, 0x0a,
|
||||
0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x70, 0x75, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x26, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, 0x70, 0x75, 0x53, 0x65, 0x63, 0x12,
|
||||
0x22, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x70, 0x75, 0x5f, 0x75, 0x73, 0x65, 0x63,
|
||||
0x18, 0x27, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x43, 0x70, 0x75, 0x55,
|
||||
0x73, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x63, 0x6b, 0x65, 0x79, 0x18, 0x28, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x05, 0x77, 0x63, 0x6b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x63, 0x6b,
|
||||
0x65, 0x79, 0x69, 0x64, 0x18, 0x29, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x77, 0x63, 0x6b, 0x65,
|
||||
0x79, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f,
|
||||
0x72, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x22, 0x99, 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, 0x3a, 0x0a, 0x0c, 0x68, 0x69, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x79, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17,
|
||||
0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61, 0x6e, 0x68, 0x65, 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, 0x60, 0x0a, 0x0b, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61,
|
||||
0x6e, 0x68, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f,
|
||||
0x72, 0x79, 0x4a, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61,
|
||||
0x6e, 0x68, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a,
|
||||
0x6f, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x54, 0x69, 0x61,
|
||||
0x6e, 0x68, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4a,
|
||||
0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0e, 0x5a, 0x0c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d,
|
||||
0x54, 0x69, 0x61, 0x6e, 0x68, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_slurmTianhe_proto_rawDescOnce sync.Once
|
||||
file_slurmTianhe_proto_rawDescData = file_slurmTianhe_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_slurmTianhe_proto_rawDescGZIP() []byte {
|
||||
file_slurmTianhe_proto_rawDescOnce.Do(func() {
|
||||
file_slurmTianhe_proto_rawDescData = protoimpl.X.CompressGZIP(file_slurmTianhe_proto_rawDescData)
|
||||
})
|
||||
return file_slurmTianhe_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_slurmTianhe_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_slurmTianhe_proto_goTypes = []interface{}{
|
||||
(*HistoryJob)(nil), // 0: slurmTianhe.historyJob
|
||||
(*ListHistoryJobReq)(nil), // 1: slurmTianhe.ListHistoryJobReq
|
||||
(*ListHistoryJobResp)(nil), // 2: slurmTianhe.ListHistoryJobResp
|
||||
}
|
||||
var file_slurmTianhe_proto_depIdxs = []int32{
|
||||
0, // 0: slurmTianhe.ListHistoryJobResp.history_jobs:type_name -> slurmTianhe.historyJob
|
||||
1, // 1: slurmTianhe.slurmTianhe.ListHistoryJob:input_type -> slurmTianhe.ListHistoryJobReq
|
||||
2, // 2: slurmTianhe.slurmTianhe.ListHistoryJob:output_type -> slurmTianhe.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
|
||||
}
|
||||
|
||||
func init() { file_slurmTianhe_proto_init() }
|
||||
func file_slurmTianhe_proto_init() {
|
||||
if File_slurmTianhe_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_slurmTianhe_proto_msgTypes[0].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_slurmTianhe_proto_msgTypes[1].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_slurmTianhe_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListHistoryJobResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_slurmTianhe_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_slurmTianhe_proto_goTypes,
|
||||
DependencyIndexes: file_slurmTianhe_proto_depIdxs,
|
||||
MessageInfos: file_slurmTianhe_proto_msgTypes,
|
||||
}.Build()
|
||||
File_slurmTianhe_proto = out.File
|
||||
file_slurmTianhe_proto_rawDesc = nil
|
||||
file_slurmTianhe_proto_goTypes = nil
|
||||
file_slurmTianhe_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.8
|
||||
// source: slurmTianhe.proto
|
||||
|
||||
package slurmTianhe
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// SlurmTianheClient is the client API for SlurmTianhe service.
|
||||
//
|
||||
// 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
|
||||
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
|
||||
}
|
||||
|
||||
type slurmTianheClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSlurmTianheClient(cc grpc.ClientConnInterface) SlurmTianheClient {
|
||||
return &slurmTianheClient{cc}
|
||||
}
|
||||
|
||||
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...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SlurmTianheServer is the server API for SlurmTianhe service.
|
||||
// All implementations must embed UnimplementedSlurmTianheServer
|
||||
// for forward compatibility
|
||||
type SlurmTianheServer interface {
|
||||
// ListHistoryJob list all jobs from slurmdb
|
||||
ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error)
|
||||
mustEmbedUnimplementedSlurmTianheServer()
|
||||
}
|
||||
|
||||
// UnimplementedSlurmTianheServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedSlurmTianheServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedSlurmTianheServer) ListHistoryJob(context.Context, *ListHistoryJobReq) (*ListHistoryJobResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListHistoryJob not implemented")
|
||||
}
|
||||
func (UnimplementedSlurmTianheServer) mustEmbedUnimplementedSlurmTianheServer() {}
|
||||
|
||||
// UnsafeSlurmTianheServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SlurmTianheServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSlurmTianheServer interface {
|
||||
mustEmbedUnimplementedSlurmTianheServer()
|
||||
}
|
||||
|
||||
func RegisterSlurmTianheServer(s grpc.ServiceRegistrar, srv SlurmTianheServer) {
|
||||
s.RegisterService(&SlurmTianhe_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SlurmTianheServer).ListHistoryJob(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/slurmTianhe.slurmTianhe/ListHistoryJob",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SlurmTianheServer).ListHistoryJob(ctx, req.(*ListHistoryJobReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SlurmTianhe_ServiceDesc is the grpc.ServiceDesc for SlurmTianhe service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SlurmTianhe_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "slurmTianhe.slurmTianhe",
|
||||
HandlerType: (*SlurmTianheServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListHistoryJob",
|
||||
Handler: _SlurmTianhe_ListHistoryJob_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "slurmTianhe.proto",
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/config"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/server"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/internal/svc"
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmTianhe"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/reflection"
|
||||
)
|
||||
|
||||
var configFile = flag.String("f", "app/slurm/slurmTianhe/rpc/etc/slurmtianhe.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
ctx := svc.NewServiceContext(c)
|
||||
|
||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
slurmTianhe.RegisterSlurmTianheServer(grpcServer, server.NewSlurmTianheServer(ctx))
|
||||
|
||||
if c.Mode == service.DevMode || c.Mode == service.TestMode {
|
||||
reflection.Register(grpcServer)
|
||||
}
|
||||
})
|
||||
defer s.Stop()
|
||||
|
||||
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
|
||||
s.Start()
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
// Code generated by goctl. DO NOT EDIT.
|
||||
// Source: slurmTianhe.proto
|
||||
|
||||
package slurmtianheclient
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"PCM/app/slurm/slurmTianhe/rpc/slurmTianhe"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
HistoryJob = slurmTianhe.HistoryJob
|
||||
ListHistoryJobReq = slurmTianhe.ListHistoryJobReq
|
||||
ListHistoryJobResp = slurmTianhe.ListHistoryJobResp
|
||||
|
||||
SlurmTianhe interface {
|
||||
// ListHistoryJob list all jobs from slurmdb
|
||||
ListHistoryJob(ctx context.Context, in *ListHistoryJobReq, opts ...grpc.CallOption) (*ListHistoryJobResp, error)
|
||||
}
|
||||
|
||||
defaultSlurmTianhe struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewSlurmTianhe(cli zrpc.Client) SlurmTianhe {
|
||||
return &defaultSlurmTianhe{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// ListHistoryJob list all jobs from slurmdb
|
||||
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...)
|
||||
}
|
4
go.mod
4
go.mod
|
@ -3,6 +3,7 @@ module PCM
|
|||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/bitly/go-simplejson v0.5.0
|
||||
github.com/jinzhu/copier v0.3.5
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/shopspring/decimal v1.3.1
|
||||
|
@ -14,7 +15,7 @@ require (
|
|||
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bitly/go-simplejson v0.5.0 // indirect
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
|
@ -22,7 +23,6 @@ require (
|
|||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/favadi/protoc-go-inject-tag v1.4.0 // indirect
|
||||
github.com/felixge/fgprof v0.9.3 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
|
|
4
go.sum
4
go.sum
|
@ -399,6 +399,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
|
|||
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
|
||||
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
|
||||
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=
|
||||
github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
|
@ -451,8 +453,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
|
|||
github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/favadi/protoc-go-inject-tag v1.4.0 h1:K3KXxbgRw5WT4f43LbglARGz/8jVsDOS7uMjG4oNvXY=
|
||||
github.com/favadi/protoc-go-inject-tag v1.4.0/go.mod h1:AZ+PK+QDKUOLlBRG0rYiKkUX5Hw7+7GTFzlU99GFSbQ=
|
||||
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
|
||||
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
|
||||
|
|
Loading…
Reference in New Issue