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

Accept both 0 and 'off' as inputs to interpolate builtin #1044

Closed
6 tasks done
jmcook1186 opened this issue Oct 9, 2024 · 3 comments · Fixed by #1050
Closed
6 tasks done

Accept both 0 and 'off' as inputs to interpolate builtin #1044

jmcook1186 opened this issue Oct 9, 2024 · 3 comments · Fixed by #1050
Assignees
Milestone

Comments

@jmcook1186
Copy link
Contributor

jmcook1186 commented Oct 9, 2024

What

  1. accept zero as an input to interpolate - this should be treated as a valid point to interpolate.
  2. accept a string, off, as an input to interpolate that causes the builtin to return zero for the cpu power, rather than the value that assumes the server is idle.

Why
There are two aspects to this - one is that there is no reason to throw an error on x=0 in the interpolation code - 0 is a valid interpolation point. Even in the canonical IF example (Teads) there is a given y value for x=0 which we cannot retrieve because the builtin throws an exception on x=0.

Secondly, we can't model a server that periodically shuts down and spins up within a time series - the best we can do is provide cpu-util: 0 but the power drawn by an idling server is ~50-70% of full utilization. For servers that are actually totally turned off, we still assign power to them as if they were idling. To model, for example a monthly conference call in a 30 day, 1-day resolution time series,, we are forced to include an idling server for the full month, even though we only really want to capture 30 mins of activity.

Context
as above

Prerequisites/resources
n/a

SoW (scope of work)

  • accept 0 as valid input to interpolate
  • accept the string 'off' as a valid input - it always returns 0.
  • documentation updated
  • test cases added

Acceptance criteria

  • Scenario 1

Given the builtin accepts 0 as an input:
When I run the following manifest:

name: interpolation-demo
description: simple demo of interpolation plugin
tags:
initialize:
  plugins:
    interpolation:
      method: Interpolation
      path: "builtin"
      config:
        method: linear
        x: [0, 10, 50, 100]
        y: [0.12, 0.32, 0.75, 1.02]
        input-parameter: "cpu/utilization"
        output-parameter: "result"
tree:
  children:
    child:
      pipeline:
        compute:
          - interpolation
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: 0

Then I get the following result:

name: interpolation-demo
description: simple demo of interpolation plugin
tags:
initialize:
  plugins:
    interpolation:
      method: Interpolation
      path: "builtin"
      config:
        method: linear
        x: [0, 10, 50, 100]
        y: [0.12, 0.32, 0.75, 1.02]
        input-parameter: "cpu/utilization"
        output-parameter: "result"
tree:
  children:
    child:
      pipeline:
        compute:
          - interpolation
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: 0
      outputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: 0
          result: 0.12
  • Scenario 2

Given the builtin accepts 'off' as an input:
When I run the following manifest:

name: interpolation-demo
description: simple demo of interpolation plugin
tags:
initialize:
  plugins:
    interpolation:
      method: Interpolation
      path: "builtin"
      config:
        method: linear
        x: [0, 10, 50, 100]
        y: [0.12, 0.32, 0.75, 1.02]
        input-parameter: "cpu/utilization"
        output-parameter: "result"
tree:
  children:
    child:
      pipeline:
        compute:
          - interpolation
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: off

Then I will get the following result:

name: interpolation-demo
description: simple demo of interpolation plugin
tags:
initialize:
  plugins:
    interpolation:
      method: Interpolation
      path: "builtin"
      config:
        method: linear
        x: [0, 10, 50, 100]
        y: [0.12, 0.32, 0.75, 1.02]
        input-parameter: "cpu/utilization"
        output-parameter: "result"
tree:
  children:
    child:
      pipeline:
        compute:
          - interpolation
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: off
      outputs:
        - timestamp: 2023-07-06T00:00
          duration: 3600
          cpu/utilization: 0
          result: 0
@jmcook1186 jmcook1186 self-assigned this Oct 9, 2024
@jmcook1186 jmcook1186 added this to IF Oct 9, 2024
@jmcook1186 jmcook1186 moved this to Ready in IF Oct 9, 2024
@zanete zanete added this to the IF 1.0 milestone Oct 10, 2024
@narekhovhannisyan narekhovhannisyan moved this from Ready to In Progress in IF Oct 13, 2024
@zanete
Copy link

zanete commented Oct 15, 2024

PR expected today

@narekhovhannisyan
Copy link
Member

@narekhovhannisyan narekhovhannisyan moved this from In Progress to Pending Review in IF Oct 15, 2024
@zanete zanete moved this from Pending Review to In Progress in IF Oct 17, 2024
@zanete
Copy link

zanete commented Oct 17, 2024

needs more changes in the plugin factory and make a new release of if core

@zanete zanete moved this from In Progress to Pending Review in IF Oct 21, 2024
@github-project-automation github-project-automation bot moved this from Pending Review to Done in IF Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants