From 7851156ebc38bdd92886db56886059d1e7585abc Mon Sep 17 00:00:00 2001 From: gibsondan Date: Mon, 4 Mar 2024 15:05:04 -0600 Subject: [PATCH] Reference dagster/max_runtime tag in docs instead of the python constant (#20243) Summary: Since you might apply this tag in places other than python, the Python constant indirection here is causing more confusion than doing good. Test Plan: Inspect docs page ## Summary & Motivation ## How I Tested These Changes --- docs/content/deployment/run-monitoring.mdx | 8 ++++---- .../deploying/monitoring_daemon/run_timeouts.py | 6 +++--- .../deploying_tests/test_monitoring_daemon_examples.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/deployment/run-monitoring.mdx b/docs/content/deployment/run-monitoring.mdx index 1848ac829affe..b2db2295efffe 100644 --- a/docs/content/deployment/run-monitoring.mdx +++ b/docs/content/deployment/run-monitoring.mdx @@ -31,21 +31,21 @@ When Dagster terminates a run, the run moves into CANCELING status and sends a t ## General run timeouts -After a run is marked as STARTED, it may hang indefinitely for various reasons (user API errors, network issues, etc.). `MAX_RUNTIME_SECONDS_TAG` can be used to set a timeout on a per-run basis. If the run exceeds this timeout, and run monitoring is enabled, it will be marked as failed. +After a run is marked as STARTED, it may hang indefinitely for various reasons (user API errors, network issues, etc.). The `dagster/max_runtime` tag can be used to set a timeout in seconds on a per-run basis. If the run exceeds this timeout, and run monitoring is enabled, it will be marked as failed. The below code example shows how to set a run timeout of 10 seconds on a per-job basis: ```python file=/deploying/monitoring_daemon/run_timeouts.py startafter=start_timeout -from dagster import MAX_RUNTIME_SECONDS_TAG, define_asset_job, job +from dagster import define_asset_job, job -@job(tags={MAX_RUNTIME_SECONDS_TAG: 10}) +@job(tags={"dagster/max_runtime": 10}) def my_job(): ... asset_job = define_asset_job( - name="some_job", selection="*", tags={MAX_RUNTIME_SECONDS_TAG: 10} + name="some_job", selection="*", tags={"dagster/max_runtime": 10} ) # end_timeout ``` diff --git a/examples/docs_snippets/docs_snippets/deploying/monitoring_daemon/run_timeouts.py b/examples/docs_snippets/docs_snippets/deploying/monitoring_daemon/run_timeouts.py index b2dd2d7f98450..ecfea99e87b99 100644 --- a/examples/docs_snippets/docs_snippets/deploying/monitoring_daemon/run_timeouts.py +++ b/examples/docs_snippets/docs_snippets/deploying/monitoring_daemon/run_timeouts.py @@ -1,13 +1,13 @@ # start_timeout -from dagster import MAX_RUNTIME_SECONDS_TAG, define_asset_job, job +from dagster import define_asset_job, job -@job(tags={MAX_RUNTIME_SECONDS_TAG: 10}) +@job(tags={"dagster/max_runtime": 10}) def my_job(): ... asset_job = define_asset_job( - name="some_job", selection="*", tags={MAX_RUNTIME_SECONDS_TAG: 10} + name="some_job", selection="*", tags={"dagster/max_runtime": 10} ) # end_timeout diff --git a/examples/docs_snippets/docs_snippets_tests/deploying_tests/test_monitoring_daemon_examples.py b/examples/docs_snippets/docs_snippets_tests/deploying_tests/test_monitoring_daemon_examples.py index d2cb2248eebd3..b988da34c971e 100644 --- a/examples/docs_snippets/docs_snippets_tests/deploying_tests/test_monitoring_daemon_examples.py +++ b/examples/docs_snippets/docs_snippets_tests/deploying_tests/test_monitoring_daemon_examples.py @@ -1,5 +1,5 @@ +from dagster import MAX_RUNTIME_SECONDS_TAG from docs_snippets.deploying.monitoring_daemon.run_timeouts import ( - MAX_RUNTIME_SECONDS_TAG, asset_job, my_job, )