Skip to content

Add CloudRunExecuteJobOperator - #28525

Closed
VinceLegendre wants to merge 1 commit into
apache:mainfrom
VinceLegendre:add_google_cloud_run_execute_job_operator
Closed

Add CloudRunExecuteJobOperator#28525
VinceLegendre wants to merge 1 commit into
apache:mainfrom
VinceLegendre:add_google_cloud_run_execute_job_operator

Conversation

@VinceLegendre

@VinceLegendre VinceLegendre commented Dec 21, 2022

Copy link
Copy Markdown

This operator aims at executing existing Cloud Run jobs, with the same design philosophy as the DataflowStartFlexTemplateOperator.

  • CloudRunExecuteJobOperator extends the BaseOperator
  • CloudRunJobHook extends the GoogleBaseHook, to easily manage authentication and project_id fallback
  • CloudRunJobLink andCloudRunJobExecutionLink extend the BaseGoogleLink

Closes: #24730

@boring-cyborg

boring-cyborg Bot commented Dec 21, 2022

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@VinceLegendre VinceLegendre changed the title Add CloudRunExecuteJobOperator and required dependencies Add CloudRunExecuteJobOperator Dec 21, 2022
@VinceLegendre VinceLegendre mentioned this pull request Dec 22, 2022
2 tasks
Comment thread tests/providers/google/cloud/hooks/test_cloud_run.py Outdated
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch 2 times, most recently from 2c8fce5 to 20bfa7b Compare December 29, 2022 11:16
@VinceLegendre
VinceLegendre requested review from Taragolis and removed request for mik-laj and turbaszek December 29, 2022 16:49
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch from 20bfa7b to 48eed2e Compare January 2, 2023 09:12
Comment on lines 167 to 188

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1, the v2 API and its Python client libraries should be much easier to use.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi @lwyszomi @steren

Cannot install the python client library (google-cloud-run>=0.7.0) as it breaks other dependencies requirements.
Happy to use the JobsClient if we manage to install google-cloud-run library

@VinceLegendre VinceLegendre Feb 17, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@Taragolis would you have an idea of how to fix this?

If using the official Python Client and implementing all the CRUD operations on jobs are completion requirements for this PR, we should mark this PR as draft for the time being.

@VinceLegendre VinceLegendre Feb 18, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

FYI Completion requirements were discussed in this issue : #24730.

Maybe we could consider all the Jobs CRUD operations in a later PR, when the official JobsClient can be installed properly?

Opened to suggestions here 😉

Comment thread tests/providers/google/cloud/hooks/test_cloud_run.py Outdated
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch 3 times, most recently from 104d1ef to 420c506 Compare February 16, 2023 15:45
Comment thread tests/providers/google/cloud/hooks/test_cloud_run.py Outdated
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch from 420c506 to fabda1d Compare February 17, 2023 17:35
Comment thread airflow/providers/google/cloud/hooks/cloud_run.py Outdated

@Taragolis Taragolis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve in advance (need to resolve doc spellcheck)

I'm not familiar with GCP, for me looks nice. So would be nice if someone else review it

@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch from fabda1d to 2a95a05 Compare February 18, 2023 11:38
@VinceLegendre
VinceLegendre requested a review from steren February 18, 2023 11:51
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch from 2a95a05 to d2a90cc Compare February 18, 2023 13:58
Comment thread airflow/providers/google/cloud/hooks/cloud_run.py Outdated
@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch 2 times, most recently from ab3e06e to c58f4a0 Compare February 23, 2023 14:29
@eladkal

eladkal commented Mar 9, 2023

Copy link
Copy Markdown
Contributor

tests are failing :(

@eladkal

eladkal commented Mar 9, 2023

Copy link
Copy Markdown
Contributor

I'm assuming that by merging this PR we won't need #27638 ?

@alexshires

Copy link
Copy Markdown
Contributor

I'm assuming that by merging this PR we won't need #27638 ?

CloudRun is a container hosting service and CloudRunJobs are a job-based container execution version of that - IMO, we would need both sets of operators in Airflow to support both functionalities

@VinceLegendre

Copy link
Copy Markdown
Author

I'll try to fix tests in the coming days.

@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch 2 times, most recently from 7265c97 to 334efe5 Compare April 4, 2023 14:15
@VinceLegendre
VinceLegendre requested a review from potiuk April 5, 2023 07:53
@VinceLegendre

Copy link
Copy Markdown
Author

Tests should be fixed now @eladkal .
Waiting for approvals to run all tests

@potiuk

potiuk commented Apr 7, 2023

Copy link
Copy Markdown
Member

Tests should be fixed now @eladkal . Waiting for approvals to run all tests

approved

@VinceLegendre

Copy link
Copy Markdown
Author

Looks like the failing test is not related to my implementation. I believe I should wait for a fix and rebase my branch from time to time?

@VinceLegendre
VinceLegendre force-pushed the add_google_cloud_run_execute_job_operator branch from 334efe5 to 7f19415 Compare April 11, 2023 08:16
@VinceLegendre

Copy link
Copy Markdown
Author

Checks seem ok (appart from 9 skipped) @eladkal 🙂
Is there a further step to approve these changes? Should I look for additional reviewers in the community?

@eladkal

eladkal commented Apr 17, 2023

Copy link
Copy Markdown
Contributor

Is there a further step to approve these changes? Should I look for additional reviewers in the community?

waiting for your comment on #28525 (comment)

@eladkal

eladkal commented May 21, 2023

Copy link
Copy Markdown
Contributor

@VinceLegendre We bumped many google packages #30067
Can you please recheck and comment on #28525 (comment) if there is still a reason not to use V2?

@eladkal eladkal mentioned this pull request May 21, 2023
2 tasks
- New hook : CloudRunJobHook
- New links : CloudRunJobLink and CloudRunJobExecutionLinks
- New operator : CloudRunExecuteJobOperator
- According tests
- Documentation and examples
@potiuk
potiuk force-pushed the add_google_cloud_run_execute_job_operator branch from 7f19415 to 587504e Compare May 21, 2023 15:01
@potiuk

potiuk commented May 21, 2023

Copy link
Copy Markdown
Member

I just rebased it to see if it works after recent upgrade of deps. I don't think there will be a big problem, It does not use any of the google client specific libraries - but the discovery client, so it should be fine as-is.

@potiuk

potiuk commented May 22, 2023

Copy link
Copy Markdown
Member

I just rebased it to see if it works after recent upgrade of deps. I don't think there will be a big problem, It does not use any of the google client specific libraries - but the discovery client, so it should be fine as-is.

However. I think indeed. it would be better to use the actual cloud run client rather than discovery one now. It should be possible now, after all the dependencies are updated, So the reason why discovery client was used here is gone. @VinceLegendre ?

@VinceLegendre

Copy link
Copy Markdown
Author

@potiuk @eladkal I think we should switch to the official client too.

Currently away from work for two weeks, I can try to work on it when I get back.

If this is urgent matter, please feel free to initiate new developments and I'll be happy to contribute 🙂

@potiuk

potiuk commented May 22, 2023

Copy link
Copy Markdown
Member

No worries. It can wait

@eladkal

eladkal commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

@potiuk @eladkal I think we should switch to the official client too.

Cool! please ping me when ready for review

@eladkal

eladkal commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

Hi @VinceLegendre checking if you still plan to make the changes?

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Aug 15, 2023
@github-actions github-actions Bot closed this Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers area:system-tests kind:documentation provider:google Google (including GCP) related issues stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google CloudRun job operator

8 participants