feat(telemetry): Rework
[csit.git] / resources / libraries / python / ContainerUtils.py
index 3d70684..7ec8258 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -587,6 +587,12 @@ class ContainerEngine:
         topo_instance = BuiltIn().get_library_instance(
             u"resources.libraries.python.topology.Topology"
         )
+        topo_instance.add_new_socket(
+            self.container.node,
+            SocketType.CLI,
+            self.container.name,
+            self.container.cli_socket,
+        )
         topo_instance.add_new_socket(
             self.container.node,
             SocketType.PAPI,
@@ -700,10 +706,12 @@ class ContainerEngine:
         vpp_config.add_buffers_per_numa(215040)
         vpp_config.add_plugin(u"disable", u"default")
         vpp_config.add_plugin(u"enable", u"memif_plugin.so")
+        vpp_config.add_plugin(u"enable", u"perfmon_plugin.so")
         vpp_config.add_main_heap_size(u"2G")
-        vpp_config.add_main_heap_page_size(u"2M")
+        vpp_config.add_main_heap_page_size(self.container.page_size)
+        vpp_config.add_default_hugepage_size(self.container.page_size)
         vpp_config.add_statseg_size(u"2G")
-        vpp_config.add_statseg_page_size(u"2M")
+        vpp_config.add_statseg_page_size(self.container.page_size)
         vpp_config.add_statseg_per_node_counters(u"on")
 
         return vpp_config
@@ -736,6 +744,7 @@ class ContainerEngine:
         vpp_config.add_dpdk_no_tx_checksum_offload()
         vpp_config.add_dpdk_dev_default_rxq(rxq)
         vpp_config.add_plugin(u"enable", u"dpdk_plugin.so")
+        vpp_config.add_plugin(u"enable", u"perfmon_plugin.so")
 
         # Apply configuration
         self.execute(u"mkdir -p /etc/vpp/")
@@ -753,6 +762,7 @@ class ContainerEngine:
         vpp_config.add_plugin(u"enable", u"crypto_native_plugin.so")
         vpp_config.add_plugin(u"enable", u"crypto_ipsecmb_plugin.so")
         vpp_config.add_plugin(u"enable", u"crypto_openssl_plugin.so")
+        vpp_config.add_plugin(u"enable", u"perfmon_plugin.so")
 
         # Apply configuration
         self.execute(u"mkdir -p /etc/vpp/")
@@ -853,7 +863,7 @@ class LXC(ContainerEngine):
             else u"amd64"
 
         image = self.container.image if self.container.image \
-            else f"-d ubuntu -r bionic -a {target_arch}"
+            else f"-d ubuntu -r focal -a {target_arch}"
 
         cmd = f"lxc-create -t download --name {self.container.name} " \
             f"-- {image} --no-validate"
@@ -1273,6 +1283,7 @@ class Container:
                 path = f"/tmp/vpp_sockets/{value}"
                 self.__dict__[u"socket_dir"] = path
                 self.__dict__[u"api_socket"] = f"{path}/api.sock"
+                self.__dict__[u"cli_socket"] = f"{path}/cli.sock"
                 self.__dict__[u"stats_socket"] = f"{path}/stats.sock"
             self.__dict__[attr] = value
         else: