♻ 修改core端引用方法

This commit is contained in:
zhouqunjie 2023-11-07 10:23:16 +08:00
parent 6bb6e6012f
commit 576530b96f
4 changed files with 10 additions and 8 deletions

View File

@ -3,12 +3,12 @@ package cron
import (
"context"
"github.com/zeromicro/go-zero/core/logx"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils/httputils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice"
)
func ReportHeartbeat(participantRpc participantservice.ParticipantService) {
participantId, err := tool.GetParticipantId("etc/slurm.yaml")
participantId, err := utils.GetParticipantId("etc/slurm.yaml")
if err != nil {
logx.Errorf("获取participant id失败 err:", err)
return

View File

@ -3,7 +3,7 @@ package cron
import (
"context"
"github.com/zeromicro/go-zero/core/logx"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils/httputils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/logic"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/svc"
@ -11,7 +11,7 @@ import (
)
func SyncTask(svc *svc.ServiceContext) {
participantId, err := tool.GetParticipantId("etc/slurm.yaml")
participantId, err := utils.GetParticipantId("etc/slurm.yaml")
if err != nil {
return
}

View File

@ -7,10 +7,11 @@ import (
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
proModel "github.com/prometheus/common/model"
model "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils/httputils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/logic"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/svc"
"gitlink.org.cn/jcce-pcm/utils/tool"
"time"
)
@ -47,7 +48,7 @@ func MetricsQuery(statement string) (*proModel.Vector, error) {
}
func NodesDynamicInfo(svc *svc.ServiceContext) ([]*model.ScNodeAvailInfo, error) {
participantId, err := tool.GetParticipantId("etc/slurm.yaml")
participantId, err := utils.GetParticipantId("etc/slurm.yaml")
ctx := context.TODO()
listNodeLogic := logic.NewListNodeLogic(ctx, svc)
var nodes []*model.ScNodeAvailInfo

View File

@ -7,7 +7,7 @@ import (
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/service"
"github.com/zeromicro/go-zero/zrpc"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils/httputils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/config"
@ -15,6 +15,7 @@ import (
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/server"
"gitlink.org.cn/jcce-pcm/pcm-slurm/internal/svc"
"gitlink.org.cn/jcce-pcm/pcm-slurm/slurm"
"gitlink.org.cn/jcce-pcm/utils/tool"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"strconv"
@ -51,7 +52,7 @@ func main() {
// PushParticipantInfo 推送p端静态信息
func PushParticipantInfo(address string, participantService participantservice.ParticipantService) {
// 服务注册到core端 同步静态信息
participantId, err := tool.GetParticipantId(*configFile)
participantId, err := utils.GetParticipantId(*configFile)
if err != nil {
return
}