Skip to content

Commit

Permalink
Update running-dagster-locally.mdx (#25739)
Browse files Browse the repository at this point in the history
Adds documentation for the `DAGSTER_IS_DEV_CLI` environment variable.

## Summary & Motivation

I was looking for ways to detect whether Dagster was running in local
dev, since I've run into staging automations triggering from local dev
environments when they shouldn't. I stumbled across
`DAGSTER_IS_DEV_CLI`, which appears to be used by both the `sdf` and
`dbt` Dagster libraries, but isn't really documented anywhere else.

## How I Tested These Changes

This is a documentation fix.

## Changelog

> Document the `DAGSTER_IS_DEV_CLI` environment variable
  • Loading branch information
alexras authored Nov 5, 2024
1 parent a156e32 commit 71e74cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/content/guides/running-dagster-locally.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ For the full list of options that can be set in the `dagster.yaml` file, refer t

---

## Detecting when you're running in `dagster dev`

You may want to detect whether you're running locally. For example, you might want schedules or sensors to start in the `RUNNING` state in production but not in your local test deployment.

`dagster dev` sets the environment variable `DAGSTER_IS_DEV_CLI` to `1`. You can detect whether you're in a local dev environment by checking for the presence of that environment variable.

---

## Moving to production

`dagster dev` is primarily useful for running Dagster for local development and testing. It isn't suitable for the demands of most production deployments. Most importantly, `dagster dev` does not include authentication or web security. Additionally, in a production deployment, you might want to run multiple webserver replicas, have zero downtime continuous deployment of your code, or set up your Dagster daemon to automatically restart if it crashes.
Expand Down

1 comment on commit 71e74cc

@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-n95mmri3k-elementl.vercel.app
https://master.dagster.dagster-docs.io

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

Please sign in to comment.