<!-- markdownlint-disable MD013 MD024 -->

# Notes

## Running Network Monitoring and Training

### mec

- To start aggregator: `docker run -p 34000:8080 -p 34001:5000 -e FLWR_PORT=8080 -e DMLO_PORT=5000 --name aggregator --rm aggregator:latest`
- To start pqos: `docker run --rm --name pqos -e ENDPOINT=https://webhook.site/9ebcf608-2c9a-4302-87e5-5b477831b6b -p 32000:5000  pqos:latest`
- To start nmsender: `docker run --rm --cpus=1 -p 31000:1935 --name nginx nginx-stream`

### Send server_config to aggregator and do client_select

- config: `curl -X POST -H "Content-Type: application/json" -d '{ "ml_model": "../resources/best_model_no_tuner_40.h5", "num_epochs": 10, "min_working_nodes": 2, "hyperparam_epochs": 5, "hyperparam_batch_size": 2048, "hyperparam_learning_rate": 0.001, "avg_algorithm": "FedAvg", "training_clients_per_round": 2}' http://172.17.0.1:34001/config_server`
- client_select: `curl -X GET -H "Content-Type: application/json" -d '{"eligible_clients_ids" : ["1", "2"]}' http://172.17.0.1:34001/select_clients`

### Run nmclient on obus

`docker run -p 45000:8000 -e RUST_LOG=info -e ROCKET_CONFIG=/etc/videoprobe/Rocket.toml -e GNSS_DEV=/dev/ttyACM0 -e GNSS_ENABLED=false --name nmcli1 nmcli:latest`
`docker run -p 55000:8000 -e RUST_LOG=info -e ROCKET_CONFIG=/etc/videoprobe/Rocket.toml -e GNSS_DEV=/dev/ttyACM0 -e GNSS_ENABLED=false --name nmcli2 nmcli:latest`

### Send config to nmclients on obus

`curl -X GET -H "Content-Type: application/json" -d "{\"node_ip\": [\"http://172.17.0.1:41002/upload\"], \"stream_ip\": \"172.17.0.1\", \"stream_url\": \"rtmp://172.17.0.1:31000/live/test\"}" http://172.17.0.1:45000/demo/start`
`curl -X GET -H "Content-Type: application/json" -d "{\"node_ip\": [\"http://172.17.0.1:51002/upload\"], \"stream_ip\": \"172.17.0.1\", \"stream_url\": \"rtmp://172.17.0.1:31000/live/test\"}" http://172.17.0.1:55000/demo/start`

### Start training on Clients

`docker run --cpus=1 -p 41000:8080 -p 41001:5000 -p 41002:80 -e SERVER_IP_FLWR=172.17.0.1:34000 -e SERVER_IP_AGG=172.17.0.1:34001 -e CLIENT_ID=1 --name client1 --rm obu:latest`
`docker run --cpus=1 -p 51000:8080 -p 51001:5000 -p 51002:80 -e SERVER_IP_FLWR=172.17.0.1:34000 -e SERVER_IP_AGG=172.17.0.1:34001 -e CLIENT_ID=2 --name client2 --rm obu:latest`

## 5G IANA

Here I'll describe how we deploy this setup onto the 5G IANA platform.

### Setup Components

We'll need the following 5 components:

- nmsender
- nmclient
- aggregator
- obu-node
- pqos

All images are on the custom docker registry: [192.168.100.2:5000/uulm](192.168.100.2:5000/uulm) with
the 5g-iana user.

#### uc6nmsen2 / nmsender

nmsender is pushed as nginx:v1.2.2 onto the registry. The components name is: uc6nmsen2

##### General

Name: uc6nmsen2
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: nginx:v1.2.2

##### Minimum Execution Requirements

vCPUs: 1
RAM: 2048
Storage: 10
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: ffprobe -v quiet -print_format json -show_streams rtmp://localhost/live/test
Time Interval: 10

##### ~~Container Execution~~

##### ~~Environment Variables~~

##### Exposed Interfaces

uc6nmsen21935: 1935 / Access / TCP/UDP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6nmclient / nmclient

nmclient is pushed as passive_network_monitoring:v1.2.1. The components name is:
uc6nmclient

##### General

Name: uc6nmclient
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: passive_network_monitoring:v1.2.1

##### Minimum Execution Requirements

vCPUs: 1
RAM: 512
Storage: 10
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: <http://localhost:8000>
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

ROCKET_CONFIG: /etc/videoprobe/Rocket.toml
GNSS_DEV: /dev/ttyACM0
RUST_LOG: info
GNSS_ENABLED: true

##### Exposed Interfaces

uc6nmclientstatus: 8000 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6aggnode / aggregator

aggregator is pushed as uc6aggnode:v1.1.0. The component is: uc6aggnode

##### General

Name: uc6aggnode
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: uc6aggnode:v0.9.0

##### Minimum Execution Requirements

vCPUs: 1
RAM: 1024
Storage: 10
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: <http://localhost:8080>
Time Interval: 10

##### ~~Container Execution~~

##### ~~Environment Variables~~

##### Exposed Interfaces

uc6aggnode8080: 8080 / Access / TCP
uc6aggnode5000: 5000 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6dmltrain0 / obu-node

We'll need this twice, with different environment variables
obu-node is pushed as training_agent:v1.2.0. The component name is: uc6dmltrain0

##### General

Name: uc6dmltrain0
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: training_agent:v1.2.0

##### Minimum Execution Requirements

vCPUs: 1
RAM: 4096
Storage: 4
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [ http://localhost:80 ]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

- SERVER_IP_FLWR=192.168.100.4:30765
- SERVER_IP_AGG=192.168.100.4:31810
- CLIENT_ID=0

##### Exposed Interfaces

uc6dmltrain08080: 8080 / Access / TCP
uc6dmltrain080: 80 / Access / TCP
obustart0: 5001 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6dmltrain1 / obu-node

We'll need this twice, with different environment variables
obu-node is pushed as training_agent:v1.2.0. The component name is: uc6dmltrain1

##### General

Name: uc6dmltrain1
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: training_agent:v1.2.0

##### Minimum Execution Requirements

vCPUs: 1
RAM: 4096
Storage: 4
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [ http://localhost:80 ]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

- SERVER_IP_FLWR=192.168.100.4:30765
- SERVER_IP_AGG=192.168.100.4:31810
- CLIENT_ID=1

##### Exposed Interfaces

uc6dmltrain18080: 8080 / Access / TCP
uc6dmltrain180: 80 / Access / TCP
obustart1: 5001 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6pqos / pqos

pqos is pushed as uc6pqos:v1.2.0. The component is uc6pqos

##### General

Name: uc6pqos
Architecture: amd64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: uc6pqos:v1.2.0

##### Minimum Execution Requirements

vCPUs: 1
RAM: 512
Storage: 10
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [http://localhost:5000]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

ENDPOINT: [ https://webhook.site/9ebcf608-2c9a-4302-87e5-5b477831b6b ]

##### Exposed Interfaces

uc6pqos5000: 5000 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6dmlarm0 / obu-node

We'll need this twice, with different environment variables
obu-node is pushed as training_agent:v1.2.0. The component name is: uc6dmlarm0

##### General

Name: us6dmlarm0
Architecture: arm64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: training_agent:v1.2.0
Docker Username: 5g-iana
Docker Password: 5g-iana
Custom Docker Registry: [ 192.168.100.2:5000/uulm ]

##### Minimum Execution Requirements

vCPUs: 1
RAM: 4096
Storage: 4
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [ http://localhost:80 ]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

- SERVER_IP_FLWR=192.168.100.4:30765
- SERVER_IP_AGG=192.168.100.4:31810
- CLIENT_ID=3

##### Exposed Interfaces

uc6dmlarm08080: 8080 / Access / TCP
uc6dmlarm080: 80 / Access / TCP
obustart3: 5001 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6dmlarm1 / obu-node

We'll need this twice, with different environment variables
obu-node is pushed as training_agent:v1.2.0. The component name is: uc6dmlarm1

##### General

Name: uc6dmlarm1
Architecture: arm64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: training_agent:v1.2.0
Docker Username: 5g-iana
Docker Password: 5g-iana
Custom Docker Registry: [ 192.168.100.2:5000/uulm ]

##### Minimum Execution Requirements

vCPUs: 1
RAM: 4096
Storage: 4
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [ http://localhost:80 ]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

- SERVER_IP_FLWR=192.168.100.4:31805
- SERVER_IP_AGG=192.168.100.4:30760
- CLIENT_ID=4

##### Exposed Interfaces

uc6dmlarm18080: 8080 / Access / TCP
uc6dmlarm180: 80 / Access / TCP
obustart4: 5001 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

#### uc6dmlarm2 / obu-node

We'll need this twice, with different environment variables
obu-node is pushed as training_agent:v1.2.0. The component name is: uc6dmlarm2

##### General

Name: uc6dmlarm2
Architecture: arm64
Elasticity Controller: HORIZONTAL

##### Distribution Parameters

Docker Image: training_agent:v1.2.0
Docker Username: 5g-iana
Docker Password: 5g-iana
Custom Docker Registry: [ 192.168.100.2:5000/uulm ]

##### Minimum Execution Requirements

vCPUs: 1
RAM: 4096
Storage: 4
Hypervisor Type: ESXI

##### Health Check

HTTP/Command: [ http://localhost:80 ]
Time Interval: 10

##### ~~Container Execution~~

##### Environment Variables

- SERVER_IP_FLWR=192.168.100.4:30765
- SERVER_IP_AGG=192.168.100.4:31810
- CLIENT_ID=2

##### Exposed Interfaces

uc6dmlarm28080: 8080 / Access / TCP
uc6dmlarm280: 80 / Access / TCP
obustart2: 5001 / Access / TCP

##### ~~Required Interfaces~~

##### ~~Plugins~~

##### ~~Volumes~~

##### ~~Devices~~

##### ~~Labels~~

##### ~~Advanced Options~~

### Setup Applications

#### uc6nmsen2 / uc6nmsen2

Has uc6nmsen2 with the name uc6nmsen21831.

#### uc6nmcli2 / uc6nmclient

Has uc6nmclient with the name us6nmclient1771.

#### uc6aggnode / uc6aggnode

Has uc6aggnode with the name uc6aggnode1781.

#### uc6dmltrain0 / uc6dmltrain0

Has uc6dmltrain0 with the name uc6dmltrain02031.

#### uc6dmltrain1 / uc6dmltrain1

Has uc6dmltrain1 with the name uc6dmltrain1541.

#### uc6pqos / uc6pqos

Has uc6pqos with the name uc6pqos1841.

#### uc6dmlarm0 / uc6dmlarm0

Has uc6dmlarm0 with the name uc6dmlarm02041.

#### uc6dmlarm1 / uc6dmlarm1

Has uc6dmlarm1 with the name uc6dmlarm12051.

#### uc6dmlarm2 / uc6dmlarm2

Has uc6dmlarm2 with the name uc6dmlarm22061.

### Setup Deployment

#### uc6aggnode6 / uc6aggnode

##### Configure "uc6aggnode1781" Component

Select node: 5g-iana-mec

##### Set the Constraints of "uc6aggnode1781" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6nmsender / uc6nmsen2

##### Configure "uc6nmsen21831" Component

Select node: 5g-iana-mec

##### Set the Constraints of "uc6nmsen21831" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6pqos0 / uc6pqos

##### Configure "uc6pqos1841" Component

Select node: 5g-iana-mec

##### Set the Constraints of "uc6pqos1841" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6nmcli1 / uc6nmcli2

Select node: uulm-obu1

##### Set the Constraints of "" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6nmcli0 / uc6nmcli2

##### Configure "" Component

Select node: uulm-obu0

##### Set the Constraints of "uc6nmclient1771" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6dml90 / uc6dmltrain0

##### Configure "uc6dmltrain02031" Component

Select node: uulm-obu0

##### Set the Constraints of "uc6dmltrain02031" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6dml91 / uc6dmltrain1

##### Configure "uc6dmltrain1541" Component

Select node: uulm-obu1

##### Set the Constraints of "uc6dmltrain1541" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6dmlarm0 / uc6dmlarm0

##### Configure "uc6dmlarm02041" Component

Select node: orin

##### Set the Constraints of "uc6dmlarm02041" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6dmlarm1 / uc6dmlarm1

##### Configure "uc6dmlarm12051" Component

Select node: ubuntu

##### Set the Constraints of "uc6dmlarm12051" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

#### uc6dmlarm2 / uc6dmlarm2

##### Configure "uc6dmlarm22061" Component

Select node: links-vobu-1

##### Set the Constraints of "uc6dmlarm22061" Access Interface

Radio Service Types: eMBB
Uplink Bandwidth: 1
Downlink Bandwidth: 10

### Curl commands

```sh
# towards uc6aggnode
curl -X POST -H "Content-Type: application/json" -d '{ "ml_model": "../resources/best_model_no_tuner_40.h5", "num_epochs": 10, "min_working_nodes": 1, "hyperparam_epochs": 5, "hyperparam_batch_size": 2048, "hyperparam_learning_rate": 0.001, "avg_algorithm": "FedAvg", "training_clients_per_round": 1}' http://172.17.0.1:34001/config_server

curl -X POST -H "Content-Type: application/json" -d '{"eligible_clients_ids" : ["1"]}' http://172.17.0.1:34001/select_clients

# towards nmcli2
curl -X GET -H "Content-Type: application/json" -d "{\"node_ip\": [\"http://172.17.0.1:41002/upload\"], \"stream_ip\": \"172.17.0.1\", \"stream_url\": \"rtmp://172.17.0.1:31000/live/test\"}" http://172.17.0.1:45000/demo/start
```

### Possible Tags

```sh
curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/uulm/nginx/tags/list
{"name":"uulm/nginx","tags":["v1.2.1","v1.1.0","v1.2.2","v1.1.1"]}
```

```sh
curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/uulm/passive_network_monitoring/tags/list
{"name":"uulm/passive_network_monitoring","tags":["v1.2.1","v1.1.0","v1.2.0","v1.1.1"]}
```

```sh
curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/uulm/uc6aggnode/tags/list
{"name":"uulm/uc6aggnode","tags":["v0.9.0"]}
```

```sh
curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/uulm/training_agent/tags/list
{"name":"uulm/training_agent","tags":["v1.1.0","v1.2.0","v1.1.1"]}
```

### Kubernetes Stats

#### Aggregator node

```sh
nxw@5g-iana-manager:~$ kc get all -n 31ff3ac6-c9c9-454c-8131-f0be06dfd711
NAME                                                               READY   STATUS    RESTARTS      AGE
pod/uc6agg-uc6aggnode1781-eeqsuyvfcx-deployment-767949685b-tlrn8   1/1     Running   4 (44h ago)   45h

NAME                                               TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)                         AGE
service/uc6agg-uc6aggnode1781-eeqsuyvfcx-service   NodePort   10.152.183.223   <none>        8080:30765/TCP,5000:31810/TCP   45h

NAME                                                          READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6agg-uc6aggnode1781-eeqsuyvfcx-deployment   1/1     1            1           45h
```

Curl only from obu or mec
Curl to start this: `curl -X POST -H "Content-Type: application/json" -d '{ "ml_model": "../resources/best_model_no_tuner_40.h5", "num_epochs": 10, "min_working_nodes": 2, "hyperparam_epochs": 5, "hyperparam_batch_size": 2048,"hyperparam_learning_rate": 0.001, "avg_algorithm": "FedAvg", "training_clients_per_round": 2}' http://192.168.100.4:31808/config_server`
Client Selection: `curl -X GET -H "Content-Type: application/json" -d '{"eligible_clients_ids" : ["0", "1"]}' http://192.168.100.4:31808/select_clients`

#### uc6dml on uulm-obu0 / uulm-obu1

##### uulm-obu0

```sh
nxw@5g-iana-manager:~$ kc get all -n 5dcb12b1-a7a9-4b73-b290-a30f1d02b7db
NAME                                                       TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                                      AGE
service/uc6dmltrain0-uc6dmltrain02031-jekf9nmeui-service   NodePort   10.152.183.71   <none>        80:31418/TCP,8080:30402/TCP,5001:32126/TCP   45h

NAME                                                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6dmltrain0-uc6dmltrain02031-jekf9nmeui-deployment   0/0     0            0           45h

NAME                                                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6dmltrain0-uc6dmltrain02031-jekf9nmeui-deployment-7b779477b4   0         0         0       45h
```

##### uulm-obu1

```sh
nxw@5g-iana-manager:~$ kc get all -n 7cc5f73c-e349-493c-a592-9e0e685a0a65
NAME                                                      TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                                      AGE
service/uc6dmltrain1-uc6dmltrain1541-xtyata0ycb-service   NodePort   10.152.183.89   <none>        8080:30022/TCP,80:32174/TCP,5001:31066/TCP   45h

NAME                                                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6dmltrain1-uc6dmltrain1541-xtyata0ycb-deployment   0/0     0            0           45h

NAME                                                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6dmltrain1-uc6dmltrain1541-xtyata0ycb-deployment-bd7d5964b   0         0         0       45h
```

#### PQoS (TODO)

```sh
nxw@5g-iana-manager:~$ kc get all -n e2c74d7f-5de3-47ae-a450-5af3745ba0dc
NAME                                                              READY   STATUS              RESTARTS   AGE
pod/uc6pqos0-uc6pqos1841-chdrqcj0rm-deployment-7546f9455f-qmfx6   0/1     ContainerCreating   0          21s

NAME                                              TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/uc6pqos0-uc6pqos1841-chdrqcj0rm-service   NodePort   10.152.183.18   <none>        5000:32119/TCP   21s

NAME                                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6pqos0-uc6pqos1841-chdrqcj0rm-deployment   0/1     1            0           21s

NAME                                                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6pqos0-uc6pqos1841-chdrqcj0rm-deployment-7546f9455f   1         1         0       21s
```

#### NmSender

```sh
nxw@5g-iana-manager:~$ kc get all -n 1918b480-5b0c-4cf5-aff6-f60d06622251
NAME                                                                  READY   STATUS    RESTARTS   AGE
pod/uc6nmsender-uc6nmsen21831-3ebfpbnq83-deployment-64884c7f769pc8s   1/1     Running   0          56m

NAME                                                   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/uc6nmsender-uc6nmsen21831-3ebfpbnq83-service   NodePort   10.152.183.30   <none>        1935:31023/TCP   56m

NAME                                                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6nmsender-uc6nmsen21831-3ebfpbnq83-deployment   1/1     1            1           56m

NAME                                                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6nmsender-uc6nmsen21831-3ebfpbnq83-deployment-64884c7f76   1         1         1       56m
```

#### NmCli on uulm-obu0 / uulm-obu1

##### uulm-obu0

```sh
nxw@5g-iana-manager:~$ kc get all -n a0633f4a-98bb-4dc3-9aff-c0c8b75ccf33
NAME                                                                  READY   STATUS    RESTARTS   AGE
pod/uc6nmcli0-uc6nmclient1771-1gyqqtau43-deployment-6d6fc795dfsbvgj   1/1     Running   0          16m

NAME                                                   TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
service/uc6nmcli0-uc6nmclient1771-1gyqqtau43-service   NodePort   10.152.183.164   <none>        8000:30637/TCP   16m

NAME                                                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6nmcli0-uc6nmclient1771-1gyqqtau43-deployment   1/1     1            1           16m

NAME                                                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6nmcli0-uc6nmclient1771-1gyqqtau43-deployment-6d6fc795df   1         1         1       16m
```

Curl to start this: `curl -X GET -H "Content-Type: application/json" -d "{\"endpoint_ip\": [\"http://192.168.100.4:31418/upload\", \"https://webhook.site/fbf62890-8c93-426c-bb19-461d8e11ff8c\"], \"ping_ip\": \"192.168.100.4\", \"stream_url\": \"rtmp://192.168.100.4:31023/live/test\"}" http://192.168.100.4:30637/demo/start`

##### uulm-obu1

```sh
nxw@5g-iana-manager:~$ kc get all -n fa862b87-1d25-4357-bc29-ffcc4aa67907
NAME                                                                  READY   STATUS    RESTARTS   AGE
pod/uc6nmcli1-uc6nmclient1771-k9rifya6n3-deployment-84f59b85ccvrn8q   1/1     Running   0          14m

NAME                                                   TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
service/uc6nmcli1-uc6nmclient1771-k9rifya6n3-service   NodePort   10.152.183.237   <none>        8000:32334/TCP   14m

NAME                                                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/uc6nmcli1-uc6nmclient1771-k9rifya6n3-deployment   1/1     1            1           14m

NAME                                                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/uc6nmcli1-uc6nmclient1771-k9rifya6n3-deployment-84f59b85cc   1         1         1       14m

```

Curl only from obu or mec
Curl to start this: `curl -X GET -H "Content-Type: application/json" -d "{\"endpoint_ip\": [\"http://192.168.100.4:32174/upload\", \"https://webhook.site/fbf62890-8c93-426c-bb19-461d8e11ff8c\"], \"ping_ip\": \"192.168.100.4\", \"stream_url\": \"rtmp://192.168.100.4:31023/live/test\"}" http://192.168.100.4:32334/demo/start`

```json
{
  "endpoint_ip": [
    "http://192.168.100.4:30956/upload",
    "http://192.168.100.4:32119/accept_data"
  ],
  "ping_ip": "192.168.100.4",
  "stream_url": "rtmp://192.168.100.4:30888/live/test"
}
```

## Scripts

From uulm-obu0, uulm-obu1 or 5g-iana-mec.
Get list of repos:
`curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/_catalog`
Get tags for a repo:
`curl -u 5g-iana:5g-iana -k https://192.168.100.2:5000/v2/uulm/training_agent/tags/list`

## Issues

### uulm-obu0 offline

uulm-obu0 is offline and has been offline for a while.

### Logs

Can't access logs from kubernetes on the uulm-obu1

```sh
Error from server: Get "https://172.16.1.11:10250/containerLogs/26f69d2b-bf62-44a6-9346-421d34d376d8/uc6dml9-01-uc6dmltrain541-ccdgt3sqq8-deployment-6896f68c87cgq4r/uc6dml9-01-uc6dmltrain541-ccdgt3sqq8": dial tcp 172.16.1.11:10250: i/o timeout
```

Troubleshooting steps would be

> I get "i/o timeouts" when calling "microk8s kubectl logs"
>
> Make sure your hostname resolves correctly to the IP address of your host or localhost. The following error may indicate this misconfiguration:
>
> microk8s kubectl logs
> Error from server: Get "<https://hostname:10250/containerLogs/default/>...": dial tcp host-IP:10250: i/o timeout
>
> One way to address this issue is to add the hostname and IP details of the host in /etc/hosts. In the case of a multi-node cluster, the /etc/hosts on each machine has to be updated with the details of all cluster nodes.

But doesn't work

## todo

- Agg node testing - Giorgos will test on platform
- network monitoring figure out why not our obus are working
- check arm deployment of nmclient
- deploy nmclient tool on uc1 obus
- confirm pqos deployment on obu on our obus

## Data Collection for NEtwork Monitoring

```sh
curl -X GET -d "{\"id\": 1}" 192.168.200.11:32684/data_collection/get_data_stats
curl -X GET -H "Content-Type: application/json" -d "{\"endpoint_ip\": [\"https://webhook.site/85e1c94b-6642-45e2-abd4-59ef11450c2b\"], \"ping_ip\": \"192.168.100.4\", \"stream_url\": \"rtmp://192.168.100.4:31023/live/test\"}" http://192.168.200.11:32684/demo/start
```

## PQoS Final Event

### Component

#### General

- Name: uc6pqos-fe
- Architecture: x86
- Elasticity controller: HORIZONTAL

#### Distribution Parameters

- Docker Image: uc6pqos:v1.3.0
- Docker Credentials: <STANDARD>

#### Minimum Execution Requirements

- vCPUs: 1
- RAM (MB): 512
- Storage (GB): 10
- Hypervisor Type: ESXI

#### Health Check

- HTTP: [http://localhost:5000](http://localhost:5000)
- Time Interval (in seconds): 10

#### Environment variables

# For testing

- ENDPOINT: [https://webhook.site/fc612cc3-48a1-418f-8e97-e6b691285892](https://webhook.site/fc612cc3-48a1-418f-8e97-e6b691285892)

#### Exposed Interfaces

- uc6pqosfe5000: 5000

### Application

- Name: PQoS-finalevent
- Component: uc6pqos-fe

### Instance

- Name: PQoS-finalevent
- Selector Provider: NEXTWORKS-OSS
- Application: PQoS-finalevent
  - Selector node: uulm-obu0 # For Testing
- Ingress:
  - Minimum Bandwidth: eMBB
  - Radio Service Types: 1
  - Maximum Bandwidth: 10
