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

pass-through strategy plugin #433

Merged
merged 6 commits into from
Mar 31, 2021
Merged

pass-through strategy plugin #433

merged 6 commits into from
Mar 31, 2021

Conversation

jazzyfresh
Copy link
Contributor

@jazzyfresh jazzyfresh commented Mar 24, 2021

This feature would introduce a new strategy plugin for simple pass-through scaling action. That is, whatever the value returned by the APM, this strategy will scale to that value exactly.

strategy "pass-through" {}

This strategy would be incorporated into a scaling policy like so:

scaling "batch_processing_cluster" {
  min = 0
  max = 20

  policy {
    check "queue_size" {
      source = "prometheus"
      query  = "running_jobs + pending_jobs"

      strategy "pass-through" {}
    }

    target "aws-asg" {
      aws_asg_name = "batch_clients"
      node_class = "high_memory"
    }
  }
}

plugins/plugin.go Outdated Show resolved Hide resolved
@jazzyfresh
Copy link
Contributor Author

TODO: add documentation to nomadproject.io website in nomad repo

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Early review and it's looking good! Just a few places with the wrong plugin name.

plugins/builtin/strategy/none/main.go Outdated Show resolved Hide resolved
plugins/builtin/strategy/none/main.go Outdated Show resolved Hide resolved
plugins/builtin/strategy/none/plugin/plugin.go Outdated Show resolved Hide resolved
plugins/builtin/strategy/none/plugin/plugin.go Outdated Show resolved Hide resolved
plugins/builtin/strategy/none/plugin/plugin.go Outdated Show resolved Hide resolved
plugins/builtin/strategy/none/plugin/plugin.go Outdated Show resolved Hide resolved
@jazzyfresh jazzyfresh changed the title "None" Strategy Plugin pass-thru strategy plugin Mar 30, 2021
@lgfa29 lgfa29 added this to the 0.3.1 milestone Mar 30, 2021
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

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

looks good to me!
why pass-thru and not pass-through?

@jazzyfresh jazzyfresh changed the title pass-thru strategy plugin pass-through strategy plugin Mar 31, 2021
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

:shipit:

I pushed a commit to guard against empty metric results. It shouldn't really happen inside a plugin (the worker won't call the plugin without metrics), but just in case.

This check is also present in the target-value plugin, but it's wrong 😬

@jazzyfresh jazzyfresh merged commit 404ff5b into main Mar 31, 2021
@jazzyfresh jazzyfresh deleted the strategy-none branch March 31, 2021 22:11
jrasell added a commit that referenced this pull request Apr 1, 2021
jrasell added a commit that referenced this pull request Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants