Skip to content

Commit

Permalink
Create unified storage configuration for dagster.yaml (#7283)
Browse files Browse the repository at this point in the history
* Add legacy stubs, unified storage configuration

* lint

* lint

* fix legacy

* add scheme to pg config
  • Loading branch information
prha committed Jun 7, 2022
1 parent 1b20e2e commit a5a1c0b
Show file tree
Hide file tree
Showing 41 changed files with 1,524 additions and 1,065 deletions.
6 changes: 5 additions & 1 deletion docs/content/api/modules.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/content/api/searchindex.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/content/api/sections.json

Large diffs are not rendered by default.

435 changes: 53 additions & 382 deletions docs/content/deployment/dagster-instance.mdx

Large diffs are not rendered by default.

38 changes: 7 additions & 31 deletions docs/content/deployment/guides/aws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,14 @@ To host Dagster on a bare VM or in Docker on EC2, see [Running Dagster as a serv
You can use a hosted RDS PostgreSQL database for your Dagster run/events data by configuring your `dagster.yaml` file.

```python file=/deploying/dagster-pg.yaml
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
storage:
postgres:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }
username: my_username
password: my_password
hostname: my_hostname
db_name: my_database
port: 5432
```

In this case, you'll want to ensure you provide the right connection strings for your RDS instance, and ensure that the node or container hosting Dagit is able to connect to RDS.
Expand Down
38 changes: 7 additions & 31 deletions docs/content/deployment/guides/celery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,14 @@ In production, more configuration is required.
First, ensure that appropriate persistent run and event log storage, e.g., **`PostgresRunStorage`** and **`PostgresEventLogStorage`**, are configured on your Dagster instance, so that Dagit and the workers can communicate information about the run and events. You can do this by adding a block such as the following to your `dagster.yaml` (by default, Dagster will look for this file at `$DAGSTER_HOME/dagster.yaml` when the `DAGSTER_HOME` environment variable is set):

```python file=/deploying/dagster-pg.yaml
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
storage:
postgres:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }
username: my_username
password: my_password
hostname: my_hostname
db_name: my_database
port: 5432
```

**The same instance config must be present in Dagit's environment and in the workers' environments.** If you haven't already, please read about [the Dagster instance](/deployment/dagster-instance).
Expand Down
36 changes: 2 additions & 34 deletions docs/content/deployment/guides/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,8 @@ load_from:
as well as a `dagster.yaml` file to configure your [Dagster instance](/deployment/dagster-instance):

```yaml file=/deploying/docker/dagster.yaml
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
postgres_db:
username:
env: DAGSTER_PG_USERNAME
password:
env: DAGSTER_PG_PASSWORD
hostname:
env: DAGSTER_PG_HOST
db_name:
env: DAGSTER_PG_DB
port: 5432

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username:
env: DAGSTER_PG_USERNAME
password:
env: DAGSTER_PG_PASSWORD
hostname:
env: DAGSTER_PG_HOST
db_name:
env: DAGSTER_PG_DB
port: 5432

schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
storage:
postgres:
postgres_db:
username:
env: DAGSTER_PG_USERNAME
Expand Down
38 changes: 7 additions & 31 deletions docs/content/deployment/guides/gcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,14 @@ To host Dagit or Dagster Daemon on a bare VM or in Docker on GCE, see [Running D
We recommend launching a Cloud SQL PostgreSQL instance for run and events data. You can configure Dagit to use Cloud SQL to run and events data by setting blocks in your `$DAGSTER_HOME/dagster.yaml` appropriately:

```python file=/deploying/dagster-pg.yaml
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
storage:
postgres:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }
username: my_username
password: my_password
hostname: my_hostname
db_name: my_database
port: 5432
```

In this case, you'll want to ensure you provide the right connection strings for your Cloud SQL instance, and that the node or container hosting Dagit is able to connect to Cloud SQL.
Expand Down
9 changes: 9 additions & 0 deletions docs/sphinx/sections/api/apidocs/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ Instance

----

Storage
-------

.. currentmodule:: dagster.core.storage.base_storage

.. autoclass:: DagsterStorage

----

Run storage
-----------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# start_marker_runs

run_storage:
module: dagster_mysql.run_storage
class: MySQLRunStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

# end_marker_runs

# start_marker_event_log

event_log_storage:
module: dagster_mysql.event_log
class: MySQLEventLogStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

# end_marker_event_log

# start_marker_schedules

schedule_storage:
module: dagster_mysql.schedule_storage
class: MySQLScheduleStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

# end_marker_schedules
52 changes: 8 additions & 44 deletions examples/docs_snippets/docs_snippets/deploying/dagster-mysql.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
# start_marker_runs

run_storage:
module: dagster_mysql.run_storage
class: MySQLRunStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

# end_marker_runs

# start_marker_event_log

event_log_storage:
module: dagster_mysql.event_log
class: MySQLEventLogStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

# end_marker_event_log

# start_marker_schedules

schedule_storage:
module: dagster_mysql.schedule_storage
class: MySQLScheduleStorage
config:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

# end_marker_schedules
storage:
mysql:
mysql_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

schedule_storage:
module: dagster_postgres.event_log
class: PostgresScheduleStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }
38 changes: 7 additions & 31 deletions examples/docs_snippets/docs_snippets/deploying/dagster-pg.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
storage:
postgres:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { database }
port: { port }

event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }

schedule_storage:
module: dagster_postgres.schedule_storage
class: PostgresScheduleStorage
config:
postgres_db:
username: { username }
password: { password }
hostname: { hostname }
db_name: { db_name }
port: { port }
username: my_username
password: my_password
hostname: my_hostname
db_name: my_database
port: 5432

1 comment on commit a5a1c0b

@vercel
Copy link

@vercel vercel bot commented on a5a1c0b Jun 7, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.