Use setuptools to install python files
Now, to reference mininet files, use 'import mininet.mininet'. PYTHONPATH mods are no longer required for installation.
This commit is contained in:
@@ -3,9 +3,12 @@ Preliminary Mininet Installation/Configuration Notes
|
||||
|
||||
- This is not (yet) a 'release'; things may be broken.
|
||||
|
||||
- Mininet is not currently 'installed.' If you want to install it,
|
||||
so that you can 'import mininet', place mininet.py somewhere in your
|
||||
python path.
|
||||
- To install mininet, with root privileges:
|
||||
|
||||
python setup.py install
|
||||
|
||||
This places the mininet package in /usr/lib/python-2.5/site-packages/,
|
||||
so that 'import mininet' will work.
|
||||
|
||||
- A functional netns binary is required to run mininet, but currently you
|
||||
have to compile it and install it yourself from the included .c file:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
"Create a tree network and run the CLI on it."
|
||||
|
||||
from mininet import init, TreeNet, Cli
|
||||
from mininet.mininet import init, TreeNet, Cli
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
"Instantiate a Grid network and use NOX as the controller."
|
||||
|
||||
from mininet import init, Controller, GridNet, Cli
|
||||
from mininet.mininet import init, Controller, GridNet, Cli
|
||||
|
||||
class NoxController( Controller ):
|
||||
def __init__( self, name, **kwargs ):
|
||||
|
||||
@@ -15,8 +15,8 @@ switches, so this test WILL NOT WORK unless you have recompiled
|
||||
your controller to support 100 switches (or more.)
|
||||
"""
|
||||
|
||||
from mininet import init, Network, defaultNames, Host, Switch
|
||||
from mininet import createLink, flush, iperf, pingTestVerbose, Cli
|
||||
from mininet.mininet import init, Network, defaultNames, Host, Switch
|
||||
from mininet.mininet import createLink, flush, iperf, pingTestVerbose, Cli
|
||||
|
||||
class LinearNet( Network ):
|
||||
def __init__( self, switchCount, **kwargs ):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
"Run multiple tests on a network."
|
||||
|
||||
from mininet import init, TreeNet, pingTestVerbose, iperfTest, Cli
|
||||
from mininet.mininet import init, TreeNet, pingTestVerbose, iperfTest, Cli
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
"Instantiate a Tree network and use NOX as the controller."
|
||||
|
||||
from mininet import init, Controller, TreeNet, Cli
|
||||
from mininet.mininet import init, Controller, TreeNet, Cli
|
||||
|
||||
class NoxController( Controller ):
|
||||
def __init__( self, name, **kwargs ):
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
import ripcord
|
||||
from ripcord.topo import FatTreeTopo
|
||||
|
||||
from mininet import init, Controller, Network, Host, nameGen, Cli
|
||||
from mininet import createLink, flush
|
||||
from mininet.mininet import init, Controller, Network, Host, nameGen, Cli
|
||||
from mininet.mininet import createLink, flush
|
||||
|
||||
class NoxController( Controller ):
|
||||
def __init__( self, name, kernel=False **kwargs ):
|
||||
def __init__( self, name, kernel=False, **kwargs ):
|
||||
Controller.__init__( self, name, kernel=kernel,
|
||||
controller='nox_core',
|
||||
cargs='-v --libdir=/usr/local/lib -i ptcp: routing',
|
||||
cargs='-v --libdir=/usr/local/lib -i ptcp:',
|
||||
cdir='/usr/local/bin', **kwargs)
|
||||
|
||||
class FatTree( Network ):
|
||||
|
||||
@@ -6,7 +6,7 @@ This is more complicated than using the higher-level classes,
|
||||
but it exposes the configuration details and allows customization.
|
||||
"""
|
||||
|
||||
from mininet import init, Node, createLink
|
||||
from mininet.mininet import init, Node, createLink
|
||||
|
||||
def scratchNet( cname='controller', cargs='ptcp:'):
|
||||
# Create Network
|
||||
|
||||
@@ -8,7 +8,7 @@ but it exposes the configuration details and allows customization.
|
||||
This version uses the user datapath.
|
||||
"""
|
||||
|
||||
from mininet import init, Node, createLink
|
||||
from mininet.mininet import init, Node, createLink
|
||||
|
||||
def scratchNetUser( cname='controller', cargs='ptcp:'):
|
||||
# Create Network
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ unchanged on mininet and hardware.
|
||||
"""
|
||||
|
||||
import sys ; readline = sys.stdin.readline
|
||||
from mininet import init, Node, createLink, TreeNet, Cli
|
||||
from mininet.mininet import init, Node, createLink, TreeNet, Cli
|
||||
|
||||
def nets( hosts ):
|
||||
"Return list of networks (/24) for hosts."
|
||||
|
||||
@@ -7,7 +7,7 @@ to adjust them, e.g. by adding entries to /etc/sysctl.conf
|
||||
and running sysctl -p.
|
||||
"""
|
||||
|
||||
from mininet import init, TreeNet, Cli
|
||||
from mininet.mininet import init, TreeNet, Cli
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
"Create a 64-node tree network, and test connectivity using ping."
|
||||
|
||||
from mininet import init, TreeNet, pingTestVerbose
|
||||
from mininet.mininet import init, TreeNet, pingTestVerbose
|
||||
|
||||
def treePing64():
|
||||
results = {}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ host. Requires xterm(1) and GNU screen(1).
|
||||
|
||||
import os, re
|
||||
from subprocess import Popen
|
||||
from mininet import init, TreeNet, quietRun
|
||||
from mininet.mininet import init, TreeNet, quietRun
|
||||
|
||||
def makeXterm( node, title ):
|
||||
"Run screen on a node, and hook up an xterm."
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
'''Setuptools params'''
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name='mininet',
|
||||
version='0.0.0',
|
||||
description='The OpenFlow-based data center network',
|
||||
author='Bob Lantz',
|
||||
author_email='rlantz@cs.stanford.edu',
|
||||
packages=find_packages(exclude='test'),
|
||||
long_description="""\
|
||||
Insert longer description here.
|
||||
""",
|
||||
classifiers=[
|
||||
"License :: OSI Approved :: GNU General Public License (GPL)",
|
||||
"Programming Language :: Python",
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Internet",
|
||||
],
|
||||
keywords='networking protocol Internet OpenFlow',
|
||||
license='GPL',
|
||||
install_requires=[
|
||||
'setuptools'
|
||||
])
|
||||
Reference in New Issue
Block a user