Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
f8d6bf8e
Unverified
Commit
f8d6bf8e
authored
Jun 02, 2021
by
Jinjing Zhou
Committed by
GitHub
Jun 02, 2021
Browse files
[Test] Fix regression ram info (#2964)
* fix regression ram info * fix
parent
0e964ea5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
Jenkinsfile
Jenkinsfile
+5
-2
benchmarks/scripts/fix_ram_info.py
benchmarks/scripts/fix_ram_info.py
+24
-0
No files found.
Jenkinsfile
View file @
f8d6bf8e
...
...
@@ -119,8 +119,10 @@ pipeline {
script
{
def
comment
=
env
.
GITHUB_COMMENT
def
author
=
env
.
GITHUB_COMMENT_AUTHOR
echo
(
"${env.GIT_URL}"
)
echo
(
"${env}"
)
if
(!
is_authorized
(
author
))
{
error
(
'Not authorized to launch regression tests'
)
error
(
'Not authorized to launch regression tests'
)
}
dir
(
'benchmark_scripts_repo'
)
{
checkout
([
$class
:
'GitSCM'
,
branches:
[[
name:
'*/master'
]],
...
...
@@ -135,9 +137,10 @@ pipeline {
}
else
{
pullRequest
.
comment
(
"Start the Regression test. View at ${RUN_DISPLAY_URL}"
)
}
def
prNumber
=
env
.
BRANCH_NAME
.
replace
(
'PR-'
,
''
)
dir
(
'benchmarks/scripts'
)
{
sh
(
'python3 -m pip install boto3'
)
sh
(
"PYTHONUNBUFFERED=1 GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'"
)
sh
(
"PYTHONUNBUFFERED=1
GIT_PR_ID=${prNumber}
GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'"
)
}
pullRequest
.
comment
(
"Finished the Regression test. Result table is at https://dgl-asv-data.s3-us-west-2.amazonaws.com/${env.GIT_COMMIT}_${instance_type}/results/result.csv. Jenkins job link is ${RUN_DISPLAY_URL}. "
)
currentBuild
.
result
=
'SUCCESS'
...
...
benchmarks/scripts/fix_ram_info.py
0 → 100644
View file @
f8d6bf8e
from
pathlib
import
Path
import
json
def
main
():
result_dir
=
Path
(
__file__
).
parent
/
".."
/
Path
(
"results/"
)
for
per_machine_dir
in
result_dir
.
iterdir
():
if
per_machine_dir
.
is_dir
():
try
:
machine_json
=
json
.
loads
((
per_machine_dir
/
"machine.json"
).
read_text
())
ram
=
machine_json
[
"ram"
]
for
f
in
per_machine_dir
.
glob
(
"*.json"
):
if
f
.
stem
!=
"machine"
:
result
=
json
.
loads
(
f
.
read_text
())
result_ram
=
result
[
"params"
][
"ram"
]
if
result_ram
!=
ram
:
result
[
"params"
][
"ram"
]
=
ram
print
(
f
"Fix ram in
{
f
}
"
)
f
.
write_text
(
json
.
dumps
(
result
))
else
:
print
(
f
"Skip
{
f
}
"
)
except
Exception
as
e
:
print
(
e
)
main
()
\ 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