Commit 7c6b22a9 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

Merge branch 'develop'

parents 0ffd84ea 33603be1
Loading
Loading
Loading
Loading
+104 −52
Original line number Diff line number Diff line
# ETSI MEC Sandbox Frontend
# ETSI MEC Sandbox

>_NOTE: This repository contains the MEC Sandbox Frontend; the backend portion of the MEC Sandbox is realized using the open source project [AdvantEDGE](https://github.com/InterDigitalInc/AdvantEDGE)_
>_**NOTE: This repository contains the MEC Sandbox Frontend; the backend portion of the MEC Sandbox is realized
> using the open source project [AdvantEDGE](https://github.com/InterDigitalInc/AdvantEDGE)**_

MEC Sandbox is an interactive environment that enables users to learn & experiment with ETSI MEC Service APIs.
These standardised RESTful APIs are targeted towards MEC application developers to expose the value added services
@@ -11,8 +12,9 @@ presented via OpenAPI compliant descriptions.

MEC Sandbox provides the user with a choice of scenarios combining different network technologies (4G, 5G, Wi-Fi) and
terminal types. Combining these assets in a geolocated environment, a user can gain hands-on experience on the behaviour
and capabilities of the Location (MEC013), Radio Network Information (MEC012) and WLAN Information (MEC028) service APIs.
Such contextual information can offer significant differential performance for edge based MEC applications.
and capabilities of the Location (MEC013), Radio Network Information (MEC012), WLAN Information (MEC028), Edge Platform
Application Enablement (MEC011) and Application Mobility (MEC021) service APIs. Such contextual information can offer
significant differential performance for edge based MEC applications.

MEC Sandbox deploys the [AdvantEDGE edge emulation platform](https://github.com/InterDigitalInc/AdvantEDGE) to provide
real-time access to ETSI MEC service implementations.
@@ -28,9 +30,10 @@ To use the MEC Sandbox, check out the [live deployment](https://try-mec.etsi.org

To learn more about the MEC Sandbox, have a look at the [wiki page](https://mecwiki.etsi.org/index.php?title=MEC_Sandbox_Help).

To install the MEC Sandbox, follow the installation instructions below.
To install or upgrade the MEC Sandbox, follow the instructions below.

## Install MEC Sandbox
The following procedure should be used to install a new MEC Sandbox deployment.

### Prerequisites
MEC Sandbox has the following prerequisites:
@@ -61,6 +64,14 @@ MEC Sandbox has the following prerequisites:
     - _Scopes:_ read_user
     - **NOTES:**
       - Once created, keep note of the OAuth App Client ID & Secret
1. Python Installation
   - Install Python2:
     - Ubuntu 18.04: `sudo apt install python-minimal`
     - Ubuntu 20.04: `sudo apt install python2-minimal`
   - Install Python-pip:
     - Ubuntu 18.04: `sudo apt install python-pip`
     - Ubuntu 20.04: `sudo apt install python3-pip`
   - Install Pyyaml: `pip install pyyaml`

### Deploy Long-term Storage (MinIO + Thanos Compactor)

@@ -72,13 +83,13 @@ MEC Sandbox has the following prerequisites:
1. Configure Long-term Storage:
   - Configure object store:
     - `vi ~/AdvantEDGE/config/secrets.yaml`
       - Set minio accessKey to object store access key value (minimum 3 chars)
       - Set minio secretKey to object store secret key value (minimum 8 chars)
       - Set minio _accessKey_ to object store access key value (minimum 3 chars)
       - Set minio _secretKey_ to object store secret key value (minimum 8 chars)
     - `vi ~/AdvantEDGE/config/objstore-thanos.yaml`
       - Set endpoint to VM FQDN
       - Set _endpoint_ to VM FQDN
         - **NOTE:** Make sure _/etc/hosts_ file contains entry for VM FQDN that points to VM private IP address
       - Set access_key to object store access key value 
       - Set secret_key to object store secret key value
       - Set _access\_key_ to object store access key value 
       - Set _secret\_key_ to object store secret key value
   - Configure deployment:
     - `vi ~/AdvantEDGE/config/long-term-storage-repocfg.yaml`
       - Set uid & gid
@@ -86,15 +97,15 @@ MEC Sandbox has the following prerequisites:
       - Set Thanos compactor retention times
     - Overwrite repocfg file with provided long-term storage repocfg:
       - `cp ~/AdvantEDGE/config/long-term-storage-repocfg.yaml ~/AdvantEDGE/.meepctl-repocfg.yaml`
   - Configure MinIO helm chart:
     - `vi ~/AdvantEDGE/charts/minio/values.yaml`
       - _securityContext_:
         - Set _runAsUser_ to uid
         - Set _runAsGroup_ to gid
         - Set _fsGroup_ to groups
1. Create MinIO & Thanos Secrets:
   - MinIO:
     - Install Python2:
       - Ubuntu 18.04: `sudo apt install python-minimal`
       - Ubuntu 20.04: `sudo apt install python2-minimal`
     - Install Python-pip:
       - Ubuntu 18.04: `sudo apt install python-pip`
       - Ubuntu 20.04: `sudo apt install python3-pip`
     - Install Pyyaml: `pip install pyyaml`
     - Install Python as described in the prerequisites
     - Create secrets:
       - Ubuntu 18.04: `python ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml`
       - Ubuntu 20.04: `python3 ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml`
@@ -102,9 +113,10 @@ MEC Sandbox has the following prerequisites:
     - `~/AdvantEDGE/config/configure-objstore-secrets.sh`
   - **NOTE:** Once the kubernetes secrets have been created, it is recommended to remove the config files containing the clear-text secrets
1. Deploy MinIO & Thanos Compactor:
   - Build meepctl:
   - Build & Configure meepctl:
     - `~/AdvantEDGE/go-apps/meepctl/install.sh`
     - **NOTE:** On first install the IP address & gitdir must be configured
     - `meepctl config ip <VM private IP address>`
     - `meepctl config gitdir <full path to ~/AdvantEDGE>`
   - Deploy dependency pods:
     - `meepctl deploy dep`
   - Deploy Core pods:
@@ -120,18 +132,6 @@ MEC Sandbox has the following prerequisites:

### Build & Deploy MEC Sandbox (AdvantEDGE + MEC Sandbox Frontend)

1. Stop AdvantEDGE (if running)
   - Delete user sandboxes
     - Using AdvantEDGE frontend:
       - Login as admin @ https://try-mec.etsi.org
       - Open AdvantEDGE frontend @ https://try-mec.etsi.org/alt
       - Go to Exec Page and delete user sandboxes
     - Manually:
       - `helm ls -A --short | grep <sandbox-name> | xargs -L1 helm delete`
   - Delete core & dependency microservices:
     - `meepctl delete core`
     - `meepctl delete dep`
     - **NOTE:** This will clear all sessions in Redis DB
1. Clone MEC Sandbox & AdvantEDGE repositories:
   - Fetch required MEC Sandbox baseline:
     - Clone this repo to the MEC Sandbox deployment VM
@@ -143,13 +143,13 @@ MEC Sandbox has the following prerequisites:
1. Configure MEC Sandbox:
   - Configure object store:
     - `vi ~/mec-sandbox/config/objstore-thanos.yaml` and `vi ~/mec-sandbox/config/objstore-thanos-archive.yaml`
       - Set endpoint to long-term storage VM FQDN
       - Set _endpoint_ to long-term storage VM FQDN
         - **NOTE:** Make sure _/etc/hosts_ file contains entry for VM FQDN that points to VM private IP address (if on same local network)
       - Set access_key to object store access key value 
       - Set secret_key to object store secret key value
       - Set _access\_key_ to object store access key value 
       - Set _secret\_key_ to object store secret key value
     - `vi ~/mec-sandbox/config/objstore-influx.cfg`
       - Set aws_access_key_id to object store access key value 
       - Set aws_secret_access_key to object store secret key value
       - Set _aws\_access\_key\_id_ to object store access key value 
       - Set _aws\_secret\_access\_key_ to object store secret key value
   - Configure session & OAuth secrets:
     - `vi ~/mec-sandbox/config/secrets.yaml`
       - Set a unique session encryption key
@@ -184,14 +184,13 @@ MEC Sandbox has the following prerequisites:
     - **NOTE:** This also copies the AdvantEDGE configuration files to their respective locations in your local AdvantEDGE clone `~/AdvantEDGE/`. Running `git status` in your AdvantEDGE clone will list the updated (or new) files.
1. Create Secrets:
   - Session & OAuth:
     - Install Python2: `sudo apt install python-minimal`
     - Install Python-pip: `sudo apt install python-pip`
     - Install Pyyaml: `pip install pyyaml`
     - Install Python as described in the prerequisites
     - Create secrets:
       - `python ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml`
       - Ubuntu 18.04: `python ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml`
       - Ubuntu 20.04: `python3 ~/AdvantEDGE/config/configure-secrets.py set ~/AdvantEDGE/config/secrets.yaml`
   - Object Store (Thanos & Influx):
     - `~/AdvantEDGE/config/configure-objstore-secrets.sh`
   - **NOTE:** Once the kuberentes secrets have been created, it is recommended to remove the config files containing the clear-text secrets
   - **NOTE:** Once the kubernetes secrets have been created, it is recommended to remove the config files containing the clear-text secrets
1. Build & Deploy AdvantEDGE:
   - Build meepctl:
     - `~/AdvantEDGE/go-apps/meepctl/install.sh`
@@ -206,20 +205,23 @@ MEC Sandbox has the following prerequisites:
     - `meepctl deploy core`
     - **NOTE:** Wait for dep pods to be successfully deployed before deploying core

### Configure Scenarios
If necessary, configure the MEC Sandbox scenarios as follows:
### Provision Admin User Accounts
Manage MEC Sandbox admin user accounts as follows:

1. Provide _admin_ privileges to a user account
   - SSH to MEC Sandbox machine
   - SSH into _meep-postgis-0_ pod
   - Login & connect to PostgreSQL user role database:
1. SSH to MEC Sandbox machine
1. SSH into _meep-postgis-0_ pod
1. Login & connect to PostgreSQL user role database:
   - `psql -U postgres`
   - `\c meep_platform_ctrl`
   - Add entry to give _admin_ rights to a specific username from a specific provider. Examples:
1. Add entry to give _admin_ rights to a specific username from a specific provider. Examples:
   - `INSERT INTO users (provider, username, password, sboxname, role) VALUES ('github', 'user1', '', 'sbx-user1','admin');`
   - `INSERT INTO users (provider, username, password, sboxname, role) VALUES ('gitlab', 'user2', '', 'sbx-user2','admin');`
   - List configured user roles to verify proper configuration:
1. List configured user roles to verify proper configuration:
   - `SELECT * from users;`

### Configure Scenarios
If necessary, configure the MEC Sandbox scenarios as follows:

1. Sign in to MEC Sandbox using an account with _admin_ privileges
   - Login as admin user @ https://try-mec.etsi.org
1. Open the AdvantEDGE frontend
@@ -228,6 +230,56 @@ If necessary, configure the MEC Sandbox scenarios as follows:
   - In the AdvantEDGE Configuration view, import the required scenario _yaml_ file
   - Save the imported scenario to the AdvantEDGE backend to make it available in the MEC Sandbox

## Upgrade MEC Sandbox
The following procedure should be used to upgrade a running MEC Sandbox deployment.

1. Stop AdvantEDGE
   - Delete user sandboxes
     - Using AdvantEDGE frontend:
       - Login as admin @ https://try-mec.etsi.org
       - Open AdvantEDGE frontend @ https://try-mec.etsi.org/alt
       - Go to Exec Page and delete user sandboxes
     - Manually:
       - `helm ls -A --short | grep <sandbox-name> | xargs -L1 helm delete`
   - Delete core & dependency microservices:
     - `meepctl delete core`
     - `meepctl delete dep`
     - **NOTE:** This will clear all active sessions
1. Pull latest updates from MEC Sandbox & AdvantEDGE repositories
1. Configure MEC Sandbox deployment:
   - Configure deployment:
     - `vi ~/mec-sandbox/config/.meepctl-repocfg.yaml`
       - Set Prometheus external labels
         - **NOTE:** This uniquely identifies Prometheus data sources in the long-term storage data buckets
   - Configure Alert Manager slack channel webhook:
     - Set webhook url in Prometheus values override:
       - `vi ~/mec-sandbox/config/values/meep-prometheus.yaml`
       - Set `slack_api_url` to your slack channel webhook url
       - Set `channel` to your slack channel
1. Build & Deploy STF Frontend:
   - SSH to MEC Sandbox deployment VM
   - Build STF Frontend:
     - `cd ~/mec-sandbox`
     - `./build.sh`
   - Deploy STF Frontend & Configuration files:
     - `./deploy.sh`
     - **NOTE:** This updates the `~/.meep/user/` folder with the user frontend, sandbox swagger UI, and user chart values.yaml overrides
     - **NOTE:** This also copies the AdvantEDGE configuration files to their respective locations in your local AdvantEDGE clone `~/AdvantEDGE/`. Running `git status` in your AdvantEDGE clone will list the updated (or new) files.
1. Build & Deploy AdvantEDGE:
   - Build meepctl:
     - `~/AdvantEDGE/go-apps/meepctl/install.sh`
   - Deploy dependency pods:
     - `meepctl deploy dep`
   - Build & Dockerize:
     - `meepctl build all`
     - `meepctl dockerize all`
   - Prune old docker images:
     - `docker image prune`
   - Deploy Core pods:
     - `meepctl deploy core`
     - **NOTE:** Wait for dep pods to be successfully deployed before deploying core
1. Update network scenarios (if necessary)

## Licensing
MEC Sandbox is a private repo with all rights reserved to ETSI.
```
+74 −74
Original line number Diff line number Diff line
version: 1.8.3
version: 1.8.1
repo:
  name: AdvantEDGE

@@ -430,6 +430,40 @@ repo:

    # Go Applications
    go-apps:
      meep-ams:
        # location of source code
        src: go-apps/meep-ams
        # location of binary
        bin: bin/meep-ams
        # location of deployment chart
        chart: charts/meep-ams
        # user supplied value file located @ .meep/user/values (use below file name)
        chart-user-values: meep-ams.yaml
        # extra build flags
        build-flags:
          - -mod=vendor
        # enable meepctl build
        build: true
        # enable meepctl dockerize
        dockerize: true
        # enable meepctl deploy/delete
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: true
        # supports linting
        lint: true
        # location of API specifications
        api:
          - name: 'AdvantEDGE Application Mobility REST API'
            file: go-apps/meep-ams/api/swagger.yaml
        # location of user supplied API specifications
        user-api:
          - name: 'Application Mobility Service REST API'
            file: config/api/ams-api.yaml
        # resources available to docker container image
        docker-data:
          # location of entry script
          'entrypoint.sh': go-apps/meep-ams/entrypoint.sh
      meep-app-enablement:
        # location of source code
        src: go-apps/meep-app-enablement
@@ -449,7 +483,7 @@ repo:
        # enable meepctl deploy/delete
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: false
        codecov: true
        # supports linting
        lint: true
        # location of API specifications
@@ -630,74 +664,6 @@ repo:
        docker-data:
          # location of entry script
          'entrypoint.sh': go-apps/meep-rnis/entrypoint.sh
      meep-wais:
        # location of source code
        src: go-apps/meep-wais
        # location of binary
        bin: bin/meep-wais
        # location of deployment chart
        chart: charts/meep-wais
        # user supplied value file located @ .meep/user/values (use below file name)
        chart-user-values: meep-wais.yaml
        # extra build flags
        build-flags:
          - -mod=vendor
        # enable meepctl build
        build: true
        # enable meepctl dockerize
        dockerize: true
        # enable meepctl deploy/delete
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: true
        # supports linting
        lint: true
        # location of API specifications
        api:
          - name: 'AdvantEDGE WLAN Access Information Service REST API'
            file: go-apps/meep-wais/api/swagger.yaml
        # location of user supplied API specifications
        user-api:
          - name: 'WLAN Access Information Service REST API'
            file: config/api/wais-api.yaml
        # resources available to docker container image
        docker-data:
          # location of entry script
          'entrypoint.sh': go-apps/meep-wais/entrypoint.sh
      meep-ams:
        # location of source code
        src: go-apps/meep-ams
        # location of binary
        bin: bin/meep-ams
        # location of deployment chart
        chart: charts/meep-ams
        # user supplied value file located @ .meep/user/values (use below file name)
        chart-user-values: meep-ams.yaml
        # extra build flags
        build-flags:
          - -mod=vendor
        # enable meepctl build
        build: true
        # enable meepctl dockerize
        dockerize: true
        # enable meepctl deploy/delete
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: true
        # supports linting
        lint: true
        # location of API specifications
        api:
          - name: 'AdvantEDGE Application Mobility REST API'
            file: go-apps/meep-ams/api/swagger.yaml
        # location of user supplied API specifications
        user-api:
          - name: 'Application Mobility Service REST API'
            file: config/api/ams-api.yaml
        # resources available to docker container image
        docker-data:
          # location of entry script
          'entrypoint.sh': go-apps/meep-ams/entrypoint.sh
      meep-sandbox-ctrl:
        # location of source code
        src: go-apps/meep-sandbox-ctrl
@@ -754,15 +720,49 @@ repo:
        # location of binary
        bin: bin/meep-tc-sidecar
        # enable meepctl build
        build: false
        build: true
        # enable meepctl dockerize
        dockerize: false
        dockerize: true
        # enable meepctl deploy/delete
        deploy: false
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: false
        # supports linting
        lint: false
        lint: true
      meep-wais:
        # location of source code
        src: go-apps/meep-wais
        # location of binary
        bin: bin/meep-wais
        # location of deployment chart
        chart: charts/meep-wais
        # user supplied value file located @ .meep/user/values (use below file name)
        chart-user-values: meep-wais.yaml
        # extra build flags
        build-flags:
          - -mod=vendor
        # enable meepctl build
        build: true
        # enable meepctl dockerize
        dockerize: true
        # enable meepctl deploy/delete
        deploy: true
        # supports code coverage measurement when built in codecov mode
        codecov: true
        # supports linting
        lint: true
        # location of API specifications
        api:
          - name: 'AdvantEDGE WLAN Access Information REST API'
            file: go-apps/meep-wais/api/swagger.yaml
        # location of user supplied API specifications
        user-api:
          - name: 'WLAN Access Information Service REST API'
            file: config/api/wais-api.yaml
        # resources available to docker container image
        docker-data:
          # location of entry script
          'entrypoint.sh': go-apps/meep-wais/entrypoint.sh

  #------------------------------
  #  Dependencies
+3 −3
Original line number Diff line number Diff line
@@ -1238,14 +1238,14 @@
              "refId": "C"
            },
            {
              "expr": "sum((max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"}[$__range]) - metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"} offset $__range) or (max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"}[$__range]) unless metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"} offset $__range)) or vector(0)",
              "expr": "sum((max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"4.*\"}[$__range]) - metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"4.*\"} offset $__range) or (max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"4.*\"}[$__range]) unless metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"4.*\"} offset $__range)) or vector(0)",
              "instant": true,
              "interval": "",
              "legendFormat": "4xx",
              "refId": "D"
            },
            {
              "expr": "sum((max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"}[$__range]) - metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"} offset $__range) or (max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"}[$__range]) unless metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"3.*\"} offset $__range)) or vector(0)",
              "expr": "sum((max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"5.*\"}[$__range]) - metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"5.*\"} offset $__range) or (max_over_time(metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"5.*\"}[$__range]) unless metrics_http_request_duration_count{replica=~\"$replica\",svc=~\"$mec011\",status=~\"5.*\"} offset $__range)) or vector(0)",
              "instant": true,
              "interval": "",
              "legendFormat": "5xx",
@@ -3807,5 +3807,5 @@
  "timezone": "",
  "title": "MEC Sandbox",
  "uid": "mec-sandbox",
  "version": 4
  "version": 5
}
+8 −2
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ fileservers:
#
#  FORMAT:
#  - name: 'svc-name'                   # service name
#    api: 'api-name'                    # API-specific identifier (when service has multiple APIs)
#    path: '/svc/base/path'             # service base path
#    sbox: true|false                   # sandbox deployment
#    default:                           # default service permissions
@@ -172,6 +173,9 @@ services:
        roles:
          admin: 'allow'
          user: 'allow'
      - name: 'Websocket'
        path: '/ws'
        mode: 'allow'
    endpoints:
      - name: 'Index'
        path: '/'
@@ -180,7 +184,8 @@ services:
  #------------------------------
  #  MEC Application Support (Sbox)
  #------------------------------
  - name: 'meep-app-enablement-app-supp'
  - name: 'meep-app-enablement'
    api: 'mec_app_support'
    path: '/mec_app_support/v1'
    sbox: true
    default:
@@ -206,7 +211,8 @@ services:
  #------------------------------
  #  MEC Service Management (Sbox)
  #------------------------------
  - name: 'meep-app-enablement-srv-mgmt'
  - name: 'meep-app-enablement'
    api: 'mec_service_mgmt'
    path: '/mec_service_mgmt/v1'
    sbox: true
    default:
+5 −1
Original line number Diff line number Diff line
@@ -2,6 +2,10 @@
 * Copyright (c) 2020 ETSI.  All rights reserved.
 */

// Version
export const MEC_SANDBOX_VERSION = 'v1.6';

// Host
export const HOST_PATH = location.origin;

// Pages
@@ -57,7 +61,7 @@ export const DIALOG_SESSION_TERMINATED = 'DIALOG_SESSION_TERMINATED';
export const DIALOG_HELP_GETTING_STARTED = 'DIALOG_HELP_GETTING_STARTED';
export const DIALOG_CONFIRM_DELETE_APP = 'DIALOG_CONFIRM_DELETE_APP';
export const DIALOG_CREATE_NEW_APP = 'DIALOG_CREATE_NEW_APP';
export const DIALOG_NEWS = 'DIALOG_NEWS';
export const DIALOG_VERSION = 'DIALOG_VERSION';

// Alert Types
export const ALERT_DEGRADED_NETWORK = 'ALERT_DEGRADED_NETWORK';
Loading