From a76be5c315d190daeaaf5fcdfa04d3db9dd33949 Mon Sep 17 00:00:00 2001 From: Kevin Cameron Grismore Date: Wed, 6 Dec 2023 14:21:02 -0500 Subject: [PATCH] flow for testing retries --- prefect.yaml | 13 +++++++++++++ retry_flow.py | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 retry_flow.py diff --git a/prefect.yaml b/prefect.yaml index b953ddc..4653c3a 100644 --- a/prefect.yaml +++ b/prefect.yaml @@ -51,3 +51,16 @@ deployments: work_queue_name: default job_variables: image: "{{ build-image.image }}" + + - name: retry-test + version: + tags: [] + description: + schedule: + entrypoint: retry_flow.py:testing_retries + parameters: {} + work_pool: + name: cloud-run-v2-pool + work_queue_name: default + job_variables: + image: "{{ build-image.image }}" diff --git a/retry_flow.py b/retry_flow.py new file mode 100644 index 0000000..4a8bb77 --- /dev/null +++ b/retry_flow.py @@ -0,0 +1,21 @@ +from prefect import flow, task + + +@flow +def testing_retries(): + successful_task() + failing_task() + + +@task +def successful_task(): + print("good") + + +@task +def failing_task(): + raise Exception("bad") + + +if __name__ == "__main__": + testing_retries()