Commit 0c290407 authored by guillermo.gomez's avatar guillermo.gomez Committed by Guillermo Gomez Chavez
Browse files

fixed documentation issues

parent 78322c92
Pipeline #20677 passed with stages
in 3 minutes and 48 seconds
......@@ -95,6 +95,7 @@ class OSMInterface:
log.debug(f"vnfds: {vnfi_data}")
raise ValueError("Unable to find scaling-group-descriptor ref for the NBI (scaling-aspect)")
scaling_group = vnfd_data['df'][0]['scaling-aspect'][0]['name']
# TODO: OSM has a bug that deletes max-number-of-instances
vdu_profile_max = vnfd_data['df'][0]['vdu-profile'][0].get('max-number-of-instances', 2)
vdu_profile_min = vnfd_data['df'][0]['vdu-profile'][0].get('min-number-of-instances', 1)
......
......@@ -683,8 +683,8 @@ Here a sample of this file for your convenience:
logic: "evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True "
The meaning of the relevant attributes is as follows (for the other general purpose attributes you can refer the K8s standard variables defined in the
`official documentation <https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/>`_):
**The meaning of the relevant attributes is as follows (for the other general purpose attributes you can refer the K8s standard variables defined in the
`official documentation <https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/>`_)**:
#. *name*. Free text to designate the job.
#. *image*. Configures where the AI-Agents docker image is stored and the default update policies. The nested attributes are: *repository*, that points to the `dockerhub <https://hub.docker.com/repository/docker/atosresearch/osm-ai-agent>`_ account where the image is stored. *tag* configures which version to use (latest holds the stable version). *imagePullPolicy* is set to 'always' so that new stable releases fixing bugs are automatically used even in a running environment.
......@@ -732,55 +732,55 @@ Once we have the descriptors for the VNF and the NS we can run the demo. You can
#. You can also check the AI-Agent traces. To do so first execute 'kubectl get pods -n osm' in the commands line to identify the K8s pod associated to the AI Agent; e.g.:
.. code-block:: bash
.. code-block:: bash
ubuntu@osm10:~$ kubectl get pods -n osm
NAME READY STATUS RESTARTS AGE
eechart-0093563749-ai-agent-1630482240-4cgvp 0/1 Completed 0 17s
grafana-755979fb8c-k6xld 2/2 Running 0 34d
kafka-0 1/1 Running 0 34d
keystone-786dbb778d-qk8z5 1/1 Running 0 34d
lcm-69d8d4fb5c-kmzd7 1/1 Running 0 34d
modeloperator-77865c54-44ddm 1/1 Running 0 34d
mon-7c966fccfb-22zqz 1/1 Running 0 34d
mongodb-k8s-0 2/2 Running 0 34d
mongodb-k8s-operator-0 1/1 Running 0 34d
mysql-0 1/1 Running 0 34d
nbi-6c8b6dffb4-rjd7g 1/1 Running 0 34d
ng-ui-6d55c58954-wq7d8 1/1 Running 0 34d
pol-66bff9db8c-nhhl5 1/1 Running 0 34d
prometheus-0 1/1 Running 0 34d
ro-5d958cc7f9-cgzrl 1/1 Running 0 34d
zookeeper-0 1/1 Running 0 34d
ubuntu@osm10:~$ kubectl get pods -n osm
NAME READY STATUS RESTARTS AGE
eechart-0093563749-ai-agent-1630482240-4cgvp 0/1 Completed 0 17s
grafana-755979fb8c-k6xld 2/2 Running 0 34d
kafka-0 1/1 Running 0 34d
keystone-786dbb778d-qk8z5 1/1 Running 0 34d
lcm-69d8d4fb5c-kmzd7 1/1 Running 0 34d
modeloperator-77865c54-44ddm 1/1 Running 0 34d
mon-7c966fccfb-22zqz 1/1 Running 0 34d
mongodb-k8s-0 2/2 Running 0 34d
mongodb-k8s-operator-0 1/1 Running 0 34d
mysql-0 1/1 Running 0 34d
nbi-6c8b6dffb4-rjd7g 1/1 Running 0 34d
ng-ui-6d55c58954-wq7d8 1/1 Running 0 34d
pol-66bff9db8c-nhhl5 1/1 Running 0 34d
prometheus-0 1/1 Running 0 34d
ro-5d958cc7f9-cgzrl 1/1 Running 0 34d
zookeeper-0 1/1 Running 0 34d
The K8s pod is the one with the 'eechart' prefix ('eechart-0093563749-ai-agent-1630482240-4cgvp' in this case).
Once you have the pod identifier you can access the traces as follows:
The K8s pod is the one with the 'eechart' prefix ('eechart-0093563749-ai-agent-1630482240-4cgvp' in this case).
.. code-block:: bash
Once you have the pod identifier you can access the traces as follows:
ubuntu@osm10:~$ kubectl logs -n osm eechart-0093563749-ai-agent-1630482240-4cgvp
{"asctime": "2021-09-01 07:44:15.074", "levelname": "INFO", "name": "utils", "message": "Checking Config:\n{'predictions': [{'active': False, 'monitoring': {'endpoint': 'http://192.168.137.34:4000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/CPU-forecast-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: True if x['predictions'][0][0] >= 0.8 else False\"}}, {'active': True, 'monitoring': {'endpoint': 'http://192.168.137.34:3000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/A2-traffic-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True \"}}]}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "osm_interface", "message": "VNFi info extracted from OSM: {'member-vnf-index-ref': 'VyOS Router', 'nsi_id': 'f3bf850f-6c47-42d0-bab4-7a3d3a1046d7', 'vdu-data': [{'vdu-id-ref': 'vyos-VM', 'ip-address': '192.168.137.43', 'name': 'aiagenttest-VyOS Router-vyos-VM-0'}], 'ns_name': 'aiagenttest', 'vnfs': ['648b8bb3-7f09-41ef-8a31-d632d1a90a8a'], 'project_id': '30ec57f1-4e48-43ce-a0f1-b136d66f9f67', 'scaling-group-descriptor': 'vyos-VM_vdu_autoscale'}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "OSM Data to run model evaluation: {'member-vnf-index-ref': 'VyOS Router', 'nsi_id': 'f3bf850f-6c47-42d0-bab4-7a3d3a1046d7', 'vdu-data': [{'vdu-id-ref': 'vyos-VM', 'ip-address': '192.168.137.43', 'name': 'aiagenttest-VyOS Router-vyos-VM-0'}], 'ns_name': 'aiagenttest', 'vnfs': ['648b8bb3-7f09-41ef-8a31-d632d1a90a8a'], 'project_id': '30ec57f1-4e48-43ce-a0f1-b136d66f9f67', 'scaling-group-descriptor': 'vyos-VM_vdu_autoscale'}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "Not Running {'active': False, 'monitoring': {'endpoint': 'http://192.168.137.34:4000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/CPU-forecast-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: True if x['predictions'][0][0] >= 0.8 else False\"}} because is NOT active"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "Running {'active': True, 'monitoring': {'endpoint': 'http://192.168.137.34:3000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/A2-traffic-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True \"}} because is active"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "AI URL : http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.095", "levelname": "INFO", "name": "model_interface", "message": "Check if AI Model Server is healthy"}
{"asctime": "2021-09-01 07:44:15.112", "levelname": "INFO", "name": "model_interface", "message": "AI Model Server reachable and up in http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.186", "levelname": "INFO", "name": "monitoring_interface", "message": "Metrics Obtained: {'instances': [[[[0.545098066329956, 0.6627451181411743, # ..... too long
{"asctime": "2021-09-01 07:44:15.190", "levelname": "INFO", "name": "model_interface", "message": "Preparing model request: http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.228", "levelname": "INFO", "name": "model_interface", "message": "model requested: {'predictions': [[3.66375139e-06, 0.999996305]]}"}
{"asctime": "2021-09-01 07:44:15.233", "levelname": "INFO", "name": "threshold_interface", "message": "evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True "}
{"asctime": "2021-09-01 07:44:15.234", "levelname": "INFO", "name": "threshold_interface", "message": "Evaluating threshold: False"}
{"asctime": "2021-09-01 07:44:15.242", "levelname": "INFO", "name": "agent", "message": "No actions required"}
These traces provide a high level view of the internal sequence of calls, obtained metrics from the monitoring service and AI execution output. Also if a scaling action was requested or not.
.. code-block:: bash
ubuntu@osm10:~$ kubectl logs -n osm eechart-0093563749-ai-agent-1630482240-4cgvp
{"asctime": "2021-09-01 07:44:15.074", "levelname": "INFO", "name": "utils", "message": "Checking Config:\n{'predictions': [{'active': False, 'monitoring': {'endpoint': 'http://192.168.137.34:4000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/CPU-forecast-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: True if x['predictions'][0][0] >= 0.8 else False\"}}, {'active': True, 'monitoring': {'endpoint': 'http://192.168.137.34:3000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/A2-traffic-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True \"}}]}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "osm_interface", "message": "VNFi info extracted from OSM: {'member-vnf-index-ref': 'VyOS Router', 'nsi_id': 'f3bf850f-6c47-42d0-bab4-7a3d3a1046d7', 'vdu-data': [{'vdu-id-ref': 'vyos-VM', 'ip-address': '192.168.137.43', 'name': 'aiagenttest-VyOS Router-vyos-VM-0'}], 'ns_name': 'aiagenttest', 'vnfs': ['648b8bb3-7f09-41ef-8a31-d632d1a90a8a'], 'project_id': '30ec57f1-4e48-43ce-a0f1-b136d66f9f67', 'scaling-group-descriptor': 'vyos-VM_vdu_autoscale'}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "OSM Data to run model evaluation: {'member-vnf-index-ref': 'VyOS Router', 'nsi_id': 'f3bf850f-6c47-42d0-bab4-7a3d3a1046d7', 'vdu-data': [{'vdu-id-ref': 'vyos-VM', 'ip-address': '192.168.137.43', 'name': 'aiagenttest-VyOS Router-vyos-VM-0'}], 'ns_name': 'aiagenttest', 'vnfs': ['648b8bb3-7f09-41ef-8a31-d632d1a90a8a'], 'project_id': '30ec57f1-4e48-43ce-a0f1-b136d66f9f67', 'scaling-group-descriptor': 'vyos-VM_vdu_autoscale'}"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "Not Running {'active': False, 'monitoring': {'endpoint': 'http://192.168.137.34:4000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/CPU-forecast-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: True if x['predictions'][0][0] >= 0.8 else False\"}} because is NOT active"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "Running {'active': True, 'monitoring': {'endpoint': 'http://192.168.137.34:3000'}, 'model': {'endpoint': 'http://192.168.137.46:8501/v1/models/A2-traffic-model:predict'}, 'threshold': {'function_name': 'evaluator', 'logic': \"evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True \"}} because is active"}
{"asctime": "2021-09-01 07:44:15.094", "levelname": "INFO", "name": "agent", "message": "AI URL : http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.095", "levelname": "INFO", "name": "model_interface", "message": "Check if AI Model Server is healthy"}
{"asctime": "2021-09-01 07:44:15.112", "levelname": "INFO", "name": "model_interface", "message": "AI Model Server reachable and up in http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.186", "levelname": "INFO", "name": "monitoring_interface", "message": "Metrics Obtained: {'instances': [[[[0.545098066329956, 0.6627451181411743, # ..... too long
{"asctime": "2021-09-01 07:44:15.190", "levelname": "INFO", "name": "model_interface", "message": "Preparing model request: http://192.168.137.46:8501/v1/models/A2-traffic-model:predict"}
{"asctime": "2021-09-01 07:44:15.228", "levelname": "INFO", "name": "model_interface", "message": "model requested: {'predictions': [[3.66375139e-06, 0.999996305]]}"}
{"asctime": "2021-09-01 07:44:15.233", "levelname": "INFO", "name": "threshold_interface", "message": "evaluator = lambda x: False if (x['predictions'][0][0] < x['predictions'][0][1]) else True "}
{"asctime": "2021-09-01 07:44:15.234", "levelname": "INFO", "name": "threshold_interface", "message": "Evaluating threshold: False"}
{"asctime": "2021-09-01 07:44:15.242", "levelname": "INFO", "name": "agent", "message": "No actions required"}
These traces provide a high level view of the internal sequence of calls, obtained metrics from the monitoring service and AI execution output. Also if a scaling action was requested or not.
#. Adjust the Monitoring Service to expose images with traffic jam situations.
.. note::
Remember the Monitoring Service allows to toggle between traffic jam and smooth traffic situations just by accessing its 'jam' endpoint (http://<MonitoringServiceIP>:3000/jam) from a web browser.
.. note::
Remember the Monitoring Service allows to toggle between traffic jam and smooth traffic situations just by accessing its 'jam' endpoint (http://<MonitoringServiceIP>:3000/jam) from a web browser.
#. Let some minutes go by and check that a scale-out operation has been performed using the OSM GUI:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment