From 0c5cf619d223325b1f2b311d47a7dd9debb5eb47 Mon Sep 17 00:00:00 2001 From: gibsondan Date: Tue, 6 Aug 2024 15:34:27 -0400 Subject: [PATCH] Add base_image support to the serverless_prod_deploy action Summary: Allows you to set build:base_image to vary the base image per code location. Would like to port this to the new "dagster-cloud ci" commands as well. Test Plan: Build a release branch and test a build with and without the base_image set, in both a dagster_cloud.yaml file and in the action itself. --- actions/serverless_prod_deploy/action.yml | 2 +- src/parse_workspace.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actions/serverless_prod_deploy/action.yml b/actions/serverless_prod_deploy/action.yml index 910dbe30..e777894a 100644 --- a/actions/serverless_prod_deploy/action.yml +++ b/actions/serverless_prod_deploy/action.yml @@ -68,7 +68,7 @@ runs: with: target_directory: ${{ fromJson(inputs.location).directory }} env_vars: ${{ inputs.env_vars }} - base_image: ${{ inputs.base_image }} + base_image: ${{ inputs.base_image || fromJson(inputs.location).base_image }} - name: generate short github sha shell: bash diff --git a/src/parse_workspace.py b/src/parse_workspace.py index b27fd8b0..5b4680dc 100755 --- a/src/parse_workspace.py +++ b/src/parse_workspace.py @@ -17,7 +17,8 @@ def parse_workspace(dagster_cloud_file): "name": location["location_name"], "directory": location.get("build", {"directory": "."}).get("directory"), "build_folder": location.get("build", {"directory": "."}).get("directory"), - "registry": location.get("build", {"directory": "."}).get("registry"), + "registry": location.get("build", {}).get("registry"), + "base_image": location.get("build", {}).get("base_image"), "location_file": str(workspace), } for location in workspace_contents_yaml["locations"]