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 cron-like strategy #61

Closed
lgfa29 opened this issue Mar 30, 2020 · 2 comments
Closed

Add cron-like strategy #61

lgfa29 opened this issue Mar 30, 2020 · 2 comments

Comments

@lgfa29
Copy link
Contributor

lgfa29 commented Mar 30, 2020

Some workloads with well-defined behaviour could benefit from a cron-like strategy, where task groups are scaled based on a predefined scheduled.

An example of a cron policy in a a job spec:

scaling {
  min = 1
  max = 10

  policy {
    strategy {
      name = "cron"

      config {
        "start of business" = {
          rule     = "0 8 * * 1-5"
          count    = 10
          priority = 100
        }

        "end of business" = {
          rule     = "0 18 * * 1-5"
          count    = 3
        }

        "start of weekend" = {
          rule  = "0 0 * * 6"
          count = 1
        }
      }
    }
  }
}

In case of a conflict (two or more rules being satisfied) the order of precedence is set by:

  1. priority is set
  2. highest priority value
  3. highest count value
@lgfa29 lgfa29 added this to the 0.1.0 milestone Mar 30, 2020
@jrasell jrasell removed this from the 0.1.0 milestone Jul 13, 2020
@lgfa29 lgfa29 added this to the 0.3.1 milestone Mar 22, 2021
@lgfa29 lgfa29 removed this from the 0.3.1 milestone Mar 30, 2021
@jsiebens
Copy link
Contributor

jsiebens commented Apr 5, 2021

@lgfa29 I've just implemented this kind of strategy as an external plugin in this repository: https://github.com/jsiebens/nomad-autoscaler-plugins.
If there is interest, I'm happy to submit a PR to add it to the builtin plugins

@lgfa29
Copy link
Contributor Author

lgfa29 commented Apr 5, 2021

Hi @jsiebens, that's awesome! Thanks so much for implementing this. Are you using it yourself by any chance?

We're starting to better organize how to handle external plugins from the community. Currently we're cataloging them in this page, so if you would like we can add yours there (or you can do it yourself by opening a PR to edit this file 😄).

Furthermore, while we were scoping and planning the work for this plugin, we found it to be a bit limiting since it only allows for a fixed count value. So we came up with the idea of schedule-based autoscaling which is a bit more powerful and flexible than a plugin can be.

We would love to hear what you think about this alternative approach, as you already went through the implementation details, so feel free to add any comments in that issue 🙂

Given that the work on this issue will be superseded by #448, I will close this one, but feel free to continue the discussion either here or in #448.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants