This guide is applicable to Dagster Cloud.
In this guide, we'll give you everything you need to get up and running with Dagster Cloud using Serverless Deployment. Serverless Deployment is a fully-managed version of Dagster Cloud that allows you to run your Dagster jobs without spinning up any infrastructure.
We'll walk you through setting up your Dagster Cloud account, activating Serverless, loading your code, launching your first run, and configuring Continuous Integration (CI).
Before you get started, note that:
To use Hybrid Deployment instead, refer to the Getting started using Hybrid Deployment guide.
To complete the steps in this guide, you'll need access to some Dagster code.
You can either use your own code or our sample code (dagster-cloud-examples
). This guide uses the dagster-cloud-examples
Python package.
If you don't already have a Dagster Cloud account, sign up for one before continuing.
You'll also be asked to create a Dagster Cloud organization. When your organization is created, a single deployment, named prod
, will also be created. Deployments are standalone environments, allowing you to operate independent instances of Dagster with separately managed permissions.
Next, you'll be prompted to select a deployment type. Click Select under Serverless deployment and confirm when prompted.
Note: If you find that Serverless isn't right for you, you can switch to Hybrid Deployment at any time.
Now that you've set up your deployment, you'll need to tell Dagster Cloud the location of your Dagster code.
A code location specifies a single Python package or file that defines your Dagster code. Each Dagster Cloud deployment can include code from one or more code locations. Refer to the Adding a code location guide for more info.
There are two ways to deploy your code to Dagster Cloud:
Using GitHub - If you're a GitHub user, this is the easiest way to deploy your code.
Using the dagster-cloud CLI - If you use a non-GitHub git provider or are developing locally, you can use our CLI to get started.
Click Choose account or organization and sign into your GitHub account.
Select the account or organization where Dagster should be installed.
After the installation and authorization is complete, you'll be redirected back to Dagster Cloud.
After Dagster Cloud is connected, you'll be prompted to either:
Clone the Dagster Cloud starter project - This option clones the dagster-cloud-template repo, which already has Serverless Deployment and Branch Deployments configured.
Use an existing repo - This option uses an existing repository in your GitHub account.
When finished, continue to the next step.
Using the dagster-cloud
CLI requires a recent version of Python 3 and Docker.
To complete this step using the CLI, you can use your own Dagster code or the dagster-cloud-examples
code. Our examples use the dagster-cloud-examples
package.
To install the dagster-cloud
CLI and the dagster-cloud-examples
package, run:
pip install dagster-cloud dagster-cloud-examples
Complete the setup:
Complete the authentication step, including creating a user token.
If using your own Dagster code, add dagster-cloud
as a dependency in setup.py
. Click here for an example.
Run the following to deploy your code to Dagster Cloud:
dagster-cloud serverless deploy \
--location-name "<LOCATION_NAME>" \
--package-name <PACKAGE_NAME> \
When finished, continue to the next step.
In this step, you'll run your first job in Dagster Cloud. Our example uses the compute_cereal_properties
job from the dagster-cloud-examples
package.
Click the icon in the top-left corner of the page to expand the navigation.
In the nav, open a repository and click a job.
On the job's page, click the Launchpad tab.
Click Launch Run in the bottom right corner to launch the run:
If you used the GitHub integration to deploy your code and you cloned the Dagster Cloud starter project, this step has already been completed for you! Branch Deployments come pre-configured in the Dagster Cloud starter project.
Branch Deployments allow you to quickly and collaboratively develop your Dagster jobs. When a branch is created or updated in your Dagster repository, Branch Deployments will create a testing environment in your Dagster Cloud instance.
Check out the Branch deployment docs for more info. If you skip this step now, you can always set it up later.
Congrats - your Dagster Cloud deployment is all set up! From here, you can: