From 0696b8cd62e7a1b56f406f4e843fff27dc718bf2 Mon Sep 17 00:00:00 2001 From: benpankow Date: Thu, 8 Dec 2022 15:48:11 -0800 Subject: [PATCH 1/2] [parse-location] Use dagster_cloud.yaml dir as root for relative build paths --- actions/utils/parse_workspace/action.yml | 6 ++++-- sample-repo/dagster_cloud.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/actions/utils/parse_workspace/action.yml b/actions/utils/parse_workspace/action.yml index a42334a4..89ad5592 100644 --- a/actions/utils/parse_workspace/action.yml +++ b/actions/utils/parse_workspace/action.yml @@ -33,11 +33,13 @@ runs: workspace_contents = f.read() workspace_contents_yaml = yaml.safe_load(workspace_contents) + base_dir = os.path.abspath(os.path.dirname(dagster_cloud_yaml_file)) + output_obj = [ { 'name': location['location_name'], - 'directory': location.get('build', {'directory': '.'}).get('directory'), - 'build_folder': location.get('build', {'directory': '.'}).get('directory'), + 'directory': os.path.join(base_dir, location.get('build', {'directory': '.'}).get('directory')), + 'build_folder': os.path.join(base_dir, location.get('build', {'directory': '.'}).get('directory')), 'registry': location.get('build', {'directory': '.'}).get('registry'), 'location_file': str(workspace), } diff --git a/sample-repo/dagster_cloud.yaml b/sample-repo/dagster_cloud.yaml index 615f65d5..c0db60e1 100644 --- a/sample-repo/dagster_cloud.yaml +++ b/sample-repo/dagster_cloud.yaml @@ -3,5 +3,5 @@ locations: code_source: python_file: repo.py build: - directory: ./sample-repo + directory: . registry: 764506304434.dkr.ecr.us-west-2.amazonaws.com/branch-deployments-gh-action-test From 9114deb52ea8720c5d23dd5fed277a08bb69e409 Mon Sep 17 00:00:00 2001 From: benpankow Date: Thu, 8 Dec 2022 15:49:18 -0800 Subject: [PATCH 2/2] fix --- actions/utils/parse_workspace/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/utils/parse_workspace/action.yml b/actions/utils/parse_workspace/action.yml index 89ad5592..a4bc3f60 100644 --- a/actions/utils/parse_workspace/action.yml +++ b/actions/utils/parse_workspace/action.yml @@ -33,7 +33,7 @@ runs: workspace_contents = f.read() workspace_contents_yaml = yaml.safe_load(workspace_contents) - base_dir = os.path.abspath(os.path.dirname(dagster_cloud_yaml_file)) + base_dir = os.path.abspath(os.path.dirname(workspace)) output_obj = [ {