-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DbtProject support in serverless template
- Loading branch information
1 parent
7c2f65f
commit ce76391
Showing
2 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -40,18 +40,35 @@ jobs: | |
ref: ${{ github.head_ref }} | ||
path: project-repo | ||
|
||
# Validate dagster_cloud.yaml and the connection to dagster.cloud | ||
- name: Validate configuration | ||
id: ci-validate | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci check --project-dir ${{ env.DAGSTER_PROJECT_DIR }} --dagster-cloud-yaml-path ${{ env.DAGSTER_CLOUD_YAML_PATH }}" | ||
|
||
# Parse dagster_cloud.yaml, detect if this is branch deployment and initialize the build session | ||
- name: Initialize build session | ||
id: ci-init | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
project_dir: ${{ env.DAGSTER_PROJECT_DIR }} | ||
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_YAML_PATH }} | ||
# The full deployment name. If this run is for a PR, this value is ignored and a branch | ||
# deployment is used. | ||
deployment: 'prod' | ||
|
||
- name: Parse dbt project and package with Dagster project | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
# --upgrade-strategy eager picks up newer packages that are required for things to work | ||
run: | | ||
pip install pip --upgrade | ||
cd ${{ env.DBT_PROJECT_DIR }}/${{ env.DAGSTER_PROJECT_NAME }} | ||
pip install . MarkupSafe==2.0.1 'click>8.1.0' 'Jinja2>3.0.0' | ||
pip install pyOpenSSL --upgrade | ||
cd - | ||
rsync -avz --exclude ${{ env.DAGSTER_PROJECT_NAME }} --exclude .git ${{ env.DBT_PROJECT_DIR }}/ ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
dbt deps --project-dir ${{ env.DBT_PACKAGE_DATA_DIR }} --profiles-dir ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
dbt parse --project-dir ${{ env.DBT_PACKAGE_DATA_DIR }} --profiles-dir ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
rm ${{ env.DBT_PACKAGE_DATA_DIR }}/target/partial_parse.msgpack | ||
cd ${{ env.ROOT_DIR }}/${{ env.DAGSTER_PROJECT_NAME }} | ||
pip install . --upgrade --upgrade-strategy eager | ||
dagster-dbt project prepare-for-deployment --file ${{ env.DAGSTER_PROJECT_NAME }}/project.py | ||
# dagster-cloud ci dbt-project manage-state --file ${{ env.DAGSTER_PROJECT_NAME }}/project.py | ||
shell: bash | ||
env: | ||
DAGSTER_PROJECT_NAME: 'dagster_dbt_scaffold' | ||
|
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 |
---|---|---|
|
@@ -42,18 +42,35 @@ jobs: | |
ref: ${{ github.head_ref }} | ||
path: project-repo | ||
|
||
# Validate dagster_cloud.yaml and the connection to dagster.cloud | ||
- name: Validate configuration | ||
id: ci-validate | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
command: "ci check --project-dir ${{ env.DAGSTER_PROJECT_DIR }} --dagster-cloud-yaml-path ${{ env.DAGSTER_CLOUD_YAML_PATH }}" | ||
|
||
# Parse dagster_cloud.yaml, detect if this is branch deployment and initialize the build session | ||
- name: Initialize build session | ||
id: ci-init | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
uses: dagster-io/dagster-cloud-action/actions/utils/[email protected] | ||
with: | ||
project_dir: ${{ env.DAGSTER_PROJECT_DIR }} | ||
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_YAML_PATH }} | ||
# The full deployment name. If this run is for a PR, this value is ignored and a branch | ||
# deployment is used. | ||
deployment: 'prod' | ||
|
||
- name: Parse dbt project and package with Dagster project | ||
if: steps.prerun.outputs.result == 'pex-deploy' | ||
# --upgrade-strategy eager picks up newer packages that are required for things to work | ||
run: | | ||
pip install pip --upgrade | ||
cd ${{ env.DBT_PROJECT_DIR }}/${{ env.DAGSTER_PROJECT_NAME }} | ||
pip install . MarkupSafe==2.0.1 'click>8.1.0' 'Jinja2>3.0.0' | ||
pip install pyOpenSSL --upgrade | ||
cd - | ||
rsync -avz --exclude ${{ env.DAGSTER_PROJECT_NAME }} --exclude .git ${{ env.DBT_PROJECT_DIR }}/ ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
dbt deps --project-dir ${{ env.DBT_PACKAGE_DATA_DIR }} --profiles-dir ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
dbt parse --project-dir ${{ env.DBT_PACKAGE_DATA_DIR }} --profiles-dir ${{ env.DBT_PACKAGE_DATA_DIR }} | ||
rm ${{ env.DBT_PACKAGE_DATA_DIR }}/target/partial_parse.msgpack | ||
cd ${{ env.ROOT_DIR }}/${{ env.DAGSTER_PROJECT_NAME }} | ||
pip install . --upgrade --upgrade-strategy eager | ||
dagster-dbt project prepare-for-deployment --file ${{ env.DAGSTER_PROJECT_NAME }}/project.py | ||
# dagster-cloud ci dbt-project manage-state --file ${{ env.DAGSTER_PROJECT_NAME }}/project.py | ||
shell: bash | ||
env: | ||
DAGSTER_PROJECT_NAME: 'dagster_dbt_scaffold' | ||
|