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 GCP_CLOUD_RUN_JOB execution mode #1153

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

ags-de
Copy link
Contributor

@ags-de ags-de commented Aug 12, 2024

Description

Added new GCP_CLOUD_RUN_JOB execution mode that triggers Google Cloud Platform's Cloud Run Job instance with dbt model in it.

It extends Airflow's CloudRunExecuteJobOperator and overrides Cloud Run Job's container with dbt command generated by cosmos.

Note: CloudRunExecuteJobOperator has container_overrides parameter implemented in apache-airflow-providers-google==10.13.0 which is supported by airflow >=2.6.0.

Related Issue(s)

resolves #1149

Breaking Change?

None, the new execution mode is optional.

Checklist

  • I have made corresponding changes to the documentation (if required)
  • I have added tests that prove my fix is effective or that my feature works

Copy link

netlify bot commented Aug 12, 2024

Deploy Preview for sunny-pastelito-5ecb04 ready!

Name Link
🔨 Latest commit 83f9a79
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/66f5046ee1c738000877680e
😎 Deploy Preview https://deploy-preview-1153--sunny-pastelito-5ecb04.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pankajastro
Copy link
Contributor

Hi @ags-de, Thank you so much for your contribution. Please let us know if you need any support.

@ags-de ags-de changed the title [WIP] Add GCP_CLOUD_RUN_JOB execution mode Add GCP_CLOUD_RUN_JOB execution mode Aug 28, 2024
@ags-de ags-de marked this pull request as ready for review August 28, 2024 09:18
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. area:execution Related to the execution environment/mode, like Docker, Kubernetes, Local, VirtualEnv, etc labels Aug 28, 2024
@pankajkoti
Copy link
Contributor

hi @ags-de could you please rebase the PR. We just merged #1182 that should fix the breaking CI jobs.

Copy link

codecov bot commented Aug 31, 2024

Codecov Report

Attention: Patch coverage is 98.63014% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.77%. Comparing base (3414513) to head (8e549ca).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cosmos/operators/gcp_cloud_run_job.py 98.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1153      +/-   ##
==========================================
+ Coverage   95.72%   95.77%   +0.05%     
==========================================
  Files          64       65       +1     
  Lines        3672     3744      +72     
==========================================
+ Hits         3515     3586      +71     
- Misses        157      158       +1     
Flag Coverage Δ
95.77% <98.63%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tatiana
Copy link
Collaborator

tatiana commented Sep 24, 2024

@ags-de thank you very much for working so quickly on the changes requested. When you get a chance, please, rebase on the main branch.

@ags-de
Copy link
Contributor Author

ags-de commented Sep 25, 2024

Hello @tatiana,

The branch is rebased and I also fixed a few typos in docs. It should be ready to go.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@tatiana tatiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ags-de amazing work!
I left one last comment. I'll wait for your feedback/change before we merge into the main branch.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 25, 2024
Co-authored-by: Tatiana Al-Chueyr <[email protected]>
@tatiana tatiana merged commit 56ff6dd into astronomer:main Sep 26, 2024
1 check passed
@ags-de ags-de deleted the gcpcloudrun-executor branch September 26, 2024 10:28
slords pushed a commit to slords/astronomer-cosmos that referenced this pull request Sep 26, 2024
Added new `GCP_CLOUD_RUN_JOB` execution mode that triggers Google Cloud
Platform's Cloud Run Job instance with dbt model in it.

It extends Airflow's `CloudRunExecuteJobOperator` and overrides Cloud
Run Job's container with dbt command generated by cosmos.

Note: `CloudRunExecuteJobOperator` has `container_overrides` parameter
implemented in `apache-airflow-providers-google==10.13.0` which is
supported by `airflow >=2.6.0`.

Resolves astronomer#1149 

Co-authored-by: Agata Zalewska <[email protected]>
Co-authored-by: Tatiana Al-Chueyr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:execution Related to the execution environment/mode, like Docker, Kubernetes, Local, VirtualEnv, etc lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] New GCP Cloud Run Job Execution Mode
4 participants