graphqldagster

What is the value of $repositoryLocationName when running ExecutePipeline in Dagster's GraphQL API?


I am attempting to launch a Dagster pipeline run with the GraphQL API. I have Dagit running locally and a working pipeline that I can trigger via the playground.

However, I am now trying to trigger the pipeline via GraphQL Playground, available at /graphql.

I am using the following mutation:

mutation ExecutePipeline(
  $repositoryLocationName: String!
  $repositoryName: String!
  $pipelineName: String!
  $runConfigData: RunConfigData!
  $mode: String!
)

...and hence am providing the following query params:

{
  "repositoryName": "my_repo",
  "repositoryLocationName": <???>,
  "pipelineName": "my_pipeline",
  "mode": "dev",
  "runConfigData": {<MY_RUN_CONFIG>}
}

I am not sure what value repositoryLocationName should take? I have tried a few but receive the following error:

{
  "data": {
    "launchPipelineExecution": {
      "__typename": "PipelineNotFoundError"
    }
  }
}

This is the tutorial I am following.


Solution

  • Short answer:

    Each repository lives inside a repository location. Dagster provides a default repository location name if you do not provide one yourself. To find the location name, you can click the repository picker in Dagit, and it'll be next to the repository name:

    enter image description here

    In this example, the repository name is toys_repository, and the location name is dagster_test.toys.repo

    Longer answer:

    A workspace (defined with your workspace.yaml) is a collection of repository locations.

    There are currently three types of repository locations:

    Each repository location can have multiple repositories. Once you define the location, Dagster is able to automatically go find all the repositories in that location. In the example above, I defined my workspace to have a single Python module repository location:

    load_from:
      - python_module: dagster_test.toys.repo
    

    Note that simply specified a module and did not specify a repository location name, so Dagster assigned a default repository location name.

    If I wanted to specify a location name, I would do:

    load_from:
    - python_module:
        module_name: dagster_test.toys.repo
        location_name: "my_custom_location_name"
    

    Similarly for a python file location:

    load_from:
    - python_file: repo.py
    

    Or with a custom repository location name:

    load_from:
    - python_file:
        relative_path: repo.py
        location_name: "my_custom_location_name"