Compare commits

..

4 Commits

Author SHA1 Message Date
lantz 5e909c6e4f 2.3.1b3 (#1181) 2023-05-02 13:05:56 -07:00
lantz 740acfb350 Unlimit cfs hosts for startup/shutdown config (#1178)
We defer cfs cgroup bandwidth limiting until
CPULimitedHost.configDefault(), and we change
Mininet.stop() to call a new host.unlimit()
method if available.
2023-04-28 18:48:35 -07:00
lantz a978ce9484 Disable udevd to speed up tests; reinstate slow tests (#1177)
systemd-udevd appears to drastically increase
Mininet startup time.

With systemd-udevd disabled,

mn --topo single,100 --test none

takes 8s rather than 40s (31s with NM_UNMANAGED) on
my test VM.

We need a way of disabling it globally and always for
Mininet interfaces, but this is a start for github
actions at least.

For now, we execute this command before running the CI tests:

systemctl stop systemd-udevd systemd-udevd-kernel.socket \
             systemd-udevd-control.socket

We also restore the "slow" examples tests, including
test_tree1024.
2023-04-28 14:44:52 -07:00
lantz 1e546cb73b Fix list of processes to kill in cleanup() (#1173)
The list is specified as a string, but when it was
split across lines spaces were not properly added.

Probably it should actually be a list to make it more
robust to adding additional process names.

For now we are adding spaces to all of the lines, so
hopefully anyone who updates it will follow the pattern.

This should fix the problem of ovs-testcontroller processes
not being killed.

Thanks to Rwitick Ghosh.

Closes #1164
2023-04-25 17:48:01 -07:00
6 changed files with 40 additions and 18 deletions
+7 -2
View File
@@ -22,6 +22,11 @@ jobs:
# This seems too slow unfortunately:
# sudo apt-get upgrade -y -qq
PYTHON=${{ matrix.py }} util/install.sh -nv
- name: Disable slow udevd
run: sudo systemctl stop systemd-udevd
systemd-udevd-kernel.socket
systemd-udevd-control.socket
|| echo "couldn't disable udevd"
- name: Sanity test
run: |
export sudo="sudo env PATH=$PATH"
@@ -39,8 +44,8 @@ jobs:
export sudo="sudo env PATH=$PATH"
export PYTHON=${{ matrix.py }}
$sudo $PYTHON mininet/test/runner.py -v
- name: Run examples tests (quick)
- name: Run examples tests
run: |
export sudo="sudo env PATH=$PATH"
export PYTHON=${{ matrix.py }}
$sudo $PYTHON examples/test/runner.py -v -quick
$sudo $PYTHON examples/test/runner.py -v
+1 -1
View File
@@ -2,7 +2,7 @@
Mininet Installation/Configuration Notes
----------------------------------------
Mininet 2.3.1b2
Mininet 2.3.1b3
---
The supported installation methods for Mininet are 1) using a
+2 -2
View File
@@ -2,7 +2,7 @@ Mininet: Rapid Prototyping for Software Defined Networks
========================================================
*The best way to emulate almost any network on your laptop!*
Mininet 2.3.1b2
Mininet 2.3.1b3
[![Build Status][1]](https://github.com/mininet/mininet/actions)
@@ -70,7 +70,7 @@ Mininet includes:
### Python 3 Support
- Mininet 2.3.1b2 supports Python 3 and Python 2
- Mininet 2.3.1b3 supports Python 3 and Python 2
- You can install both the Python 3 and Python 2 versions of
Mininet side by side, but the most recent installation will
+3 -3
View File
@@ -53,9 +53,9 @@ class Cleanup( object ):
info( "*** Removing excess controllers/ofprotocols/ofdatapaths/"
"pings/noxes\n" )
zombies = ( 'controller ofprotocol ofdatapath ping nox_core'
'lt-nox_core ovs-openflowd ovs-controller'
'ovs-testcontroller udpbwtest mnexec ivs ryu-manager' )
zombies = ( 'controller ofprotocol ofdatapath ping nox_core '
'lt-nox_core ovs-openflowd ovs-controller '
'ovs-testcontroller udpbwtest mnexec ivs ryu-manager ' )
# Note: real zombie processes can't actually be killed, since they
# are already (un)dead. Then again,
# you can't connect to them either, so they're mostly harmless.
+5 -1
View File
@@ -109,7 +109,7 @@ from mininet.util import ( quietRun, fixLimits, numCores, ensureRoot,
from mininet.term import cleanUpScreens, makeTerms
# Mininet version: should be consistent with README and LICENSE
VERSION = "2.3.1b2"
VERSION = "2.3.1b3"
class Mininet( object ):
"Network emulation with hosts spawned in network namespaces."
@@ -572,6 +572,10 @@ class Mininet( object ):
info( controller.name + ' ' )
controller.stop()
info( '\n' )
# Unlimit cfs hosts to speed up shutdown
for h in self.hosts:
if hasattr( h, 'unlimit' ):
h.unlimit()
if self.terms:
info( '*** Stopping %i terms\n' % len( self.terms ) )
self.stopXterms()
+22 -9
View File
@@ -685,8 +685,21 @@ class CPULimitedHost( Host ):
"CPU limited host"
def __init__( self, name, sched='cfs', **kwargs ):
Host.__init__( self, name, **kwargs )
def __init__( self, name, sched='cfs', **params ):
Host.__init__( self, name, **params )
# BL: Setting the correct period/quota is tricky, particularly
# for RT. RT allows very small quotas, but the overhead
# seems to be high. CFS has a mininimum quota of 1 ms, but
# still does better with larger period values.
self.period_us = params.get( 'period_us', 100000 )
self.sched = sched
self.cgroupsInited = False
self.cgroup, self.rtprio = None, None
def initCgroups( self ):
"Deferred cgroup initialization"
if self.cgroupsInited:
return
# Initialize class if necessary
if not CPULimitedHost.inited:
CPULimitedHost.init()
@@ -696,13 +709,7 @@ class CPULimitedHost( Host ):
# We don't add ourselves to a cpuset because you must
# specify the cpu and memory placement first
errFail( 'cgclassify -g cpu,cpuacct:/%s %s' % ( self.name, self.pid ) )
# BL: Setting the correct period/quota is tricky, particularly
# for RT. RT allows very small quotas, but the overhead
# seems to be high. CFS has a mininimum quota of 1 ms, but
# still does better with larger period values.
self.period_us = kwargs.get( 'period_us', 100000 )
self.sched = sched
if sched == 'rt':
if self.sched == 'rt':
self.checkRtGroupSched()
self.rtprio = 20
@@ -863,6 +870,7 @@ class CPULimitedHost( Host ):
cores: (real) core(s) this host can run on
params: parameters for Node.config()"""
r = Node.config( self, **params )
self.initCgroups()
# Was considering cpu={'cpu': cpu , 'sched': sched}, but
# that seems redundant
self.setParam( r, 'setCPUFrac', cpu=cpu )
@@ -878,6 +886,11 @@ class CPULimitedHost( Host ):
cls.cgversion = mountCgroups()
cls.inited = True
def unlimit( self ):
"Unlimit cpu for cfs"
if self.sched == 'cfs' and self.params.get( 'cpu', -1 ) != -1:
self.setCPUFrac( -1, sched=self.sched )
# Some important things to note:
#