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
83c338be
Commit
83c338be
authored
Apr 01, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ReplicateImageNameSuffix
parent
685893ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
42 deletions
+43
-42
config.go
conf/config.go
+20
-19
config.json
config.json
+2
-1
const.go
models/const.go
+20
-21
task_handler.go
nm/task_handler.go
+1
-1
No files found.
conf/config.go
View file @
83c338be
...
...
@@ -9,25 +9,26 @@ import (
)
type
Config
struct
{
SignPrv
string
SignPub
string
DockerServer
string
BenefitAddress
string
HeartRespTimeMillis
int64
ExternalIp
string
SignPublicAddress
common
.
Address
SignPrivateKey
*
ecdsa
.
PrivateKey
NmSeed
string
`json:"nm_seed"`
HeartRespTimeSecond
int64
`json:"heart_response"`
TaskValidatorTime
float64
`json:"task_validator_time"`
ContainerNum
int64
`json:"container_num"`
NodeManagerNum
int64
`json:"node_manager_num"`
ChainID
int64
`json:"chain_id"`
ApiUrl
string
`json:"api_url"`
ValidatorUrl
string
`json:"validator_url"`
OssUrl
string
`json:"oss_url"`
WaitLastTaskExecTime
int64
`json:"wait_last_task_exec_time"`
OpSys
string
`json:"op_sys"`
SignPrv
string
SignPub
string
DockerServer
string
BenefitAddress
string
HeartRespTimeMillis
int64
ExternalIp
string
SignPublicAddress
common
.
Address
SignPrivateKey
*
ecdsa
.
PrivateKey
NmSeed
string
`json:"nm_seed"`
HeartRespTimeSecond
int64
`json:"heart_response"`
TaskValidatorTime
float64
`json:"task_validator_time"`
ContainerNum
int64
`json:"container_num"`
NodeManagerNum
int64
`json:"node_manager_num"`
ChainID
int64
`json:"chain_id"`
ApiUrl
string
`json:"api_url"`
ValidatorUrl
string
`json:"validator_url"`
OssUrl
string
`json:"oss_url"`
WaitLastTaskExecTime
int64
`json:"wait_last_task_exec_time"`
OpSys
string
`json:"op_sys"`
ReplicateImageNameSuffix
string
`json:"replicate_image_name_suffix"`
}
var
_cfg
*
Config
=
nil
...
...
config.json
View file @
83c338be
...
...
@@ -9,5 +9,6 @@
"validator_url"
:
"172.31.35.130:20011"
,
"oss_url"
:
"https://tmp-file.aigic.ai/api/v1/upload"
,
"wait_last_task_exec_time"
:
60
,
"op_sys"
:
"linux"
"op_sys"
:
"linux"
,
"replicate_image_name_suffix"
:
"docker.aigic.ai/ai"
}
\ No newline at end of file
models/const.go
View file @
83c338be
package
models
const
(
TaskType
=
"taskType"
ContainerSign
=
"container"
MinerSign
=
"miner"
ReqHash
=
"reqHash"
RespHash
=
"respHash"
ResultFileExpiresDB
=
"expires"
ContentType
=
"type"
RedirectCode
=
303
UseFileCache
=
"Use-File-Cache"
UseRedirect
=
"Use-Redirect"
Prefer
=
"Prefer"
Async
=
"respond-async"
MaxExecTime
=
"MaxExecTime"
HealthCheckAPI
=
"/health-check"
ReplicateImageNameSuffix
=
"docker.agicoin.ai/agicoin"
READY
=
"READY"
ZeroHost
=
"0.0.0.0"
ModelPublishStatusYes
=
1
ModelPublishStatusNo
=
2
DefaultMaxExecTime
=
300
DefaultTaskTimer
=
2
TaskType
=
"taskType"
ContainerSign
=
"container"
MinerSign
=
"miner"
ReqHash
=
"reqHash"
RespHash
=
"respHash"
ResultFileExpiresDB
=
"expires"
ContentType
=
"type"
RedirectCode
=
303
UseFileCache
=
"Use-File-Cache"
UseRedirect
=
"Use-Redirect"
Prefer
=
"Prefer"
Async
=
"respond-async"
MaxExecTime
=
"MaxExecTime"
HealthCheckAPI
=
"/health-check"
READY
=
"READY"
ZeroHost
=
"0.0.0.0"
ModelPublishStatusYes
=
1
ModelPublishStatusNo
=
2
DefaultMaxExecTime
=
300
DefaultTaskTimer
=
2
)
nm/task_handler.go
View file @
83c338be
...
...
@@ -476,7 +476,7 @@ func (op *TaskOp) waitContainerRunning(handler *TaskWorker, imageId string) erro
if
!
running
{
continue
}
if
isMatch
:=
strings
.
HasPrefix
(
op
.
taskCmd
.
ImageName
,
models
.
ReplicateImageNameSuffix
);
isMatch
{
if
isMatch
:=
strings
.
HasPrefix
(
op
.
taskCmd
.
ImageName
,
conf
.
GetConfig
()
.
ReplicateImageNameSuffix
);
isMatch
{
if
isReqSuccess
,
err
:=
op
.
checkContainerHealthy
(
internalIp
,
internalPort
);
err
!=
nil
{
log
.
WithField
(
"err"
,
err
)
.
Errorf
(
"check container healthy failed"
)
return
fmt
.
Errorf
(
"%s-%s"
,
"check container healthy failed"
,
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