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

Feature: Support NotDuring constraints for JobConfig #53

Open
irvinlim opened this issue Apr 16, 2022 · 0 comments
Open

Feature: Support NotDuring constraints for JobConfig #53

irvinlim opened this issue Apr 16, 2022 · 0 comments
Labels
area/scheduling Related to execution scheduling (e.g. cron, concurrency, etc) component/execution Issues or PRs related exclusively to the Execution component (Job, JobConfig) kind/feature Categorizes issue or PR as related to a new, well-defined and agreed-upon feature.

Comments

@irvinlim
Copy link
Member

Users may want to have a periodically scheduled job that runs regularly on interval, except for some explicitly defined time ranges. For example, we may want to specify that during deploy freezes or some other real-world event, a cron job should not be run.

Users should be able to specify a list of time ranges (start and end time, inclusive), during which schedules are not allowed.

API Design

apiVersion: execution.furiko.io/v1alpha1
kind: JobConfig
metadata:
  name: my-job-config
  namespace: my-namespace
spec:
  schedule:
    # Schedule every hour from 10AM to 6PM.
    cron:
      expression: 0 10-18 * * *
      timezone: Asia/Singapore
    constraints:
      # Example of multiple notDuring freeze periods, inclusive.
      notDuring:
        - start: 2022-04-01T00:00:00+08:00
          end: 2022-04-02T11:59:59+08:00
        - start: 2022-04-28T00:00:00+08:00
          end: 2022-04-28T15:59:59+08:00

Using the above example:

  • On 1st April, no schedules will be created at all.
  • On 2nd April, the first schedule that day will be at 12:00:00.
  • On 28th April, the first schedule that day will be at 16:00:00.

Possible Extensions

  • Sharing constraints across multiple JobConfigs
  • Regular constraints instead of fixed time range: Using a cron expression to define exclusions to the main cron schedule, similar to GitLab
@irvinlim irvinlim added component/execution Issues or PRs related exclusively to the Execution component (Job, JobConfig) kind/feature Categorizes issue or PR as related to a new, well-defined and agreed-upon feature. area/scheduling Related to execution scheduling (e.g. cron, concurrency, etc) labels Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/scheduling Related to execution scheduling (e.g. cron, concurrency, etc) component/execution Issues or PRs related exclusively to the Execution component (Job, JobConfig) kind/feature Categorizes issue or PR as related to a new, well-defined and agreed-upon feature.
Projects
None yet
Development

No branches or pull requests

1 participant