kruize / autotune

Autonomous Performance Tuning for Kubernetes!
Apache License 2.0
152 stars 52 forks source link

Validation checks for tunables bounds should be included #143

Open chandrams opened 3 years ago

chandrams commented 3 years ago

Validation checks for tunable bounds should be included. Dependency analyzer does not give an error for the following:

1) bounds has chars 2) lower bound is greater than upper bound 3) bounds are 0

apiVersion: "recommender.com/v1"
kind: "AutotuneConfig"
metadata:
  name: "char-tunable-upper-bound"
layer_name: container
layer_level: 0
details: generic container tunables
layerPresence:
  # This layer is assumed to be available by default for all applications.
  presence: always
tunables:
  - name: memoryRequest
    value_type: double
    upper_bound: 'GM'
    lower_bound: '150M'
    queries:
      datasource:
        - name: 'prometheus'
          query: 'container_memory_working_set_bytes{$CONTAINER_LABEL$="", $POD_LABEL$="$POD$"}'
    sla_class:
      - response_time
      - throughput
      - resource_usage
 tunables:
  - name: memoryRequest
    value_type: double
    upper_bound: '100M'
    lower_bound: '450M'
 tunables:
  - name: memoryRequest
    value_type: double
    upper_bound: '0'
    lower_bound: '150'
shruacha1234 commented 3 years ago

defect 1 is resolved but for lower bound is greater than the upper bound and for bounds value zero object create message is seen along with error message interchanged-bound-autotune.log zero-tunable-upper-bound-autotune.log