This guide is applicable to Dagster Cloud.
Welcome to Dagster Cloud!
In this guide, we'll give you everything you need to get up and running with Dagster Cloud using a Hybrid Deployment. With a Hybrid Deployment, your Dagster code is executed in your infrastructure. Refer to the Getting started with Serverless Deployment guide if you want to use Serverless.
We'll walk you through setting up your Dagster Cloud account, setting up an agent, loading your code, launching your first run, and configuring continuous integration.
To complete the steps in this guide, you'll need:
Access to some Dagster code. You can either use your own code or a project scaffold. This guide uses a scaffold.
To have dagster
and dagster-cloud
installed. To install, run:
pip install dagster dagster-cloud
The ability to create and configure an agent in your infrastructure. Using a Hybrid Deployment requires setting up an agent for use with Dagster Cloud. The agent runs in your infrastructure, executes your code, and streams metadata about code execution over HTTPS back to Dagster Cloud.
Dagster Cloud supports a handful of agents, each with its own prerequisites for setup. Refer to the Agent documentation for more info.
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.
When prompted, click Select under Hybrid deployment.
The modal that displays will contain a pre-generated agent token and info about the agents currently supported by Dagster Cloud.
Follow the steps for setting up and deploying your agent:
Continue to the next step when finished.
Now that you've set up your deployment, you'll need to tell it 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.
To complete this step, you can use your own Dagster code or a project scaffold. Our examples use the scaffold. Scaffold a new project by running:
dagster project from-example \
--name <PROJECT_NAME> \
--example <EXAMPLE_PROJECT_NAME>
In Dagster Cloud, click Workspace.
Click the Add sample code location button:
A pre-filled YAML editor with configuration will display.
Verify that the configuration is correct, then click Add code location to save the config.
The agent will attempt to load the your code. After the code is loaded, the new code location will show a Loaded status and a sample Dagster job will display in Dagster Cloud.
In this step, you'll run your first job in Dagster Cloud.
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 the current Dagster Cloud deployment. For example, prod
.
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: