From 384f0e577ad454f6993b9d492634892568292e5b Mon Sep 17 00:00:00 2001 From: zhouqunjie <450705171@qq.com> Date: Sun, 6 Nov 2022 23:16:08 -0800 Subject: [PATCH] slurmdb api for list user&list association --- adaptor/pcm_pod/server/tencent/models.go | 6 +- .../cgo_tianhe/example/get_user_info.go | 16 + .../cgo_tianhe/src/slurm/qos/get_qos_info.go | 36 + .../pcm_slurm/cgo_tianhe/src/slurm/slurm.go | 2 +- .../src/slurm/user/get_user_info.go | 90 +++ .../src/slurm/user/get_user_info_bak.go | 80 +++ .../src/slurm/user/get_user_info_new.go | 92 +++ adaptor/pcm_slurm/gen/idl/node.pb.go | 323 +++++++++ adaptor/pcm_slurm/gen/idl/slurm.pb.go | 354 +--------- adaptor/pcm_slurm/gen/idl/slurm.pb.gw.go | 174 +++++ adaptor/pcm_slurm/gen/idl/slurm_grpc.pb.go | 76 +++ .../pcm_slurm/gen/idl/slurmdb_account.pb.go | 171 +++++ adaptor/pcm_slurm/gen/idl/slurmdb_assoc.pb.go | 640 ++++++++++++++++++ .../pcm_slurm/gen/idl/slurmdb_cluster.pb.go | 280 ++++++++ adaptor/pcm_slurm/gen/idl/slurmdb_coord.pb.go | 156 +++++ adaptor/pcm_slurm/gen/idl/slurmdb_qos.pb.go | 470 +++++++++++++ adaptor/pcm_slurm/gen/idl/slurmdb_user.pb.go | 567 ++++++++++++++++ adaptor/pcm_slurm/gen/idl/slurmdb_wckey.pb.go | 210 ++++++ adaptor/pcm_slurm/gen/idl/static.pb.go | 130 ++++ .../gen/openapiv2/idl/node.swagger.json | 43 ++ .../gen/openapiv2/idl/slurm.swagger.json | 385 +++++++++++ .../idl/slurmdb_account.swagger.json | 43 ++ .../openapiv2/idl/slurmdb_assoc.swagger.json | 43 ++ .../idl/slurmdb_cluster.swagger.json | 43 ++ .../openapiv2/idl/slurmdb_coord.swagger.json | 43 ++ .../openapiv2/idl/slurmdb_qos.swagger.json | 43 ++ .../openapiv2/idl/slurmdb_user.swagger.json | 43 ++ .../openapiv2/idl/slurmdb_wckey.swagger.json | 43 ++ .../gen/openapiv2/idl/static.swagger.json | 43 ++ adaptor/pcm_slurm/idl/node.proto | 22 + adaptor/pcm_slurm/idl/slurm.proto | 30 +- adaptor/pcm_slurm/idl/slurm.yaml | 6 +- adaptor/pcm_slurm/idl/slurmdb_account.proto | 12 + adaptor/pcm_slurm/idl/slurmdb_assoc.proto | 53 ++ adaptor/pcm_slurm/idl/slurmdb_cluster.proto | 25 + adaptor/pcm_slurm/idl/slurmdb_coord.proto | 12 + adaptor/pcm_slurm/idl/slurmdb_qos.proto | 41 ++ adaptor/pcm_slurm/idl/slurmdb_user.proto | 37 + adaptor/pcm_slurm/idl/slurmdb_wckey.proto | 17 + adaptor/pcm_slurm/idl/static.proto | 12 + adaptor/pcm_slurm/server/slurm.go | 20 + adaptor/pcm_slurm/server/slurmImpl.go | 21 + adaptor/pcm_slurm/service/slurm_node.go | 227 +++++++ .../pcm_slurm/service/slurmdb_association.go | 126 ++++ adaptor/pcm_slurm/service/slurmdb_user.go | 102 +++ adaptor/pcm_slurm/service/slurmer.go | 10 +- adaptor/pcm_vm/service/harvester_util.go | 6 +- examples/slurm/get_partitions.go | 13 +- .../submit_example/submit_mpi_and_update.go | 249 +++---- .../submit_example/submit_mpi_containier.go | 217 +++--- .../submit_example/submit_openmp_container.go | 318 ++++----- tenant/gen/openapiv2/idl/tenant.swagger.json | 9 +- 52 files changed, 5478 insertions(+), 752 deletions(-) create mode 100644 adaptor/pcm_slurm/cgo_tianhe/example/get_user_info.go create mode 100644 adaptor/pcm_slurm/cgo_tianhe/src/slurm/qos/get_qos_info.go create mode 100644 adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info.go create mode 100644 adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_bak.go create mode 100644 adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_new.go create mode 100644 adaptor/pcm_slurm/gen/idl/node.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_account.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_assoc.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_cluster.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_coord.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_qos.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_user.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/slurmdb_wckey.pb.go create mode 100644 adaptor/pcm_slurm/gen/idl/static.pb.go create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/node.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_account.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_assoc.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_cluster.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_coord.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_qos.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_user.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_wckey.swagger.json create mode 100644 adaptor/pcm_slurm/gen/openapiv2/idl/static.swagger.json create mode 100644 adaptor/pcm_slurm/idl/node.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_account.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_assoc.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_cluster.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_coord.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_qos.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_user.proto create mode 100644 adaptor/pcm_slurm/idl/slurmdb_wckey.proto create mode 100644 adaptor/pcm_slurm/idl/static.proto create mode 100644 adaptor/pcm_slurm/service/slurm_node.go create mode 100644 adaptor/pcm_slurm/service/slurmdb_association.go create mode 100644 adaptor/pcm_slurm/service/slurmdb_user.go diff --git a/adaptor/pcm_pod/server/tencent/models.go b/adaptor/pcm_pod/server/tencent/models.go index 637f5462..5edd6eeb 100644 --- a/adaptor/pcm_pod/server/tencent/models.go +++ b/adaptor/pcm_pod/server/tencent/models.go @@ -1285,7 +1285,7 @@ func (r *CreateClusterNodePoolFromExistingAsgResponse) FromJsonString(s string) type CreateClusterNodePoolRequest struct { *tchttp.BaseRequest - // cluster id + // user id ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` // AutoScalingGroupPara AS组参数 @@ -7604,7 +7604,7 @@ type PrometheusTemplate struct { // 模板维度,支持以下类型 // instance 实例级别 - // cluster 集群级别 + // user 集群级别 Level *string `json:"Level,omitempty" name:"Level"` // 模板描述 @@ -8210,7 +8210,7 @@ type Tag struct { type TagSpecification struct { - // 标签绑定的资源类型,当前支持类型:"cluster" + // 标签绑定的资源类型,当前支持类型:"user" // 注意:此字段可能返回 null,表示取不到有效值。 ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` diff --git a/adaptor/pcm_slurm/cgo_tianhe/example/get_user_info.go b/adaptor/pcm_slurm/cgo_tianhe/example/get_user_info.go new file mode 100644 index 00000000..54933d64 --- /dev/null +++ b/adaptor/pcm_slurm/cgo_tianhe/example/get_user_info.go @@ -0,0 +1,16 @@ +package main + +// +//import ( +// user_info "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user" +// "fmt" +//) +// +//func main() { +// +// fmt.Printf("Found user") +// +// userList := user_info.Get_all_users() +// fmt.Printf("Found %d user \n", userList.WithoutDefaults) +// +//} diff --git a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/qos/get_qos_info.go b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/qos/get_qos_info.go new file mode 100644 index 00000000..8b115d47 --- /dev/null +++ b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/qos/get_qos_info.go @@ -0,0 +1,36 @@ +package main + +/* +#cgo LDFLAGS: -lslurmdb + +#include +#include +#include + +slurmdb_qos_rec_t Get_qos() { + + slurmdb_qos_cond_t *qos_cond = NULL; + void *conn = slurmdb_connection_get(); + List asdlist = slurmdb_qos_get(conn, qos_cond); + uint16_t size = slurm_list_count(asdlist); + slurmdb_qos_rec_t QosArray[size]; + + slurmdb_qos_rec_t *rec = NULL; + ListIterator itr = slurm_list_iterator_create(asdlist); + + int i = 0; + while ((rec = slurm_list_next(itr))) { + QosArray[i] = *rec; + i++; + } + slurm_list_destroy(asdlist); + return *QosArray; +} +*/ +import "C" +import "fmt" + +func main() { + a := C.Get_qos() + fmt.Println("name: ", C.GoString(a.name)) +} diff --git a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/slurm.go b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/slurm.go index 05ca7d1e..9c74545a 100644 --- a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/slurm.go +++ b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/slurm.go @@ -405,7 +405,7 @@ func Print_Ctl_conf(go_struct Ctl_conf) { fmt.Printf("%s:\t %d\n", "batch start timeout", go_struct.Batch_start_timeout) fmt.Printf("%s:\t %d\n", "boot time", go_struct.Boot_time) fmt.Printf("%s:\t %s\n", "checkpoint type", go_struct.Checkpoint_type) - fmt.Printf("%s:\t %s\n", "cluster name", go_struct.Cluster_name) + fmt.Printf("%s:\t %s\n", "user name", go_struct.Cluster_name) fmt.Printf("%s:\t %d\n", "complete wait", go_struct.Complete_wait) fmt.Printf("%s:\t %d\n", "debug flags", go_struct.Debug_flags) fmt.Printf("%s:\t %d\n", "def mem per cpu", go_struct.Def_mem_per_cpu) diff --git a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info.go b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info.go new file mode 100644 index 00000000..43ad2b39 --- /dev/null +++ b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info.go @@ -0,0 +1,90 @@ +package user + +// +///* +//#cgo LDFLAGS: -lslurmdb +// +//#include +//#include +//#include +//#include +//#include +// +//typedef struct user_info_msg { +// uint32_t record_count; +// slurmdb_user_rec_t *user_array; +//} user_info_msg_t; +// +//typedef struct slurmdb_user_rec{ +// uint16_t admin_level; +// List assoc_list; +// List coord_accts; +// char *default_acct; +// char *default_wckey; +// char *name; +// char *old_name; +// uint32_t uid; +// List wckey_list; +//} slurmdb_user_rec_t_f; +// +//struct user_info_msg get_user_info() { +// struct user_info_msg userinfo; +// List userList = NULL; +// slurmdb_user_cond_t *user_cond = NULL; +// void *db_conn; +// db_conn = slurmdb_connection_get(); +// userList = slurmdb_users_get(db_conn, user_cond); +// slurmdb_connection_close(&db_conn); +// +// slurmdb_user_rec_t *rec = NULL; +// ListIterator itr = slurm_list_iterator_create(userList); +// int i = 0; +// uint32_t length; +// length = slurm_list_count(userList); +// userinfo.record_count = length; +// userinfo.user_array = malloc(length * sizeof(slurmdb_user_rec_t)); +// while ((rec = slurm_list_next(itr))) { +// userinfo.user_array[i] = *rec; +// i++; +// } +// return userinfo; +//} +// +//struct slurmdb_user_rec *user_from_list(struct user_info_msg *list, int i) { +// return (struct slurmdb_user_rec *) &list->user_array[i]; +//} +// +//*/ +//import "C" +// +//type UserInfo struct { +// Name string +// OldName string +//} +// +//type UserInfoMsg struct { +// Last_update int64 +// Record_count uint32 +// UserInfoList []UserInfo +//} +// +//func User_descriptor_convert_c_to_go(c_struct *C.struct_slurmdb_user_rec) UserInfo { +// var go_struct UserInfo +// go_struct.Name = C.GoString(c_struct.name) +// return go_struct +//} +// +//// []slurmpb.UserInfo +//func GetUserInfo() UserInfoMsg { +// var go_user_buffer UserInfoMsg +// c_user_buffer := C.get_user_info() +// go_user_buffer.Record_count = uint32(c_user_buffer.record_count) +// go_user_buffer.UserInfoList = make([]UserInfo, c_user_buffer.record_count, c_user_buffer.record_count) +// +// for i := uint32(0); i < go_user_buffer.Record_count; i++ { +// user := C.user_from_list(&c_user_buffer, C.int(i)) +// go_user := User_descriptor_convert_c_to_go(user) +// go_user_buffer.UserInfoList[i] = go_user +// } +// return go_user_buffer +//} diff --git a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_bak.go b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_bak.go new file mode 100644 index 00000000..127e78fc --- /dev/null +++ b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_bak.go @@ -0,0 +1,80 @@ +package user + +// +///* +//#cgo LDFLAGS: -lslurmdb +// +//#include +//#include +//#include +// +//List Get_user_List() { +// __attribute__((unused)) List slurmdb_user_rec_t = NULL; +// slurmdb_user_cond_t *user_cond = NULL; +// slurmdb_user_rec_t = slurmdb_users_get(slurmdb_connection_get(), user_cond); +// return slurmdb_user_rec_t; +//} +// +//slurmdb_user_rec_t UserArray[900]; +// +//struct slurmdb_user_rec_t *user_from_list() { +// __attribute__((unused)) List userList = NULL; +// slurmdb_user_cond_t *user_cond = NULL; +// userList = slurmdb_users_get(slurmdb_connection_get(), user_cond); +// slurmdb_user_rec_t *rec = NULL; +// ListIterator itr = slurm_list_iterator_create(userList); +// int i = 0; +// while ((rec = slurm_list_next(itr))) { +// UserArray[i] = *rec; +// i++; +// } +// return (struct slurmdb_user_rec_t *) UserArray; +//} +//*/ +//import "C" +//import ( +// "fmt" +//) +// +//type SlurmdbUsers struct { +// slurm_user []SlurmdbUser +//} +//type SlurmdbUser struct { +// admin_level uint16 /* really slurmdb_admin_level_t but for +// packing purposes needs to be uint16_t */ +// //assoc_list List /* list of slurmdb_association_rec_t *'s */ +// //coord_accts List /* list of slurmdb_coord_rec_t *'s */ +// default_acct string +// default_wckey string +// name string +// old_name string +// uid uint32 +// //wckey_list List /* list of slurmdb_wckey_rec_t *'s */ +//} +// +//func User_descriptor_convert_c_to_go(c_struct *C.slurmdb_user_rec_t) SlurmdbUser { +// var go_struct SlurmdbUser +// go_struct.name = C.GoString(c_struct.name) +// return go_struct +//} +// +//func GetUserInfo() SlurmdbUsers { +// var go_struct SlurmdbUser +// var users SlurmdbUsers +// userCount := int(C.slurm_list_count(C.Get_user_List())) +// C.user_from_list() +// SlurmdbUserList := make([]SlurmdbUser, 0) +// for i := 0; i < userCount; i++ { +// C.user_from_list() +// user := C.UserArray[i] +// go_struct = User_descriptor_convert_c_to_go(&user) +// SlurmdbUserList = append(SlurmdbUserList, go_struct) +// users.slurm_user = append(users.slurm_user, go_struct) +// } +// return users +//} +// +//func main() { +// slurmdbUser := GetUserInfo() +// fmt.Println(slurmdbUser.slurm_user[0].name) +//} diff --git a/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_new.go b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_new.go new file mode 100644 index 00000000..d2ae8037 --- /dev/null +++ b/adaptor/pcm_slurm/cgo_tianhe/src/slurm/user/get_user_info_new.go @@ -0,0 +1,92 @@ +package user + +// +//import "C" +//import slurmpb "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/gen/idl" +// +///* +//#cgo LDFLAGS: -lslurmdb +// +//#include +//#include +//#include +// +// +////slurmdb_user_rec_t UserArray[10]; +// +////struct slurmdb_user_rec_t *user_from_list() { +//// +//// __attribute__((unused)) List userList = NULL; +//// slurmdb_user_cond_t *user_cond = NULL; +//// userList = slurmdb_users_get(slurmdb_connection_get(), user_cond); +//// //slurmdb_user_rec_t *rec = NULL; +//// //ListIterator itr = slurm_list_iterator_create(userList); +//// //int i = 0; +//// //while ((rec = slurm_list_next(itr))) { +//// // UserArray[i] = *rec; +//// // i++; +//// //} +//// //return (struct slurmdb_user_rec_t *) UserArray; +//// return +////} +// +//typedef struct user_info_msg { +// time_t last_update; +// uint32_t record_count; +// slurmdb_user_rec_t *user_array[10]; +//} user_info_msg_t; +// +// +//struct user_info_msg_t *user_from_list() { +// user_info_msg_t* user_buffer; +// __attribute__((unused)) List userList = NULL; +// slurmdb_user_cond_t *user_cond = NULL; +// userList = slurmdb_users_get(slurmdb_connection_get(), user_cond); +// +// slurmdb_user_rec_t *rec = NULL; +// ListIterator itr = slurm_list_iterator_create(userList); +// int i = 0; +// int length; +// length = slurm_list_count(userList); +// slurmdb_user_rec_t UserArray[length]; +// while ((rec = slurm_list_next(itr))) { +// UserArray[i]=*rec; +// user_buffer->user_array[i] = &UserArray[i]; +// i++; +// } +// return user_buffer; +//} +// +// +//*/ +//import "C" +// +//func ConvertCToGo(cStruct *C.slurmdb_user_rec_t) slurmpb.UserInfo { +// var goStruct slurmpb.UserInfo +// goStruct.Name = C.GoString(cStruct.name) +// return goStruct +//} +// +//func GetUserInfo() slurmpb.UserInfoList { +// var users slurmpb.UserInfoList +// var goStruct slurmpb.UserInfo +// //userCount := int(C.slurm_list_count(C.Get_user_List())) +// c_users_buffer := C.user_from_list() +// println(c_users_buffer) +// SlurmUserList := make([]slurmpb.UserInfo, 0) +// for i := 0; i < 2; i++ { +// //c_users_buffer := C.user_from_list() +// //println(c_users_buffer) +// C.user_from_list() +// //user := C.UserArray[i] +// //goStruct = ConvertCToGo(&user) +// SlurmUserList = append(SlurmUserList, goStruct) +// users.UserInfos = append(users.UserInfos, &goStruct) +// } +// return users +//} +// +//func main() { +// users := GetUserInfo() +// println(users.UserInfos[0].Name) +//} diff --git a/adaptor/pcm_slurm/gen/idl/node.pb.go b/adaptor/pcm_slurm/gen/idl/node.pb.go new file mode 100644 index 00000000..33d0b4a8 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/node.pb.go @@ -0,0 +1,323 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/node.proto + +package slurmpb + +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) +) + +type ListNodesReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SlurmVersion SlurmVersion `protobuf:"varint,1,opt,name=slurm_version,json=slurmVersion,proto3,enum=slurm.SlurmVersion" json:"slurm_version,omitempty"` +} + +func (x *ListNodesReq) Reset() { + *x = ListNodesReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodesReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodesReq) ProtoMessage() {} + +func (x *ListNodesReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_node_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 ListNodesReq.ProtoReflect.Descriptor instead. +func (*ListNodesReq) Descriptor() ([]byte, []int) { + return file_idl_node_proto_rawDescGZIP(), []int{0} +} + +func (x *ListNodesReq) GetSlurmVersion() SlurmVersion { + if x != nil { + return x.SlurmVersion + } + return SlurmVersion_tianhe +} + +type NodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Boards int32 `protobuf:"varint,1,opt,name=boards,proto3" json:"boards,omitempty"` + Cpus int32 `protobuf:"varint,2,opt,name=cpus,proto3" json:"cpus,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + RealMemory int32 `protobuf:"varint,4,opt,name=realMemory,proto3" json:"realMemory,omitempty"` + Sockets int32 `protobuf:"varint,5,opt,name=sockets,proto3" json:"sockets,omitempty"` + Threads int32 `protobuf:"varint,6,opt,name=threads,proto3" json:"threads,omitempty"` +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo) ProtoMessage() {} + +func (x *NodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_node_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 NodeInfo.ProtoReflect.Descriptor instead. +func (*NodeInfo) Descriptor() ([]byte, []int) { + return file_idl_node_proto_rawDescGZIP(), []int{1} +} + +func (x *NodeInfo) GetBoards() int32 { + if x != nil { + return x.Boards + } + return 0 +} + +func (x *NodeInfo) GetCpus() int32 { + if x != nil { + return x.Cpus + } + return 0 +} + +func (x *NodeInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NodeInfo) GetRealMemory() int32 { + if x != nil { + return x.RealMemory + } + return 0 +} + +func (x *NodeInfo) GetSockets() int32 { + if x != nil { + return x.Sockets + } + return 0 +} + +func (x *NodeInfo) GetThreads() int32 { + if x != nil { + return x.Threads + } + return 0 +} + +type ListNodesResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeInfos []*NodeInfo `protobuf:"bytes,1,rep,name=node_infos,json=nodeInfos,proto3" json:"node_infos,omitempty"` +} + +func (x *ListNodesResp) Reset() { + *x = ListNodesResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_node_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNodesResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNodesResp) ProtoMessage() {} + +func (x *ListNodesResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_node_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 ListNodesResp.ProtoReflect.Descriptor instead. +func (*ListNodesResp) Descriptor() ([]byte, []int) { + return file_idl_node_proto_rawDescGZIP(), []int{2} +} + +func (x *ListNodesResp) GetNodeInfos() []*NodeInfo { + if x != nil { + return x.NodeInfos + } + return nil +} + +var File_idl_node_proto protoreflect.FileDescriptor + +var file_idl_node_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x69, 0x64, 0x6c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x0c, 0x4c, 0x69, 0x73, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x0d, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x70, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x70, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x73, 0x22, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x6c, 0x75, 0x72, + 0x6d, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_node_proto_rawDescOnce sync.Once + file_idl_node_proto_rawDescData = file_idl_node_proto_rawDesc +) + +func file_idl_node_proto_rawDescGZIP() []byte { + file_idl_node_proto_rawDescOnce.Do(func() { + file_idl_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_node_proto_rawDescData) + }) + return file_idl_node_proto_rawDescData +} + +var file_idl_node_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_idl_node_proto_goTypes = []interface{}{ + (*ListNodesReq)(nil), // 0: slurm.ListNodesReq + (*NodeInfo)(nil), // 1: slurm.NodeInfo + (*ListNodesResp)(nil), // 2: slurm.ListNodesResp + (SlurmVersion)(0), // 3: slurm.SlurmVersion +} +var file_idl_node_proto_depIdxs = []int32{ + 3, // 0: slurm.ListNodesReq.slurm_version:type_name -> slurm.SlurmVersion + 1, // 1: slurm.ListNodesResp.node_infos:type_name -> slurm.NodeInfo + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] 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_idl_node_proto_init() } +func file_idl_node_proto_init() { + if File_idl_node_proto != nil { + return + } + file_idl_static_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodesReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNodesResp); 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_idl_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_node_proto_goTypes, + DependencyIndexes: file_idl_node_proto_depIdxs, + MessageInfos: file_idl_node_proto_msgTypes, + }.Build() + File_idl_node_proto = out.File + file_idl_node_proto_rawDesc = nil + file_idl_node_proto_goTypes = nil + file_idl_node_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurm.pb.go b/adaptor/pcm_slurm/gen/idl/slurm.pb.go index d4aba9e4..925c362b 100644 --- a/adaptor/pcm_slurm/gen/idl/slurm.pb.go +++ b/adaptor/pcm_slurm/gen/idl/slurm.pb.go @@ -10,7 +10,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - sync "sync" ) const ( @@ -20,293 +19,51 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// slurm version -type SlurmVersion int32 - -const ( - // 0 - 阿里云 - SlurmVersion_tianhe SlurmVersion = 0 -) - -// Enum value maps for SlurmVersion. -var ( - SlurmVersion_name = map[int32]string{ - 0: "tianhe", - } - SlurmVersion_value = map[string]int32{ - "tianhe": 0, - } -) - -func (x SlurmVersion) Enum() *SlurmVersion { - p := new(SlurmVersion) - *p = x - return p -} - -func (x SlurmVersion) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SlurmVersion) Descriptor() protoreflect.EnumDescriptor { - return file_idl_slurm_proto_enumTypes[0].Descriptor() -} - -func (SlurmVersion) Type() protoreflect.EnumType { - return &file_idl_slurm_proto_enumTypes[0] -} - -func (x SlurmVersion) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SlurmVersion.Descriptor instead. -func (SlurmVersion) EnumDescriptor() ([]byte, []int) { - return file_idl_slurm_proto_rawDescGZIP(), []int{0} -} - -type ListNodesReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SlurmVersion int32 `protobuf:"varint,1,opt,name=SlurmVersion,proto3" json:"SlurmVersion,omitempty"` -} - -func (x *ListNodesReq) Reset() { - *x = ListNodesReq{} - if protoimpl.UnsafeEnabled { - mi := &file_idl_slurm_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListNodesReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesReq) ProtoMessage() {} - -func (x *ListNodesReq) ProtoReflect() protoreflect.Message { - mi := &file_idl_slurm_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 ListNodesReq.ProtoReflect.Descriptor instead. -func (*ListNodesReq) Descriptor() ([]byte, []int) { - return file_idl_slurm_proto_rawDescGZIP(), []int{0} -} - -func (x *ListNodesReq) GetSlurmVersion() int32 { - if x != nil { - return x.SlurmVersion - } - return 0 -} - -type NodeInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Boards int32 `protobuf:"varint,1,opt,name=boards,proto3" json:"boards,omitempty"` - Cpus int32 `protobuf:"varint,2,opt,name=cpus,proto3" json:"cpus,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - RealMemory int32 `protobuf:"varint,4,opt,name=realMemory,proto3" json:"realMemory,omitempty"` - Sockets int32 `protobuf:"varint,5,opt,name=sockets,proto3" json:"sockets,omitempty"` - Threads int32 `protobuf:"varint,6,opt,name=threads,proto3" json:"threads,omitempty"` -} - -func (x *NodeInfo) Reset() { - *x = NodeInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_idl_slurm_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeInfo) ProtoMessage() {} - -func (x *NodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_idl_slurm_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 NodeInfo.ProtoReflect.Descriptor instead. -func (*NodeInfo) Descriptor() ([]byte, []int) { - return file_idl_slurm_proto_rawDescGZIP(), []int{1} -} - -func (x *NodeInfo) GetBoards() int32 { - if x != nil { - return x.Boards - } - return 0 -} - -func (x *NodeInfo) GetCpus() int32 { - if x != nil { - return x.Cpus - } - return 0 -} - -func (x *NodeInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NodeInfo) GetRealMemory() int32 { - if x != nil { - return x.RealMemory - } - return 0 -} - -func (x *NodeInfo) GetSockets() int32 { - if x != nil { - return x.Sockets - } - return 0 -} - -func (x *NodeInfo) GetThreads() int32 { - if x != nil { - return x.Threads - } - return 0 -} - -type ListNodesResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeInfos []*NodeInfo `protobuf:"bytes,1,rep,name=node_infos,json=nodeInfos,proto3" json:"node_infos,omitempty"` -} - -func (x *ListNodesResp) Reset() { - *x = ListNodesResp{} - if protoimpl.UnsafeEnabled { - mi := &file_idl_slurm_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListNodesResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListNodesResp) ProtoMessage() {} - -func (x *ListNodesResp) ProtoReflect() protoreflect.Message { - mi := &file_idl_slurm_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 ListNodesResp.ProtoReflect.Descriptor instead. -func (*ListNodesResp) Descriptor() ([]byte, []int) { - return file_idl_slurm_proto_rawDescGZIP(), []int{2} -} - -func (x *ListNodesResp) GetNodeInfos() []*NodeInfo { - if x != nil { - return x.NodeInfos - } - return nil -} - var File_idl_slurm_proto protoreflect.FileDescriptor var file_idl_slurm_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x22, 0x32, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x53, 0x6c, 0x75, 0x72, - 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, - 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9e, 0x01, 0x0a, - 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x70, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x63, 0x70, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x61, - 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, - 0x65, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x6f, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x22, 0x3f, 0x0a, - 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, - 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x2a, 0x1a, - 0x0a, 0x0c, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, - 0x0a, 0x06, 0x74, 0x69, 0x61, 0x6e, 0x68, 0x65, 0x10, 0x00, 0x32, 0x46, 0x0a, 0x0c, 0x53, 0x6c, + 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x1a, 0x0e, 0x69, 0x64, 0x6c, 0x2f, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, + 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x61, 0x73, + 0x73, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xcb, 0x01, 0x0a, 0x0c, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x13, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, + 0x13, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x10, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, + 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, + 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, + 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var ( - file_idl_slurm_proto_rawDescOnce sync.Once - file_idl_slurm_proto_rawDescData = file_idl_slurm_proto_rawDesc -) - -func file_idl_slurm_proto_rawDescGZIP() []byte { - file_idl_slurm_proto_rawDescOnce.Do(func() { - file_idl_slurm_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurm_proto_rawDescData) - }) - return file_idl_slurm_proto_rawDescData -} - -var file_idl_slurm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_idl_slurm_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_idl_slurm_proto_goTypes = []interface{}{ - (SlurmVersion)(0), // 0: slurm.SlurmVersion - (*ListNodesReq)(nil), // 1: slurm.ListNodesReq - (*NodeInfo)(nil), // 2: slurm.NodeInfo - (*ListNodesResp)(nil), // 3: slurm.ListNodesResp + (*ListNodesReq)(nil), // 0: slurm.ListNodesReq + (*ListUsersReq)(nil), // 1: slurm.ListUsersReq + (*ListAssociationsReq)(nil), // 2: slurm.ListAssociationsReq + (*ListNodesResp)(nil), // 3: slurm.ListNodesResp + (*ListUsersResp)(nil), // 4: slurm.ListUsersResp + (*ListAssociationsResp)(nil), // 5: slurm.ListAssociationsResp } var file_idl_slurm_proto_depIdxs = []int32{ - 2, // 0: slurm.ListNodesResp.node_infos:type_name -> slurm.NodeInfo - 1, // 1: slurm.SlurmService.ListNodes:input_type -> slurm.ListNodesReq - 3, // 2: slurm.SlurmService.ListNodes:output_type -> slurm.ListNodesResp - 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: slurm.SlurmService.ListNodes:input_type -> slurm.ListNodesReq + 1, // 1: slurm.SlurmService.ListUsers:input_type -> slurm.ListUsersReq + 2, // 2: slurm.SlurmService.ListAssociations:input_type -> slurm.ListAssociationsReq + 3, // 3: slurm.SlurmService.ListNodes:output_type -> slurm.ListNodesResp + 4, // 4: slurm.SlurmService.ListUsers:output_type -> slurm.ListUsersResp + 5, // 5: slurm.SlurmService.ListAssociations:output_type -> slurm.ListAssociationsResp + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_idl_slurm_proto_init() } @@ -314,58 +71,21 @@ func file_idl_slurm_proto_init() { if File_idl_slurm_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_idl_slurm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListNodesReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_idl_slurm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_idl_slurm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListNodesResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } + file_idl_node_proto_init() + file_idl_slurmdb_user_proto_init() + file_idl_slurmdb_assoc_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_idl_slurm_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, + NumEnums: 0, + NumMessages: 0, NumExtensions: 0, NumServices: 1, }, GoTypes: file_idl_slurm_proto_goTypes, DependencyIndexes: file_idl_slurm_proto_depIdxs, - EnumInfos: file_idl_slurm_proto_enumTypes, - MessageInfos: file_idl_slurm_proto_msgTypes, }.Build() File_idl_slurm_proto = out.File file_idl_slurm_proto_rawDesc = nil diff --git a/adaptor/pcm_slurm/gen/idl/slurm.pb.gw.go b/adaptor/pcm_slurm/gen/idl/slurm.pb.gw.go index 81b1967e..3d7cee0e 100644 --- a/adaptor/pcm_slurm/gen/idl/slurm.pb.gw.go +++ b/adaptor/pcm_slurm/gen/idl/slurm.pb.gw.go @@ -67,6 +67,78 @@ func local_request_SlurmService_ListNodes_0(ctx context.Context, marshaler runti } +var ( + filter_SlurmService_ListUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SlurmService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, client SlurmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUsersReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SlurmService_ListUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SlurmService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, server SlurmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListUsersReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SlurmService_ListUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUsers(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SlurmService_ListAssociations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SlurmService_ListAssociations_0(ctx context.Context, marshaler runtime.Marshaler, client SlurmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAssociationsReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SlurmService_ListAssociations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListAssociations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SlurmService_ListAssociations_0(ctx context.Context, marshaler runtime.Marshaler, server SlurmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAssociationsReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SlurmService_ListAssociations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListAssociations(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterSlurmServiceHandlerServer registers the http handlers for service SlurmService to "mux". // UnaryRPC :call SlurmServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -98,6 +170,56 @@ func RegisterSlurmServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("GET", pattern_SlurmService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slurm.SlurmService/ListUsers", runtime.WithHTTPPathPattern("/apis/slurm/listUsers")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SlurmService_ListUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SlurmService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SlurmService_ListAssociations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slurm.SlurmService/ListAssociations", runtime.WithHTTPPathPattern("/apis/slurm/listAssociations")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SlurmService_ListAssociations_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SlurmService_ListAssociations_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -161,13 +283,65 @@ func RegisterSlurmServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("GET", pattern_SlurmService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slurm.SlurmService/ListUsers", runtime.WithHTTPPathPattern("/apis/slurm/listUsers")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SlurmService_ListUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SlurmService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SlurmService_ListAssociations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slurm.SlurmService/ListAssociations", runtime.WithHTTPPathPattern("/apis/slurm/listAssociations")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SlurmService_ListAssociations_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SlurmService_ListAssociations_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_SlurmService_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "slurm", "listNodes"}, "")) + + pattern_SlurmService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "slurm", "listUsers"}, "")) + + pattern_SlurmService_ListAssociations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "slurm", "listAssociations"}, "")) ) var ( forward_SlurmService_ListNodes_0 = runtime.ForwardResponseMessage + + forward_SlurmService_ListUsers_0 = runtime.ForwardResponseMessage + + forward_SlurmService_ListAssociations_0 = runtime.ForwardResponseMessage ) diff --git a/adaptor/pcm_slurm/gen/idl/slurm_grpc.pb.go b/adaptor/pcm_slurm/gen/idl/slurm_grpc.pb.go index 9701ba9b..31156ec9 100644 --- a/adaptor/pcm_slurm/gen/idl/slurm_grpc.pb.go +++ b/adaptor/pcm_slurm/gen/idl/slurm_grpc.pb.go @@ -24,6 +24,10 @@ const _ = grpc.SupportPackageIsVersion7 type SlurmServiceClient interface { // Echo 样例接口 ListNodes(ctx context.Context, in *ListNodesReq, opts ...grpc.CallOption) (*ListNodesResp, error) + // get user info from slurmdb + ListUsers(ctx context.Context, in *ListUsersReq, opts ...grpc.CallOption) (*ListUsersResp, error) + // get association info from slurmdb + ListAssociations(ctx context.Context, in *ListAssociationsReq, opts ...grpc.CallOption) (*ListAssociationsResp, error) } type slurmServiceClient struct { @@ -43,12 +47,34 @@ func (c *slurmServiceClient) ListNodes(ctx context.Context, in *ListNodesReq, op return out, nil } +func (c *slurmServiceClient) ListUsers(ctx context.Context, in *ListUsersReq, opts ...grpc.CallOption) (*ListUsersResp, error) { + out := new(ListUsersResp) + err := c.cc.Invoke(ctx, "/slurm.SlurmService/ListUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *slurmServiceClient) ListAssociations(ctx context.Context, in *ListAssociationsReq, opts ...grpc.CallOption) (*ListAssociationsResp, error) { + out := new(ListAssociationsResp) + err := c.cc.Invoke(ctx, "/slurm.SlurmService/ListAssociations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SlurmServiceServer is the server API for SlurmService service. // All implementations must embed UnimplementedSlurmServiceServer // for forward compatibility type SlurmServiceServer interface { // Echo 样例接口 ListNodes(context.Context, *ListNodesReq) (*ListNodesResp, error) + // get user info from slurmdb + ListUsers(context.Context, *ListUsersReq) (*ListUsersResp, error) + // get association info from slurmdb + ListAssociations(context.Context, *ListAssociationsReq) (*ListAssociationsResp, error) mustEmbedUnimplementedSlurmServiceServer() } @@ -59,6 +85,12 @@ type UnimplementedSlurmServiceServer struct { func (UnimplementedSlurmServiceServer) ListNodes(context.Context, *ListNodesReq) (*ListNodesResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListNodes not implemented") } +func (UnimplementedSlurmServiceServer) ListUsers(context.Context, *ListUsersReq) (*ListUsersResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented") +} +func (UnimplementedSlurmServiceServer) ListAssociations(context.Context, *ListAssociationsReq) (*ListAssociationsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAssociations not implemented") +} func (UnimplementedSlurmServiceServer) mustEmbedUnimplementedSlurmServiceServer() {} // UnsafeSlurmServiceServer may be embedded to opt out of forward compatibility for this service. @@ -90,6 +122,42 @@ func _SlurmService_ListNodes_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _SlurmService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SlurmServiceServer).ListUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slurm.SlurmService/ListUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SlurmServiceServer).ListUsers(ctx, req.(*ListUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SlurmService_ListAssociations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAssociationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SlurmServiceServer).ListAssociations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slurm.SlurmService/ListAssociations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SlurmServiceServer).ListAssociations(ctx, req.(*ListAssociationsReq)) + } + return interceptor(ctx, in, info, handler) +} + // SlurmService_ServiceDesc is the grpc.ServiceDesc for SlurmService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -101,6 +169,14 @@ var SlurmService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListNodes", Handler: _SlurmService_ListNodes_Handler, }, + { + MethodName: "ListUsers", + Handler: _SlurmService_ListUsers_Handler, + }, + { + MethodName: "ListAssociations", + Handler: _SlurmService_ListAssociations_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "idl/slurm.proto", diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_account.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_account.pb.go new file mode 100644 index 00000000..66b251d5 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_account.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_account.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type AccountingInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllocSecs int64 `protobuf:"varint,1,opt,name=allocSecs,proto3" json:"allocSecs,omitempty"` + Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + PeriodStart *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=periodStart,proto3" json:"periodStart,omitempty"` +} + +func (x *AccountingInfo) Reset() { + *x = AccountingInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountingInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountingInfo) ProtoMessage() {} + +func (x *AccountingInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_account_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 AccountingInfo.ProtoReflect.Descriptor instead. +func (*AccountingInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_account_proto_rawDescGZIP(), []int{0} +} + +func (x *AccountingInfo) GetAllocSecs() int64 { + if x != nil { + return x.AllocSecs + } + return 0 +} + +func (x *AccountingInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AccountingInfo) GetPeriodStart() *timestamppb.Timestamp { + if x != nil { + return x.PeriodStart + } + return nil +} + +var File_idl_slurmdb_account_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_account_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x63, + 0x53, 0x65, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x53, 0x65, 0x63, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_account_proto_rawDescOnce sync.Once + file_idl_slurmdb_account_proto_rawDescData = file_idl_slurmdb_account_proto_rawDesc +) + +func file_idl_slurmdb_account_proto_rawDescGZIP() []byte { + file_idl_slurmdb_account_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_account_proto_rawDescData) + }) + return file_idl_slurmdb_account_proto_rawDescData +} + +var file_idl_slurmdb_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_idl_slurmdb_account_proto_goTypes = []interface{}{ + (*AccountingInfo)(nil), // 0: slurm.AccountingInfo + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_idl_slurmdb_account_proto_depIdxs = []int32{ + 1, // 0: slurm.AccountingInfo.periodStart:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_idl_slurmdb_account_proto_init() } +func file_idl_slurmdb_account_proto_init() { + if File_idl_slurmdb_account_proto != nil { + return + } + file_idl_static_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountingInfo); 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_idl_slurmdb_account_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_account_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_account_proto_depIdxs, + MessageInfos: file_idl_slurmdb_account_proto_msgTypes, + }.Build() + File_idl_slurmdb_account_proto = out.File + file_idl_slurmdb_account_proto_rawDesc = nil + file_idl_slurmdb_account_proto_goTypes = nil + file_idl_slurmdb_account_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_assoc.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_assoc.pb.go new file mode 100644 index 00000000..7f1f9cc4 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_assoc.pb.go @@ -0,0 +1,640 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_assoc.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type AssocUsageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AssocUsageInfo) Reset() { + *x = AssocUsageInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_assoc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssocUsageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssocUsageInfo) ProtoMessage() {} + +func (x *AssocUsageInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_assoc_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 AssocUsageInfo.ProtoReflect.Descriptor instead. +func (*AssocUsageInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_assoc_proto_rawDescGZIP(), []int{0} +} + +type AssociationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountingList []*AccountingInfo `protobuf:"bytes,1,rep,name=accountingList,proto3" json:"accountingList,omitempty"` + Acct string `protobuf:"bytes,2,opt,name=acct,proto3" json:"acct,omitempty"` + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + DefQosId int32 `protobuf:"varint,4,opt,name=defQosId,proto3" json:"defQosId,omitempty"` + GrpCpuMins int64 `protobuf:"varint,5,opt,name=grpCpuMins,proto3" json:"grpCpuMins,omitempty"` + GrpGpuRunMins int64 `protobuf:"varint,6,opt,name=grpGpuRunMins,proto3" json:"grpGpuRunMins,omitempty"` + GrpCpus int32 `protobuf:"varint,7,opt,name=grpCpus,proto3" json:"grpCpus,omitempty"` + GrpJobs int32 `protobuf:"varint,8,opt,name=grpJobs,proto3" json:"grpJobs,omitempty"` + GrpMem int32 `protobuf:"varint,9,opt,name=grpMem,proto3" json:"grpMem,omitempty"` + GrpNodes int32 `protobuf:"varint,10,opt,name=grpNodes,proto3" json:"grpNodes,omitempty"` + GrpSubmitJobs int32 `protobuf:"varint,11,opt,name=grpSubmitJobs,proto3" json:"grpSubmitJobs,omitempty"` + GrpWall int32 `protobuf:"varint,12,opt,name=grpWall,proto3" json:"grpWall,omitempty"` + Id int32 `protobuf:"varint,13,opt,name=id,proto3" json:"id,omitempty"` + IsDef int32 `protobuf:"varint,14,opt,name=isDef,proto3" json:"isDef,omitempty"` + Lft int32 `protobuf:"varint,15,opt,name=lft,proto3" json:"lft,omitempty"` + MaxCpuMinsPj int64 `protobuf:"varint,16,opt,name=maxCpuMinsPj,proto3" json:"maxCpuMinsPj,omitempty"` + MaxCpuRunMins int64 `protobuf:"varint,17,opt,name=maxCpuRunMins,proto3" json:"maxCpuRunMins,omitempty"` + MaxCpusPj int32 `protobuf:"varint,18,opt,name=maxCpusPj,proto3" json:"maxCpusPj,omitempty"` + MaxJobs int32 `protobuf:"varint,19,opt,name=maxJobs,proto3" json:"maxJobs,omitempty"` + MaxNodesPj int32 `protobuf:"varint,20,opt,name=maxNodesPj,proto3" json:"maxNodesPj,omitempty"` + MaxSubmitJobs int32 `protobuf:"varint,21,opt,name=maxSubmitJobs,proto3" json:"maxSubmitJobs,omitempty"` + MaxWallPj int32 `protobuf:"varint,22,opt,name=maxWallPj,proto3" json:"maxWallPj,omitempty"` + ParentAcct string `protobuf:"bytes,23,opt,name=parentAcct,proto3" json:"parentAcct,omitempty"` + ParentId int32 `protobuf:"varint,24,opt,name=parentId,proto3" json:"parentId,omitempty"` + Partition string `protobuf:"bytes,25,opt,name=partition,proto3" json:"partition,omitempty"` + QosList []*QosInfo `protobuf:"bytes,26,rep,name=qosList,proto3" json:"qosList,omitempty"` + Rgt int32 `protobuf:"varint,27,opt,name=rgt,proto3" json:"rgt,omitempty"` + SharesRaw int32 `protobuf:"varint,28,opt,name=sharesRaw,proto3" json:"sharesRaw,omitempty"` + Uid int32 `protobuf:"varint,29,opt,name=uid,proto3" json:"uid,omitempty"` + AssocUsage *AssocUsageInfo `protobuf:"bytes,30,opt,name=assocUsage,proto3" json:"assocUsage,omitempty"` + User string `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *AssociationInfo) Reset() { + *x = AssociationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_assoc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssociationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssociationInfo) ProtoMessage() {} + +func (x *AssociationInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_assoc_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 AssociationInfo.ProtoReflect.Descriptor instead. +func (*AssociationInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_assoc_proto_rawDescGZIP(), []int{1} +} + +func (x *AssociationInfo) GetAccountingList() []*AccountingInfo { + if x != nil { + return x.AccountingList + } + return nil +} + +func (x *AssociationInfo) GetAcct() string { + if x != nil { + return x.Acct + } + return "" +} + +func (x *AssociationInfo) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *AssociationInfo) GetDefQosId() int32 { + if x != nil { + return x.DefQosId + } + return 0 +} + +func (x *AssociationInfo) GetGrpCpuMins() int64 { + if x != nil { + return x.GrpCpuMins + } + return 0 +} + +func (x *AssociationInfo) GetGrpGpuRunMins() int64 { + if x != nil { + return x.GrpGpuRunMins + } + return 0 +} + +func (x *AssociationInfo) GetGrpCpus() int32 { + if x != nil { + return x.GrpCpus + } + return 0 +} + +func (x *AssociationInfo) GetGrpJobs() int32 { + if x != nil { + return x.GrpJobs + } + return 0 +} + +func (x *AssociationInfo) GetGrpMem() int32 { + if x != nil { + return x.GrpMem + } + return 0 +} + +func (x *AssociationInfo) GetGrpNodes() int32 { + if x != nil { + return x.GrpNodes + } + return 0 +} + +func (x *AssociationInfo) GetGrpSubmitJobs() int32 { + if x != nil { + return x.GrpSubmitJobs + } + return 0 +} + +func (x *AssociationInfo) GetGrpWall() int32 { + if x != nil { + return x.GrpWall + } + return 0 +} + +func (x *AssociationInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AssociationInfo) GetIsDef() int32 { + if x != nil { + return x.IsDef + } + return 0 +} + +func (x *AssociationInfo) GetLft() int32 { + if x != nil { + return x.Lft + } + return 0 +} + +func (x *AssociationInfo) GetMaxCpuMinsPj() int64 { + if x != nil { + return x.MaxCpuMinsPj + } + return 0 +} + +func (x *AssociationInfo) GetMaxCpuRunMins() int64 { + if x != nil { + return x.MaxCpuRunMins + } + return 0 +} + +func (x *AssociationInfo) GetMaxCpusPj() int32 { + if x != nil { + return x.MaxCpusPj + } + return 0 +} + +func (x *AssociationInfo) GetMaxJobs() int32 { + if x != nil { + return x.MaxJobs + } + return 0 +} + +func (x *AssociationInfo) GetMaxNodesPj() int32 { + if x != nil { + return x.MaxNodesPj + } + return 0 +} + +func (x *AssociationInfo) GetMaxSubmitJobs() int32 { + if x != nil { + return x.MaxSubmitJobs + } + return 0 +} + +func (x *AssociationInfo) GetMaxWallPj() int32 { + if x != nil { + return x.MaxWallPj + } + return 0 +} + +func (x *AssociationInfo) GetParentAcct() string { + if x != nil { + return x.ParentAcct + } + return "" +} + +func (x *AssociationInfo) GetParentId() int32 { + if x != nil { + return x.ParentId + } + return 0 +} + +func (x *AssociationInfo) GetPartition() string { + if x != nil { + return x.Partition + } + return "" +} + +func (x *AssociationInfo) GetQosList() []*QosInfo { + if x != nil { + return x.QosList + } + return nil +} + +func (x *AssociationInfo) GetRgt() int32 { + if x != nil { + return x.Rgt + } + return 0 +} + +func (x *AssociationInfo) GetSharesRaw() int32 { + if x != nil { + return x.SharesRaw + } + return 0 +} + +func (x *AssociationInfo) GetUid() int32 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *AssociationInfo) GetAssocUsage() *AssocUsageInfo { + if x != nil { + return x.AssocUsage + } + return nil +} + +func (x *AssociationInfo) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +type ListAssociationsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SlurmVersion SlurmVersion `protobuf:"varint,1,opt,name=slurm_version,json=slurmVersion,proto3,enum=slurm.SlurmVersion" json:"slurm_version,omitempty"` +} + +func (x *ListAssociationsReq) Reset() { + *x = ListAssociationsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_assoc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAssociationsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAssociationsReq) ProtoMessage() {} + +func (x *ListAssociationsReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_assoc_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 ListAssociationsReq.ProtoReflect.Descriptor instead. +func (*ListAssociationsReq) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_assoc_proto_rawDescGZIP(), []int{2} +} + +func (x *ListAssociationsReq) GetSlurmVersion() SlurmVersion { + if x != nil { + return x.SlurmVersion + } + return SlurmVersion_tianhe +} + +type ListAssociationsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AssocInfos []*AssociationInfo `protobuf:"bytes,1,rep,name=assoc_infos,json=assocInfos,proto3" json:"assoc_infos,omitempty"` +} + +func (x *ListAssociationsResp) Reset() { + *x = ListAssociationsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_assoc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAssociationsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAssociationsResp) ProtoMessage() {} + +func (x *ListAssociationsResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_assoc_proto_msgTypes[3] + 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 ListAssociationsResp.ProtoReflect.Descriptor instead. +func (*ListAssociationsResp) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_assoc_proto_rawDescGZIP(), []int{3} +} + +func (x *ListAssociationsResp) GetAssocInfos() []*AssociationInfo { + if x != nil { + return x.AssocInfos + } + return nil +} + +var File_idl_slurmdb_assoc_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_assoc_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x61, 0x73, + 0x73, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, + 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x71, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xb7, 0x07, 0x0a, 0x0f, 0x41, 0x73, 0x73, 0x6f, + 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3d, 0x0a, 0x0e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x63, + 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x63, 0x63, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x51, + 0x6f, 0x73, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x65, 0x66, 0x51, + 0x6f, 0x73, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x72, 0x70, 0x43, 0x70, 0x75, 0x4d, 0x69, + 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x72, 0x70, 0x43, 0x70, 0x75, + 0x4d, 0x69, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x70, 0x47, 0x70, 0x75, 0x52, 0x75, + 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x67, 0x72, 0x70, + 0x47, 0x70, 0x75, 0x52, 0x75, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, + 0x70, 0x43, 0x70, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x70, + 0x43, 0x70, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x70, 0x4a, 0x6f, 0x62, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x70, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x67, 0x72, 0x70, 0x4d, 0x65, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x67, 0x72, 0x70, 0x4d, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x70, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x70, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4a, + 0x6f, 0x62, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x67, 0x72, 0x70, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x70, 0x57, + 0x61, 0x6c, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x70, 0x57, 0x61, + 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x44, 0x65, 0x66, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x69, 0x73, 0x44, 0x65, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x66, 0x74, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x66, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, + 0x78, 0x43, 0x70, 0x75, 0x4d, 0x69, 0x6e, 0x73, 0x50, 0x6a, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x4d, 0x69, 0x6e, 0x73, 0x50, 0x6a, 0x12, 0x24, + 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x52, 0x75, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x52, 0x75, 0x6e, + 0x4d, 0x69, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, 0x50, + 0x6a, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, + 0x50, 0x6a, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x4a, 0x6f, 0x62, 0x73, 0x18, 0x13, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x1e, 0x0a, 0x0a, + 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x6a, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x6a, 0x12, 0x24, 0x0a, 0x0d, + 0x6d, 0x61, 0x78, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4a, 0x6f, + 0x62, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x6c, 0x6c, 0x50, 0x6a, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x6c, 0x6c, 0x50, 0x6a, + 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x74, 0x18, 0x17, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x18, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x07, 0x71, 0x6f, + 0x73, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x6c, + 0x75, 0x72, 0x6d, 0x2e, 0x51, 0x6f, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x71, 0x6f, 0x73, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x67, 0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x72, 0x67, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, + 0x52, 0x61, 0x77, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x73, 0x52, 0x61, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x2e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x55, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x22, 0x4f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x0d, 0x73, 0x6c, 0x75, 0x72, + 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x13, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x0b, 0x61, 0x73, + 0x73, 0x6f, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x49, 0x6e, + 0x66, 0x6f, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_assoc_proto_rawDescOnce sync.Once + file_idl_slurmdb_assoc_proto_rawDescData = file_idl_slurmdb_assoc_proto_rawDesc +) + +func file_idl_slurmdb_assoc_proto_rawDescGZIP() []byte { + file_idl_slurmdb_assoc_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_assoc_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_assoc_proto_rawDescData) + }) + return file_idl_slurmdb_assoc_proto_rawDescData +} + +var file_idl_slurmdb_assoc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_idl_slurmdb_assoc_proto_goTypes = []interface{}{ + (*AssocUsageInfo)(nil), // 0: slurm.AssocUsageInfo + (*AssociationInfo)(nil), // 1: slurm.AssociationInfo + (*ListAssociationsReq)(nil), // 2: slurm.ListAssociationsReq + (*ListAssociationsResp)(nil), // 3: slurm.ListAssociationsResp + (*AccountingInfo)(nil), // 4: slurm.AccountingInfo + (*QosInfo)(nil), // 5: slurm.QosInfo + (SlurmVersion)(0), // 6: slurm.SlurmVersion +} +var file_idl_slurmdb_assoc_proto_depIdxs = []int32{ + 4, // 0: slurm.AssociationInfo.accountingList:type_name -> slurm.AccountingInfo + 5, // 1: slurm.AssociationInfo.qosList:type_name -> slurm.QosInfo + 0, // 2: slurm.AssociationInfo.assocUsage:type_name -> slurm.AssocUsageInfo + 6, // 3: slurm.ListAssociationsReq.slurm_version:type_name -> slurm.SlurmVersion + 1, // 4: slurm.ListAssociationsResp.assoc_infos:type_name -> slurm.AssociationInfo + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_idl_slurmdb_assoc_proto_init() } +func file_idl_slurmdb_assoc_proto_init() { + if File_idl_slurmdb_assoc_proto != nil { + return + } + file_idl_static_proto_init() + file_idl_slurmdb_account_proto_init() + file_idl_slurmdb_qos_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_assoc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssocUsageInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_assoc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssociationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_assoc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAssociationsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_assoc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAssociationsResp); 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_idl_slurmdb_assoc_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_assoc_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_assoc_proto_depIdxs, + MessageInfos: file_idl_slurmdb_assoc_proto_msgTypes, + }.Build() + File_idl_slurmdb_assoc_proto = out.File + file_idl_slurmdb_assoc_proto_rawDesc = nil + file_idl_slurmdb_assoc_proto_goTypes = nil + file_idl_slurmdb_assoc_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_cluster.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_cluster.pb.go new file mode 100644 index 00000000..25d8c0e4 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_cluster.pb.go @@ -0,0 +1,280 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_cluster.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type ClusterInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountingList []*AccountingInfo `protobuf:"bytes,1,rep,name=accountingList,proto3" json:"accountingList,omitempty"` + Classification int32 `protobuf:"varint,2,opt,name=classification,proto3" json:"classification,omitempty"` + // slurm_addr_t control_addr; + ControlHost string `protobuf:"bytes,3,opt,name=controlHost,proto3" json:"controlHost,omitempty"` + ControlPort int32 `protobuf:"varint,4,opt,name=controlPort,proto3" json:"controlPort,omitempty"` + CpuCount int32 `protobuf:"varint,5,opt,name=cpuCount,proto3" json:"cpuCount,omitempty"` + Dimensions int32 `protobuf:"varint,6,opt,name=dimensions,proto3" json:"dimensions,omitempty"` + DimSize int32 `protobuf:"varint,7,opt,name=dimSize,proto3" json:"dimSize,omitempty"` + Flags int32 `protobuf:"varint,8,opt,name=flags,proto3" json:"flags,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Nodes string `protobuf:"bytes,10,opt,name=nodes,proto3" json:"nodes,omitempty"` + PluginIdSelect int32 `protobuf:"varint,11,opt,name=pluginIdSelect,proto3" json:"pluginIdSelect,omitempty"` + RootAssoc *AssociationInfo `protobuf:"bytes,12,opt,name=rootAssoc,proto3" json:"rootAssoc,omitempty"` + RpcVersion int32 `protobuf:"varint,13,opt,name=rpcVersion,proto3" json:"rpcVersion,omitempty"` +} + +func (x *ClusterInfo) Reset() { + *x = ClusterInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterInfo) ProtoMessage() {} + +func (x *ClusterInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_cluster_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 ClusterInfo.ProtoReflect.Descriptor instead. +func (*ClusterInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_cluster_proto_rawDescGZIP(), []int{0} +} + +func (x *ClusterInfo) GetAccountingList() []*AccountingInfo { + if x != nil { + return x.AccountingList + } + return nil +} + +func (x *ClusterInfo) GetClassification() int32 { + if x != nil { + return x.Classification + } + return 0 +} + +func (x *ClusterInfo) GetControlHost() string { + if x != nil { + return x.ControlHost + } + return "" +} + +func (x *ClusterInfo) GetControlPort() int32 { + if x != nil { + return x.ControlPort + } + return 0 +} + +func (x *ClusterInfo) GetCpuCount() int32 { + if x != nil { + return x.CpuCount + } + return 0 +} + +func (x *ClusterInfo) GetDimensions() int32 { + if x != nil { + return x.Dimensions + } + return 0 +} + +func (x *ClusterInfo) GetDimSize() int32 { + if x != nil { + return x.DimSize + } + return 0 +} + +func (x *ClusterInfo) GetFlags() int32 { + if x != nil { + return x.Flags + } + return 0 +} + +func (x *ClusterInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterInfo) GetNodes() string { + if x != nil { + return x.Nodes + } + return "" +} + +func (x *ClusterInfo) GetPluginIdSelect() int32 { + if x != nil { + return x.PluginIdSelect + } + return 0 +} + +func (x *ClusterInfo) GetRootAssoc() *AssociationInfo { + if x != nil { + return x.RootAssoc + } + return nil +} + +func (x *ClusterInfo) GetRpcVersion() int32 { + if x != nil { + return x.RpcVersion + } + return 0 +} + +var File_idl_slurmdb_cluster_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_cluster_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, + 0x64, 0x62, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x61, 0x73, + 0x73, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x03, 0x0a, 0x0b, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3d, 0x0a, 0x0e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x48, 0x6f, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x48, 0x6f, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x6f, 0x72, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x64, 0x69, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x73, + 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x72, + 0x6f, 0x6f, 0x74, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x70, 0x63, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x70, + 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, + 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_cluster_proto_rawDescOnce sync.Once + file_idl_slurmdb_cluster_proto_rawDescData = file_idl_slurmdb_cluster_proto_rawDesc +) + +func file_idl_slurmdb_cluster_proto_rawDescGZIP() []byte { + file_idl_slurmdb_cluster_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_cluster_proto_rawDescData) + }) + return file_idl_slurmdb_cluster_proto_rawDescData +} + +var file_idl_slurmdb_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_idl_slurmdb_cluster_proto_goTypes = []interface{}{ + (*ClusterInfo)(nil), // 0: slurm.ClusterInfo + (*AccountingInfo)(nil), // 1: slurm.AccountingInfo + (*AssociationInfo)(nil), // 2: slurm.AssociationInfo +} +var file_idl_slurmdb_cluster_proto_depIdxs = []int32{ + 1, // 0: slurm.ClusterInfo.accountingList:type_name -> slurm.AccountingInfo + 2, // 1: slurm.ClusterInfo.rootAssoc:type_name -> slurm.AssociationInfo + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] 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_idl_slurmdb_cluster_proto_init() } +func file_idl_slurmdb_cluster_proto_init() { + if File_idl_slurmdb_cluster_proto != nil { + return + } + file_idl_static_proto_init() + file_idl_slurmdb_account_proto_init() + file_idl_slurmdb_assoc_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterInfo); 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_idl_slurmdb_cluster_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_cluster_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_cluster_proto_depIdxs, + MessageInfos: file_idl_slurmdb_cluster_proto_msgTypes, + }.Build() + File_idl_slurmdb_cluster_proto = out.File + file_idl_slurmdb_cluster_proto_rawDesc = nil + file_idl_slurmdb_cluster_proto_goTypes = nil + file_idl_slurmdb_cluster_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_coord.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_coord.pb.go new file mode 100644 index 00000000..e964764c --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_coord.pb.go @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_coord.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type CoordInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Direct int32 `protobuf:"varint,2,opt,name=direct,proto3" json:"direct,omitempty"` +} + +func (x *CoordInfo) Reset() { + *x = CoordInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_coord_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoordInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoordInfo) ProtoMessage() {} + +func (x *CoordInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_coord_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 CoordInfo.ProtoReflect.Descriptor instead. +func (*CoordInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_coord_proto_rawDescGZIP(), []int{0} +} + +func (x *CoordInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CoordInfo) GetDirect() int32 { + if x != nil { + return x.Direct + } + return 0 +} + +var File_idl_slurmdb_coord_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_coord_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x63, 0x6f, + 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x37, 0x0a, 0x09, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x42, 0x0a, 0x5a, 0x08, + 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_coord_proto_rawDescOnce sync.Once + file_idl_slurmdb_coord_proto_rawDescData = file_idl_slurmdb_coord_proto_rawDesc +) + +func file_idl_slurmdb_coord_proto_rawDescGZIP() []byte { + file_idl_slurmdb_coord_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_coord_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_coord_proto_rawDescData) + }) + return file_idl_slurmdb_coord_proto_rawDescData +} + +var file_idl_slurmdb_coord_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_idl_slurmdb_coord_proto_goTypes = []interface{}{ + (*CoordInfo)(nil), // 0: slurm.CoordInfo +} +var file_idl_slurmdb_coord_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_idl_slurmdb_coord_proto_init() } +func file_idl_slurmdb_coord_proto_init() { + if File_idl_slurmdb_coord_proto != nil { + return + } + file_idl_static_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_coord_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoordInfo); 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_idl_slurmdb_coord_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_coord_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_coord_proto_depIdxs, + MessageInfos: file_idl_slurmdb_coord_proto_msgTypes, + }.Build() + File_idl_slurmdb_coord_proto = out.File + file_idl_slurmdb_coord_proto_rawDesc = nil + file_idl_slurmdb_coord_proto_goTypes = nil + file_idl_slurmdb_coord_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_qos.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_qos.pb.go new file mode 100644 index 00000000..9379a99e --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_qos.pb.go @@ -0,0 +1,470 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_qos.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type QosUsageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QosUsageInfo) Reset() { + *x = QosUsageInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_qos_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QosUsageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QosUsageInfo) ProtoMessage() {} + +func (x *QosUsageInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_qos_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 QosUsageInfo.ProtoReflect.Descriptor instead. +func (*QosUsageInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_qos_proto_rawDescGZIP(), []int{0} +} + +type QosInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Flags int32 `protobuf:"varint,3,opt,name=flags,proto3" json:"flags,omitempty"` + GraceTime int32 `protobuf:"varint,4,opt,name=graceTime,proto3" json:"graceTime,omitempty"` + GrpCpuMins int64 `protobuf:"varint,5,opt,name=grpCpuMins,proto3" json:"grpCpuMins,omitempty"` + GrpCpuRunMins int64 `protobuf:"varint,6,opt,name=grpCpuRunMins,proto3" json:"grpCpuRunMins,omitempty"` + GrpCpus int32 `protobuf:"varint,7,opt,name=grpCpus,proto3" json:"grpCpus,omitempty"` + GrpJobs int32 `protobuf:"varint,8,opt,name=grpJobs,proto3" json:"grpJobs,omitempty"` + GrpMem int32 `protobuf:"varint,9,opt,name=grp_mem,json=grpMem,proto3" json:"grp_mem,omitempty"` + GrpNodes int32 `protobuf:"varint,10,opt,name=grp_nodes,json=grpNodes,proto3" json:"grp_nodes,omitempty"` + GrpSubmitJobs int32 `protobuf:"varint,11,opt,name=grp_submitJobs,json=grpSubmitJobs,proto3" json:"grp_submitJobs,omitempty"` + GrpWall int32 `protobuf:"varint,12,opt,name=grp_wall,json=grpWall,proto3" json:"grp_wall,omitempty"` + MaxCpuMinsPj int64 `protobuf:"varint,13,opt,name=maxCpuMinsPj,proto3" json:"maxCpuMinsPj,omitempty"` + MaxCpuRunMinsPu int64 `protobuf:"varint,14,opt,name=maxCpuRunMinsPu,proto3" json:"maxCpuRunMinsPu,omitempty"` + MaxCpusPj int32 `protobuf:"varint,15,opt,name=maxCpusPj,proto3" json:"maxCpusPj,omitempty"` + MaxCpusPu int32 `protobuf:"varint,16,opt,name=maxCpusPu,proto3" json:"maxCpusPu,omitempty"` + MaxJobsPu int32 `protobuf:"varint,17,opt,name=maxJobsPu,proto3" json:"maxJobsPu,omitempty"` + MaxNodesPj int32 `protobuf:"varint,18,opt,name=max_nodesPj,json=maxNodesPj,proto3" json:"max_nodesPj,omitempty"` + MaxSubmitJobsPu int32 `protobuf:"varint,19,opt,name=maxSubmitJobsPu,proto3" json:"maxSubmitJobsPu,omitempty"` + MaxWallPj int32 `protobuf:"varint,20,opt,name=maxWallPj,proto3" json:"maxWallPj,omitempty"` + Name string `protobuf:"bytes,21,opt,name=name,proto3" json:"name,omitempty"` + PreemptBitstr int32 `protobuf:"varint,22,opt,name=preemptBitstr,proto3" json:"preemptBitstr,omitempty"` + PreemptList []string `protobuf:"bytes,23,rep,name=preemptList,proto3" json:"preemptList,omitempty"` + PreemptMode int32 `protobuf:"varint,24,opt,name=preemptMode,proto3" json:"preemptMode,omitempty"` + Priority int32 `protobuf:"varint,25,opt,name=priority,proto3" json:"priority,omitempty"` + Usage *QosUsageInfo `protobuf:"bytes,26,opt,name=usage,proto3" json:"usage,omitempty"` + UsageFactor float64 `protobuf:"fixed64,27,opt,name=usageFactor,proto3" json:"usageFactor,omitempty"` + UsageThres float64 `protobuf:"fixed64,28,opt,name=usageThres,proto3" json:"usageThres,omitempty"` +} + +func (x *QosInfo) Reset() { + *x = QosInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_qos_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QosInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QosInfo) ProtoMessage() {} + +func (x *QosInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_qos_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 QosInfo.ProtoReflect.Descriptor instead. +func (*QosInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_qos_proto_rawDescGZIP(), []int{1} +} + +func (x *QosInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *QosInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QosInfo) GetFlags() int32 { + if x != nil { + return x.Flags + } + return 0 +} + +func (x *QosInfo) GetGraceTime() int32 { + if x != nil { + return x.GraceTime + } + return 0 +} + +func (x *QosInfo) GetGrpCpuMins() int64 { + if x != nil { + return x.GrpCpuMins + } + return 0 +} + +func (x *QosInfo) GetGrpCpuRunMins() int64 { + if x != nil { + return x.GrpCpuRunMins + } + return 0 +} + +func (x *QosInfo) GetGrpCpus() int32 { + if x != nil { + return x.GrpCpus + } + return 0 +} + +func (x *QosInfo) GetGrpJobs() int32 { + if x != nil { + return x.GrpJobs + } + return 0 +} + +func (x *QosInfo) GetGrpMem() int32 { + if x != nil { + return x.GrpMem + } + return 0 +} + +func (x *QosInfo) GetGrpNodes() int32 { + if x != nil { + return x.GrpNodes + } + return 0 +} + +func (x *QosInfo) GetGrpSubmitJobs() int32 { + if x != nil { + return x.GrpSubmitJobs + } + return 0 +} + +func (x *QosInfo) GetGrpWall() int32 { + if x != nil { + return x.GrpWall + } + return 0 +} + +func (x *QosInfo) GetMaxCpuMinsPj() int64 { + if x != nil { + return x.MaxCpuMinsPj + } + return 0 +} + +func (x *QosInfo) GetMaxCpuRunMinsPu() int64 { + if x != nil { + return x.MaxCpuRunMinsPu + } + return 0 +} + +func (x *QosInfo) GetMaxCpusPj() int32 { + if x != nil { + return x.MaxCpusPj + } + return 0 +} + +func (x *QosInfo) GetMaxCpusPu() int32 { + if x != nil { + return x.MaxCpusPu + } + return 0 +} + +func (x *QosInfo) GetMaxJobsPu() int32 { + if x != nil { + return x.MaxJobsPu + } + return 0 +} + +func (x *QosInfo) GetMaxNodesPj() int32 { + if x != nil { + return x.MaxNodesPj + } + return 0 +} + +func (x *QosInfo) GetMaxSubmitJobsPu() int32 { + if x != nil { + return x.MaxSubmitJobsPu + } + return 0 +} + +func (x *QosInfo) GetMaxWallPj() int32 { + if x != nil { + return x.MaxWallPj + } + return 0 +} + +func (x *QosInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QosInfo) GetPreemptBitstr() int32 { + if x != nil { + return x.PreemptBitstr + } + return 0 +} + +func (x *QosInfo) GetPreemptList() []string { + if x != nil { + return x.PreemptList + } + return nil +} + +func (x *QosInfo) GetPreemptMode() int32 { + if x != nil { + return x.PreemptMode + } + return 0 +} + +func (x *QosInfo) GetPriority() int32 { + if x != nil { + return x.Priority + } + return 0 +} + +func (x *QosInfo) GetUsage() *QosUsageInfo { + if x != nil { + return x.Usage + } + return nil +} + +func (x *QosInfo) GetUsageFactor() float64 { + if x != nil { + return x.UsageFactor + } + return 0 +} + +func (x *QosInfo) GetUsageThres() float64 { + if x != nil { + return x.UsageThres + } + return 0 +} + +var File_idl_slurmdb_qos_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_qos_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x71, 0x6f, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x51, 0x6f, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x22, 0xf9, 0x06, 0x0a, 0x07, 0x51, 0x6f, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x61, 0x63, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, 0x61, 0x63, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x72, 0x70, 0x43, 0x70, 0x75, 0x4d, 0x69, 0x6e, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x72, 0x70, 0x43, 0x70, 0x75, 0x4d, + 0x69, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x72, 0x70, 0x43, 0x70, 0x75, 0x52, 0x75, 0x6e, + 0x4d, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x67, 0x72, 0x70, 0x43, + 0x70, 0x75, 0x52, 0x75, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x70, + 0x43, 0x70, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x70, 0x43, + 0x70, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x70, 0x4a, 0x6f, 0x62, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x70, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x67, 0x72, 0x70, 0x5f, 0x6d, 0x65, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x67, 0x72, 0x70, 0x4d, 0x65, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x70, 0x5f, 0x6e, 0x6f, + 0x64, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x70, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x67, 0x72, 0x70, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x67, 0x72, 0x70, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, + 0x70, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, + 0x70, 0x57, 0x61, 0x6c, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x4d, + 0x69, 0x6e, 0x73, 0x50, 0x6a, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x61, 0x78, + 0x43, 0x70, 0x75, 0x4d, 0x69, 0x6e, 0x73, 0x50, 0x6a, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x61, 0x78, + 0x43, 0x70, 0x75, 0x52, 0x75, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x50, 0x75, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x52, 0x75, 0x6e, 0x4d, 0x69, 0x6e, + 0x73, 0x50, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, 0x50, 0x6a, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, 0x50, + 0x6a, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, 0x50, 0x75, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x73, 0x50, 0x75, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4a, 0x6f, 0x62, 0x73, 0x50, 0x75, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4a, 0x6f, 0x62, 0x73, 0x50, 0x75, 0x12, 0x1f, 0x0a, + 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x6a, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x6a, 0x12, 0x28, + 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x50, + 0x75, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x50, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x57, + 0x61, 0x6c, 0x6c, 0x50, 0x6a, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, + 0x57, 0x61, 0x6c, 0x6c, 0x50, 0x6a, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x15, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, + 0x65, 0x65, 0x6d, 0x70, 0x74, 0x42, 0x69, 0x74, 0x73, 0x74, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x65, 0x6d, 0x70, 0x74, 0x42, 0x69, 0x74, 0x73, 0x74, 0x72, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x65, 0x6d, 0x70, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, + 0x17, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x65, 0x6d, 0x70, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x65, 0x6d, 0x70, 0x74, 0x4d, 0x6f, 0x64, + 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x65, 0x6d, 0x70, 0x74, + 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x29, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x51, 0x6f, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x0b, 0x75, 0x73, 0x61, 0x67, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x75, 0x73, 0x61, 0x67, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x0a, 0x75, 0x73, 0x61, 0x67, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x42, 0x0a, 0x5a, + 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_idl_slurmdb_qos_proto_rawDescOnce sync.Once + file_idl_slurmdb_qos_proto_rawDescData = file_idl_slurmdb_qos_proto_rawDesc +) + +func file_idl_slurmdb_qos_proto_rawDescGZIP() []byte { + file_idl_slurmdb_qos_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_qos_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_qos_proto_rawDescData) + }) + return file_idl_slurmdb_qos_proto_rawDescData +} + +var file_idl_slurmdb_qos_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_idl_slurmdb_qos_proto_goTypes = []interface{}{ + (*QosUsageInfo)(nil), // 0: slurm.QosUsageInfo + (*QosInfo)(nil), // 1: slurm.QosInfo +} +var file_idl_slurmdb_qos_proto_depIdxs = []int32{ + 0, // 0: slurm.QosInfo.usage:type_name -> slurm.QosUsageInfo + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_idl_slurmdb_qos_proto_init() } +func file_idl_slurmdb_qos_proto_init() { + if File_idl_slurmdb_qos_proto != nil { + return + } + file_idl_static_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_qos_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QosUsageInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_qos_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QosInfo); 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_idl_slurmdb_qos_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_qos_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_qos_proto_depIdxs, + MessageInfos: file_idl_slurmdb_qos_proto_msgTypes, + }.Build() + File_idl_slurmdb_qos_proto = out.File + file_idl_slurmdb_qos_proto_rawDesc = nil + file_idl_slurmdb_qos_proto_goTypes = nil + file_idl_slurmdb_qos_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_user.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_user.pb.go new file mode 100644 index 00000000..a808c905 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_user.pb.go @@ -0,0 +1,567 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_user.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type UserInfoList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserInfos []*UserInfo `protobuf:"bytes,1,rep,name=userInfos,proto3" json:"userInfos,omitempty"` +} + +func (x *UserInfoList) Reset() { + *x = UserInfoList{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserInfoList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInfoList) ProtoMessage() {} + +func (x *UserInfoList) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_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 UserInfoList.ProtoReflect.Descriptor instead. +func (*UserInfoList) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{0} +} + +func (x *UserInfoList) GetUserInfos() []*UserInfo { + if x != nil { + return x.UserInfos + } + return nil +} + +type UserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AdminLevel int32 `protobuf:"varint,1,opt,name=adminLevel,proto3" json:"adminLevel,omitempty"` + AssocList []*AssociationInfo `protobuf:"bytes,2,rep,name=assocList,proto3" json:"assocList,omitempty"` + CoordList []*CoordInfo `protobuf:"bytes,3,rep,name=coordList,proto3" json:"coordList,omitempty"` + DefaultAcct string `protobuf:"bytes,4,opt,name=defaultAcct,proto3" json:"defaultAcct,omitempty"` + DefaultWckey string `protobuf:"bytes,5,opt,name=defaultWckey,proto3" json:"defaultWckey,omitempty"` + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` + OldName string `protobuf:"bytes,7,opt,name=oldName,proto3" json:"oldName,omitempty"` + Uid int32 `protobuf:"varint,8,opt,name=uid,proto3" json:"uid,omitempty"` + WckeyList []*WckeyInfo `protobuf:"bytes,9,rep,name=wckeyList,proto3" json:"wckeyList,omitempty"` +} + +func (x *UserInfo) Reset() { + *x = UserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInfo) ProtoMessage() {} + +func (x *UserInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_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 UserInfo.ProtoReflect.Descriptor instead. +func (*UserInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{1} +} + +func (x *UserInfo) GetAdminLevel() int32 { + if x != nil { + return x.AdminLevel + } + return 0 +} + +func (x *UserInfo) GetAssocList() []*AssociationInfo { + if x != nil { + return x.AssocList + } + return nil +} + +func (x *UserInfo) GetCoordList() []*CoordInfo { + if x != nil { + return x.CoordList + } + return nil +} + +func (x *UserInfo) GetDefaultAcct() string { + if x != nil { + return x.DefaultAcct + } + return "" +} + +func (x *UserInfo) GetDefaultWckey() string { + if x != nil { + return x.DefaultWckey + } + return "" +} + +func (x *UserInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserInfo) GetOldName() string { + if x != nil { + return x.OldName + } + return "" +} + +func (x *UserInfo) GetUid() int32 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *UserInfo) GetWckeyList() []*WckeyInfo { + if x != nil { + return x.WckeyList + } + return nil +} + +type ListUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SlurmVersion SlurmVersion `protobuf:"varint,1,opt,name=slurm_version,json=slurmVersion,proto3,enum=slurm.SlurmVersion" json:"slurm_version,omitempty"` +} + +func (x *ListUsersReq) Reset() { + *x = ListUsersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersReq) ProtoMessage() {} + +func (x *ListUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_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 ListUsersReq.ProtoReflect.Descriptor instead. +func (*ListUsersReq) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{2} +} + +func (x *ListUsersReq) GetSlurmVersion() SlurmVersion { + if x != nil { + return x.SlurmVersion + } + return SlurmVersion_tianhe +} + +type ListUsersResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserInfos []*UserInfo `protobuf:"bytes,1,rep,name=user_infos,json=userInfos,proto3" json:"user_infos,omitempty"` +} + +func (x *ListUsersResp) Reset() { + *x = ListUsersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersResp) ProtoMessage() {} + +func (x *ListUsersResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_proto_msgTypes[3] + 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 ListUsersResp.ProtoReflect.Descriptor instead. +func (*ListUsersResp) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{3} +} + +func (x *ListUsersResp) GetUserInfos() []*UserInfo { + if x != nil { + return x.UserInfos + } + return nil +} + +type AddUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserInfo *UserInfo `protobuf:"bytes,1,opt,name=user_info,json=userInfo,proto3" json:"user_info,omitempty"` +} + +func (x *AddUsersReq) Reset() { + *x = AddUsersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddUsersReq) ProtoMessage() {} + +func (x *AddUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_proto_msgTypes[4] + 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 AddUsersReq.ProtoReflect.Descriptor instead. +func (*AddUsersReq) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{4} +} + +func (x *AddUsersReq) GetUserInfo() *UserInfo { + if x != nil { + return x.UserInfo + } + return nil +} + +type AddUsersResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result int32 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *AddUsersResp) Reset() { + *x = AddUsersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddUsersResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddUsersResp) ProtoMessage() {} + +func (x *AddUsersResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_user_proto_msgTypes[5] + 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 AddUsersResp.ProtoReflect.Descriptor instead. +func (*AddUsersResp) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_user_proto_rawDescGZIP(), []int{5} +} + +func (x *AddUsersResp) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +var File_idl_slurmdb_user_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_user_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x64, 0x6c, + 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x77, 0x63, 0x6b, 0x65, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, + 0x62, 0x5f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3d, 0x0a, + 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, + 0x09, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0xc6, 0x02, 0x0a, + 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x34, 0x0a, 0x09, 0x61, 0x73, 0x73, + 0x6f, 0x63, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, + 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x2e, 0x0a, 0x09, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x43, 0x6f, 0x6f, 0x72, 0x64, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x63, 0x63, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x63, 0x63, + 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x57, 0x63, 0x6b, 0x65, + 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x57, 0x63, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x6c, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x77, 0x63, 0x6b, 0x65, 0x79, 0x4c, 0x69, + 0x73, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, + 0x2e, 0x57, 0x63, 0x6b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x77, 0x63, 0x6b, 0x65, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x0d, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x73, + 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x53, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x0c, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x2e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, + 0x22, 0x3b, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x2c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x26, 0x0a, + 0x0c, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_user_proto_rawDescOnce sync.Once + file_idl_slurmdb_user_proto_rawDescData = file_idl_slurmdb_user_proto_rawDesc +) + +func file_idl_slurmdb_user_proto_rawDescGZIP() []byte { + file_idl_slurmdb_user_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_user_proto_rawDescData) + }) + return file_idl_slurmdb_user_proto_rawDescData +} + +var file_idl_slurmdb_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_idl_slurmdb_user_proto_goTypes = []interface{}{ + (*UserInfoList)(nil), // 0: slurm.UserInfoList + (*UserInfo)(nil), // 1: slurm.UserInfo + (*ListUsersReq)(nil), // 2: slurm.ListUsersReq + (*ListUsersResp)(nil), // 3: slurm.ListUsersResp + (*AddUsersReq)(nil), // 4: slurm.AddUsersReq + (*AddUsersResp)(nil), // 5: slurm.AddUsersResp + (*AssociationInfo)(nil), // 6: slurm.AssociationInfo + (*CoordInfo)(nil), // 7: slurm.CoordInfo + (*WckeyInfo)(nil), // 8: slurm.WckeyInfo + (SlurmVersion)(0), // 9: slurm.SlurmVersion +} +var file_idl_slurmdb_user_proto_depIdxs = []int32{ + 1, // 0: slurm.UserInfoList.userInfos:type_name -> slurm.UserInfo + 6, // 1: slurm.UserInfo.assocList:type_name -> slurm.AssociationInfo + 7, // 2: slurm.UserInfo.coordList:type_name -> slurm.CoordInfo + 8, // 3: slurm.UserInfo.wckeyList:type_name -> slurm.WckeyInfo + 9, // 4: slurm.ListUsersReq.slurm_version:type_name -> slurm.SlurmVersion + 1, // 5: slurm.ListUsersResp.user_infos:type_name -> slurm.UserInfo + 1, // 6: slurm.AddUsersReq.user_info:type_name -> slurm.UserInfo + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_idl_slurmdb_user_proto_init() } +func file_idl_slurmdb_user_proto_init() { + if File_idl_slurmdb_user_proto != nil { + return + } + file_idl_static_proto_init() + file_idl_slurmdb_coord_proto_init() + file_idl_slurmdb_wckey_proto_init() + file_idl_slurmdb_assoc_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfoList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUsersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_slurmdb_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUsersResp); 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_idl_slurmdb_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_user_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_user_proto_depIdxs, + MessageInfos: file_idl_slurmdb_user_proto_msgTypes, + }.Build() + File_idl_slurmdb_user_proto = out.File + file_idl_slurmdb_user_proto_rawDesc = nil + file_idl_slurmdb_user_proto_goTypes = nil + file_idl_slurmdb_user_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/slurmdb_wckey.pb.go b/adaptor/pcm_slurm/gen/idl/slurmdb_wckey.pb.go new file mode 100644 index 00000000..b7be2044 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/slurmdb_wckey.pb.go @@ -0,0 +1,210 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/slurmdb_wckey.proto + +package slurmpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type WckeyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountingList []*AccountingInfo `protobuf:"bytes,1,rep,name=accountingList,proto3" json:"accountingList,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Id int32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + IdDef int32 `protobuf:"varint,4,opt,name=idDef,proto3" json:"idDef,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Uid int32 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"` + User string `protobuf:"bytes,7,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *WckeyInfo) Reset() { + *x = WckeyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_slurmdb_wckey_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WckeyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WckeyInfo) ProtoMessage() {} + +func (x *WckeyInfo) ProtoReflect() protoreflect.Message { + mi := &file_idl_slurmdb_wckey_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 WckeyInfo.ProtoReflect.Descriptor instead. +func (*WckeyInfo) Descriptor() ([]byte, []int) { + return file_idl_slurmdb_wckey_proto_rawDescGZIP(), []int{0} +} + +func (x *WckeyInfo) GetAccountingList() []*AccountingInfo { + if x != nil { + return x.AccountingList + } + return nil +} + +func (x *WckeyInfo) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *WckeyInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *WckeyInfo) GetIdDef() int32 { + if x != nil { + return x.IdDef + } + return 0 +} + +func (x *WckeyInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WckeyInfo) GetUid() int32 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *WckeyInfo) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +var File_idl_slurmdb_wckey_proto protoreflect.FileDescriptor + +var file_idl_slurmdb_wckey_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, 0x5f, 0x77, 0x63, + 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x64, 0x62, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc4, + 0x01, 0x0a, 0x09, 0x57, 0x63, 0x6b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3d, 0x0a, 0x0e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x64, 0x44, 0x65, 0x66, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x64, 0x44, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x75, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_slurmdb_wckey_proto_rawDescOnce sync.Once + file_idl_slurmdb_wckey_proto_rawDescData = file_idl_slurmdb_wckey_proto_rawDesc +) + +func file_idl_slurmdb_wckey_proto_rawDescGZIP() []byte { + file_idl_slurmdb_wckey_proto_rawDescOnce.Do(func() { + file_idl_slurmdb_wckey_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_slurmdb_wckey_proto_rawDescData) + }) + return file_idl_slurmdb_wckey_proto_rawDescData +} + +var file_idl_slurmdb_wckey_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_idl_slurmdb_wckey_proto_goTypes = []interface{}{ + (*WckeyInfo)(nil), // 0: slurm.WckeyInfo + (*AccountingInfo)(nil), // 1: slurm.AccountingInfo +} +var file_idl_slurmdb_wckey_proto_depIdxs = []int32{ + 1, // 0: slurm.WckeyInfo.accountingList:type_name -> slurm.AccountingInfo + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_idl_slurmdb_wckey_proto_init() } +func file_idl_slurmdb_wckey_proto_init() { + if File_idl_slurmdb_wckey_proto != nil { + return + } + file_idl_static_proto_init() + file_idl_slurmdb_account_proto_init() + if !protoimpl.UnsafeEnabled { + file_idl_slurmdb_wckey_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WckeyInfo); 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_idl_slurmdb_wckey_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_slurmdb_wckey_proto_goTypes, + DependencyIndexes: file_idl_slurmdb_wckey_proto_depIdxs, + MessageInfos: file_idl_slurmdb_wckey_proto_msgTypes, + }.Build() + File_idl_slurmdb_wckey_proto = out.File + file_idl_slurmdb_wckey_proto_rawDesc = nil + file_idl_slurmdb_wckey_proto_goTypes = nil + file_idl_slurmdb_wckey_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/idl/static.pb.go b/adaptor/pcm_slurm/gen/idl/static.pb.go new file mode 100644 index 00000000..0f2440d8 --- /dev/null +++ b/adaptor/pcm_slurm/gen/idl/static.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: idl/static.proto + +package slurmpb + +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) +) + +// slurm version +type SlurmVersion int32 + +const ( + // 0 - tianhe hpc + SlurmVersion_tianhe SlurmVersion = 0 + // 1 - shenwei hpc + SlurmVersion_shenwei SlurmVersion = 1 +) + +// Enum value maps for SlurmVersion. +var ( + SlurmVersion_name = map[int32]string{ + 0: "tianhe", + 1: "shenwei", + } + SlurmVersion_value = map[string]int32{ + "tianhe": 0, + "shenwei": 1, + } +) + +func (x SlurmVersion) Enum() *SlurmVersion { + p := new(SlurmVersion) + *p = x + return p +} + +func (x SlurmVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SlurmVersion) Descriptor() protoreflect.EnumDescriptor { + return file_idl_static_proto_enumTypes[0].Descriptor() +} + +func (SlurmVersion) Type() protoreflect.EnumType { + return &file_idl_static_proto_enumTypes[0] +} + +func (x SlurmVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SlurmVersion.Descriptor instead. +func (SlurmVersion) EnumDescriptor() ([]byte, []int) { + return file_idl_static_proto_rawDescGZIP(), []int{0} +} + +var File_idl_static_proto protoreflect.FileDescriptor + +var file_idl_static_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x69, 0x64, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x05, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x2a, 0x27, 0x0a, 0x0c, 0x53, 0x6c, 0x75, + 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x69, 0x61, + 0x6e, 0x68, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x68, 0x65, 0x6e, 0x77, 0x65, 0x69, + 0x10, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x73, 0x6c, 0x75, 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_static_proto_rawDescOnce sync.Once + file_idl_static_proto_rawDescData = file_idl_static_proto_rawDesc +) + +func file_idl_static_proto_rawDescGZIP() []byte { + file_idl_static_proto_rawDescOnce.Do(func() { + file_idl_static_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_static_proto_rawDescData) + }) + return file_idl_static_proto_rawDescData +} + +var file_idl_static_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_idl_static_proto_goTypes = []interface{}{ + (SlurmVersion)(0), // 0: slurm.SlurmVersion +} +var file_idl_static_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_idl_static_proto_init() } +func file_idl_static_proto_init() { + if File_idl_static_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_idl_static_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_idl_static_proto_goTypes, + DependencyIndexes: file_idl_static_proto_depIdxs, + EnumInfos: file_idl_static_proto_enumTypes, + }.Build() + File_idl_static_proto = out.File + file_idl_static_proto_rawDesc = nil + file_idl_static_proto_goTypes = nil + file_idl_static_proto_depIdxs = nil +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/node.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/node.swagger.json new file mode 100644 index 00000000..cbb0c94f --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/node.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/node.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json index ebe0873c..c03cb46d 100644 --- a/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurm.swagger.json @@ -44,6 +44,176 @@ } } }, + "slurmAccountingInfo": { + "type": "object", + "properties": { + "allocSecs": { + "type": "string", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "periodStart": { + "type": "string", + "format": "date-time" + } + } + }, + "slurmAssocUsageInfo": { + "type": "object" + }, + "slurmAssociationInfo": { + "type": "object", + "properties": { + "accountingList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmAccountingInfo" + } + }, + "acct": { + "type": "string" + }, + "cluster": { + "type": "string" + }, + "defQosId": { + "type": "integer", + "format": "int32" + }, + "grpCpuMins": { + "type": "string", + "format": "int64" + }, + "grpGpuRunMins": { + "type": "string", + "format": "int64" + }, + "grpCpus": { + "type": "integer", + "format": "int32" + }, + "grpJobs": { + "type": "integer", + "format": "int32" + }, + "grpMem": { + "type": "integer", + "format": "int32" + }, + "grpNodes": { + "type": "integer", + "format": "int32" + }, + "grpSubmitJobs": { + "type": "integer", + "format": "int32" + }, + "grpWall": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "isDef": { + "type": "integer", + "format": "int32" + }, + "lft": { + "type": "integer", + "format": "int32" + }, + "maxCpuMinsPj": { + "type": "string", + "format": "int64" + }, + "maxCpuRunMins": { + "type": "string", + "format": "int64" + }, + "maxCpusPj": { + "type": "integer", + "format": "int32" + }, + "maxJobs": { + "type": "integer", + "format": "int32" + }, + "maxNodesPj": { + "type": "integer", + "format": "int32" + }, + "maxSubmitJobs": { + "type": "integer", + "format": "int32" + }, + "maxWallPj": { + "type": "integer", + "format": "int32" + }, + "parentAcct": { + "type": "string" + }, + "parentId": { + "type": "integer", + "format": "int32" + }, + "partition": { + "type": "string" + }, + "qosList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmQosInfo" + } + }, + "rgt": { + "type": "integer", + "format": "int32" + }, + "sharesRaw": { + "type": "integer", + "format": "int32" + }, + "uid": { + "type": "integer", + "format": "int32" + }, + "assocUsage": { + "$ref": "#/definitions/slurmAssocUsageInfo" + }, + "user": { + "type": "string" + } + } + }, + "slurmCoordInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "direct": { + "type": "integer", + "format": "int32" + } + } + }, + "slurmListAssociationsResp": { + "type": "object", + "properties": { + "assocInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmAssociationInfo" + } + } + } + }, "slurmListNodesResp": { "type": "object", "properties": { @@ -55,6 +225,17 @@ } } }, + "slurmListUsersResp": { + "type": "object", + "properties": { + "userInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmUserInfo" + } + } + } + }, "slurmNodeInfo": { "type": "object", "properties": { @@ -82,6 +263,210 @@ "format": "int32" } } + }, + "slurmQosInfo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "flags": { + "type": "integer", + "format": "int32" + }, + "graceTime": { + "type": "integer", + "format": "int32" + }, + "grpCpuMins": { + "type": "string", + "format": "int64" + }, + "grpCpuRunMins": { + "type": "string", + "format": "int64" + }, + "grpCpus": { + "type": "integer", + "format": "int32" + }, + "grpJobs": { + "type": "integer", + "format": "int32" + }, + "grpMem": { + "type": "integer", + "format": "int32" + }, + "grpNodes": { + "type": "integer", + "format": "int32" + }, + "grpSubmitJobs": { + "type": "integer", + "format": "int32" + }, + "grpWall": { + "type": "integer", + "format": "int32" + }, + "maxCpuMinsPj": { + "type": "string", + "format": "int64" + }, + "maxCpuRunMinsPu": { + "type": "string", + "format": "int64" + }, + "maxCpusPj": { + "type": "integer", + "format": "int32" + }, + "maxCpusPu": { + "type": "integer", + "format": "int32" + }, + "maxJobsPu": { + "type": "integer", + "format": "int32" + }, + "maxNodesPj": { + "type": "integer", + "format": "int32" + }, + "maxSubmitJobsPu": { + "type": "integer", + "format": "int32" + }, + "maxWallPj": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "preemptBitstr": { + "type": "integer", + "format": "int32" + }, + "preemptList": { + "type": "array", + "items": { + "type": "string" + } + }, + "preemptMode": { + "type": "integer", + "format": "int32" + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "usage": { + "$ref": "#/definitions/slurmQosUsageInfo" + }, + "usageFactor": { + "type": "number", + "format": "double" + }, + "usageThres": { + "type": "number", + "format": "double" + } + } + }, + "slurmQosUsageInfo": { + "type": "object" + }, + "slurmSlurmVersion": { + "type": "string", + "enum": [ + "tianhe", + "shenwei" + ], + "default": "tianhe", + "description": "- tianhe: 0 - tianhe hpc\n - shenwei: 1 - shenwei hpc", + "title": "slurm version" + }, + "slurmUserInfo": { + "type": "object", + "properties": { + "adminLevel": { + "type": "integer", + "format": "int32" + }, + "assocList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmAssociationInfo" + } + }, + "coordList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmCoordInfo" + } + }, + "defaultAcct": { + "type": "string" + }, + "defaultWckey": { + "type": "string" + }, + "name": { + "type": "string" + }, + "oldName": { + "type": "string" + }, + "uid": { + "type": "integer", + "format": "int32" + }, + "wckeyList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmWckeyInfo" + } + } + } + }, + "slurmWckeyInfo": { + "type": "object", + "properties": { + "accountingList": { + "type": "array", + "items": { + "$ref": "#/definitions/slurmAccountingInfo" + } + }, + "cluster": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "idDef": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "integer", + "format": "int32" + }, + "user": { + "type": "string" + } + } } } } diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_account.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_account.swagger.json new file mode 100644 index 00000000..5a34e4a1 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_account.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_account.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_assoc.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_assoc.swagger.json new file mode 100644 index 00000000..aecb5f94 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_assoc.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_assoc.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_cluster.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_cluster.swagger.json new file mode 100644 index 00000000..cb332779 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_cluster.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_cluster.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_coord.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_coord.swagger.json new file mode 100644 index 00000000..7bbbcc18 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_coord.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_coord.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_qos.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_qos.swagger.json new file mode 100644 index 00000000..5b7b18f8 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_qos.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_qos.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_user.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_user.swagger.json new file mode 100644 index 00000000..45dd503b --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_user.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_user.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_wckey.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_wckey.swagger.json new file mode 100644 index 00000000..5fb54fac --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/slurmdb_wckey.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/slurmdb_wckey.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/gen/openapiv2/idl/static.swagger.json b/adaptor/pcm_slurm/gen/openapiv2/idl/static.swagger.json new file mode 100644 index 00000000..ab940c60 --- /dev/null +++ b/adaptor/pcm_slurm/gen/openapiv2/idl/static.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/static.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/adaptor/pcm_slurm/idl/node.proto b/adaptor/pcm_slurm/idl/node.proto new file mode 100644 index 00000000..7001c2c3 --- /dev/null +++ b/adaptor/pcm_slurm/idl/node.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "idl/static.proto"; + +message ListNodesReq{ + SlurmVersion slurm_version = 1; +} + +message NodeInfo{ + int32 boards = 1 ; + int32 cpus = 2 ; + string name = 3 ; + int32 realMemory = 4 ; + int32 sockets = 5 ; + int32 threads = 6 ; +} + +message ListNodesResp { + repeated NodeInfo node_infos =1; +} diff --git a/adaptor/pcm_slurm/idl/slurm.proto b/adaptor/pcm_slurm/idl/slurm.proto index 366a46ca..e0a78c97 100644 --- a/adaptor/pcm_slurm/idl/slurm.proto +++ b/adaptor/pcm_slurm/idl/slurm.proto @@ -2,32 +2,20 @@ syntax = "proto3"; package slurm; option go_package = "/slurmpb"; +import "idl/node.proto"; +import "idl/slurmdb_user.proto"; +import "idl/slurmdb_assoc.proto"; -// slurm version -enum SlurmVersion { - // 0 - 阿里云 - tianhe = 0; -} -message ListNodesReq{ - int32 SlurmVersion = 1; -} - -message NodeInfo{ - int32 boards = 1 ; - int32 cpus = 2 ; - string name = 3 ; - int32 realMemory = 4 ; - int32 sockets = 5 ; - int32 threads = 6 ; -} - -message ListNodesResp { - repeated NodeInfo node_infos =1; -} // Slurm Services service SlurmService { // Echo 样例接口 rpc ListNodes(ListNodesReq) returns (ListNodesResp); + + // get user info from slurmdb + rpc ListUsers(ListUsersReq) returns (ListUsersResp); + + // get association info from slurmdb + rpc ListAssociations(ListAssociationsReq) returns (ListAssociationsResp); } diff --git a/adaptor/pcm_slurm/idl/slurm.yaml b/adaptor/pcm_slurm/idl/slurm.yaml index b48afca9..e154cb46 100644 --- a/adaptor/pcm_slurm/idl/slurm.yaml +++ b/adaptor/pcm_slurm/idl/slurm.yaml @@ -4,4 +4,8 @@ config_version: 3 http: rules: - selector: slurm.SlurmService.ListNodes - get: "/apis/slurm/listNodes" \ No newline at end of file + get: "/apis/slurm/listNodes" + - selector: slurm.SlurmService.ListUsers + get: "/apis/slurm/listUsers" + - selector: slurm.SlurmService.ListAssociations + get: "/apis/slurm/listAssociations" diff --git a/adaptor/pcm_slurm/idl/slurmdb_account.proto b/adaptor/pcm_slurm/idl/slurmdb_account.proto new file mode 100644 index 00000000..019a1e43 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_account.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; + +message AccountingInfo{ + int64 allocSecs = 1 ; + int32 id = 2 ; + google.protobuf.Timestamp periodStart = 3; +} diff --git a/adaptor/pcm_slurm/idl/slurmdb_assoc.proto b/adaptor/pcm_slurm/idl/slurmdb_assoc.proto new file mode 100644 index 00000000..9730cee3 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_assoc.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; +import "idl/slurmdb_account.proto"; +import "idl/slurmdb_qos.proto"; + + +message AssocUsageInfo{ + +} + +message AssociationInfo{ + repeated AccountingInfo accountingList = 1 ; + string acct = 2 ; + string cluster = 3 ; + int32 defQosId = 4 ; + int64 grpCpuMins = 5 ; + int64 grpGpuRunMins = 6 ; + int32 grpCpus = 7 ; + int32 grpJobs = 8 ; + int32 grpMem = 9 ; + int32 grpNodes = 10 ; + int32 grpSubmitJobs = 11 ; + int32 grpWall = 12 ; + int32 id = 13 ; + int32 isDef = 14 ; + int32 lft = 15 ; + int64 maxCpuMinsPj = 16 ; + int64 maxCpuRunMins = 17 ; + int32 maxCpusPj = 18 ; + int32 maxJobs = 19 ; + int32 maxNodesPj = 20 ; + int32 maxSubmitJobs = 21 ; + int32 maxWallPj = 22 ; + string parentAcct = 23 ; + int32 parentId = 24 ; + string partition = 25 ; + repeated QosInfo qosList = 26 ; + int32 rgt = 27 ; + int32 sharesRaw = 28 ; + int32 uid = 29 ; + AssocUsageInfo assocUsage = 30 ; + string user = 31 ; +} +message ListAssociationsReq{ + SlurmVersion slurm_version = 1; +} +message ListAssociationsResp { + repeated AssociationInfo assoc_infos =1; +} \ No newline at end of file diff --git a/adaptor/pcm_slurm/idl/slurmdb_cluster.proto b/adaptor/pcm_slurm/idl/slurmdb_cluster.proto new file mode 100644 index 00000000..a575243a --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_cluster.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; +import "idl/slurmdb_account.proto"; +import "idl/slurmdb_assoc.proto"; + +message ClusterInfo{ + repeated AccountingInfo accountingList = 1 ; + int32 classification = 2 ; + //slurm_addr_t control_addr; + string controlHost = 3 ; + int32 controlPort = 4 ; + int32 cpuCount = 5 ; + int32 dimensions = 6 ; + int32 dimSize = 7 ; + int32 flags = 8 ; + string name = 9 ; + string nodes = 10 ; + int32 pluginIdSelect = 11 ; + AssociationInfo rootAssoc = 12 ; + int32 rpcVersion = 13 ; +} diff --git a/adaptor/pcm_slurm/idl/slurmdb_coord.proto b/adaptor/pcm_slurm/idl/slurmdb_coord.proto new file mode 100644 index 00000000..607bdad4 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_coord.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; + + +message CoordInfo{ + string name = 1 ; + int32 direct = 2 ; +} diff --git a/adaptor/pcm_slurm/idl/slurmdb_qos.proto b/adaptor/pcm_slurm/idl/slurmdb_qos.proto new file mode 100644 index 00000000..50c29c88 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_qos.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; + +message QosUsageInfo{ + +} + +message QosInfo{ + string description = 1 ; + int32 id = 2 ; + int32 flags = 3 ; + int32 graceTime = 4 ; + int64 grpCpuMins = 5; + int64 grpCpuRunMins = 6; + int32 grpCpus = 7 ; + int32 grpJobs = 8 ; + int32 grp_mem = 9 ; + int32 grp_nodes = 10 ; + int32 grp_submitJobs = 11 ; + int32 grp_wall = 12 ; + int64 maxCpuMinsPj = 13 ; + int64 maxCpuRunMinsPu = 14 ; + int32 maxCpusPj = 15 ; + int32 maxCpusPu = 16 ; + int32 maxJobsPu = 17 ; + int32 max_nodesPj = 18 ; + int32 maxSubmitJobsPu = 19 ; + int32 maxWallPj = 20 ; + string name = 21 ; + int32 preemptBitstr = 22 ; + repeated string preemptList = 23 ; + int32 preemptMode = 24 ; + int32 priority = 25 ; + QosUsageInfo usage = 26 ; + double usageFactor = 27 ; + double usageThres = 28 ; +} diff --git a/adaptor/pcm_slurm/idl/slurmdb_user.proto b/adaptor/pcm_slurm/idl/slurmdb_user.proto new file mode 100644 index 00000000..6a8aedf8 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_user.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; +import "idl/slurmdb_coord.proto"; +import "idl/slurmdb_wckey.proto"; +import "idl/slurmdb_assoc.proto"; + +message UserInfoList{ + repeated UserInfo userInfos = 1 ; +} +message UserInfo{ + int32 adminLevel = 1 ; + repeated AssociationInfo assocList= 2 ; + repeated CoordInfo coordList = 3 ; + string defaultAcct = 4 ; + string defaultWckey = 5 ; + string name = 6 ; + string oldName = 7 ; + int32 uid = 8 ; + repeated WckeyInfo wckeyList = 9 ; +} + +message ListUsersReq{ + SlurmVersion slurm_version = 1; +} +message ListUsersResp { + repeated UserInfo user_infos =1; +} +message AddUsersReq{ + UserInfo user_info = 1; +} +message AddUsersResp { + int32 result =1; +} \ No newline at end of file diff --git a/adaptor/pcm_slurm/idl/slurmdb_wckey.proto b/adaptor/pcm_slurm/idl/slurmdb_wckey.proto new file mode 100644 index 00000000..4a03a233 --- /dev/null +++ b/adaptor/pcm_slurm/idl/slurmdb_wckey.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; +import "google/protobuf/timestamp.proto"; +import "idl/static.proto"; +import "idl/slurmdb_account.proto"; + +message WckeyInfo{ + repeated AccountingInfo accountingList = 1 ; + string cluster= 2 ; + int32 id = 3 ; + int32 idDef = 4 ; + string name = 5 ; + int32 uid = 6 ; + string user = 7 ; +} diff --git a/adaptor/pcm_slurm/idl/static.proto b/adaptor/pcm_slurm/idl/static.proto new file mode 100644 index 00000000..12d05378 --- /dev/null +++ b/adaptor/pcm_slurm/idl/static.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package slurm; + +option go_package = "/slurmpb"; + +// slurm version +enum SlurmVersion { + // 0 - tianhe hpc + tianhe = 0; + // 1 - shenwei hpc + shenwei = 1; +} \ No newline at end of file diff --git a/adaptor/pcm_slurm/server/slurm.go b/adaptor/pcm_slurm/server/slurm.go index 68f90415..a7c42141 100644 --- a/adaptor/pcm_slurm/server/slurm.go +++ b/adaptor/pcm_slurm/server/slurm.go @@ -21,3 +21,23 @@ func (s *Server) ListNodes(ctx context.Context, req *slurmpb.ListNodesReq) (*slu } return resp, nil } + +// ListUsers return all slurm users +func (s *Server) ListUsers(ctx context.Context, req *slurmpb.ListUsersReq) (*slurmpb.ListUsersResp, error) { + resp, err := ListUsers(ctx, req) + if err != nil { + glog.Errorf("ListSlurmUsers error %+v", err) + return nil, status.Errorf(codes.Internal, err.Error()) + } + return resp, nil +} + +// ListAssociations return all slurm associations +func (s *Server) ListAssociations(ctx context.Context, req *slurmpb.ListAssociationsReq) (*slurmpb.ListAssociationsResp, error) { + resp, err := ListAssociations(ctx, req) + if err != nil { + glog.Errorf("ListSlurmAssociations error %+v", err) + return nil, status.Errorf(codes.Internal, err.Error()) + } + return resp, nil +} diff --git a/adaptor/pcm_slurm/server/slurmImpl.go b/adaptor/pcm_slurm/server/slurmImpl.go index efc47bcf..4e790853 100644 --- a/adaptor/pcm_slurm/server/slurmImpl.go +++ b/adaptor/pcm_slurm/server/slurmImpl.go @@ -8,6 +8,27 @@ import ( func ListNodes(ctx context.Context, req *pbslurm.ListNodesReq) (*pbslurm.ListNodesResp, error) { slurm, _ := slurmer.SelectSlurmVersion(req.SlurmVersion) + if slurm == nil { + return nil, nil + } resp, _ := slurm.ListNodes(ctx, req) return resp, nil } + +func ListUsers(ctx context.Context, req *pbslurm.ListUsersReq) (*pbslurm.ListUsersResp, error) { + slurm, _ := slurmer.SelectSlurmVersion(req.SlurmVersion) + if slurm == nil { + return nil, nil + } + resp, _ := slurm.ListUsers(ctx, req) + return resp, nil +} + +func ListAssociations(ctx context.Context, req *pbslurm.ListAssociationsReq) (*pbslurm.ListAssociationsResp, error) { + slurm, _ := slurmer.SelectSlurmVersion(req.SlurmVersion) + if slurm == nil { + return nil, nil + } + resp, _ := slurm.ListAssociations(ctx, req) + return resp, nil +} diff --git a/adaptor/pcm_slurm/service/slurm_node.go b/adaptor/pcm_slurm/service/slurm_node.go new file mode 100644 index 00000000..bf5bed68 --- /dev/null +++ b/adaptor/pcm_slurm/service/slurm_node.go @@ -0,0 +1,227 @@ +package slurmer + +// +///* +//#cgo LDFLAGS: -lslurm +//#include +//#include +//#include +//inline uint8_t uint8_ptr(uint8_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline int8_t int8_ptr(int8_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//uint16_t uint16_ptr(uint16_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline int16_t int16_ptr(int16_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline uint32_t uint32_ptr(uint32_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline int32_t int32_ptr(int32_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline uint64_t uint64_ptr(uint64_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +//inline int64_t int64_ptr(int16_t* pointer) { +// if (NULL == pointer) { +// return -1;} +// return *pointer; +//} +// struct node_info_msg *get_node_info(){ +// struct node_info_msg* node_buffer; +// if(slurm_load_node ((time_t) NULL, +// &node_buffer, SHOW_ALL)) +// return NULL; +// return node_buffer; +// } +// struct node_info_msg *get_single_node_info(char* name){ +// struct node_info_msg* node_buffer; +// if( slurm_load_node_single (&node_buffer, name, SHOW_DETAIL)) +// return NULL; +// return node_buffer; +// } +// +// struct node_info* node_from_list(struct node_info_msg *list, int i){ +// return &list->node_array[i]; +//} +// void free_node_buffer(void* buffer){ +// +// slurm_free_node_info_msg ((struct node_info_msg*)buffer); +// } +// +// +//*/ +//import "C" +// +//import ( +// pbslurm "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/gen/idl" +// "context" +// "unsafe" +//) +// +//type Node_info struct { +// Arch string +// Boards uint16 +// Boot_time int64 +// Cores uint16 +// Cpu_load uint32 +// Cpus uint16 +// Features string +// Gres string +// Name string +// Node_addr string +// Node_hostname string +// Node_state uint32 +// Os string +// Real_memory uint64 +// Reason string +// Reason_time int64 +// Reason_uid uint32 +// Slurmd_start_time int64 +// Sockets uint16 +// Threads uint16 +// Tmp_disk uint32 +// Weight uint32 +//} +// +//func Node_info_convert_c_to_go(c_struct *C.struct_node_info) Node_info { +// var go_struct Node_info +// +// go_struct.Arch = C.GoString(c_struct.arch) +// go_struct.Boards = uint16(c_struct.boards) +// go_struct.Boot_time = int64(c_struct.boot_time) +// go_struct.Cores = uint16(c_struct.cores) +// go_struct.Cpu_load = uint32(c_struct.cpu_load) +// go_struct.Cpus = uint16(c_struct.cpus) +// go_struct.Features = C.GoString(c_struct.features) +// go_struct.Gres = C.GoString(c_struct.gres) +// go_struct.Name = C.GoString(c_struct.name) +// go_struct.Node_addr = C.GoString(c_struct.node_addr) +// go_struct.Node_hostname = C.GoString(c_struct.node_hostname) +// go_struct.Node_state = uint32(c_struct.node_state) +// go_struct.Os = C.GoString(c_struct.os) +// go_struct.Real_memory = uint64(c_struct.real_memory) +// go_struct.Reason = C.GoString(c_struct.reason) +// go_struct.Reason_time = int64(c_struct.reason_time) +// go_struct.Reason_uid = uint32(c_struct.reason_uid) +// go_struct.Slurmd_start_time = int64(c_struct.slurmd_start_time) +// go_struct.Sockets = uint16(c_struct.sockets) +// go_struct.Threads = uint16(c_struct.threads) +// go_struct.Tmp_disk = uint32(c_struct.tmp_disk) +// go_struct.Weight = uint32(c_struct.weight) +// return go_struct +//} +// +//func State_to_string(state uint32) string { +// +// switch s := C.uint16_t(state); s { +// case C.NODE_STATE_UNKNOWN: +// return "node state unknown" +// case C.NODE_STATE_DOWN: +// return "node state down" +// case C.NODE_STATE_IDLE: +// return "node state idle" +// case C.NODE_STATE_ALLOCATED: +// return "node state allocated" +// case C.NODE_STATE_ERROR: +// return "node state error" +// case C.NODE_STATE_MIXED: +// return "node state mixed" +// case C.NODE_STATE_FUTURE: +// return "node state future" +// case C.NODE_STATE_END: +// return "node state end" +// } +// return "Unkown state" +//} +// +//type Node_info_msg struct { +// Last_update int64 +// Record_count uint32 +// Error_code uint32 +// Node_list []Node_info +//} +// +//func Get_all_nodes() Node_info_msg { +// var go_node_buffer Node_info_msg +// c_node_buffer := C.get_node_info() +// if c_node_buffer == nil { +// go_node_buffer.Last_update = int64(0) +// go_node_buffer.Record_count = uint32(0) +// go_node_buffer.Error_code = uint32(C.slurm_get_errno()) +// return go_node_buffer +// } +// go_node_buffer.Last_update = int64(c_node_buffer.last_update) +// go_node_buffer.Record_count = uint32(c_node_buffer.record_count) +// go_node_buffer.Node_list = make([]Node_info, c_node_buffer.record_count, c_node_buffer.record_count) +// for i := uint32(0); i < go_node_buffer.Record_count; i++ { +// node := C.node_from_list(c_node_buffer, C.int(i)) +// go_node := Node_info_convert_c_to_go(node) +// go_node_buffer.Node_list[i] = go_node +// } +// C.slurm_free_node_info_msg(c_node_buffer) +// +// return go_node_buffer +//} +// +//func Get_node_info(name string) Node_info_msg { +// +// var go_node_buffer Node_info_msg +// c_name := C.CString(name) +// defer C.free(unsafe.Pointer(c_name)) +// c_node_buffer := C.get_single_node_info(c_name) +// if c_node_buffer == nil { +// go_node_buffer.Last_update = int64(0) +// go_node_buffer.Record_count = uint32(0) +// go_node_buffer.Error_code = uint32(C.slurm_get_errno()) +// +// return go_node_buffer +// } +// go_node_buffer.Last_update = int64(c_node_buffer.last_update) +// go_node_buffer.Record_count = uint32(c_node_buffer.record_count) +// go_node_buffer.Node_list = make([]Node_info, c_node_buffer.record_count, c_node_buffer.record_count) +// for i := uint32(0); i < go_node_buffer.Record_count; i++ { +// node := C.node_from_list(c_node_buffer, C.int(i)) +// go_node := Node_info_convert_c_to_go(node) +// go_node_buffer.Node_list[i] = go_node +// } +// C.slurm_free_node_info_msg(c_node_buffer) +// +// return go_node_buffer +// +//} +// +//func (s SlurmStruct) ListNodes(ctx context.Context, req *pbslurm.ListNodesReq) (*pbslurm.ListNodesResp, error) { +// nodeList := Get_all_nodes() +// +// var resp = pbslurm.ListNodesResp{} +// for _, node := range nodeList.Node_list { +// nodeInfoResult := pbslurm.NodeInfo{} +// nodeInfoResult.Cpus = int32(node.Cpus) +// nodeInfoResult.Boards = int32(node.Boards) +// nodeInfoResult.RealMemory = int32(node.Real_memory) +// nodeInfoResult.Sockets = int32(node.Sockets) +// nodeInfoResult.Threads = int32(node.Threads) +// resp.NodeInfos = append(resp.NodeInfos, &nodeInfoResult) +// } +// return &resp, nil +//} diff --git a/adaptor/pcm_slurm/service/slurmdb_association.go b/adaptor/pcm_slurm/service/slurmdb_association.go new file mode 100644 index 00000000..fa2c8590 --- /dev/null +++ b/adaptor/pcm_slurm/service/slurmdb_association.go @@ -0,0 +1,126 @@ +package slurmer + +import ( + pbslurm "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/gen/idl" + "context" +) + +/* +#cgo LDFLAGS: -lslurmdb + +#include +#include +#include +#include +#include + +typedef struct assoc_info_msg { + uint32_t record_count; + slurmdb_association_rec_t *assoc_array; +} assoc_info_msg_t; + + +typedef struct slurmdb_association_rec{ + List accounting_list; + char *acct; + char *cluster; + uint32_t def_qos_id; + uint64_t grp_cpu_mins; + uint64_t grp_cpu_run_mins; + uint32_t grp_cpus; + uint32_t grp_jobs; + uint32_t grp_mem; + uint32_t grp_nodes; + uint32_t grp_submit_jobs; + uint32_t grp_wall; + uint32_t id; + uint16_t is_def; + uint32_t lft; + uint64_t max_cpu_mins_pj; + uint64_t max_cpu_run_mins; + uint32_t max_cpus_pj; + uint32_t max_jobs; + uint32_t max_nodes_pj; + uint32_t max_submit_jobs; + uint32_t max_wall_pj; + char *parent_acct; + uint32_t parent_id; + char *partition; + List qos_list; + uint32_t rgt; + uint32_t shares_raw; + uint32_t uid; + assoc_mgr_association_usage_t *usage; + char *assoc; +} slurmdb_association_rec_pcm; + +struct assoc_info_msg get_assoc_info() { + struct assoc_info_msg associnfo; + List assocList = NULL; + slurmdb_association_cond_t *assoc_cond = NULL; + void *db_conn; + db_conn = slurmdb_connection_get(); + assocList = slurmdb_associations_get(db_conn, assoc_cond); + slurmdb_connection_close(&db_conn); + + slurmdb_association_rec_t *rec = NULL; + ListIterator itr = slurm_list_iterator_create(assocList); + int i = 0; + uint32_t length; + length = slurm_list_count(assocList); + associnfo.record_count = length; + associnfo.assoc_array = malloc(length * sizeof(slurmdb_association_rec_t)); + while ((rec = slurm_list_next(itr))) { + associnfo.assoc_array[i] = *rec; + i++; + } + return associnfo; +} + +struct slurmdb_association_rec *assoc_from_list(struct assoc_info_msg *list, int i) { + return (struct slurmdb_association_rec *) &list->assoc_array[i]; +} + +*/ +import "C" + +type AssocInfoMsg struct { + LastUpdate int64 + RecordCount uint32 + AssocInfoList []pbslurm.AssociationInfo +} + +func AssocDescriptorConvertCToGo(cStruct *C.struct_slurmdb_association_rec) pbslurm.AssociationInfo { + var goStruct pbslurm.AssociationInfo + goStruct.Id = int32(cStruct.id) + return goStruct +} + +func GetAssociationInfo() AssocInfoMsg { + var goAssocBuffer AssocInfoMsg + cAssocBuffer := C.get_assoc_info() + goAssocBuffer.RecordCount = uint32(cAssocBuffer.record_count) + goAssocBuffer.AssocInfoList = make([]pbslurm.AssociationInfo, cAssocBuffer.record_count, cAssocBuffer.record_count) + + for i := uint32(0); i < goAssocBuffer.RecordCount; i++ { + assoc := C.assoc_from_list(&cAssocBuffer, C.int(i)) + goAssociation := AssocDescriptorConvertCToGo(assoc) + goAssocBuffer.AssocInfoList[i] = goAssociation + } + return goAssocBuffer +} + +func (slurmStruct SlurmStruct) ListAssociations(ctx context.Context, req *pbslurm.ListAssociationsReq) (*pbslurm.ListAssociationsResp, error) { + + assocList := GetAssociationInfo() + + resp := pbslurm.ListAssociationsResp{} + for _, assoc := range assocList.AssocInfoList { + assocInfoResult := pbslurm.AssociationInfo{} + assocInfoResult.Id = assoc.Id + + resp.AssocInfos = append(resp.AssocInfos, &assocInfoResult) + } + + return &resp, nil +} diff --git a/adaptor/pcm_slurm/service/slurmdb_user.go b/adaptor/pcm_slurm/service/slurmdb_user.go new file mode 100644 index 00000000..7dc3b522 --- /dev/null +++ b/adaptor/pcm_slurm/service/slurmdb_user.go @@ -0,0 +1,102 @@ +package slurmer + +/* +#cgo LDFLAGS: -lslurmdb + +#include +#include +#include +#include +#include + +typedef struct user_info_msg { + uint32_t record_count; + slurmdb_user_rec_t *user_array; +} user_info_msg_t; + +typedef struct slurmdb_user_rec{ + uint16_t admin_level; + List assoc_list; + List coord_accts; + char *default_acct; + char *default_wckey; + char *name; + char *old_name; + uint32_t uid; + List wckey_list; +} slurmdb_user_rec_pcm; + +struct user_info_msg get_user_info() { + struct user_info_msg userinfo; + List userList = NULL; + slurmdb_user_cond_t *user_cond = NULL; + void *db_conn; + db_conn = slurmdb_connection_get(); + userList = slurmdb_users_get(db_conn, user_cond); + slurmdb_connection_close(&db_conn); + + slurmdb_user_rec_t *rec = NULL; + ListIterator itr = slurm_list_iterator_create(userList); + int i = 0; + uint32_t length; + length = slurm_list_count(userList); + userinfo.record_count = length; + userinfo.user_array = malloc(length * sizeof(slurmdb_user_rec_t)); + while ((rec = slurm_list_next(itr))) { + userinfo.user_array[i] = *rec; + i++; + } + return userinfo; +} + +struct slurmdb_user_rec *user_from_list(struct user_info_msg *list, int i) { + return (struct slurmdb_user_rec *) &list->user_array[i]; +} + +*/ +import "C" +import ( + pbslurm "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/gen/idl" + "context" +) + +type UserInfoMsg struct { + Last_update int64 + Record_count uint32 + UserInfoList []pbslurm.UserInfo +} + +func User_descriptor_convert_c_to_go(c_struct *C.struct_slurmdb_user_rec) pbslurm.UserInfo { + var go_struct pbslurm.UserInfo + go_struct.Name = C.GoString(c_struct.name) + return go_struct +} + +func GetUserInfo() UserInfoMsg { + var go_user_buffer UserInfoMsg + c_user_buffer := C.get_user_info() + go_user_buffer.Record_count = uint32(c_user_buffer.record_count) + go_user_buffer.UserInfoList = make([]pbslurm.UserInfo, c_user_buffer.record_count, c_user_buffer.record_count) + + for i := uint32(0); i < go_user_buffer.Record_count; i++ { + user := C.user_from_list(&c_user_buffer, C.int(i)) + go_user := User_descriptor_convert_c_to_go(user) + go_user_buffer.UserInfoList[i] = go_user + } + return go_user_buffer +} + +func (slurmStruct SlurmStruct) ListUsers(ctx context.Context, req *pbslurm.ListUsersReq) (*pbslurm.ListUsersResp, error) { + + userList := GetUserInfo() + + resp := pbslurm.ListUsersResp{} + for _, user := range userList.UserInfoList { + userInfoResult := pbslurm.UserInfo{} + userInfoResult.Name = user.Name + + resp.UserInfos = append(resp.UserInfos, &userInfoResult) + } + + return &resp, nil +} diff --git a/adaptor/pcm_slurm/service/slurmer.go b/adaptor/pcm_slurm/service/slurmer.go index b723467b..2869df86 100644 --- a/adaptor/pcm_slurm/service/slurmer.go +++ b/adaptor/pcm_slurm/service/slurmer.go @@ -6,14 +6,18 @@ import ( ) type Slurmer interface { - ListNodes(ctx context.Context, req *pbslurm.ListNodesReq) (resp *pbslurm.ListNodesResp, err error) //list slurm nodes + ListNodes(ctx context.Context, req *pbslurm.ListNodesReq) (resp *pbslurm.ListNodesResp, err error) //list slurm nodes + ListUsers(ctx context.Context, req *pbslurm.ListUsersReq) (resp *pbslurm.ListUsersResp, err error) //list slurm users + ListAssociations(ctx context.Context, req *pbslurm.ListAssociationsReq) (resp *pbslurm.ListAssociationsResp, err error) //list slurm associations } -func SelectSlurmVersion(slurmVersion int32) (slurmer Slurmer, err error) { +func SelectSlurmVersion(slurmVersion pbslurm.SlurmVersion) (slurmer Slurmer, err error) { switch slurmVersion { - case int32(pbslurm.SlurmVersion_tianhe): + case pbslurm.SlurmVersion_tianhe: return SelectTianhe() + case pbslurm.SlurmVersion_shenwei: + print("no adaptor for shenwei right now") } return } diff --git a/adaptor/pcm_vm/service/harvester_util.go b/adaptor/pcm_vm/service/harvester_util.go index b98003fa..2883d436 100644 --- a/adaptor/pcm_vm/service/harvester_util.go +++ b/adaptor/pcm_vm/service/harvester_util.go @@ -37,8 +37,8 @@ const ( var ( // ManagementResourceTypes lists the types we use the management client for - ManagementResourceTypes = []string{"cluster", "node", "project"} - // ProjectResourceTypes lists the types we use the cluster client for + ManagementResourceTypes = []string{"user", "node", "project"} + // ProjectResourceTypes lists the types we use the user client for ProjectResourceTypes = []string{"secret", "namespacedSecret", "workload"} // ClusterResourceTypes lists the types we use the project client for ClusterResourceTypes = []string{"persistentVolume", "storageClass", "namespace"} @@ -322,7 +322,7 @@ func parseClusterAndProjectID(id string) (string, string, error) { return "", "", fmt.Errorf("unable to extract clusterid and projectid from [%s]", id) } -// getClusterNames maps cluster ID to name and defaults to ID if name is blank +// getClusterNames maps user ID to name and defaults to ID if name is blank func getClusterNames(ctx *cli.Context, c *cliclient.MasterClient) (map[string]string, error) { clusterNames := make(map[string]string) clusterCollection, err := c.ManagementClient.Cluster.List(defaultListOpts(ctx)) diff --git a/examples/slurm/get_partitions.go b/examples/slurm/get_partitions.go index e5699ff8..7f9ed497 100644 --- a/examples/slurm/get_partitions.go +++ b/examples/slurm/get_partitions.go @@ -1,19 +1,20 @@ package main -import "slurm/partitioninfo" -import "fmt" +import ( + partition_info "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/cgo_tianhe/src/slurm/partitioninfo" + "fmt" +) -func main(){ +func main() { partition_list := partition_info.Get_partitions() fmt.Printf("Found %d partions \n", partition_list.Record_count) - -/* a little bit nicer */ + /* a little bit nicer */ fmt.Printf("Name\t Nodes\t\t\t Max_time(min)\t\t Tres\n") fmt.Printf("________________________________________\n") for i := range partition_list.Partition_list { partition := partition_list.Partition_list[i] - fmt.Printf("%s\t %s\t %d\t %d\n", partition.Name, partition.Nodes, partition.Max_time, partition.Node_inx ) + fmt.Printf("%s\t %s\t %d\t %d\n", partition.Name, partition.Nodes, partition.Max_time, partition.Node_inx) } diff --git a/examples/slurm/submit_example/submit_mpi_and_update.go b/examples/slurm/submit_example/submit_mpi_and_update.go index c9549066..429933c4 100644 --- a/examples/slurm/submit_example/submit_mpi_and_update.go +++ b/examples/slurm/submit_example/submit_mpi_and_update.go @@ -1,127 +1,128 @@ package main - -import "slurm/submitjob" -import "slurm" -import "os" -import "strconv" -import "fmt" -import "os/exec" -import "path/filepath" -import "slurm/jobinfo" -import "time" -import "os/user" - - - -func fileExists(filename string) bool { - info, err := os.Stat(filename) - if os.IsNotExist(err) { - return false - } - return !info.IsDir() -} -func build_container(file_name,container_name string){ - - cmd := exec.Command("sudo", "/usr/local/bin/singularity", "build",container_name, file_name) - fmt.Print("Now build new container") - fmt.Printf("%s\n", cmd.String()) - stdoutStderr, err := cmd.CombinedOutput() - if err != nil { - fmt.Printf("error in creating container %s \n", err); +// +// +//import "slurm/submitjob" +//import "slurm" +//import "os" +//import "strconv" +//import "fmt" +//import "os/exec" +//import "path/filepath" +//import "slurm/jobinfo" +//import "time" +//import "os/user" +// +// +// +//func fileExists(filename string) bool { +// info, err := os.Stat(filename) +// if os.IsNotExist(err) { +// return false +// } +// return !info.IsDir() +//} +//func build_container(file_name,container_name string){ +// +// cmd := exec.Command("sudo", "/usr/local/bin/singularity", "build",container_name, file_name) +// fmt.Print("Now build new container") +// fmt.Printf("%s\n", cmd.String()) +// stdoutStderr, err := cmd.CombinedOutput() +// if err != nil { +// fmt.Printf("error in creating container %s \n", err); +//// return +// } +// fmt.Printf("%s\n", stdoutStderr) +//} +// +//func main(){ +// job_desc := submit_job.Job_descriptor{} +// +// dir, _ := os.Getwd() +// container := filepath.Join(dir, "mpi_container.img") +// definition := filepath.Join(dir, "mpi_container.def") +// if !fileExists(container){ +// build_container(definition,container) +// } +// +// if !fileExists(container){ // return - } - fmt.Printf("%s\n", stdoutStderr) -} - -func main(){ - job_desc := submit_job.Job_descriptor{} - - dir, _ := os.Getwd() - container := filepath.Join(dir, "mpi_container.img") - definition := filepath.Join(dir, "mpi_container.def") - if !fileExists(container){ - build_container(definition,container) - } - - if !fileExists(container){ - return - } - /* use Cmd to create our script */ - - job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n srun hostname \n" - cmd := exec.Command( "/home0/opt/openmpi/bin/mpirun", "-mca btl_tcp_if_include eth1", "/usr/local/bin/singularity", "exec",container, "/opt/mpi_pingpong" ) - job_desc.Script+= cmd.String() - fmt.Printf("cmd %s\n", job_desc.Script) - user, _:= user.Current() - userid , _ := strconv.Atoi(user.Uid) - job_desc.User_id= uint32(userid) - groupid , _ := strconv.Atoi(user.Gid) - - job_desc.Group_id= uint32(groupid) - job_desc.Name = "flex_mpi_job" - job_desc.Partition="long" - job_desc.Time_limit = uint32(60) - job_desc.Ntasks_per_node = uint16(1) - job_desc.Num_tasks = uint32(2) - job_desc.Std_out = ("./%j-out.txt") - job_desc.Std_err = ("./%j-err.txt") - job_desc.Work_dir = dir - - time.Sleep(3 * time.Second) - answer := submit_job.Submit_job(&job_desc) - if(answer.Error_code != 0) { - msg := slurm.GetErrorString(answer.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - } - fmt.Printf("Submitted Job %d\n", answer.Job_id) - - time.Sleep(5 * time.Second) - - job_list := job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job := job_list.Job_list[0] - - fmt.Printf("job %d is %s\n", answer.Job_id, job.Job_stateS) - state := job.Job_stateS - if state == "Pending" { - fmt.Printf("Move job %d to another partition \n", answer.Job_id) - var ops submit_job.Update_job_options - - ops.Qos = "shortjobs" - ops.Partition = "short" - err2 := submit_job.Update_job(ops, uint32(answer.Job_id)) - if err2!= uint32(0) { - fmt.Printf("error %s \n", slurm.GetErrorString(err2)) - } - } - - for state == "Pending" || state == "Running" { - time.Sleep(2 * time.Second) - job_list = job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job = job_list.Job_list[0] - - state = job.Job_stateS - - fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) - - - } - - fmt.Printf("Total runtime Job %d %s\n",job.Job_id, job_info.Get_job_runtime(job).String() ) -} - - - +// } +// /* use Cmd to create our script */ +// +// job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n srun hostname \n" +// cmd := exec.Command( "/home0/opt/openmpi/bin/mpirun", "-mca btl_tcp_if_include eth1", "/usr/local/bin/singularity", "exec",container, "/opt/mpi_pingpong" ) +// job_desc.Script+= cmd.String() +// fmt.Printf("cmd %s\n", job_desc.Script) +// user, _:= user.Current() +// userid , _ := strconv.Atoi(user.Uid) +// job_desc.User_id= uint32(userid) +// groupid , _ := strconv.Atoi(user.Gid) +// +// job_desc.Group_id= uint32(groupid) +// job_desc.Name = "flex_mpi_job" +// job_desc.Partition="long" +// job_desc.Time_limit = uint32(60) +// job_desc.Ntasks_per_node = uint16(1) +// job_desc.Num_tasks = uint32(2) +// job_desc.Std_out = ("./%j-out.txt") +// job_desc.Std_err = ("./%j-err.txt") +// job_desc.Work_dir = dir +// +// time.Sleep(3 * time.Second) +// answer := submit_job.Submit_job(&job_desc) +// if(answer.Error_code != 0) { +// msg := slurm.GetErrorString(answer.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// } +// fmt.Printf("Submitted Job %d\n", answer.Job_id) +// +// time.Sleep(5 * time.Second) +// +// job_list := job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job := job_list.Job_list[0] +// +// fmt.Printf("job %d is %s\n", answer.Job_id, job.Job_stateS) +// state := job.Job_stateS +// if state == "Pending" { +// fmt.Printf("Move job %d to another partition \n", answer.Job_id) +// var ops submit_job.Update_job_options +// +// ops.Qos = "shortjobs" +// ops.Partition = "short" +// err2 := submit_job.Update_job(ops, uint32(answer.Job_id)) +// if err2!= uint32(0) { +// fmt.Printf("error %s \n", slurm.GetErrorString(err2)) +// } +// } +// +// for state == "Pending" || state == "Running" { +// time.Sleep(2 * time.Second) +// job_list = job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job = job_list.Job_list[0] +// +// state = job.Job_stateS +// +// fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) +// +// +// } +// +// fmt.Printf("Total runtime Job %d %s\n",job.Job_id, job_info.Get_job_runtime(job).String() ) +//} +// +// +// diff --git a/examples/slurm/submit_example/submit_mpi_containier.go b/examples/slurm/submit_example/submit_mpi_containier.go index 64b85e7a..24256fa6 100644 --- a/examples/slurm/submit_example/submit_mpi_containier.go +++ b/examples/slurm/submit_example/submit_mpi_containier.go @@ -1,111 +1,112 @@ package main -import "slurm/submitjob" -import "slurm" -import "os/user" -import "os" -import "strconv" -import "fmt" -import "os/exec" -import "path/filepath" -import "slurm/jobinfo" -import "time" - - -func fileExists(filename string) bool { - info, err := os.Stat(filename) - if os.IsNotExist(err) { - return false - } - return !info.IsDir() -} -func build_container(file_name,container_name string){ - - cmd := exec.Command("sudo","/usr/local/bin/singularity", "build",container_name, file_name) - fmt.Print("Now build new container") - fmt.Printf("%s\n", cmd.String()) - stdoutStderr, err := cmd.CombinedOutput() - if err != nil { - fmt.Printf("error in creating container %s \n", err) - - fmt.Printf("%s\n", stdoutStderr) +// +//import "slurm/submitjob" +//import "slurm" +//import "os/user" +//import "os" +//import "strconv" +//import "fmt" +//import "os/exec" +//import "path/filepath" +//import "slurm/jobinfo" +//import "time" +// +// +//func fileExists(filename string) bool { +// info, err := os.Stat(filename) +// if os.IsNotExist(err) { +// return false +// } +// return !info.IsDir() +//} +//func build_container(file_name,container_name string){ +// +// cmd := exec.Command("sudo","/usr/local/bin/singularity", "build",container_name, file_name) +// fmt.Print("Now build new container") +// fmt.Printf("%s\n", cmd.String()) +// stdoutStderr, err := cmd.CombinedOutput() +// if err != nil { +// fmt.Printf("error in creating container %s \n", err) +// +// fmt.Printf("%s\n", stdoutStderr) +//// return +// } +// fmt.Printf("%s\n", stdoutStderr) +//} +// +//func main(){ +// job_desc := submit_job.Job_descriptor{} +// +// dir, _ := os.Getwd() +// container := filepath.Join(dir, "mpi_container.img") +// definition := filepath.Join(dir, "mpi_container.def") +// if !fileExists(container){ +// build_container(definition,container) +// } +// +// if !fileExists(container){ // return - } - fmt.Printf("%s\n", stdoutStderr) -} - -func main(){ - job_desc := submit_job.Job_descriptor{} - - dir, _ := os.Getwd() - container := filepath.Join(dir, "mpi_container.img") - definition := filepath.Join(dir, "mpi_container.def") - if !fileExists(container){ - build_container(definition,container) - } - - if !fileExists(container){ - return - } - /* use Cmd to create our script */ - - job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" - cmd := exec.Command( "/home0/opt/openmpi/bin/mpirun", "-mca btl_tcp_if_include eth1", "/usr/local/bin/singularity", "exec",container, "/opt/mpi_pingpong" ) - job_desc.Script+= cmd.String() - fmt.Printf("cmd %s\n", job_desc.Script) - user, _:= user.Current() - userid , _ := strconv.Atoi(user.Uid) - job_desc.User_id= uint32(userid) - groupid , _ := strconv.Atoi(user.Gid) - - job_desc.Group_id= uint32(groupid) - job_desc.Name = "mpi_job" - job_desc.Partition="long" - job_desc.Time_limit = uint32(60) - job_desc.Min_nodes =uint32(2) - job_desc.Num_tasks = uint32(2) - job_desc.Std_out = ("./%j-out.txt") - job_desc.Std_err = ("./%j-err.txt") - job_desc.Work_dir = dir - - answer := submit_job.Submit_job(&job_desc) - if(answer.Error_code != 0) { - msg := slurm.GetErrorString(answer.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - } - fmt.Printf("Submitted Job %d\n", answer.Job_id) - - - job_list := job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job := job_list.Job_list[0] - - fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) - state := job.Job_stateS - for state == "Pending" || state == "Running" { - time.Sleep(2 * time.Second) - job_list = job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job = job_list.Job_list[0] - - state = job.Job_stateS - - fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) - - - } - - fmt.Printf("Total runtime Job %d: %s\n",job.Job_id, job_info.Get_job_runtime(job).String() ) - -} +// } +// /* use Cmd to create our script */ +// +// job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" +// cmd := exec.Command( "/home0/opt/openmpi/bin/mpirun", "-mca btl_tcp_if_include eth1", "/usr/local/bin/singularity", "exec",container, "/opt/mpi_pingpong" ) +// job_desc.Script+= cmd.String() +// fmt.Printf("cmd %s\n", job_desc.Script) +// user, _:= user.Current() +// userid , _ := strconv.Atoi(user.Uid) +// job_desc.User_id= uint32(userid) +// groupid , _ := strconv.Atoi(user.Gid) +// +// job_desc.Group_id= uint32(groupid) +// job_desc.Name = "mpi_job" +// job_desc.Partition="long" +// job_desc.Time_limit = uint32(60) +// job_desc.Min_nodes =uint32(2) +// job_desc.Num_tasks = uint32(2) +// job_desc.Std_out = ("./%j-out.txt") +// job_desc.Std_err = ("./%j-err.txt") +// job_desc.Work_dir = dir +// +// answer := submit_job.Submit_job(&job_desc) +// if(answer.Error_code != 0) { +// msg := slurm.GetErrorString(answer.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// } +// fmt.Printf("Submitted Job %d\n", answer.Job_id) +// +// +// job_list := job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job := job_list.Job_list[0] +// +// fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) +// state := job.Job_stateS +// for state == "Pending" || state == "Running" { +// time.Sleep(2 * time.Second) +// job_list = job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job = job_list.Job_list[0] +// +// state = job.Job_stateS +// +// fmt.Printf("job %d is %s\n",answer.Job_id, job.Job_stateS) +// +// +// } +// +// fmt.Printf("Total runtime Job %d: %s\n",job.Job_id, job_info.Get_job_runtime(job).String() ) +// +//} diff --git a/examples/slurm/submit_example/submit_openmp_container.go b/examples/slurm/submit_example/submit_openmp_container.go index 80afa886..b7d8eb46 100644 --- a/examples/slurm/submit_example/submit_openmp_container.go +++ b/examples/slurm/submit_example/submit_openmp_container.go @@ -1,162 +1,162 @@ package main -import "slurm/submitjob" -import "slurm" -import "os/user" -import "os" -import "strconv" -import "fmt" -import "os/exec" -import "path/filepath" -import "slurm/jobinfo" -import "time" - - -func fileExists(filename string) bool { - info, err := os.Stat(filename) - if os.IsNotExist(err) { - return false - } - return !info.IsDir() -} -func build_container(file_name,container_name string){ - - cmd := exec.Command("sudo", "/usr/local/bin/singularity", "build",container_name, file_name) - fmt.Print("Now build new container") - fmt.Printf("%s\n", cmd.String()) - stdoutStderr, err := cmd.CombinedOutput() - if err != nil { - fmt.Printf("error in creating container %s \n", err) - - fmt.Printf("%s\n", stdoutStderr) +//import "slurm/submitjob" +//import "slurm" +//import "os/user" +//import "os" +//import "strconv" +//import "fmt" +//import "os/exec" +//import "path/filepath" +//import "slurm/jobinfo" +//import "time" +// +// +//func fileExists(filename string) bool { +// info, err := os.Stat(filename) +// if os.IsNotExist(err) { +// return false +// } +// return !info.IsDir() +//} +//func build_container(file_name,container_name string){ +// +// cmd := exec.Command("sudo", "/usr/local/bin/singularity", "build",container_name, file_name) +// fmt.Print("Now build new container") +// fmt.Printf("%s\n", cmd.String()) +// stdoutStderr, err := cmd.CombinedOutput() +// if err != nil { +// fmt.Printf("error in creating container %s \n", err) +// +// fmt.Printf("%s\n", stdoutStderr) +//// return +// } +// fmt.Printf("%s\n", stdoutStderr) +//} +// +//func main(){ +// job_desc := submit_job.Job_descriptor{} +// +// dir, _ := os.Getwd() +// container := filepath.Join(dir, "openmp_container.img") +// definition := filepath.Join(dir, "openmp_container.def") +// if !fileExists(container){ +// build_container(definition,container) +// } +// +// if !fileExists(container){ // return - } - fmt.Printf("%s\n", stdoutStderr) -} - -func main(){ - job_desc := submit_job.Job_descriptor{} - - dir, _ := os.Getwd() - container := filepath.Join(dir, "openmp_container.img") - definition := filepath.Join(dir, "openmp_container.def") - if !fileExists(container){ - build_container(definition,container) - } - - if !fileExists(container){ - return - } - /* use Cmd to create our script */ - - job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" - job_desc.Script+= "export OMP_NUM_THREADS=$SLURM_JOB_CPUS_PER_NODE\n" - cmd := exec.Command( "/usr/local/bin/singularity", "exec",container, "/opt/openmp_example" ) - - job_desc.Script+= cmd.String() - fmt.Printf("cmd %s\n", job_desc.Script) - user, _:= user.Current() - userid , _ := strconv.Atoi(user.Uid) - job_desc.User_id= uint32(userid) - groupid , _ := strconv.Atoi(user.Gid) - - job_desc.Group_id= uint32(groupid) - job_desc.Name = "test_job" - job_desc.Partition="long" - job_desc.Time_limit = uint32(60) - job_desc.Min_nodes =uint32(1) - job_desc.Num_tasks = uint32(1) - - job_desc.Cpus_per_task = uint16(2) - job_desc.Std_out = ("./%j-out.txt") - job_desc.Std_err = ("./%j-err.txt") - job_desc.Work_dir = dir - - answer := submit_job.Submit_job(&job_desc) - if(answer.Error_code != 0) { - msg := slurm.GetErrorString(answer.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - } - fmt.Printf("Submitted Job %d\n", answer.Job_id) - - /*Now, we submit the same jon again, ut with some oversubsciption */ - job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" - job_desc.Script+= "export OMP_NUM_THREADS=4\n" - - job_desc.Script+= cmd.String() - fmt.Printf("cmd %s\n", job_desc.Script) - answer2 := submit_job.Submit_job(&job_desc) - if(answer2.Error_code != 0) { - msg := slurm.GetErrorString(answer.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - } - fmt.Printf("Submitted Job %d\n", answer2.Job_id) - - - - job_list := job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job := job_list.Job_list[0] - - fmt.Printf("job is %s\n",job.Job_stateS) - state := job.Job_stateS - for state == "Pending" || state == "Running" { - time.Sleep(2 * time.Second) - job_list = job_info.Get_job(answer.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job = job_list.Job_list[0] - - state = job.Job_stateS - - fmt.Printf("job is %s\n",job.Job_stateS) - - - } - - fmt.Printf("Total runtime first job %s\n",job_info.Get_job_runtime(job).String() ) - /*wait for second job */ - job_list = job_info.Get_job(answer2.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job = job_list.Job_list[0] - - fmt.Printf("job is %s\n",job.Job_stateS) - state = job.Job_stateS - for state == "Pending" || state == "Running" { - time.Sleep(2 * time.Second) - job_list = job_info.Get_job(answer2.Job_id) - if job_list.Error_code != 0 { - msg := slurm.GetErrorString(job_list.Error_code) - fmt.Printf("Error: %s\n" ,msg) - return - - } - job = job_list.Job_list[0] - - state = job.Job_stateS - - fmt.Printf("job is %s\n",job.Job_stateS) - - - } - - - fmt.Printf("Total runtime second job %s\n",job_info.Get_job_runtime(job).String() ) - -} +// } +// /* use Cmd to create our script */ +// +// job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" +// job_desc.Script+= "export OMP_NUM_THREADS=$SLURM_JOB_CPUS_PER_NODE\n" +// cmd := exec.Command( "/usr/local/bin/singularity", "exec",container, "/opt/openmp_example" ) +// +// job_desc.Script+= cmd.String() +// fmt.Printf("cmd %s\n", job_desc.Script) +// user, _:= user.Current() +// userid , _ := strconv.Atoi(user.Uid) +// job_desc.User_id= uint32(userid) +// groupid , _ := strconv.Atoi(user.Gid) +// +// job_desc.Group_id= uint32(groupid) +// job_desc.Name = "test_job" +// job_desc.Partition="long" +// job_desc.Time_limit = uint32(60) +// job_desc.Min_nodes =uint32(1) +// job_desc.Num_tasks = uint32(1) +// +// job_desc.Cpus_per_task = uint16(2) +// job_desc.Std_out = ("./%j-out.txt") +// job_desc.Std_err = ("./%j-err.txt") +// job_desc.Work_dir = dir +// +// answer := submit_job.Submit_job(&job_desc) +// if(answer.Error_code != 0) { +// msg := slurm.GetErrorString(answer.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// } +// fmt.Printf("Submitted Job %d\n", answer.Job_id) +// +// /*Now, we submit the same jon again, ut with some oversubsciption */ +// job_desc.Script = "#!/bin/bash\n export PATH=$PATH:/usr/local/bin\n hostname \n" +// job_desc.Script+= "export OMP_NUM_THREADS=4\n" +// +// job_desc.Script+= cmd.String() +// fmt.Printf("cmd %s\n", job_desc.Script) +// answer2 := submit_job.Submit_job(&job_desc) +// if(answer2.Error_code != 0) { +// msg := slurm.GetErrorString(answer.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// } +// fmt.Printf("Submitted Job %d\n", answer2.Job_id) +// +// +// +// job_list := job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job := job_list.Job_list[0] +// +// fmt.Printf("job is %s\n",job.Job_stateS) +// state := job.Job_stateS +// for state == "Pending" || state == "Running" { +// time.Sleep(2 * time.Second) +// job_list = job_info.Get_job(answer.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job = job_list.Job_list[0] +// +// state = job.Job_stateS +// +// fmt.Printf("job is %s\n",job.Job_stateS) +// +// +// } +// +// fmt.Printf("Total runtime first job %s\n",job_info.Get_job_runtime(job).String() ) +// /*wait for second job */ +// job_list = job_info.Get_job(answer2.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job = job_list.Job_list[0] +// +// fmt.Printf("job is %s\n",job.Job_stateS) +// state = job.Job_stateS +// for state == "Pending" || state == "Running" { +// time.Sleep(2 * time.Second) +// job_list = job_info.Get_job(answer2.Job_id) +// if job_list.Error_code != 0 { +// msg := slurm.GetErrorString(job_list.Error_code) +// fmt.Printf("Error: %s\n" ,msg) +// return +// +// } +// job = job_list.Job_list[0] +// +// state = job.Job_stateS +// +// fmt.Printf("job is %s\n",job.Job_stateS) +// +// +// } +// +// +// fmt.Printf("Total runtime second job %s\n",job_info.Get_job_runtime(job).String() ) +// +//} diff --git a/tenant/gen/openapiv2/idl/tenant.swagger.json b/tenant/gen/openapiv2/idl/tenant.swagger.json index 99e1518b..727eb16e 100644 --- a/tenant/gen/openapiv2/idl/tenant.swagger.json +++ b/tenant/gen/openapiv2/idl/tenant.swagger.json @@ -15,14 +15,11 @@ "protobufAny": { "type": "object", "properties": { - "typeUrl": { + "@type": { "type": "string" - }, - "value": { - "type": "string", - "format": "byte" } - } + }, + "additionalProperties": {} }, "rpcStatus": { "type": "object",