Fix for container .env file and small updates 35/70235/1
authorLuc Provoost <luc.provoost@intel.com>
Fri, 29 May 2020 08:22:45 +0000 (10:22 +0200)
committerLuc Provoost <luc.provoost@intel.com>
Fri, 29 May 2020 08:22:45 +0000 (10:22 +0200)
Since runrapid.py is now supporting more than 1 dataplane interface, we
need to use a port index in the rapid.env file for the dataplane ports.
In k8sdeployment.py, we only support 1 dataplane port, but we are
writing dp_ip1 and dp_mac1 in the environment file. The copyright dates
are also updated. Some references to VM have also been changed to instance.

Change-Id: Ie1d036c13ef5d6f0aa1f35aa068a9760a1cfc2a9
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
17 files changed:
VNFs/DPPD-PROX/helper-scripts/rapid/README
VNFs/DPPD-PROX/helper-scripts/rapid/bare.test
VNFs/DPPD-PROX/helper-scripts/rapid/basicrapid.test
VNFs/DPPD-PROX/helper-scripts/rapid/centos.json
VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh
VNFs/DPPD-PROX/helper-scripts/rapid/deploycentostools.sh
VNFs/DPPD-PROX/helper-scripts/rapid/genv6.cfg
VNFs/DPPD-PROX/helper-scripts/rapid/helper.lua
VNFs/DPPD-PROX/helper-scripts/rapid/impair.test
VNFs/DPPD-PROX/helper-scripts/rapid/ipv6.test
VNFs/DPPD-PROX/helper-scripts/rapid/k8sdeployment.py
VNFs/DPPD-PROX/helper-scripts/rapid/l2framerate.test
VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py
VNFs/DPPD-PROX/helper-scripts/rapid/rapid.vms [deleted file]
VNFs/DPPD-PROX/helper-scripts/rapid/secgw.test
VNFs/DPPD-PROX/helper-scripts/rapid/sharkproxlog.sh
VNFs/DPPD-PROX/helper-scripts/rapid/swapv6.cfg

index ab6e44f..198b6db 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 37d5221..e827e97 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 25561bc..e0909c4 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 964de93..d7d8f1d 100644 (file)
@@ -1,5 +1,5 @@
 {
-"_Copyright": "Copyright (c) 2010-2019 Intel Corporation",
+"_Copyright": "Copyright (c) 2010-2020 Intel Corporation",
 "_License":   "SPDX-License-Identifier: Apache-2.0",
 "builders": [
    {
index 984f025..cca7f74 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index f89d4fe..d19abbe 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 8f5e399..650e284 100644 (file)
@@ -1,5 +1,5 @@
 ;;
-;; Copyright (c) 2010-2020 Intel Corporation
+;; Copyright (c) 2020 Intel Corporation
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.
index d38bb80..237c385 100644 (file)
@@ -1,5 +1,5 @@
 --
--- Copyright (c) 2010-2020 Intel Corporation
+-- Copyright (c) 2020 Intel Corporation
 --
 -- Licensed under the Apache License, Version 2.0 (the "License");
 -- you may not use this file except in compliance with the License.
index a6a217d..02e3852 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 2dd571b..f854c6a 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index caf2d2e..5e921d4 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python2.7
 
 ##
-## Copyright (c) 2019 Intel Corporation
+## Copyright (c) 2019-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
@@ -175,11 +175,11 @@ class K8sDeployment:
             self._runtime_config.set("M%d" % pod.get_id(),
                                      "admin_ip", pod.get_admin_ip())
             self._runtime_config.set("M%d" % pod.get_id(),
-                                     "dp_mac", pod.get_dp_mac())
+                                     "dp_mac1", pod.get_dp_mac())
             self._runtime_config.set("M%d" % pod.get_id(),
                                      "dp_pci_dev", pod.get_dp_pci_dev())
             self._runtime_config.set("M%d" % pod.get_id(),
-                                     "dp_ip", pod.get_dp_ip())
+                                     "dp_ip1", pod.get_dp_ip())
 
         # Section [Varia]
         self._runtime_config.add_section("Varia")
index fc452f8..e09b80f 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 163c6d9..43f7f14 100644 (file)
@@ -50,7 +50,8 @@ class prox_ctrl(object):
 
     def connect(self):
         attempts = 1
-        RapidLog.debug("Trying to connect to VM which was just launched on %s, attempt: %d" % (self._ip, attempts))
+        RapidLog.debug("Trying to connect to instance which was just launched \
+                on %s, attempt: %d" % (self._ip, attempts))
         while True:
             try:
                 self.test_connect()
@@ -58,15 +59,19 @@ class prox_ctrl(object):
             except RuntimeWarning as ex:
                 attempts += 1
                 if attempts > 20:
-                    RapidLog.exception("Failed to connect to VM after %d attempts:\n%s" % (attempts, ex))
-                    raise Exception("Failed to connect to VM after %d attempts:\n%s" % (attempts, ex))
+                    RapidLog.exception("Failed to connect to instance after %d\
+                            attempts:\n%s" % (attempts, ex))
+                    raise Exception("Failed to connect to instance after %d \
+                            attempts:\n%s" % (attempts, ex))
                 time.sleep(2)
-                RapidLog.debug("Trying to connect to VM which was just launched on %s, attempt: %d" % (self._ip, attempts))
-        RapidLog.debug("Connected to VM on %s" % self._ip)
+                RapidLog.debug("Trying to connect to instance which was just \
+                        launched on %s, attempt: %d" % (self._ip, attempts))
+        RapidLog.debug("Connected to instance on %s" % self._ip)
 
     def connect_socket(self):
         attempts = 1
-        RapidLog.debug("Trying to connect to PROX (just launched) on %s, attempt: %d" % (self._ip, attempts))
+        RapidLog.debug("Trying to connect to PROX (just launched) on %s, \
+                attempt: %d" % (self._ip, attempts))
         sock = None
         while True:
             sock = self.prox_sock()
@@ -74,10 +79,13 @@ class prox_ctrl(object):
                 break
             attempts += 1
             if attempts > 20:
-                RapidLog.exception("Failed to connect to PROX on %s after %d attempts" % (self._ip, attempts))
-                raise Exception("Failed to connect to PROX on %s after %d attempts" % (self._ip, attempts))
+                RapidLog.exception("Failed to connect to PROX on %s after %d \
+                        attempts" % (self._ip, attempts))
+                raise Exception("Failed to connect to PROX on %s after %d \
+                        attempts" % (self._ip, attempts))
             time.sleep(2)
-            RapidLog.debug("Trying to connect to PROX (just launched) on %s, attempt: %d" % (self._ip, attempts))
+            RapidLog.debug("Trying to connect to PROX (just launched) on %s, \
+                    attempt: %d" % (self._ip, attempts))
         RapidLog.info("Connected to PROX on %s" % self._ip)
         return sock
 
@@ -93,12 +101,14 @@ class prox_ctrl(object):
         for child in self._children:
             ret = os.waitpid(child[0], os.WNOHANG)
             if ret[0] == 0:
-                print("Waiting for child process '%s' to complete ..." % child[1])
+                print("Waiting for child process '%s' to complete ..." 
+                        % child[1])
                 ret = os.waitpid(child[0], 0)
             rc = ret[1]
             if os.WIFEXITED(rc):
                 if os.WEXITSTATUS(rc) == 0:
-                    print("Child process '%s' completed successfully" % child[1])
+                    print("Child process '%s' completed successfully" 
+                            % child[1])
                 else:
                     print("Child process '%s' returned exit status %d" % (
                             child[1], os.WEXITSTATUS(rc)))
@@ -231,14 +241,16 @@ class prox_sock(object):
         max_lat = avg_lat = 0
         number_tasks_returning_stats = 0
         buckets = [0] * 128
-        self._send('lat all stats %s %s' % (','.join(map(str, cores)), ','.join(map(str, tasks))))
+        self._send('lat all stats %s %s' % (','.join(map(str, cores)),
+            ','.join(map(str, tasks))))
         for core in cores:
             for task in tasks:
                 stats = self._recv().split(',')
             if 'is not measuring' in stats[0]:
                 continue
             if stats[0].startswith('error'):
-                RapidLog.critical("lat stats error: unexpected reply from PROX (potential incompatibility between scripts and PROX)")
+                RapidLog.critical("lat stats error: unexpected reply from PROX\
+                        (potential incompatibility between scripts and PROX)")
                 raise Exception("lat stats error")
             number_tasks_returning_stats += 1
             min_lat = min(int(stats[0]),min_lat)
@@ -246,13 +258,17 @@ class prox_sock(object):
             avg_lat += int(stats[2])
             #min_since begin = int(stats[3])
             #max_since_begin = int(stats[4])
-            tsc = int(stats[5]) # Taking the last tsc as the timestamp since PROX will return the same tsc for each core/task combination 
+            tsc = int(stats[5]) # Taking the last tsc as the timestamp since
+                                # PROX will return the same tsc for each 
+                                # core/task combination 
             hz = int(stats[6])
             #coreid = int(stats[7])
             #taskid = int(stats[8])
             stats = self._recv().split(':')
             if stats[0].startswith('error'):
-                RapidLog.critical("lat stats error: unexpected lat bucket reply (potential incompatibility between scripts and PROX)")
+                RapidLog.critical("lat stats error: unexpected lat bucket \
+                        reply (potential incompatibility between scripts \
+                        and PROX)")
                 raise Exception("lat bucket reply error")
             buckets[0] = int(stats[1])
             for i in range(1, 128):
@@ -263,10 +279,12 @@ class prox_sock(object):
         used = float(self._recv())
         self._send('stats latency(0).total')
         total = float(self._recv())
-        return min_lat, max_lat, avg_lat, (old_div(used,total)), tsc, hz, buckets
+        return (min_lat, max_lat, avg_lat, (old_div(used,total)), tsc, hz,
+                buckets)
 
     def irq_stats(self, core, bucket, task=0):
-        self._send('stats task.core(%s).task(%s).irq(%s)' % (core, task, bucket))
+        self._send('stats task.core(%s).task(%s).irq(%s)' % 
+                (core, task, bucket))
         stats = self._recv().split(',')
         return int(stats[0])
 
@@ -279,13 +297,16 @@ class prox_sock(object):
 
     def core_stats(self, cores, tasks=[0]):
         rx = tx = drop = tsc = hz = rx_non_dp = tx_non_dp = tx_fail = 0
-        self._send('dp core stats %s %s' % (','.join(map(str, cores)), ','.join(map(str, tasks))))
+        self._send('dp core stats %s %s' % (','.join(map(str, cores)), 
+            ','.join(map(str, tasks))))
         for core in cores:
             for task in tasks:
                 stats = self._recv().split(',')
                 if stats[0].startswith('error'):  
                     if stats[0].startswith('error: invalid syntax'):
-                        RapidLog.critical("dp core stats error: unexpected invalid syntax (potential incompatibility between scripts and PROX)")
+                        RapidLog.critical("dp core stats error: unexpected \
+                                invalid syntax (potential incompatibility \
+                                between scripts and PROX)")
                         raise Exception("dp core stats error")
                     continue
                 rx += int(stats[0])
@@ -303,7 +324,9 @@ class prox_sock(object):
         self._send('multi port stats %s' % (','.join(map(str, ports))))
         result = self._recv().split(';')
         if result[0].startswith('error'):  
-            RapidLog.critical("multi port stats error: unexpected invalid syntax (potential incompatibility between scripts and PROX)")
+            RapidLog.critical("multi port stats error: unexpected invalid \
+                    syntax (potential incompatibility between scripts and \
+                    PROX)")
             raise Exception("multi port stats error")
         for statistics in result:
             stats = statistics.split(',')
@@ -316,16 +339,20 @@ class prox_sock(object):
         return rx, tx, no_mbufs, errors, tsc
 
     def set_random(self, cores, task, offset, mask, length):
-        self._send('set random %s %s %s %s %s' % (','.join(map(str, cores)), task, offset, mask, length))
+        self._send('set random %s %s %s %s %s' % (','.join(map(str, cores)), 
+            task, offset, mask, length))
 
     def set_size(self, cores, task, pkt_size):
-        self._send('pkt_size %s %s %s' % (','.join(map(str, cores)), task, pkt_size))
+        self._send('pkt_size %s %s %s' % (','.join(map(str, cores)), task, 
+            pkt_size))
 
     def set_imix(self, cores, task, imix):
-        self._send('imix %s %s %s' % (','.join(map(str, cores)), task, ','.join(map(str,imix))))
+        self._send('imix %s %s %s' % (','.join(map(str, cores)), task, 
+            ','.join(map(str,imix))))
 
     def set_value(self, cores, task, offset, value, length):
-        self._send('set value %s %s %s %s %s' % (','.join(map(str, cores)), task, offset, value, length))
+        self._send('set value %s %s %s %s %s' % (','.join(map(str, cores)), 
+            task, offset, value, length))
 
     def _send(self, cmd):
         """Append LF and send command to the PROX instance."""
@@ -334,7 +361,7 @@ class prox_sock(object):
         self._sock.sendall(cmd.encode() + b'\n')
 
     def _recv(self):
-        """Receive response from PROX instance, and return it with LF removed."""
+        """Receive response from PROX instance, return it with LF removed."""
         if self._sock is None:
             raise RuntimeError("PROX socket closed, cannot receive anymore")
         pos = self._rcvd.find(b'\n')
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid.vms b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid.vms
deleted file mode 100644 (file)
index a790540..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-##
-## Copyright (c) 2010-2019 Intel Corporation
-##
-## 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
-##
-##     http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-##
-
-
-[DEFAULT]
-total_number_of_vms=3
-flavor_info=--ram 4096 --disk 40 --vcpus 4
-;flavor_meta_data=--property hw:mem_page_size=large --property hw:cpu_policy=dedicated --property hw:cpu_thread_policy=isolate --property hw:numa_nodes=1 --property hw:numa_cpus.0=0,1,2,3 --property hw:numa_mempolicy=strict --property hw:numa_mem.0=4096
-;flavor_meta_data=--property hw:mem_page_size=large --property hw:cpu_policy=dedicated --property hw:cpu_thread_policy=isolate
-flavor_meta_data=--property hw:mem_page_size=large --property hw:cpu_policy=dedicated
-;flavor_meta_data=--property hw:mem_page_size=large --property hw:cpu_policy=dedicated --property hw:cpu_realtime=yes --property hw:cpu_realtime_mask=^0
-;boot_info=--availability-zone nova --security-group default --config-drive=true
-boot_info=--availability-zone nova --security-group prox_security_group
-SRIOV_mgmt_port=NO
-SRIOV_port=NO
-
-[VM1]
-
-[VM2]
-
-[VM3]
-
-[VM4]
-
-[VM5]
-
-[VM6]
-
-[VM7]
-
-[VM8]
-
-[VM9]
-
-[VM10]
-
-[VM11]
-
-[VM12]
-
-[VM13]
-
-[VM14]
-
-[VM15]
-
-[VM16]
-
-
index fea9b51..b34f664 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index 18fdaa0..c2c4ab0 100755 (executable)
@@ -1,5 +1,5 @@
 ##
-## Copyright (c) 2010-2019 Intel Corporation
+## Copyright (c) 2010-2020 Intel Corporation
 ##
 ## Licensed under the Apache License, Version 2.0 (the "License");
 ## you may not use this file except in compliance with the License.
index ce323e9..e073f8f 100644 (file)
@@ -1,5 +1,5 @@
 ;;
-;; Copyright (c) 2010-2019 Intel Corporation
+;; Copyright (c) 2020 Intel Corporation
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License");
 ;; you may not use this file except in compliance with the License.