Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python version env var for GitLab #174

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gitlab/dbt/serverless-ci-dbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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:
stage: deploy
Expand Down
2 changes: 2 additions & 0 deletions gitlab/serverless-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ variables:
DISABLE_FAST_DEPLOYS:
DAGSTER_CLOUD_URL: $DAGSTER_CLOUD_URL
DAGSTER_CLOUD_API_TOKEN: $DAGSTER_CLOUD_API_TOKEN
# Python versions 3.8 to 3.11 are supported
PYTHON_VERSION: '3.8'

deploy-branch:
stage: deploy
Expand Down
4 changes: 4 additions & 0 deletions src/gitlab_action/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@


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"]
if not os.getenv("SERVERLESS_BASE_IMAGE_PREFIX"):
base_image_prefix = "657821118200.dkr.ecr.us-west-2.amazonaws.com/dagster-cloud-serverless-base-"
Expand Down Expand Up @@ -39,6 +42,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}")
Expand Down
Loading