InseeFrLab/onyxia-api

Params to set sliders resources for all services

Closed this issue · 3 comments

Issue explanation

When we deploy onyxia self-hosted, it would be great to set sliderMin and sliderMax on resource definition for all services.

Why?

For some cases, the sliderMax is tool large (a mistake can be regrettable), or is too small (for example in storage, if we want larges databases for shared projects). These parameters is very dependents on underlying infrastructure.

How?

It could be set on region settings and only for CPU, RAM and storage (the same for requests and limits). For example:

"regions": [
      "services": {
        "sliders": {
          "cpu": {
                    "min": "100",
                    "max": "10000",
                    "unit": "m"
                     },
          "memory": {
                    "min": "0.5",
                    "max": "12",
                    "unit": "Gi"
                   },
          "storage": {
                    "min": "1",
                    "max": "1000",
                    "unit": "Gi"
                    }
                 }
             }
]

The difficulty is applying this settings for all charts. It can be like:

"cpu": { 
           "sliderMin": region.sliders.cpu.min,
           "sliderMax": region.sliders.cpu.max,
           "sliderUnit": region.sliders.cpu.unit
           },
"memory": { 
           "sliderMin": region.sliders.memory.min,
           "sliderMax": region.sliders.memory.max,
           "sliderUnit": region.sliders.memory.unit
           },
"size": { 
           "sliderMin": region.sliders.size.min,
           "sliderMax": region.sliders.size.max,
           "sliderUnit": region.sliders.size.unit
           }

Thanks you!

I think we should do as follow :

                      "cpu": {
                        "description": "The amount of cpu guaranteed",
                        "title": "CPU",
                        "type": "string",
                        "default": "100m",
                        "render": "slider",
                        "sliderMin": 50,
                        "sliderMax": 40000,
                        "sliderStep": 50,
                        "sliderUnit": "m",
                        "sliderExtremity": "down",
                        "sliderExtremitySemantic": "guaranteed",
                        "sliderRangeId": "cpu",
                        "x-onyxia": {
                            "overwriteDefaultWith": "region.cpu.request"
                            "overwriteSliderWith": "region.slider.cpu"
                        }
                      }

and region.slider.cpu contains overwrite values for this 4 attributes.

                        "sliderMin": 50,
                        "sliderMax": 40000,
                        "sliderStep": 50,
                        "sliderUnit": "m"

Works for me 👍🏻