The dagster_cloud.yaml file should be placed in the root of your Dagster project. Below is an example of a file structure modified from the Dagster+ ETL quickstart.
If your repository contains multiple Dagster projects in subdirectories - otherwise known as a monorepository - add the dagster_cloud.yaml file to the root of where the Dagster projects are stored.
The dagster_cloud.yaml file contains a single top-level key, locations. This key accepts a list of code locations; for each code location, you can configure the following:
This section is required. The code_source defines how a code location is sourced.
A code_source key must contain either a module_name, package_name, or file_name parameter that specifies where to find the definitions in the code location.
Use the working_directory setting to load Dagster code from a different directory than the root of your code repository. This setting allows you to specify the directory you want to load your code from.
directory - Setting a build directory is useful if your setup.py or requirements.txt is in a subdirectory instead of the project root. This is common if you have multiple Python modules within a single Dagster project.
registry - Applicable only to Hybrid deployments. Specifies the Docker registry to push the code location to.
In the example below, the Docker image for the code location is in the root directory and the registry and image defined:
The path to the directory in your project that you want to deploy. If there are subdirectories, you can specify the path to only deploy a specific project directory.
Format - string(path)
Default - .
build.registry
Applicable to Hybrid deployments. The Docker registry to push your code location to
For Dagster+ Hybrid deployments, the Python executable that is installed globally in the image, or the default Python executable on the local system if you use the local agent, will be used. To use a different Python executable, specify it using the executable_path setting. It can be useful to have different Python executables for different code locations.
If using Hybrid deployment, you can define additional configuration options for code locations using the container_context parameter. Depending on the Hybrid agent you're using, the configuration settings under container_context will vary.
Refer to the configuration reference for your agent for more info: