PDLC-DP metrics to PDLC-CA
Hello @karamolegkos @pep1parask ,
As part of the IETF hackathon preparations and for internal experiment in FOR. We note the following:
- For PDLC-CA we would like to have all the metrics also as normalized values, so the equations of aggregation using any of the metrics will be correct.
- There is a mismatch between the values of node energy and node cpu usage as per the ACM returned CR JSON printed in the logs of PDLC-DP pod and the values written to the data_CA.csv file in the shared volume. In the csv file those values are shown as zeroes. This was tested in KinD, and below are the logs of this issue:
PDLC-DP pod Logs:
$ k logs -n he-codeco-pdlc pdlc-dp-6fc798d598-l5z79
.....
Printing ACM JSON: {'apiVersion': 'codeco.he-codeco.eu/v1alpha1', 'kind': 'CodecoApp', 'metadata': {'annotations': {'kubectl.kubernetes.io/last-applied-configuration': '{"apiVersion":"codeco.he-codeco.eu/v1alpha1","kind":"CodecoApp","metadata":{"annotations":{},"generation":1,"name":"codecoappinstance3","namespace":"he-codeco-acm","resourceVersion":"1456","uid":"5c948d7e-43d6-425b-b0b2-76402b606e07"},"spec":{"appEnergyLimit":"20","appFailureTolerance":"","appName":"acm-swm-app","codecoapp-msspec":[{"podspec":{"containers":[{"image":"quay.io/skupper/hello-world-backend:latest","name":"skupper-backend","ports":[{"containerPort":8080,"name":"skupper-backend","protocol":"TCP"}],"resources":{"limits":{"cpu":"2","memory":"4Gi"}}}]},"serviceChannels":[{"advancedChannelSettings":{"frameSize":"100","maxDelay":"1","minBandwidth":"5","sendInterval":"10"},"channelName":"frontend","otherService":{"appName":"acm-swm-app","port":9090,"serviceName":"front-end"},"serviceClass":"ASSURED"}],"serviceName":"backend"},{"podspec":{"containers":[{"image":"quay.io/dekelly/frontend-app:v0.0.2","name":"front-end","ports":[{"containerPort":8080,"protocol":"TCP"}]}]},"serviceChannels":[{"advancedChannelSettings":{"frameSize":"100","maxDelay":"1","minBandwidth":"5","sendInterval":"10"},"channelName":"backend","otherService":{"appName":"acm-swm-app","port":8080,"serviceName":"backend"},"serviceClass":"ASSURED"}],"serviceName":"front-end"}],"complianceClass":"High","qosClass":"Gold","securityClass":"Good"}}\n'}, 'creationTimestamp': '2025-07-09T09:07:44Z', 'generation': 1, 'managedFields': [{'apiVersion': 'codeco.he-codeco.eu/v1alpha1', 'fieldsType': 'FieldsV1', 'fieldsV1': {'f:metadata': {'f:annotations': {'.': {}, 'f:kubectl.kubernetes.io/last-applied-configuration': {}}}, 'f:spec': {'.': {}, 'f:appEnergyLimit': {}, 'f:appFailureTolerance': {}, 'f:appName': {}, 'f:codecoapp-msspec': {}, 'f:complianceClass': {}, 'f:qosClass': {}, 'f:securityClass': {}}}, 'manager': 'kubectl-client-side-apply', 'operation': 'Update', 'time': '2025-07-09T09:07:44Z'}, {'apiVersion': 'codeco.he-codeco.eu/v1alpha1', 'fieldsType': 'FieldsV1', 'fieldsV1': {'f:status': {'.': {}, 'f:appMetrics': {'.': {}, 'f:numPods': {}, 'f:serviceMetrics': {}}, 'f:nodeMetrics': {}}}, 'manager': 'manager', 'operation': 'Update', 'subresource': 'status', 'time': '2025-07-09T09:09:27Z'}], 'name': 'codecoappinstance3', 'namespace': 'he-codeco-acm', 'resourceVersion': '9325', 'uid': '2a3e6cad-fed9-4a2d-a67b-c1e65cc7273f'}, 'spec': {'appEnergyLimit': '20', 'appFailureTolerance': '', 'appName': 'acm-swm-app', 'codecoapp-msspec': [{'podspec': {'containers': [{'image': 'quay.io/skupper/hello-world-backend:latest', 'name': 'skupper-backend', 'ports': [{'containerPort': 8080, 'name': 'skupper-backend', 'protocol': 'TCP'}], 'resources': {'limits': {'cpu': '2', 'memory': '4Gi'}}}]}, 'serviceChannels': [{'advancedChannelSettings': {'frameSize': '100', 'maxDelay': '1', 'minBandwidth': '5', 'sendInterval': '10'}, 'channelName': 'frontend', 'otherService': {'appName': 'acm-swm-app', 'port': 9090, 'serviceName': 'front-end'}, 'serviceClass': 'ASSURED'}], 'serviceName': 'backend'}, {'podspec': {'containers': [{'image': 'quay.io/dekelly/frontend-app:v0.0.2', 'name': 'front-end', 'ports': [{'containerPort': 8080, 'protocol': 'TCP'}]}]}, 'serviceChannels': [{'advancedChannelSettings': {'frameSize': '100', 'maxDelay': '1', 'minBandwidth': '5', 'sendInterval': '10'}, 'channelName': 'backend', 'otherService': {'appName': 'acm-swm-app', 'port': 8080, 'serviceName': 'backend'}, 'serviceClass': 'ASSURED'}], 'serviceName': 'front-end'}], 'complianceClass': 'High', 'qosClass': 'Gold', 'securityClass': 'Good'}, 'status': {'appMetrics': {'numPods': 2, 'serviceMetrics': [{'avgServiceCpu': '0.002556', 'avgServiceMemory': '18112512.000000', 'clusterName': 'codeco-cluster-1', 'nodeName': 'c1', 'podName': 'acm-swm-app-front-end', 'serviceName': 'backend'}, {'avgServiceCpu': '0.001957', 'avgServiceMemory': '18636800.000000', 'clusterName': 'codeco-cluster-1', 'nodeName': 'c1', 'podName': 'acm-swm-app-backend', 'serviceName': 'front-end'}]}, 'nodeMetrics': [{'avgNodeCpu': '0.353444', 'avgNodeEnergy': '0.001000', 'avgNodeMemory': '11190705152.000000', 'nodeName': 'c1'}, {'avgNodeCpu': '0.353278', 'avgNodeEnergy': '0.001100', 'avgNodeMemory': '11188691968.000000', 'nodeName': 'c2'}, {'avgNodeCpu': '0.353111', 'avgNodeEnergy': '0.001300', 'avgNodeMemory': '11187499008.000000', 'nodeName': 'kind-control-plane'}]}}
[MDM] MDM URL: http://mdm-api.he-codeco-mdm.svc.cluster.local:8090
[MDM] CLUSTER CONTEXT: kind-kind
------- RAW MDM Text -------
spec:
groups: codeco.com
versions:
- name: v1
served: 'true'
storage: 'true'
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
pod_name:
description: identifier of the node
type: string
value: acm-swm-app-backend
freshness:
description: healthiness of the node based on data freshness
type: string
value: n/a
compliance:
description: compliance to application requirements
type: string
value: n/a
portability:
description: portability level for a specific application
type: string
value: n/a
scope: Namespaced
names:
plural: mdm-mons
singular: mdm-mon
kind: MDM
shortNames:
- mdm-m
------- MDM Collected by PDLC -------
{'cluster': 'kind-kind', 'namespace': 'he-codeco-acm', 'pod_name': 'acm-swm-app-backend', 'freshness': 'n/a', 'compliance': 'n/a', 'portability': 'n/a'}
[MDM] MDM URL: http://mdm-api.he-codeco-mdm.svc.cluster.local:8090
[MDM] CLUSTER CONTEXT: kind-kind
------- RAW MDM Text -------
spec:
groups: codeco.com
versions:
- name: v1
served: 'true'
storage: 'true'
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
pod_name:
description: identifier of the node
type: string
value: acm-swm-app-front-end
freshness:
description: healthiness of the node based on data freshness
type: string
value: n/a
compliance:
description: compliance to application requirements
type: string
value: n/a
portability:
description: portability level for a specific application
type: string
value: n/a
scope: Namespaced
names:
plural: mdm-mons
singular: mdm-mon
kind: MDM
shortNames:
- mdm-m
------- MDM Collected by PDLC -------
{'cluster': 'kind-kind', 'namespace': 'he-codeco-acm', 'pod_name': 'acm-swm-app-front-end', 'freshness': 'n/a', 'compliance': 'n/a', 'portability': 'n/a'}
Directory '/data/CA/' already exists.
Directory '/data/RL/' already exists.
[RL - INFO]- data exist the collection has begun
Directory '/data/GNN/' already exists.
Directory '/data/min_max/' already exists.
[GNNs - INFO]- data exist the collection has begun
[INFO] - 2025-07-09 09:09:33.786294: Files /data/RL/test_integracio.csv and /data/RL/test_nodes.csv updated successfully
[INFO] - 2025-07-09 09:09:33.809263: File /data/GNN/data_GNN.csv updated successfully
[INFO] - 2025-07-09 09:09:33.811026: File /data/CA/data_CA.csv updated successfully
Directory '/data/CA/' already exists.
[INFO] - here an empty list occurs
Directory '/data/RL/' already exists.
[RLs INFO]- here an empty list occurs
Directory '/data/GNN/' already exists.
Directory '/data/min_max/' already exists.
PDLC-DP generated file for PDLC-CA:
$ POD_NAME=$(kubectl get pods -n he-codeco-pdlc -l app=pdlc-dp -o jsonpath="{.items[0].metadata.name}")
$ kubectl -n he-codeco-pdlc exec -it $POD_NAME -- sh -c "cd /data/CA && cat data_CA.csv "
timestamp,node_name,node_cpu_usage,normalized_cpu_values,node_memory_values,nomalized_memory_values,node_energy_values,nomalized_energy_values,node_ibw,normalized_node_ibw,node_ebw,normalized_node_ebw,node_degree,node_net_failure,node_failure,node_net_energy,freshness,portability,compliance
2025-07-09 09:09:33,c1,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,814924.0,8149.2400814824005,0.0,-1.00000001e-08,1,0,0,0,"['n/a', 'n/a']","['n/a', 'n/a']","['n/a', 'n/a']"
2025-07-09 09:09:33,kind-control-plane,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,686292.0,6862.920068619201,0.0,-1.00000001e-08,1,0,0,0,[],[],[]
2025-07-09 09:09:33,c2,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,675176.0,6751.7600675076,0.0,-1.00000001e-08,1,0,0,0,[],[],[]
2025-07-09 09:10:33,c1,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,814924.0,8149.2400814824005,0.0,-1.00000001e-08,1,0,0,0,"['n/a', 'n/a']","['n/a', 'n/a']","['n/a', 'n/a']"
2025-07-09 09:10:33,kind-control-plane,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,686292.0,6862.920068619201,0.0,-1.00000001e-08,1,0,0,0,[],[],[]
2025-07-09 09:10:33,c2,0.0,-1.00000001e-08,10.0,0.09999999099999991,0.0,-1.00000001e-08,675176.0,6751.7600675076,0.0,-1.00000001e-08,1,0,0,0,[],[],[]