argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
14.92k stars 3.18k forks source link

CronWorkflows: support more schedule expressions like "last day of the month" #8348

Open tooptoop4 opened 2 years ago

tooptoop4 commented 2 years ago

ability to specify schedule like 11am on '2nd weekday of the month', 'last 5 days of the month', 'last business day of the month'

see examples at the end of: https://confluence.atlassian.com/servicedeskserver030/constructing-cron-expressions-for-a-filter-subscription-761769111.html

https://en.wikipedia.org/wiki/Cron#Non-standard_characters https://github.com/robfig/cron/pull/325#issuecomment-1046319369 https://github.com/robfig/cron/pull/397 https://github.com/robfig/cron/pull/321 cc @robfig

navi1024 commented 11 months ago

To be precise following 3 expressions are supported by quartz scheduler and there are many usecases where these used in enterprise

  • The ‘L’ character is allowed for the day-of-month and day-of-week fields.
  • The ‘W’ is used to specify the weekday (Monday-Friday) nearest the given day.
  • The ‘#’ is used to specify “the nth” XXX weekday of the month.

Also, there is no year literal supported in cron expression as on today. It is mainly limitation of the upstream library.

Kubernetes also uses same cron library and following is bug reported

https://github.com/kubernetes/kubernetes/issues/121088