Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow the new 24hr max timeout for CloudRunJobs #217

Closed
wants to merge 2 commits into from

Conversation

donjpierce
Copy link
Contributor

@donjpierce donjpierce commented Oct 15, 2023

Previously: #99 the max timeout for the CloudRunJob class was set to 1hr, following the Cloud Run TaskSpec documentation.

Since then, the max timeout has been updated up to 24 hours:

By default, each task runs for a maximum of 10 minutes: you can change this to a shorter time or a longer time up to up to 24 hours.

Note: this has been mentioned in an open Issue: #199 for upgrading to V2 of the GCP API, but there are no open issues or PRs for updating the timeout Pydandic validation logic which would enable users to run longer tasks immediately.

This PR

This change updates the Pydantic validation logic to allow up to 24hrs for a Cloud Run job. This will allow users to enter this in the Prefect UI block configuration for long-running jobs even before updating to the V2 API syntax.

Example

cloud_run_job_block = CloudRunJob(
    image='',
    region='',
    credentials='',
    timeout=86400  # 24 hours
)

Screenshots

Checklist

  • References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • Includes tests or only affects documentation.
  • Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • [N/A] Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.
  • Summarizes PR's changes in CHANGELOG.md

@donjpierce donjpierce requested a review from a team as a code owner October 15, 2023 01:01
@japerry911
Copy link
Contributor

japerry911 commented Oct 22, 2023

Hello,

Just reread, haha maybe it will work. But I just opened draft for V2 API version that should cover this. Hoping to fully open it in next few days.

@donjpierce
Copy link
Contributor Author

Hello,

Just reread, haha maybe it will work. But I just opened draft for V2 API version that should cover this. Hoping to fully open it in next few days.

Sounds good, I can wait for the official release then! Thanks for the update.

@donjpierce donjpierce closed this Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants