Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
power-node
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
power-node
Commits
3e86446d
Commit
3e86446d
authored
Feb 20, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updage model container start
parent
77138ecb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
start.go
nm/start.go
+2
-0
task_msg.go
nm/task_msg.go
+4
-4
No files found.
nm/start.go
View file @
3e86446d
...
@@ -135,9 +135,11 @@ func monitorWorker(op *operate.DockerOp) {
...
@@ -135,9 +135,11 @@ func monitorWorker(op *operate.DockerOp) {
// 证明存储
// 证明存储
go
proofWorker
.
ProofStorage
()
go
proofWorker
.
ProofStorage
()
log
.
Info
(
"Proof storage worker started"
)
// 证明提交
// 证明提交
go
proofWorker
.
CommitWitness
()
go
proofWorker
.
CommitWitness
()
log
.
Info
(
"Proof commit worker started"
)
// 处理消息
// 处理消息
for
i
:=
0
;
i
<
5
;
i
++
{
for
i
:=
0
;
i
<
5
;
i
++
{
...
...
nm/task_msg.go
View file @
3e86446d
...
@@ -153,10 +153,10 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
...
@@ -153,10 +153,10 @@ func (t *TaskHandler) ComputeTaskHandler(taskMsg *nodeManagerV1.PushTaskMessage)
}
}
taskCmd
.
DockerCmd
.
HostPort
=
strconv
.
FormatInt
(
externalPort
,
10
)
taskCmd
.
DockerCmd
.
HostPort
=
strconv
.
FormatInt
(
externalPort
,
10
)
taskCmd
.
ApiUrl
=
fmt
.
Sprintf
(
taskCmd
.
ApiUrl
,
externalPort
)
taskCmd
.
ApiUrl
=
fmt
.
Sprintf
(
taskCmd
.
ApiUrl
,
externalPort
)
if
int64
(
len
(
containers
))
==
conf
.
GetConfig
()
.
ContainerNum
{
//
if int64(len(containers)) == conf.GetConfig().ContainerNum {
//todo: 待定,需要根据权重去停止哪个容器
//
//todo: 待定,需要根据权重去停止哪个容器
t
.
DockerOp
.
StopAndDeleteContainer
(
containers
[
0
]
.
ID
)
//
t.DockerOp.StopAndDeleteContainer(containers[0].ID)
}
//
}
containerId
,
err
:=
t
.
DockerOp
.
CreateAndStartContainer
(
taskCmd
.
ImageName
,
taskCmd
.
DockerCmd
)
containerId
,
err
:=
t
.
DockerOp
.
CreateAndStartContainer
(
taskCmd
.
ImageName
,
taskCmd
.
DockerCmd
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"Create and start container failed: %s"
,
err
.
Error
())
log
.
Errorf
(
"Create and start container failed: %s"
,
err
.
Error
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment