acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.14k stars 101 forks source link

Issues with computeclass created with resource limit/request. #2402

Closed sangee2004 closed 6 months ago

sangee2004 commented 6 months ago

acorn version - v0.10.0-rc2+e32a2709

Steps to reproduce the problem:

  1. Try to create a ClusterComputeClassInstance with resource limit/request set to integer values.

    kind: ClusterComputeClassInstance
    apiVersion: internal.admin.acorn.io/v1
    default: true
    metadata:
    name: cc1
    description: Large compute for linux on arm64
    cpuScaler: 0.75
    supportedRegions:
    - local
    memory:
    default: 20M
    min: 10M
    max: 100M
    runtimeClassName: mytestclass
    resources:
    limits:
    gpu-vendor.example/example-gpu: 2
    test2: 2
    requests:
    gpu-vendor.example/example-gpu: 1
    test2: 1
  2. This fails with following errors:

    kubectl apply -f ccnew.yaml           
    The ClusterComputeClassInstance "cc1" is invalid: 
    * resources.limits.gpu-vendor.example/example-gpu: Invalid value: "integer": resources.limits.gpu-vendor.example/example-gpu in body must be of type string: "integer"
    * resources.limits.test2: Invalid value: "integer": resources.limits.test2 in body must be of type string: "integer"
    * resources.requests.gpu-vendor.example/example-gpu: Invalid value: "integer": resources.requests.gpu-vendor.example/example-gpu in body must be of type string: "integer"
    * resources.requests.test2: Invalid value: "integer": resources.requests.test2 in body must be of type string: "integer"
  3. Try to create a ClusterComputeClassInstance with resource limit/request set to string. This succeeds. But app deployment using this computeclass fails with following error

    ✗  ERROR:  App.api.acorn.io "mytest" is invalid: spec.image: Invalid value: "2601fcb549cec80e17651e1eb9163a7dead87dd7ec344e9e569e2a95e6410763": error listing compute classes: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'

    Same error is also seen when listing computeclass

    acorn offerings computeclass 
    ✗  ERROR:  quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'
sangee2004 commented 6 months ago

Tested with acorn version - v0.10.0-rc2-9-g43dbcbf4+43dbcbf4

  1. Able to create a computeclass with resources field containing requests and limits using following yaml :

    kind: ClusterComputeClass
    apiVersion: admin.acorn.io/v1
    default: false
    metadata:
    name: cc-res
    description: Large compute for linux on arm64
    cpuScaler: 0.75
    supportedRegions:
    - local
    memory:
    default: 20M
    min: 10M
    max: 100M
    resources:
    limits:
    gpu-vendor.example/example-gpu: 2
    requests:
    gpu-vendor.example/example-gpu: 2
  2. Able to list this computeclass using acorn offerings computeclass and deploy apps using this computeclass.