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 is_schedule_active to client Deployment class #7430

Merged
merged 18 commits into from
Jan 24, 2023

Conversation

EmilRex
Copy link
Contributor

@EmilRex EmilRex commented Nov 3, 2022

This PR exposes the is_schedule_active option on the Deployment class. Currently, the default behavior is to enable the schedule, but users may want to apply their deployments and not schedule runs.

Example

from my_project.flows import my_flow
from prefect.deployments import Deployment
from prefect.orion.schemas.schedules import CronSchedule

deployment = Deployment.build_from_flow(
    flow=my_flow,
    name="example",
    schedule=CronSchedule(cron="0 0 * * *"),
    is_schedule_active=False
)
deployment.apply()

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@EmilRex EmilRex added the enhancement An improvement of an existing feature label Nov 3, 2022
@EmilRex EmilRex requested a review from cicdw as a code owner November 3, 2022 21:45
@netlify
Copy link

netlify bot commented Nov 3, 2022

Deploy Preview for prefect-orion ready!

Name Link
🔨 Latest commit a8cf89f
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/63cf3167ca08250008894e11
😎 Deploy Preview https://deploy-preview-7430--prefect-orion.netlify.app/api-ref/prefect/deployments
📱 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 settings.

@EmilRex EmilRex requested a review from zanieb as a code owner November 3, 2022 21:54
src/prefect/deployments.py Outdated Show resolved Hide resolved
@EmilRex EmilRex requested a review from zanieb November 14, 2022 22:22
@zanieb zanieb changed the title Exposes is_schedule_active on Deployment Add is_schedule_active to client Deployment class Nov 30, 2022
zanieb
zanieb previously approved these changes Nov 30, 2022
@zanieb
Copy link
Contributor

zanieb commented Nov 30, 2022

@EmilRex looks like this requires additional changes to work.

@zanieb zanieb dismissed their stale review November 30, 2022 19:20

Not passing CI

zanieb
zanieb previously requested changes Nov 30, 2022
Copy link
Contributor

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

We'll also want test coverage for the behavior of None, True, and False.

@zanieb
Copy link
Contributor

zanieb commented Jan 6, 2023

@EmilRex are you going to be able to finish this? Do you want help from someone on the OSS team?

@EmilRex
Copy link
Contributor Author

EmilRex commented Jan 9, 2023

@EmilRex are you going to be able to finish this? Do you want help from someone on the OSS team?

@madkinsz As much as I'd like to wrap it up, it seems unlikely. Help from the team would be extremely appreciated!

@peytonrunyan peytonrunyan requested a review from a team as a code owner January 13, 2023 13:24
@peytonrunyan peytonrunyan self-assigned this Jan 13, 2023
@peytonrunyan
Copy link
Contributor

@madkinsz any other thoughts?

tests/test_deployments.py Outdated Show resolved Hide resolved
tests/test_deployments.py Outdated Show resolved Hide resolved
@peytonrunyan peytonrunyan merged commit 1da14ed into main Jan 24, 2023
@peytonrunyan peytonrunyan deleted the deployment-is-schedule-active branch January 24, 2023 01:16
ddelange added a commit to ddelange/prefect that referenced this pull request Jan 26, 2023
…erm-testing

* 'main' of https://github.com/prefecthq/prefect: (77 commits)
  Update roles and permissions in documentation (PrefectHQ#8263)
  Add Prefect Cloud Quickstart tutorial (PrefectHQ#8227)
  Remove needless log
  Update comment for consistency
  Reorder migrations for clarity
  Refactor cancellation cleanup service
  Uses canonical `CANCELLING` states for run cancellations (PrefectHQ#8245)
  Add cancellation cleanup service (PrefectHQ#8128)
  Improve engine shutdown handling of SIGTERM (PrefectHQ#8127)
  Create a `CANCELLING` state type (PrefectHQ#7794)
  Update KubernetesJob options (PrefectHQ#8261)
  Small work pools UI updates (PrefectHQ#8257)
  Removes migration logic (PrefectHQ#8255)
  Consolidate multi-arch docker builds (PrefectHQ#7902)
  Include nested `pydantic.BaseModel` secret fields in blocks' schema (PrefectHQ#8246)
  Improve contributing documentation with venv instructions (PrefectHQ#8247)
  Update Python tests to use a single test matrix for both databases (PrefectHQ#8171)
  Adds migration logic for work pools (PrefectHQ#8214)
  Add `project_urls` to `setup.py` (PrefectHQ#8224)
  Add `is_schedule_active` to client `Deployment` class (PrefectHQ#7430)
  ...
github-actions bot pushed a commit that referenced this pull request Jan 26, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
github-actions bot pushed a commit that referenced this pull request Jan 26, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
@zanieb zanieb mentioned this pull request Feb 3, 2023
3 tasks
zanieb pushed a commit that referenced this pull request Feb 3, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
zanieb pushed a commit that referenced this pull request Feb 3, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
zanieb pushed a commit that referenced this pull request Feb 6, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
zanieb pushed a commit that referenced this pull request Feb 6, 2023
Co-authored-by: Peyton <[email protected]>
Co-authored-by: peytonrunyan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants