ray/release/golden_notebook_tests/workloads/modin_xgboost_test.py
matthewdeng 3fbe135a24
[docs] add modin_xgboost and dask_xgboost notebook tutorials (#18775)
* Add xgboost-dask golden notebook

* [examples] add modin-xgboost Jupyter notebook

* Add xgboost dast gn

* update modin notebook to sphinx-gallery compatible python file

* fix build file

* fix test

* fix test

* Add modin notebook anyscale connect test

* Add missing file

* add dask_xgboost notebook

* Add the new modin golden notebook to CI

* fix lint and filter out tests with py37

* Update release/golden_notebook_tests_new/golden_notebook_tests.yaml

Co-authored-by: matthewdeng <matthew.j.deng@gmail.com>

* Add dask, wait for cluster client, remove pytest

* Replace folder

* Fix

* Update dask_xgboost_app_config.yaml

* Update modin_xgboost_app_config.yaml

* comment on filtered out tests

Co-authored-by: Antoni Baum <antoni.baum@protonmail.com>
2021-10-05 09:17:33 -07:00

37 lines
973 B
Python

import ray
import os
import time
import json
from util import import_and_execute_test_script, wait_for_cluster_client
NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO = (
"doc/examples/modin_xgboost/modin_xgboost.py")
def main():
import_and_execute_test_script(NOTEBOOK_PATH_RELATIVE_TO_RAY_REPO)
if __name__ == "__main__":
start = time.time()
addr = os.environ.get("RAY_ADDRESS")
job_name = os.environ.get("RAY_JOB_NAME", "modin_xgboost_test")
if addr is not None and addr.startswith("anyscale://"):
ray.init(address=addr, job_name=job_name)
else:
ray.init(address="auto")
wait_for_cluster_client(4, 600)
main()
taken = time.time() - start
result = {
"time_taken": taken,
}
test_output_json = os.environ.get("TEST_OUTPUT_JSON",
"/tmp/modin_xgboost_test.json")
with open(test_output_json, "wt") as f:
json.dump(result, f)
print("Test Successful!")