camaraproject / EdgeCloud

Repository to describe, develop, document and test the EdgeCloud API family
Apache License 2.0
16 stars 43 forks source link

EAM: Change RequiredResources numCPU to allow fractional cpus #253

Open gainsley opened 4 months ago

gainsley commented 4 months ago

Problem description The Edge-Application-Management's current RequiredResources' numCPU field is an integer, which restricts vcpu resource allocation to whole vcpus. Notably Kubernetes allows for fractional vcpu allocation down to the millivcpu, to allow for very lightweight containers/microservices that do not use a lot of compute.

Expected behavior Being able to specify required vcpus in milli-vcpu increments.

Alternative solution None.

Additional context The GSMA Federation EWBI already allows for this:

    Vcpu:
      type: string
      pattern: ^\d+((\.\d{1,3})|(m))?$
      description: Number of vcpus in whole, decimal up to millivcpu, or millivcpu format.
      example:
        whole:
          value: 2
        decimal:
          value: 0.500
        millivcpu:
          value: 500m

For VM-based deployments, fractional vcpus may not be allowed, but that should be implementation dependent. For example a VM deployed via Kata-containers (kube-virt) on a Kubernetes cluster may allow for fractional vcpus.