From 1f3826a8d70bfc4567762f2b309a987a1ace0d0e Mon Sep 17 00:00:00 2001 From: Felipe Vicens Date: Sat, 24 Aug 2024 16:36:32 +0000 Subject: [PATCH] Removing Flavors and adding cpu and gpu resources pool for k8s Signed-off-by: Felipe Vicens --- .../Edge-Application-Management.yaml | 303 ++++++++++-------- 1 file changed, 170 insertions(+), 133 deletions(-) diff --git a/code/API_definitions/Edge-Application-Management.yaml b/code/API_definitions/Edge-Application-Management.yaml index a0cf3c3..7169bfb 100644 --- a/code/API_definitions/Edge-Application-Management.yaml +++ b/code/API_definitions/Edge-Application-Management.yaml @@ -908,8 +908,6 @@ components: $ref: '#/components/schemas/EdgeCloudZoneName' edgeCloudZoneStatus: $ref: '#/components/schemas/EdgeCloudZoneStatus' - edgeCloudZoneFlavors: - $ref: '#/components/schemas/EdgeCloudZoneFlavors' edgeCloudProvider: $ref: '#/components/schemas/EdgeCloudProvider' edgeCloudRegion: @@ -931,38 +929,6 @@ components: - unknown default: unknown - EdgeCloudZoneFlavors: - description: List of unique Name IDs of Infrastructure Flavors - type: array - items: - type: object - description: Flavor - required: - - id - - numCpu - - memory - - gpuMemory - properties: - id: - type: string - example: A1.8C10M.GPU8G - description: - type: string - description: Additional information about the flavor - example: "x86 flavor" - numCPU: - type: integer - example: 8 - description: Number of virtual Cores - memory: - type: integer - example: 10 - description: Amount of memory in giga bytes - gpuMemory: - type: integer - example: 16 - description: GPU memory in giga bytes - ErrorInfo: type: object description: Information about the error @@ -985,6 +951,7 @@ components: type: string description: | Full qualified domain name of an application instance + GpuInfo: type: object description: Information about the supported GPUs @@ -999,33 +966,6 @@ components: type: integer description: Number of GPUs - Flavor: - type: string - description: | - Preset configuration for compute, memory, GPU, - and storage capacity. (i.e - A1.2C4M.GPU8G, A1.2C4M.GPU16G, A1.4C8M,..) - example: A1.2C2M.GPU8G - - NodePool: - description: | - Set of worker nodes in a Kubernetes cluster. - type: object - required: - - flavor - - numNodes - properties: - name: - type: string - example: nodepool1 - description: | - Nodepool Name (Autogenerated if not provided in the request) - flavor: - $ref: '#/components/schemas/Flavor' - numNodes: - type: integer - example: 1 - description: Number of workers that compose the node pool. - K8sAddons: description: | Addons for the Kubernetes cluster. @@ -1123,11 +1063,10 @@ components: KubernetesResources: description: Definition of Kubernetes Cluster Infrastructure. - type: object required: - - nodePools - infraKind - applicationResources + - isStandalone properties: infraKind: description: Type of infrastructure for the application. @@ -1136,23 +1075,149 @@ components: enum: - kubernetes applicationResources: - $ref: '#/components/schemas/ApplicationResources' + description: | + Application resources define the resources pool required + by the application to be executed in a Kubernetes clusters. + type: object + properties: + cpuPool: + required: + - numCPU + - memory + - topology + type: object + description: | + CPU Pool refers to the amount of application' resources + that is executed in nodes with CPU only. That means the part + of application that doesn't require GPU or other kind of + acceleration. + CPU pool is not mandatory when the application is executed + exclusively in a GPU pool. + A CPU pool is composed by CPU and memory. + properties: + numCPU: + description: | + Total number of vcpus in whole (i.e 1) of CPU pool. + type: integer + example: 1 + memory: + description: Total memory in mega bytes of CPU pool. + type: integer + example: 1024 + topology: + type: object + description: | + CPU pool topology defines an application's CPU-based + architecture. + When deploying for high availability or redundancy, it + allows for clustering with a configurable number of nodes + and minimum CPU/memory resource per Kubernetes node + requirements. + required: + - minNumberOfNodes + - minNodeCpu + - minNodeMemory + properties: + minNumberOfNodes: + description: | + Minimum number of worker nodes required by the + application. + type: integer + example: 5 + minNodeCpu: + description: | + Minimum number of vcpus in whole (i.e 1) per cluster + node in CPU pool. + type: integer + example: 2 + minNodeMemory: + description: | + Minimum memory in mega bytes per cluster node in + CPU pool. + type: integer + example: 1024 + gpuPool: + required: + - numCPU + - memory + - gpuMemory + - topology + type: object + description: | + GPU Pool refers to the amount of resources of the application + that is executed in nodes with GPU. + GPU Pool is not mandatory when the application is executed + exclusively in a CPU pool. + A GPU pool is composed by memory, CPU and GPU memory + properties: + numCPU: + description: | + Total Number of vcpus in whole (i.e 1) of GPU pool. + type: integer + example: 1 + memory: + description: Total memory in mega bytes of GPU pool. + type: integer + example: 1024 + gpuMemory: + description: Total GPU memory in giga bytes of GPU pool. + type: integer + example: 16 + topology: + type: object + description: | + GPU pool topology defines an application's GPU-based + architecture. + When deploying for high availability or redundancy, it + allows for clustering with a configurable number of nodes + and minimum CPU/memory/GPU memory resource per Kubernetes + node requirements. + required: + - minNumberOfNodes + - minNodeCpu + - minNodeMemory + - minNodeGpuMemory + properties: + minNumberOfNodes: + description: | + Minimum number of worker nodes with GPU required by + the application. + type: integer + example: 2 + minNodeCpu: + description: | + Minimum number of vcpus in whole (i.e 1) per cluster + node in GPU pool. + type: integer + example: 2 + minNodeMemory: + description: | + Minimum memory in mega bytes per cluster node in + GPU pool. + type: integer + example: 1024 + minNodeGpuMemory: + description: Minimum memory in giga bytes per cluster + node in GPU pool. + type: integer + example: 8 + isStandalone: + description: | + Define if the Kubernetes clusters can be reused by other + applications. + type: boolean + example: false + kubernetesClusterRef: + description: | + A global unique identifier associated with a Kubernetes cluster + infrastructure. + type: string + format: uuid + example: "642f6105-7015-4af1-a4d1-e1ecb8437abc" version: type: string description: Minimum Kubernetes Version. example: "1.29" - isShared: - type: boolean - description: | - True: Enable the operator platform to reuse the kubernetes cluster - False: Disable the operator platform to reuse the kubernetes cluster - default: false - nodePools: - type: array - description: | - Description of worker node set in a Kubernetes cluster. - items: - $ref: '#/components/schemas/NodePool' additionalStorage: type: string description: | @@ -1164,36 +1229,13 @@ components: addons: $ref: '#/components/schemas/K8sAddons' - KubernetesResourcesRef: - type: object - description: Kubernetes reference object - required: - - infraKind - - kubernetesClusterRef - - applicationResources - properties: - infraKind: - description: Type of infrastructure for the application. - type: string - example: kubernetesResourcesRef - enum: - - kubernetesResourcesRef - applicationResources: - $ref: '#/components/schemas/ApplicationResources' - kubernetesClusterRef: - description: | - A global unique identifier associated with the Kubernetes Cluster - Infrastructure. - type: string - format: uuid - example: "642f6105-7015-4af1-a4d1-e1ecb8437abc" - VmResources: description: Definition of Virtual Machine Infrastructure type: object required: - - flavor - infraKind + - numCPU + - memory properties: infraKind: description: Type of infrastructure for the application. @@ -1201,17 +1243,27 @@ components: example: virtualMachine enum: - virtualMachine - flavor: - $ref: '#/components/schemas/Flavor' + numCPU: + type: integer + description: | + Number of vcpus in whole (i.e 1) + example: 1 + memory: + type: integer + example: 1024 + description: Memory in mega bytes additionalStorages: $ref: '#/components/schemas/AdditionalStorage' + gpu: + $ref: '#/components/schemas/GpuInfo' DockerComposeResources: description: Definition of Docker Compose Infrastructure type: object required: - - flavor - infraKind + - numCPU + - memory properties: infraKind: description: Type of infrastructure for the application. @@ -1219,19 +1271,27 @@ components: example: dockerCompose enum: - dockerCompose - flavor: - $ref: '#/components/schemas/Flavor' - additionalStorages: + numCPU: + type: integer + description: | + Number of vcpus in whole (i.e 1) + example: 1 + memory: + type: integer + example: 1024 + description: Memory in mega bytes + storage: $ref: '#/components/schemas/AdditionalStorage' + gpu: + $ref: '#/components/schemas/GpuInfo' ContainerResources: description: Container Infrastructure Definition type: object required: + - infraKind - numCPU - memory - - storage - - infraKind properties: infraKind: description: Type of infrastructure for the application. @@ -1248,28 +1308,7 @@ components: storage: $ref: '#/components/schemas/AdditionalStorage' gpu: - type: array - description: Number of GPUs - items: - $ref: '#/components/schemas/GpuInfo' - - ApplicationResources: - description: Application Resources Definition - type: object - required: - - numCPU - - memory - properties: - numCPU: - $ref: '#/components/schemas/Vcpu' - memory: - type: integer - example: 1024 - description: Memory in mega bytes - gpuMemory: - type: integer - example: 16 - description: GPU memory in giga bytes + $ref: '#/components/schemas/GpuInfo' Ipv4Addr: type: string @@ -1344,12 +1383,10 @@ components: - $ref: "#/components/schemas/VmResources" - $ref: "#/components/schemas/ContainerResources" - $ref: "#/components/schemas/DockerComposeResources" - - $ref: "#/components/schemas/KubernetesResourcesRef" discriminator: propertyName: infraKind mapping: kubernetes: "#/components/schemas/KubernetesResources" - kubernetesRef: "#/components/schemas/KubernetesResourcesRef" virtualMachine: "#/components/schemas/VmResources" container: "#/components/schemas/ContainerResources" dockerCompose: "#/components/schemas/DockerComposeResources"