Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nodemanager
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
nodemanager
Commits
4fb25652
Commit
4fb25652
authored
Feb 22, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test standardtask
parent
cc1377a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
smallcar.go
standardlib/smallcar.go
+27
-0
standardtask.json
standardtask.json
+9
-2
No files found.
standardlib/smallcar.go
0 → 100644
View file @
4fb25652
package
standardlib
import
(
"fmt"
"math/rand"
)
type
SmallCar
struct
{
}
func
init
()
{
RegisterStdLib
(
"smallcar"
,
&
SmallCar
{})
}
func
(
g
*
SmallCar
)
GenerateParam
(
difficult
int
)
(
string
,
error
)
{
m
:=
rand
.
Intn
(
256
)
param
:=
fmt
.
Sprintf
(
"{
\n
\"
model_name
\"
:
\"
Realistic_Vision_V1.4
\"
,
\n
\"
model_type
\"
:
\"
tex2img
\"
,
\n
\"
desc
\"
: {
\n
\"
prompt
\"
:
\"
a car with number %d
\"
,
\n
\"
steps
\"
: 20
\n
}
\n
}"
,
m
)
return
param
,
nil
}
func
(
g
*
SmallCar
)
VerifyResult
(
param
string
,
result
[]
byte
)
bool
{
if
len
(
result
)
>
0
{
return
true
}
return
false
}
standardtask.json
View file @
4fb25652
...
...
@@ -3,9 +3,16 @@
"task_kind"
:
3
,
"task_type"
:
999
,
"task_cmd"
:
"{\"image_name\"
:
\
"demianhjw/ethaddr:latest\",\"docker_cmd\"
:{
\
"container_port\"
:
\
"5001\"},\"api_url\"
:
\
"http://127.0.0.1:%d/aigic
\"
}"
,
"task_timestamp"
:
1708574058633402301
,
"task_fee"
:
"0"
,
"task_workload"
:
100
,
"standlib"
:
"ethaddr"
}
},
{
"task_kind"
:
3
,
"task_type"
:
998
,
"task_cmd"
:
"{\"image_name\"
:
\
"demianhjw/ethaddr:latest\",\"docker_cmd\"
:{
\
"container_port\"
:
\
"5001\"},\"api_url\"
:
\
"http://127.0.0.1:%d/aigic
\"
}"
,
"task_fee"
:
"0"
,
"task_workload"
:
100
,
"standlib"
:
"smallcar"
}
]
\ No newline at end of file
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