HLO Deployment Engine

Component of the HLO responsible for receiving service component LCM requests and address LLOs.

Exposing endpoint for service component LCM.

Receiving input from Inter-domain Allocation/Migration Manager from the same domain or from an external aerOS domain Produce CRD and send to LLO responsible for selected IE. Only the local allocation manager has a dedicated component repository.

HLO Deployment engine

Prerequisities

This component requires make, helm and docker for building and installation.

Installation

Note that this component is part of HLO common deployment and used in aerOS domain installation. You can install as part of this standard installation.

For development installation :
  • git clone https://gitlab.aeros-project.eu/wp3/t3.3/hlo-local-allocation-manager.git
    
  • cd hlo-local-allocation-manager
    
  • python3 -m venv venv
    
  • pip install -r requirments
    
  • source venv/bin/activate
    
  • uvicorn main:app --reload
    
  • Import postman collection, configure collection env parameters and test endpoints.

For isolated component installation in aerOS domain, you can use the Makefile in the repository :

Edit variables, if needed, and :

  • Build and tag docker image

make build
  • Push to aerOS repository

make push
  • Package and upload helm chart

make helm-upload
  • Deploy against cluster chosen as current k8s context

make deploy
  • All the above

make all
  • Removes docker image

make clean-build
  • Removes the helm deployment from the cluster

make clean-deploy
  • Removes all the above

make clean-all

Configuration options

The component can be configured from docker container environment variables :

  • CB_URL : Context Broker URL.

  • CB_PORT : Context Broker Port.

Developer guide

Communications and Interactions

As introduced before, The HLO Deployment Engine interacts with HLO frontend by receiving the allocation from the HLO Allocation Engine. Internally, the data transferred to the HLO Local Allocation Endpoint, depending on the concerned domain. In what follows, the concerned data definitions :

Messages exchanged and Primitives definition

HLO AL EP openAPI

Messages exchanged

Primitives definition

openapi: 3.1.0
info:
  version: "1.0.0"
  title: HLO Local Allocation API
  contact:
    email: info@aeros-project.com
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'

servers:
  \- description: HLO Domain Allocation endpoint
    url: '{protocol}://{hostname}:{port}'
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
    hostname:
      default: localhost
    port:
      default: '443'

tags:
  - name: hlo_al
paths:
  /hlo_al/services/{service_id}:
    post:
      tags:
        - hlo_al
      description: Allocate new service component in the domain
      operationId: allocateServiceComponent
      parameters:
        - $ref: '#/components/parameters/serviceIdParameter'
      requestBody:
          description: The Service Component to allocate
          content:
            "application/json":
              schema:
                $ref: '#/components/schemas/ServiceComponentAllocation'
      responses:
        '200':
          description: "service component allocated"
        '400':
          description: "invalid Service component object"
        '409':
          description: "service component already exist"

  /hlo_al/services/{service_id}/service_components/{service_component_id}/:
    put:
      tags:
        - hlo_al
      description: Update allocation parameters of an existing service component in the domain
      operationId: updateServiceComponentParameters
      parameters:
        - $ref: '#/components/parameters/serviceIdParameter'
        - $ref: '#/components/parameters/serviceComponentIdParameter'
      requestBody:
        description: The Service Component updated parameters
        content:
          "application/json":
            schema:
              $ref: '#/components/schemas/ServiceComponentParameters'
      responses:
        '200':
          description: "service component allocation parameters updated"
        '400':
          description: "invalid Service component parameters object"
        '404':
          $ref: '#/components/responses/ServiceComponentNotAllocated'
    get:
      tags:
        - hlo_al
      description: "Get the service component allocation parameters in the domain"
      operationId: getServiceComponentParameters
      parameters:
        - $ref: '#/components/parameters/serviceIdParameter'
        - $ref: '#/components/parameters/serviceComponentIdParameter'
      responses:
        '200':
          description: "service component deallocated"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceComponentParameters'
        '404':
           $ref: '#/components/responses/ServiceComponentNotAllocated'


    delete:
      tags:
        - hlo_al
      description: Deallocate an existing service component in the domain
      operationId: deallocateServiceComponent
      parameters:
        - $ref: '#/components/parameters/serviceIdParameter'
        - $ref: '#/components/parameters/serviceComponentIdParameter'
      responses:
        '200':
          description: "service component deallocated"
        '404':
          $ref: '#/components/responses/ServiceComponentNotAllocated'


components:
  parameters:
    serviceIdParameter:
      name: 'service_id'
      in: query
      schema:
        type: string
    serviceComponentIdParameter:
      name: 'service_component_id'
      in: query
      schema:
        type: string
  responses:
    ServiceComponentNotAllocated:
      description: "service component not allocated"
  schemas:
    Port:
      type: object
      properties:
        number:
          type: integer
          format: int32

    ServiceComponentAllocation:
      type: object
      required:
        - id
        - image
        - infrastructure_element
      properties:
        id:
          type: string
        image:
          type: string
        envVars:
          type: object
          additionalProperties:
            type: string
        cliArgs:
          type: object
          additionalProperties:
            type: string
        infrastructure_element:
          type: string
        ports:
          type: array
          items:
            $ref: '#/components/schemas/Port'

    ServiceComponentParameters:
      type: object
      required:
        - image
        - infrastructure_element
      properties:
        image:
          type: string
        envVars:
          type: object
          additionalProperties:
            type: string
        cliArgs:
          type: object
          additionalProperties:
            type: string
        infrastructure_element:
          type: string
        ports:
          type: array
          items:
            $ref: '#/components/schemas/Port'
syntax = "proto3";

import "hlo.proto";

message ServiceComponentAllocation {
  InfrastructureElement old_allocated_infrastructure_element = 1;
  ServiceComponent new_allocated_service_component = 2;
}

message HLODeploymentEngineInput {
  repeated ServiceComponentAllocation service_component_allocations = 1;
}
syntax = "proto3";

message Domain {
    string id = 1;
}

message Service {
    string id = 1;
}

message LowLevelOrchestrator {
    string id = 1;
    string orchestration_type = 3;
    Domain domain = 2;
}

message InfrastructureElement {
    string id = 1;
    float total_ram = 2;
    float cpu_cores = 3;
    float avg_power_consumption = 4;
    bool real_time_capable = 5;
    float current_ram = 6;
    float current_cpu_usage = 7;
    float current_power_consumption = 8;
    Domain domain = 9;
    LowLevelOrchestrator low_level_orchestrator = 10;
}

message Port {
    int32 number = 1;
}

message ServiceComponent {
    string id = 1;
    string image = 2;
    repeated Port ports = 3;
    Service service = 4;
    ServiceComponentConstraints service_component_constraints = 5;
    optional InfrastructureElement infrastructure_element = 6;
}

message ServiceComponentConstraints {
    map<string, float> constraints = 1;
}

Authors

The authors are: