From a457227c937c2d78f94bc57b683c492a28b58a74 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Mon, 6 May 2024 14:16:55 -0400 Subject: [PATCH 1/5] Add Python version env var for GitLab --- gitlab/dbt/serverless-ci-dbt.yml | 1 + gitlab/serverless-ci.yml | 1 + src/gitlab_action/deploy.py | 3 +++ 3 files changed, 5 insertions(+) diff --git a/gitlab/dbt/serverless-ci-dbt.yml b/gitlab/dbt/serverless-ci-dbt.yml index cedc6601..edb98859 100644 --- a/gitlab/dbt/serverless-ci-dbt.yml +++ b/gitlab/dbt/serverless-ci-dbt.yml @@ -5,6 +5,7 @@ variables: DAGSTER_DBT_PROJECT_NAME: $DAGSTER_DBT_LOCATION_NAME DAGSTER_DBT_PROJECT_DIR: "${CI_PROJECT_DIR}" DAGSTER_DBT_PACKAGE_DATA_DIR: "${CI_PROJECT_DIR}/$DAGSTER_DBT_PROJECT_NAME/dbt-project" + PYTHON_VERSION: '3.8' deploy-branch: stage: deploy diff --git a/gitlab/serverless-ci.yml b/gitlab/serverless-ci.yml index 1a74fddc..2ee9c76c 100644 --- a/gitlab/serverless-ci.yml +++ b/gitlab/serverless-ci.yml @@ -2,6 +2,7 @@ variables: DISABLE_FAST_DEPLOYS: DAGSTER_CLOUD_URL: $DAGSTER_CLOUD_URL DAGSTER_CLOUD_API_TOKEN: $DAGSTER_CLOUD_API_TOKEN + PYTHON_VERSION: '3.8' deploy-branch: stage: deploy diff --git a/src/gitlab_action/deploy.py b/src/gitlab_action/deploy.py index 8b869252..dce268d3 100755 --- a/src/gitlab_action/deploy.py +++ b/src/gitlab_action/deploy.py @@ -8,6 +8,8 @@ def deploy(dagster_cloud_yaml_file, deployment=None): + python_version = os.environ["PYTHON_VERSION"] + url = os.environ["DAGSTER_CLOUD_URL"] if not os.getenv("SERVERLESS_BASE_IMAGE_PREFIX"): base_image_prefix = "657821118200.dkr.ecr.us-west-2.amazonaws.com/dagster-cloud-serverless-base-" @@ -39,6 +41,7 @@ def deploy(dagster_cloud_yaml_file, deployment=None): f"--deps-cache-to={deps_cache}", f"--commit-hash={commit}", f"--git-url={commit_url}", + f"--python-version={python_version}", ] if deployment: command_args.append(f"--url={url}/{deployment}") From 4f6fcbae864f443975d4de18de9aa56161199e46 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Tue, 14 May 2024 15:50:40 -0400 Subject: [PATCH 2/5] Update gitlab deploy.py --- src/gitlab_action/deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitlab_action/deploy.py b/src/gitlab_action/deploy.py index dce268d3..2dafece8 100755 --- a/src/gitlab_action/deploy.py +++ b/src/gitlab_action/deploy.py @@ -8,7 +8,7 @@ def deploy(dagster_cloud_yaml_file, deployment=None): - python_version = os.environ["PYTHON_VERSION"] + python_version = os.getenv("PYTHON_VERSION", "3.8") url = os.environ["DAGSTER_CLOUD_URL"] if not os.getenv("SERVERLESS_BASE_IMAGE_PREFIX"): From cab31f188605ba4ba0e131430394fbee03642524 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Wed, 15 May 2024 15:06:02 -0400 Subject: [PATCH 3/5] Add comments --- gitlab/serverless-ci.yml | 1 + src/gitlab_action/deploy.py | 1 + 2 files changed, 2 insertions(+) diff --git a/gitlab/serverless-ci.yml b/gitlab/serverless-ci.yml index 2ee9c76c..2d9b7e47 100644 --- a/gitlab/serverless-ci.yml +++ b/gitlab/serverless-ci.yml @@ -2,6 +2,7 @@ variables: DISABLE_FAST_DEPLOYS: DAGSTER_CLOUD_URL: $DAGSTER_CLOUD_URL DAGSTER_CLOUD_API_TOKEN: $DAGSTER_CLOUD_API_TOKEN + # Python versions 3.8 to 3.12 are supported PYTHON_VERSION: '3.8' deploy-branch: diff --git a/src/gitlab_action/deploy.py b/src/gitlab_action/deploy.py index 2dafece8..887e87c0 100755 --- a/src/gitlab_action/deploy.py +++ b/src/gitlab_action/deploy.py @@ -8,6 +8,7 @@ def deploy(dagster_cloud_yaml_file, deployment=None): + # Use 3.8 as default version for backward compatibility python_version = os.getenv("PYTHON_VERSION", "3.8") url = os.environ["DAGSTER_CLOUD_URL"] From c54348e19c4eb1aa488b16134904578ae409862b Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Wed, 15 May 2024 15:08:48 -0400 Subject: [PATCH 4/5] Update comments --- gitlab/serverless-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/serverless-ci.yml b/gitlab/serverless-ci.yml index 2d9b7e47..ee49d856 100644 --- a/gitlab/serverless-ci.yml +++ b/gitlab/serverless-ci.yml @@ -2,7 +2,7 @@ variables: DISABLE_FAST_DEPLOYS: DAGSTER_CLOUD_URL: $DAGSTER_CLOUD_URL DAGSTER_CLOUD_API_TOKEN: $DAGSTER_CLOUD_API_TOKEN - # Python versions 3.8 to 3.12 are supported + # Python versions 3.8 to 3.11 are supported PYTHON_VERSION: '3.8' deploy-branch: From 2f979709f644a9d0c4f199cbbca6f84afd1ea620 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Wed, 15 May 2024 15:19:42 -0400 Subject: [PATCH 5/5] Update comments --- gitlab/dbt/serverless-ci-dbt.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/gitlab/dbt/serverless-ci-dbt.yml b/gitlab/dbt/serverless-ci-dbt.yml index edb98859..a10f2a5a 100644 --- a/gitlab/dbt/serverless-ci-dbt.yml +++ b/gitlab/dbt/serverless-ci-dbt.yml @@ -5,6 +5,7 @@ variables: DAGSTER_DBT_PROJECT_NAME: $DAGSTER_DBT_LOCATION_NAME DAGSTER_DBT_PROJECT_DIR: "${CI_PROJECT_DIR}" DAGSTER_DBT_PACKAGE_DATA_DIR: "${CI_PROJECT_DIR}/$DAGSTER_DBT_PROJECT_NAME/dbt-project" + # Python versions 3.8 to 3.11 are supported PYTHON_VERSION: '3.8' deploy-branch: