2021-10-05 09:17:33 -07:00
|
|
|
import ray
|
2021-07-01 16:10:58 -07:00
|
|
|
import os
|
|
|
|
import time
|
2021-10-05 09:17:33 -07:00
|
|
|
import json
|
2022-03-13 21:39:41 +00:00
|
|
|
from util import import_and_execute_test_script
|
2021-06-11 02:03:04 -07:00
|
|
|
|
2021-10-05 09:17:33 -07:00
|
|
|
NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO = (
|
2022-02-19 10:19:07 +01:00
|
|
|
"doc/source/ray-core/examples/modin_xgboost/modin_xgboost.py"
|
2022-01-29 18:41:57 -08:00
|
|
|
)
|
2021-06-11 02:03:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2021-10-05 09:17:33 -07:00
|
|
|
import_and_execute_test_script(NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO)
|
2021-06-11 02:03:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2021-07-01 16:10:58 -07:00
|
|
|
start = time.time()
|
2021-07-07 22:37:41 -07:00
|
|
|
|
2021-08-31 17:07:47 +02:00
|
|
|
addr = os.environ.get("RAY_ADDRESS")
|
|
|
|
job_name = os.environ.get("RAY_JOB_NAME", "modin_xgboost_test")
|
2021-10-05 09:17:33 -07:00
|
|
|
if addr is not None and addr.startswith("anyscale://"):
|
2021-08-31 17:07:47 +02:00
|
|
|
ray.init(address=addr, job_name=job_name)
|
|
|
|
else:
|
|
|
|
ray.init(address="auto")
|
2021-07-07 22:37:41 -07:00
|
|
|
|
2021-06-11 02:03:04 -07:00
|
|
|
main()
|
2021-07-07 22:37:41 -07:00
|
|
|
|
2021-07-01 16:10:58 -07:00
|
|
|
taken = time.time() - start
|
|
|
|
result = {
|
|
|
|
"time_taken": taken,
|
|
|
|
}
|
2022-01-29 18:41:57 -08:00
|
|
|
test_output_json = os.environ.get(
|
|
|
|
"TEST_OUTPUT_JSON", "/tmp/modin_xgboost_test.json"
|
|
|
|
)
|
2021-07-01 16:10:58 -07:00
|
|
|
with open(test_output_json, "wt") as f:
|
|
|
|
json.dump(result, f)
|
|
|
|
|
|
|
|
print("Test Successful!")
|