Skip to content

Commit

Permalink
[Test] Fix regression ram info (dmlc#2964)
Browse files Browse the repository at this point in the history
* fix regression ram info

* fix
  • Loading branch information
VoVAllen authored Jun 2, 2021
1 parent 0e964ea commit f8d6bf8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
Expand All @@ -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'
Expand Down
24 changes: 24 additions & 0 deletions benchmarks/scripts/fix_ram_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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()

0 comments on commit f8d6bf8

Please sign in to comment.