Browse Source

Use setuptools to install python files

Now, to reference mininet files, use 'import mininet.mininet'.

PYTHONPATH mods are no longer required for installation.
pull/1/merge
Brandon Heller 16 years ago
parent
commit
51270ce4a2
  1. 9
      INSTALL
  2. 2
      examples/cli.py
  3. 2
      examples/grid.py
  4. 4
      examples/linearbandwidth.py
  5. 2
      examples/multitest.py
  6. 2
      examples/nox.py
  7. 8
      examples/ripcordtest.py
  8. 2
      examples/scratchnet.py
  9. 2
      examples/scratchnetuser.py
  10. 2
      examples/sshd.py
  11. 2
      examples/tree1024.py
  12. 2
      examples/treeping64.py
  13. 2
      examples/xterms.py
  14. 0
      mininet/cleanup
  15. 0
      mininet/mininet.py
  16. 27
      setup.py

9
INSTALL

@ -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:

2
examples/cli.py

@ -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()

2
examples/grid.py

@ -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 ):

4
examples/linearbandwidth.py

@ -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
examples/multitest.py

@ -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()

2
examples/nox.py

@ -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 ):

8
examples/ripcordtest.py

@ -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 ):

2
examples/scratchnet.py

@ -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

2
examples/scratchnetuser.py

@ -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

2
examples/sshd.py

@ -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."

2
examples/tree1024.py

@ -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
examples/treeping64.py

@ -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 = {}

2
examples/xterms.py

@ -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
cleanup → mininet/cleanup

0
mininet.py → mininet/mininet.py

27
setup.py

@ -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'
])
Loading…
Cancel
Save