-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into docs_for1.3.1_master
- Loading branch information
Showing
309 changed files
with
4,166 additions
and
3,876 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# /bin/bash | ||
# get PR id | ||
github_ref=$(echo $GITHUB_REF | grep -Eo "/[0-9]*/") | ||
pr_id=(${github_ref//// }) | ||
|
||
# generate time stamp | ||
current_time=`date "+%Y-%m-%d %H:%M:%S"` | ||
timestamp_string=`date -d "${current_time}" +%s` | ||
current_timestamp=$((timestamp_string*1000+10#`date "+%N"`/1000000)) | ||
|
||
# temporally set to mlu370 | ||
card_type="MLU370-S4" | ||
|
||
# default repo name | ||
repo_name="mlu-ops" | ||
|
||
github_user=${GITHUB_ACTOR} | ||
|
||
# start script | ||
python3 .github/scripts/run_ci_test.py ${repo_name} ${github_user} ${pr_id} ${current_timestamp} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import requests | ||
import json | ||
import time | ||
import sys | ||
|
||
local_communication_port = 12547 | ||
|
||
params = sys.argv | ||
try: | ||
if len(params) == 5: | ||
repo = params[1] | ||
user = params[2] | ||
pr_id = params[3] | ||
timestamp = params[4] | ||
elif len(params) == 4: | ||
repo = params[1] | ||
user = params[2] | ||
pr_id = "" | ||
timestamp = params[3] | ||
else: | ||
print("Got some wrong with input params. Test fail.") | ||
exit(-1) | ||
except Exception as e: | ||
print("Got some wrong with input params. Test fail.") | ||
exit(-1) | ||
|
||
json_obj = { | ||
"timestamp": timestamp, | ||
"repo": repo, | ||
"pr_id": pr_id, | ||
"trigger_type": "ci", | ||
"trigger_id": user, | ||
"repeat_times": "3", | ||
"status": "running" | ||
} | ||
local_test_server = "http://localhost:" + str(local_communication_port) | ||
|
||
# invoke test | ||
response = requests.post(local_test_server, json=json_obj) | ||
# get internal id | ||
task_obj = json.loads(response.text) | ||
|
||
try: | ||
while 1: | ||
response = requests.get(local_test_server + "/aiming=get_status&id=" + task_obj["id"]) | ||
result = json.loads(response.text) | ||
if "success" in result["status"] or "fail" in result["status"] or "error" in result["status"] or "stable" in result["status"]: | ||
print(result["log"]) | ||
print(result["status"]) | ||
response = requests.get(local_test_server + "/aiming=end_job&id=" + task_obj["id"]) | ||
if "success" in result["status"]: | ||
exit(0) | ||
else: | ||
exit(-1) | ||
break | ||
time.sleep(10) | ||
except Exception as e: | ||
print(e) | ||
print("Got internal error while invoking test. Since we can not reboot this test, you should rerun this test in github.") | ||
exit(-1) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.