Commit c37001ea authored by Yann Garcia's avatar Yann Garcia
Browse files

Continue MEC-016 development; Adding a early draft version of UE/MEC Application, demo4-ue

parent 3e44e116
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
  - [Network Scenario Creation](#network-scenario-creation)
  - [Frontend Enhancements](#frontend-enhancements)
  - [Upgrading an existing MEC Service](#upgrading-an-existing-mec-service)
  - [UE Application Creation](#ue-application-creation)
  - [MEC Application Creation](#mec-application-creation)

This guide contains all the steps that need to be taken for introducing a MEC service as a new feature in the MEC Sandbox frontend and the AdvantEDGE backend.

@@ -70,3 +72,12 @@ The above sections are strictly related to adding a new service in the MEC Sandb
In that case, there are some aspects that need to be taken into consideration while upgrading an existing MEC Service API in MEC Sandbox for both frontend and backend.

See [Service Upgradation Guide](./service-upgradation.md) for details on how to upgrade an existing MEC service.

## UE Application Creation

UE application are application running on a UE terminal. See [UE Scenarios](./ue-application-scenarios.md) for details on how to develop it.

## MEC Application Creation

MEC application are onboarded application on MEC platform (see MEC-016). See [UE Scenarios](./ue-application-scenarios.md) for details on how to develop it.
+30 −0
Original line number Diff line number Diff line
@@ -642,3 +642,33 @@ meep-<mec-identifier>
```

As a next step, code included in the directory structure above will be added into AdvantEDGE's fork repository. See [Code Integration](./backend-integration.md#code-integration) for more details.


# Usefull K8s commands

This clause provide a set of usefull K8s command lines for debugging micro-service and demo applications.
The commands (and their outputs) are just examples: 
- <i>yannsb</i> is the Sandbox named
- <i>meep-dai</i> is the DAI (MEC-016) micro-services.

They have to be modified based of the existing list of pods.

- To retrieve list of pods
```bash
$ kubectl get pods -A
```

- To retrieve pod descriptions such as internal IP address, Volumes...
```bash
$ kubectl describe pod meep-dai-8fb98975b-6jf9p -n yannsb
```

- To retrive pod logs into a text file named out_dai.txt
```bash
$ kubectl logs meep-dai-8fb98975b-6jf9p -n yannsb > out_dai.txt
```

- To retrive pod's container logs into a text file named out_demo.txt
```bash
$ kubectl logs demo4-ue1-7f8c7d8746-9vv7m demo4-ue1 -n yannsb > out_demo.txt
```
+149 −0
Original line number Diff line number Diff line
# User Application Scenarios

**Table of Contents**
- [User Application Scenarios](#ue-application-scenarios)
  - [Definitions](#definitions)
  - [Creating a UE Application](#creating-a-ue-application)
  - [Editing a UE application in an existing network scenario](#editing-a-ue-application-in-an-existing-network-scenario)
  - [Update MEEP-DAI micro-service](#update-meep-dai-micro-service)
  - [Uploading an Existing UE Application scenario](#uploading-an-existing-network-scenario)

This guide contains step-by-step procedure for creating and configuring a UE application in an existing network scenario.

# Definitions

- MEC application
This is an application or a MEC service hosted by a MEC platform

- User application (or UE Application)
This is an application or a MEC service hosted by a user terminal (UE) described in a [network scenarion](./network-scenarios.md)

- MEC application instantiation
A UE Application can request instantiation of an onboarded 

# Creating a UE Application

A UE Application is defined by its HTTP REST API.
The demo4 example provides a basic UE Application. Thios is an HTTP ping/pong request response.

## Define HTTP REST APIs (see [demo4-ue](???))

The following entry points are available:

- GET /info/logs
This request retrieves the UE application logs

- GET /info/application
This request retrieves the UE application description

- GET /dai/apps
This request retrieves the list of the available onboarded MEC application (see MEC-016 Clause )

- POST /dai/instantiate
This is a request to create a new onboarded MEC application context and to instiate it (see MEC-016 Clause )

- GET /dai/doping
This is a ping/pong request to the instantiated MEC application (see previous command)

- DELETE /dai/delete/{instance}
This is a request to delete the specified onboarded MEC application context and to un-instiate it (see MEC-016 Clause )

## Generate backend code

See [Feature-Development-Guide]()./development-guide.md) for details on how to generate the backend code based on HTTP REST APIs openAPI file.

# Editing a ue-application in an existing network scenario

Using a text editor, you need to update the networkLocations.physicalLocations.processes.serviceConfig entries of each UE application in order to export ports and protocol. This step is not accessible using the graphical User Interface.

# Update MEEP-DAI micro-service

The MEEP-DAI micro service is acting as the xxx core element in a MEC architecture with some limitations:
1) MEC application are onboarded runtime when the MEC Sandbox is launched
2) Only Mx2 interface (MEC-016) is supported
3) MEC-016 subscriptions and Notifications are not supported

## Technical details

TODO


### Environment variable
The following environment variables shall be defined in the UE application description:
- MEEP_NODE_NAME=<i>The terminal name</i>
- MEEP_HOST_PORT=<i>The listener host port</i>
- MEEP_EXTERNAL_HOST_PORT=<i>The external listener host port</i>
- MEEP_MEC_ADDRESS=<i>The MEC platform IP address</i>

The full line looks like:
<b>MEEP_NODE_NAME="10.10.20.01",MEEP_HOST_PORT=:80,MEEP_EXTERNAL_HOST_PORT=:31111,MEEP_MEC_ADDRESS=mec-platform.etsi.org</b>

### Current issues

- demo4-ue: Swagger does not work (404 Not Found) for http://mec-platform.etsi.org/yannsb/demo4-ue/api/

## Updating meep-dai/bin/onboardedapp

To rebuild both 1) UE application (demo4-ue) and MEC application (onboarded-demo), and 2) MEEP-DAI micro-service, executes the following command lines:
```bash
$ ~/AdvantEDGE/examples/demo4-ue
$ ./build-demo4-ue.sh --rebuild_dai && ./dockerize.sh
```
To rebuild demo4 without updating MEEP-DAI micro-service, executes the following command lines:
```bash
$ ~/AdvantEDGE/examples/demo4-ue
$ ./build-demo4-ue.sh && ./dockerize.sh
```

## Dockerize meep-dai

The MEEP-DAI micro-service can be rebuilt using meepctl tool. In this case, the current version of the MEC application (onboarded-demo) located in the folder ~/AdvantEDGE/bin/meep-dai will be used.

## How to use UE application demo4-ue

The UE application have no graphical user interface.
Tools such as Curl or Postman, or the AdvantEDGE swagger API can be used.

#### Using Curl

The following command retrieves the list of the UE application events:
```bash
$ curl "http://mec-platform.etsi.org:31111/info/application" -H "accept: application/json"
```

The following command retrieves the UE application logs:
```bash
$ curl "http://mec-platform.etsi.org:31111/info/logs" -H "accept: application/json"
```

The following command retrieves the list of onboarded MEC applications (see MEC-016 Clause ):
```bash
$ curl "http://mec-platform.etsi.org:31111/dai/apps" -H "accept: application/json"
```

The following command request the creation of a new AppContext (see MEC-016 Clause ):
```bash
$ curl -X POST "http://mec-platform.etsi.org:31111/dai/instantiate" -H "accept: application/json"
```

The following command request the deletions of the specified onboarded MEC applications (see MEC-016 Clause ):
```bash
$ curl -X DELETE "http://mec-platform.etsi.org:31111/dai/delete/10" -H "accept: application/json"
```

TODO: /dai/doping
```bash
$ curl "http://mec-platform.etsi.org:31111/dai/doping" -H "accept: application/json"
```

#### Using Postman

TODO

#### Using AdvantEDGE swagger API

TODO

# Uploading an Existing UE Application scenario

TODO