Skip to content

Commit

Permalink
DOC-621 Clean up Serverless docs and Dagster+ getting started page (#…
Browse files Browse the repository at this point in the history
…26552)

## Summary & Motivation

* Clean up formatting of Serverless docs
* Clean up Dagster+ "Getting started" page (copyedits, formatting,
language)

## How I Tested These Changes

Tested locally.

## Changelog

> Insert changelog entry or delete this section.

---------

Signed-off-by: nikki everett <[email protected]>
  • Loading branch information
neverett authored and danielgafni committed Dec 17, 2024
1 parent e9c48e4 commit d5526d4
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 43 deletions.
Binary file modified docs/content/api/modules.json.gz
Binary file not shown.
Binary file modified docs/content/api/searchindex.json.gz
Binary file not shown.
Binary file modified docs/content/api/sections.json.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,3 @@ dagster-cloud serverless deploy-python-executable ./my-dagster-project \

</TabItem>
</Tabs>

---
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ sidebar_position: 10

Dagster+ Serverless is a fully managed version of Dagster+ and is the easiest way to get started with Dagster. With a Serverless deployment, you can run your Dagster jobs without spinning up any infrastructure yourself.

---

## When to choose Serverless \{#when-to-choose-serverless}
## Serverless vs Hybrid

Serverless works best with workloads that primarily orchestrate other services or perform light computation. Most workloads fit into this category, especially those that orchestrate third-party SaaS products like cloud data warehouses and ETL tools.

Expand All @@ -21,9 +19,7 @@ If any of the following are applicable, you should select [Hybrid deployment](/d
- You need to distribute computation across many nodes for a single run. Dagster+ runs currently execute on a single node with 4 CPUs
- You don't want to add Dagster Labs as a data processor

---

## Limitations \{#limitations}
## Limitations

Serverless is subject to the following limitations:

Expand All @@ -36,8 +32,6 @@ Serverless is subject to the following limitations:

Dagster+ Pro customers may request a quota increase by [contacting Sales](https://dagster.io/contact).

---

## Next steps

To start using Dagster+ Serverless, follow our [Getting started with Dagster+](/dagster-plus/getting-started) guide.
To start using Dagster+ Serverless, follow the steps in [Getting started with Dagster+](/dagster-plus/getting-started).
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ To follow the steps in this guide, you'll need:
- An understanding of [Dagster+ deployment settings](/dagster-plus/deployment/management/settings/deployment-settings)
</details>

---

## Differences between isolated and non-isolated runs

- [**Isolated runs**](#isolated-runs-default) execute in their own container. They're the default and are intended for production and compute-heavy use cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ sidebar_position: 100
By default, Dagster+ Serverless will package your code as PEX files and deploys them on Docker images. Using PEX files significantly reduces the time to deploy since it does not require building a new Docker image and provisioning a new container for every code change. However you are able to customize the Serverless runtime environment in various ways:

- [Add dependencies](#add-dependencies)
- [Use a different Python version](#python-version)
- [Use a different base image](#base-image)
- [Include data files](#data-files)
- [Disable PEX deploys](#disable-pex)
- [Use private Python packages](#private-packages)
- [Use a different Python version](#use-a-different-python-version)
- [Use a different base image](#use-a-different-base-image)
- [Include data files](#include-data-files)
- [Disable PEX deploys](#disable-pex-deploys)
- [Use private Python packages](#use-private-python-packages)

## Add dependencies \{#add-dependencies}
## Add dependencies

You can add dependencies by including the corresponding Python libraries in your Dagster project's `setup.py` file. These should follow [PEP 508](https://peps.python.org/pep-0508/).

Expand All @@ -39,9 +39,9 @@ setup(
)
```

To add a package from a private GitHub repository, see: [Use private Python packages](#private-packages)
To add a package from a private GitHub repository, see [Use private Python packages](#use-private-python-packages)

## Use a different Python version \{#python-version}
## Use a different Python version

The default Python version for Dagster+ Serverless is Python 3.9. Python versions 3.10 through 3.12 are also supported. You can specify the Python version you want to use in your GitHub or GitLab workflow, or by using the `dagster-cloud` CLI.

Expand Down Expand Up @@ -70,7 +70,7 @@ dagster-cloud serverless deploy-python-executable --python-version=3.11 --locati
</TabItem>
</Tabs>

## Use a different base image \{#base-image}
## Use a different base image

Dagster+ runs your code on a Docker image that we build as follows:

Expand Down Expand Up @@ -117,7 +117,7 @@ Setting a custom base image isn't supported for GitLab CI/CD workflows out of th
</TabItem>
</Tabs>
## Include data files \{#data-files}
## Include data files
To add data files to your deployment, use the [Data Files Support](https://setuptools.pypa.io/en/latest/userguide/datafiles.html) built into Python's `setup.py`. This requires adding a `package_data` or `include_package_data` keyword in the call to `setup()` in `setup.py`. For example, given this directory structure:
Expand All @@ -134,7 +134,7 @@ To add data files to your deployment, use the [Data Files Support](https://setup
If you want to include the data folder, modify your `setup.py` to add the `package_data` line:
<CodeExample filePath="dagster-plus/deployment/deployment-types/serverless/runtime-environment/data_files_setup.py" language="Python" title="Loading data files in setup.py" />
## Disable PEX deploys \{#disable-pex}
## Disable PEX deploys
You have the option to disable PEX-based deploys and deploy using a Docker image instead of PEX. You can disable PEX in your GitHub or GitLab workflow, or by using the `dagster-cloud` CLI.
Expand Down Expand Up @@ -200,7 +200,7 @@ Setting a custom base image isn't supported for GitLab CI/CD workflows out of th
</TabItem>
</Tabs>

## Use private Python packages \{#private-packages}
## Use private Python packages

If you use PEX deploys in your workflow (`ENABLE_FAST_DEPLOYS: 'true'`), the following steps can install a package from a private GitHub repository, e.g. `my-org/private-repo`, as a dependency:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ To prevent this, you can use [another I/O manager](/guides/build/configure/io-ma
You must have [boto3](https://pypi.org/project/boto3/) or `dagster-cloud[serverless]` installed as a project dependency otherwise the Dagster+ managed storage can fail and silently fall back to using the default I/O manager.
:::

## Adding environment variables and secrets \{#adding-secrets}
## Adding environment variables and secrets

Often you'll need to securely access secrets from your jobs. Dagster+ supports several methods for adding secrets—refer to the [Dagster+ environment variables documentation](/dagster-plus/deployment/management/environment-variables) for more information.

---
22 changes: 12 additions & 10 deletions docs/docs-beta/docs/dagster-plus/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
title: "Getting started with Dagster+"
---

First [create a Dagster+ organization](https://dagster.plus/signup). Note: you can sign up with:
To get started with Dagster+, you will need to create a Dagster+ organization and choose your deployment type (Serverless or Hybrid).

## Create a Dagster+ organization

First, [create a Dagster+ organization](https://dagster.plus/signup). You can sign up with:
- a Google email address
- a GitHub account
- a one-time email link, great if you are using a corporate email. You can setup SSO after completing these steps.
- a one-time email link (ideal if you are using a corporate email). You can set up SSO after completing these steps.

Next, pick your deployment type. Not sure?
## Choose your deployment type

- [Dagster+ Serverless](/dagster-plus/deployment/deployment-types/serverless) is the easiest way to get started and is great for teams with limited DevOps support. In Dagster+ Serverless, your Dagster code is executed in Dagster+. You will need to be okay [giving Dagster+ the credentials](/dagster-plus/deployment/management/environment-variables) to connect to the tools you want to orchestrate.

Expand All @@ -20,27 +24,25 @@ The remaining steps depend on your deployment type.

We recommend following the steps in Dagster+ to add a new project.

![Screenshot of Dagster+ serverless NUX](/img/placeholder.svg)

The Dagster+ on-boarding will guide you through:
The Dagster+ onboarding will guide you through:

Check failure on line 27 in docs/docs-beta/docs/dagster-plus/getting-started.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'onboarding'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'onboarding'?", "location": {"path": "docs/docs-beta/docs/dagster-plus/getting-started.md", "range": {"start": {"line": 27, "column": 14}}}, "severity": "ERROR"}

Check failure on line 27 in docs/docs-beta/docs/dagster-plus/getting-started.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Dagster.spelling] Is 'onboarding' spelled correctly? Raw Output: {"message": "[Dagster.spelling] Is 'onboarding' spelled correctly?", "location": {"path": "docs/docs-beta/docs/dagster-plus/getting-started.md", "range": {"start": {"line": 27, "column": 14}}}, "severity": "ERROR"}
- creating a Git repository containing your Dagster code
- setting up the necessary CI/CD actions to deploy that repository to Dagster+

:::tip
If you don't have any Dagster code yet, you will have the option to select an example quickstart project or import an existing dbt project
If you don't have any Dagster code yet, you can select an example project or import an existing dbt project.
:::

See the guide on [adding code locations](/dagster-plus/deployment/code-locations) for details.
</TabItem>

<TabItem value="hybrid" label="Dagster+ Hybrid">

## Install a Dagster+ Hybrid agent
**Install a Dagster+ Hybrid agent**

Follow [these guides](/dagster-plus/deployment/deployment-types/hybrid) for installing a Dagster+ Hybrid agent. Not sure which agent to pick? We recommend using the Dagster+ Kubernetes agent in most cases.
Follow [these guides](/dagster-plus/deployment/deployment-types/hybrid) for installing a Dagster+ Hybrid agent. If you're not sure which agent to use, we recommend the [Dagster+ Kubernetes agent](/dagster-plus/deployment/deployment-types/hybrid/kubernetes/index.md) in most cases.


## Setup CI/CD
**Set up CI/CD**

In most cases, your CI/CD process will be responsible for:
- building your Dagster code into a Docker image
Expand Down
Binary file modified docs/next/public/objects.inv
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/sphinx/sections/api/apidocs/libraries/dagster-aws.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ ECS
.. autoconfigurable:: dagster_aws.ecs.EcsRunLauncher
:annotation: RunLauncher

.. autoconfigurable:: dagster_aws.ecs.ecs_executor
:annotation: ExecutorDefinition


Redshift
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def ecs_executor(init_context: InitExecutorContext) -> Executor:
To use the `ecs_executor`, set it as the `executor_def` when defining a job:
.. literalinclude:: ../../../../../../python_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/run_launcher_tests/executor_tests/test_example_executor_mode_def.py
.. literalinclude:: ../../../../../../python_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/executor_tests/test_example_executor_mode_def.py
:start-after: start_marker
:end-before: end_marker
:language: python
Expand Down Expand Up @@ -221,7 +221,8 @@ def _get_run_task_kwargs(
tags = {
**{tag["key"]: tag["value"] for tag in run_task_kwargs.get("tags", [])},
**{
tag["key"]: tag["value"] for tag in run_launcher.build_ecs_tags_for_run_task(run, container_context)
tag["key"]: tag["value"]
for tag in run_launcher.build_ecs_tags_for_run_task(run, container_context)
},
**step_handler_context.dagster_run.dagster_execution_info,
"dagster/step-key": step_key,
Expand All @@ -232,7 +233,6 @@ def _get_run_task_kwargs(
{
"key": key,
"value": value,

}
for key, value in tags.items()
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def bar():
@op(
tags={
"ecs/cpu": "256",
"ecs/cpu": "1024",
"ecs/memory": "512",
}
)
Expand Down Expand Up @@ -209,7 +209,9 @@ def test_executor_launch(instance_cm: Callable[..., ContextManager[DagsterInstan

run_task_kwargs = executor._step_handler.ecs.run_task.call_args[1] # type: ignore # noqa: SLF001

breakpoint()
# resources should come from step tags
assert run_task_kwargs["overrides"]["cpu"] == "1024"
assert run_task_kwargs["overrides"]["memory"] == "512"

tags = run_task_kwargs["tags"]

Expand Down

0 comments on commit d5526d4

Please sign in to comment.