-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default python version in ubuntu image for newly templated ser…
…verless orgs, bring in sync with dagster-cloud-action repo (#33) Summary: Now tht python 3.8 is EOL, change the default python version to 3.10 and the default ubuntu version to one that has 3.10 installed by default instead of 3.8. Also make the quickstart use the same yaml that is templated when you create a new serverless org.
- Loading branch information
Showing
5 changed files
with
119 additions
and
163 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Dagster Cloud Serverless Deployment | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "master" | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
|
||
concurrency: | ||
# Cancel in-progress deploys to same branch | ||
group: ${{ github.ref }}/deploy | ||
cancel-in-progress: true | ||
env: | ||
DAGSTER_CLOUD_API_TOKEN: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }} | ||
ENABLE_FAST_DEPLOYS: 'true' | ||
PYTHON_VERSION: '3.10' | ||
DAGSTER_CLOUD_YAML_PATH: '.' | ||
DAGSTER_CLOUD_FILE: 'dagster_cloud.yaml' | ||
DAGSTER_CLOUD_ORGANIZATION: 'ORGANIZATION_NAME' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
dagster_cloud_default_deploy: | ||
name: Dagster Serverless Deploy | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Prerun Checks | ||
id: prerun | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
# Validate dagster_cloud.yaml and the connection to dagster.cloud | ||
- name: Validate configuration | ||
id: ci-validate | ||
if: steps.prerun.outputs.result != 'skip' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci check --project-dir ${{ env.DAGSTER_CLOUD_YAML_PATH }} --dagster-cloud-yaml-path ${{ env.DAGSTER_CLOUD_FILE }}" | ||
|
||
# Parse dagster_cloud.yaml, detect if this is branch deployment and initialize the build session | ||
- name: Initialize build session | ||
id: ci-init | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
project_dir: ${{ env.DAGSTER_CLOUD_YAML_PATH }} | ||
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_FILE }} | ||
# The full deployment name. If this run is for a PR, this value is ignored and a branch | ||
# deployment is used. | ||
deployment: 'prod' | ||
|
||
|
||
# If using fast build, build the PEX | ||
# First ensure the correct Python version is installed | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} for target | ||
id: setup-python-version | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install setuptools | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
run: ${{ steps.setup-python-version.outputs.python-path }} -m pip install setuptools | ||
shell: bash | ||
|
||
- name: Run PEX build | ||
id: run-pex-build | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci build --build-strategy=python-executable --python-version ${{ env.PYTHON_VERSION }} --pex-deps-cache-from='${{ github.repository }}' --pex-deps-cache-to='${{ github.repository }}'" | ||
|
||
|
||
# Otherwise, enable buildx for caching and build the Docker image | ||
- name: Set up Docker Buildx | ||
if: steps.prerun.outputs.result == 'docker-deploy' | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Run Docker build | ||
id: run-docker-build | ||
if: steps.prerun.outputs.result == 'docker-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci build --build-strategy=docker --python-version ${{ env.PYTHON_VERSION }}" | ||
|
||
|
||
# Deploy all code locations in this build session to Dagster Cloud | ||
- name: Deploy to Dagster Cloud | ||
id: ci-deploy | ||
if: steps.prerun.outputs.result != 'skip' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci deploy" | ||
|
||
# Update a PR comment - this runs always() so the comment is updated on success and failure | ||
- name: Update PR comment for branch deployments | ||
id: ci-notify | ||
if: steps.prerun.outputs.result != 'skip' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci notify --project-dir=${{ env.DAGSTER_CLOUD_YAML_PATH }}" | ||
|
||
# Generate a summary that shows up on the Workflow Summary page | ||
- name: Generate a summary | ||
id: ci-summary | ||
if: steps.prerun.outputs.result != 'skip' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci status --output-format=markdown >> $GITHUB_STEP_SUMMARY" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
locations: | ||
- code_source: | ||
package_name: quickstart_etl | ||
package_name: quickstart_etl.definitions | ||
location_name: my-project |