Skip to content

Commit

Permalink
Reference dagster/max_runtime tag in docs instead of the python const…
Browse files Browse the repository at this point in the history
…ant (#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
  • Loading branch information
gibsondan authored Mar 4, 2024
1 parent fc28696 commit 7851156
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/content/deployment/run-monitoring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,
)
Expand Down

1 comment on commit 7851156

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-mz8zirob4-elementl.vercel.app
https://master.dagster.dagster-docs.io

Built with commit 7851156.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.