generated from astronomer/airflow-provider-sample
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial test * path changed * bug fix * bug fix * bug fix * bug fix * fix * update * bug fix * bug fix * update * bug fix * bug fix * bug fix * bug fix * update * update * bug fix * bug fix * Bug fix * bug fix * added more cpus * using minikube * updated * 14 cpus * GKE cluster * updated * update * update * update * update * update * update * update * update * print roles * update * update * test * test * update * minor update * bug fix * more tests * update * bug fix * update * update * try again * update * updates * update * try again * node svc account set * update * update * update * update * yaml files updated * making ip or dns generic choice * unit tests added * minor updates
- Loading branch information
1 parent
3634b53
commit 6aa46cf
Showing
14 changed files
with
308 additions
and
112 deletions.
There are no files selected for viewing
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
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
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
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,62 @@ | ||
from datetime import datetime, timedelta | ||
from pathlib import Path | ||
|
||
from airflow import DAG | ||
|
||
from ray_provider.operators.ray import DeleteRayCluster, SetupRayCluster, SubmitRayJob | ||
|
||
default_args = { | ||
"owner": "airflow", | ||
"start_date": datetime(2024, 3, 26), | ||
"retries": 1, | ||
"retry_delay": timedelta(minutes=0), | ||
} | ||
|
||
|
||
RAY_SPEC = Path(__file__).parent / "scripts/ray.yaml" | ||
FOLDER_PATH = Path(__file__).parent / "ray_scripts" | ||
|
||
dag = DAG( | ||
"Setup_Teardown", | ||
default_args=default_args, | ||
description="Setup Ray cluster and submit a job", | ||
schedule=None, | ||
) | ||
|
||
setup_cluster = SetupRayCluster( | ||
task_id="SetupRayCluster", | ||
conn_id="ray_conn", | ||
ray_cluster_yaml=str(RAY_SPEC), | ||
use_gpu=False, | ||
update_if_exists=False, | ||
dag=dag, | ||
) | ||
|
||
submit_ray_job = SubmitRayJob( | ||
task_id="SubmitRayJob", | ||
conn_id="ray_conn", | ||
entrypoint="python script.py", | ||
runtime_env={"working_dir": str(FOLDER_PATH)}, | ||
num_cpus=1, | ||
num_gpus=0, | ||
memory=0, | ||
resources={}, | ||
fetch_logs=True, | ||
wait_for_completion=True, | ||
job_timeout_seconds=600, | ||
xcom_task_key="SetupRayCluster.dashboard", | ||
poll_interval=5, | ||
dag=dag, | ||
) | ||
|
||
delete_cluster = DeleteRayCluster( | ||
task_id="DeleteRayCluster", | ||
conn_id="ray_conn", | ||
ray_cluster_yaml=str(RAY_SPEC), | ||
use_gpu=False, | ||
dag=dag, | ||
) | ||
|
||
# Create ray cluster and submit ray job | ||
setup_cluster.as_setup() >> submit_ray_job >> delete_cluster.as_teardown() | ||
setup_cluster >> delete_cluster |
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
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
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,8 @@ | ||
pytest -vv \ | ||
--cov=ray_provider \ | ||
--cov-report=term-missing \ | ||
--cov-report=xml \ | ||
--durations=0 \ | ||
-m integration \ | ||
-s \ | ||
--log-cli-level=DEBUG |
Oops, something went wrong.