Skip to content

Conversation

@gibsondan
Copy link
Member

@gibsondan gibsondan commented Oct 23, 2025

Summary & Motivation

In most of our examples, the project_dir is just the current folder and the dagster_cloud.yaml file is at the root. But you might also do something in your CI/CD like clone a repo with a dagster_cloud.yaml in it into a subfolder and try to init it using the project_dir argument to ci init. Unfortuntately, that does not work very well - the ci build command will still look for a setup.py at the current folder and be unable to find it. And if you try to fix it by changing your dagster_cloud.yaml file, the path has to be relative to the cwd rather than the project_dir.

This fixes that by saving the project_dir at ci init time and incorporating it into the build folder. Relative paths in the dagster_cloud.yaml are assumed to be relative to the project_dir (which was already the case in the more common case when the project dir was the same as the current directory).

Fixed an issue where setting a custom project_dir in a serverless github action resulted in the 'daggster-cloud ci build' step being unable to find the correct path.

How I Tested These Changes

New tests, run ci init and ci build locally

…use it when determining the build directory path

Summary:
In most of our examples, the project_dir is just the current folder and the dagster_cloud.yaml file is at the root. But you might also do something in your CI/CD like clone a repo with a dagster_cloud.yaml in it into a subfolder and try to init it using the project_dir argument to ci init. Unfortuntately, that does not work very well - the ci build command will still look for a setup.py at the current folder and be unable to find it. And if you try to fix it by changing your dagster_cloud.yaml file, the path has to be relative to the cwd rather than the project_dir.

This fixes that by saving the project_dir at ci init time and incorporating it into the build folder. Relative paths in the dagster_cloud.yaml are assumed to be relative to the project_dir (which was already the case in the more common case when the project dir was the same as the current directory).

Fixed an issue where setting a custom project_dir in a serverless github action resulted in the 'daggster-cloud ci build' step being unable to find the correct path.
location_build_dir = build_directory
elif (not build_directory) and configured_build_directory:
location_build_dir = configured_build_directory
if project_dir and not os.path.isabs(configured_build_directory):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we apply relative path logic to --build-directory too? that seems more consistent to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants