Commit b46080c9 authored by duanjinfei's avatar duanjinfei

update container sign and model info

parent 90a434c0
...@@ -20,8 +20,8 @@ type DockerCmd struct { ...@@ -20,8 +20,8 @@ type DockerCmd struct {
type TaskReq struct { type TaskReq struct {
TaskId string `json:"task_id"` TaskId string `json:"task_id"`
TaskParam []byte `json:"task_param"` TaskParam string `json:"task_param"`
TaskResult []byte `json:"task_result"` TaskResult string `json:"task_result"`
} }
type TaskParam struct { type TaskParam struct {
......
...@@ -75,8 +75,8 @@ func monitorModelInfo(dockerOp *operate.DockerOp) { ...@@ -75,8 +75,8 @@ func monitorModelInfo(dockerOp *operate.DockerOp) {
} }
} }
dockerOp.SignApi[modelInfo.ImageName] = modelInfo.SignUrl dockerOp.SignApi[modelInfo.ImageName] = modelInfo.SignUrl
dockerOp.ModelsInfo = append(dockerOp.ModelsInfo, modelInfo)
} }
dockerOp.ModelsInfo = modelInfosResp
reportTaskIds = append(reportTaskIds, maxLong) reportTaskIds = append(reportTaskIds, maxLong)
dockerOp.ModelTaskIdIndexesChan <- reportTaskIds dockerOp.ModelTaskIdIndexesChan <- reportTaskIds
ticker = time.NewTicker(time.Minute * 10) ticker = time.NewTicker(time.Minute * 10)
......
...@@ -48,7 +48,7 @@ func NewDockerOp() *DockerOp { ...@@ -48,7 +48,7 @@ func NewDockerOp() *DockerOp {
Reason: "", Reason: "",
dockerClient: dockerClient, dockerClient: dockerClient,
SignApi: make(map[string]string, 0), SignApi: make(map[string]string, 0),
ModelsInfo: make([]*models.ModelInfo, 0), ModelsInfo: make([]*models.ModelInfo, 1000),
UsedExternalPort: make(map[int64]bool, 0), UsedExternalPort: make(map[int64]bool, 0),
ModelTaskIdIndexesChan: make(chan []uint64, 0), ModelTaskIdIndexesChan: make(chan []uint64, 0),
} }
...@@ -63,8 +63,8 @@ func (d *DockerOp) GetContainerSign(taskMsg *nodemanagerv1.PushTaskMessage, task ...@@ -63,8 +63,8 @@ func (d *DockerOp) GetContainerSign(taskMsg *nodemanagerv1.PushTaskMessage, task
} }
reqBody := &models.TaskReq{ reqBody := &models.TaskReq{
TaskId: taskMsg.TaskId, TaskId: taskMsg.TaskId,
TaskParam: taskParam.Body, TaskParam: bytes.NewBuffer(taskParam.Body).String(),
TaskResult: taskRes, TaskResult: bytes.NewBuffer(taskRes).String(),
} }
body, err := json.Marshal(reqBody) body, err := json.Marshal(reqBody)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment