|
123456789101112131415161718192021222324252627282930313233 |
- package updater
-
- import (
- "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
- "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
- "net/http"
- "strconv"
- )
-
- //func UpdateDeployInstanceStatus(svc *svc.ServiceContext, list []*models.AiInferDeployInstance) {
- //
- //}
-
- func UpdateDeployInstanceStatus(svc *svc.ServiceContext, instance *models.AiInferDeployInstance) {
- amap, found := svc.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(instance.AdapterId, 10)]
- if !found {
- return
- }
- cmap, found := amap[strconv.FormatInt(instance.ClusterId, 10)]
- if !found {
- return
- }
- h := http.Request{}
- ins, err := cmap.GetInferDeployInstance(h.Context(), instance.InstanceId)
- if err != nil {
- return
- }
- instance.Status = ins.Status
- err = svc.Scheduler.AiStorages.UpdateInferDeployInstance(instance)
- if err != nil {
- return
- }
- }
|