Skip to content

Commit

Permalink
[components] tweaks to deployment doc for better final dagster dev (#…
Browse files Browse the repository at this point in the history
…27466)

## Summary & Motivation

Tweak the ending of the "Setting up a Deployment" tutorial:

- add `executable_path` settings to the `workspace.yaml`, ensuring code
locations load in their correct environments
- run `dagster dev` with `uv tool run`

## How I Tested These Changes

Stepped through the outlined tutorial
  • Loading branch information
smackesey authored Jan 31, 2025
1 parent 9ca0af2 commit 83431f9
Showing 1 changed file with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,34 @@ For a final step, let's load up our two code locations with `dagster dev`.
We'll need a workspace.yaml to do this. Create a new file `workspace.yaml` in
the `my-deployment` directory:

:::note
`dg` scaffolding functionality is currently under heavy development. In the
future we will construct this workspace.yaml file for you automatically in the
course of scaffolding code locations.
:::

```yaml
load_from:
- python_file:
relative_path: code_locations/code-location-1/code_location_1/definitions.py
location_name: code_location_1
executable_path: code_locations/code-location-1/.venv/bin/python
- python_file:
relative_path: code_locations/code-location-2/code_location_2/definitions.py
location_name: code_location_2
executable_path: code_locations/code-location-2/.venv/bin/python
```

And finally we'll run `dagster dev` to see your two code locations loaded up in the
UI. You may already have `dagster` installed in the ambient environment, in
which case plain `dagster dev` will work. But in case you don't, we'll run
`dagster dev` using `uv`, which will pull down and run `dagster` for you in
an isolated environment:
```
uv tool run --with=dagster-webserver dagster dev
```
And finally run `dagster dev` to see your two code locations loaded up in the
UI:
![](/images/guides/build/projects-and-components/setting-up-a-deployment/two-code-locations.png)
:::note
`dg` scaffolding functionality is currently under heavy development. In the
future we will construct this workspace.yaml file for you automatically in the
course of scaffolding code locations, and provide a `dg dev` command that
handles pulling down `dagster` for you in the background.
:::

1 comment on commit 83431f9

@github-actions
Copy link

@github-actions github-actions bot commented on 83431f9 Jan 31, 2025

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-3avwk5uvv-elementl.vercel.app

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

Please sign in to comment.