Skip to content

Commit a7c8456

Browse files
committed
Update documentation and dependencies to build Sphinx documentation
1 parent fd2aa2f commit a7c8456

File tree

10 files changed

+358
-447
lines changed

10 files changed

+358
-447
lines changed

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 102 additions & 313 deletions
Large diffs are not rendered by default.

comnetsemu/net.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,7 @@ def do_DELETE(self):
173173

174174

175175
class APPContainerManager:
176-
"""Manager for application containers (sibling containers) deployed on
177-
Mininet hosts.
178-
179-
- To make is simple. It uses docker-py APIs to manage internal containers
180-
from host system.
181-
182-
- Internal methods (starts with an underscore) should be documented after
183-
tests and before stable releases.
184-
185-
Ref:
186-
[1] https://docker-py.readthedocs.io/en/stable/containers.html
187-
"""
176+
"""Manager for application containers (sibling containers) deployed on Mininet hosts."""
188177

189178
reserved_docker_args = [
190179
"init",
@@ -220,8 +209,7 @@ class APPContainerManager:
220209
def __init__(self, net: Mininet):
221210
"""Init the APPContainerManager.
222211
223-
:param net (Mininet): The mininet object, used to manage hosts via
224-
Mininet's API.
212+
:param net (Mininet): The mininet object, used to manage hosts via Mininet's API.
225213
"""
226214
self.net = net
227215
self.dclt = docker.from_env()

doc/conf.py

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@
1212
# add these directories to sys.path here. If the directory is relative to the
1313
# documentation root, use os.path.abspath to make it absolute, like shown here.
1414
#
15+
16+
import datetime
1517
import os
1618
import sys
17-
sys.path.insert(0, os.path.abspath('..'))
19+
20+
sys.path.insert(0, os.path.abspath(".."))
1821

1922
# -- Project information -----------------------------------------------------
2023

2124
project = "ComNetsEmu"
22-
copyright = "2019, The Deutsche Telekom Chair of Communication Networks"
25+
year = datetime.datetime.now().year
26+
copyright = "%d The Deutsche Telekom Chair of Communication Networks" % year
2327
author = "Zuo Xiang"
2428

2529
# The short X.Y version
26-
version = "v0.1"
30+
version = "v0.3"
2731
# The full version, including alpha/beta/rc tags
28-
release = "v0.1.5"
32+
release = "v0.3.0"
2933

3034
# -- General configuration ---------------------------------------------------
3135

@@ -37,28 +41,20 @@
3741
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3842
# ones.
3943
extensions = [
40-
'sphinx.ext.autodoc', 'sphinxcontrib.apidoc',
41-
'sphinx.ext.autosectionlabel', 'sphinx.ext.doctest', 'recommonmark',
42-
'sphinxcontrib.napoleon'
44+
# Use builtin extensions in sphinx
45+
"sphinx.ext.autodoc",
46+
"sphinx.ext.autosectionlabel",
47+
"sphinx.ext.doctest",
48+
"sphinx.ext.napoleon",
49+
# Add markdown support
50+
"myst_parser",
4351
]
4452

45-
# Mock calls to external libraries
46-
autodoc_mock_imports = ["pytest"]
47-
48-
# API doc parameters
49-
apidoc_module_dir = '../comnetsemu/'
50-
apidoc_output_dir = 'api'
51-
apidoc_excluded_paths = ['test']
52-
apidoc_separate_modules = True
53-
apidoc_module_first = True
54-
apidoc_extra_args = ['-H', 'ComNetsEmu API', '-d', '6']
55-
autoclass_content = "both"
56-
5753
# Add any paths that contain templates here, relative to this directory.
58-
templates_path = ['_templates']
54+
templates_path = ["_templates"]
5955

6056
# The master toctree document.
61-
master_doc = 'index'
57+
master_doc = "index"
6258

6359
# The language for content autogenerated by Sphinx. Refer to documentation
6460
# for a list of supported languages.
@@ -70,23 +66,27 @@
7066
# List of patterns, relative to source directory, that match files and
7167
# directories to ignore when looking for source files.
7268
# This pattern also affects html_static_path and html_extra_path.
73-
exclude_patterns = ['build', 'Thumbs.db', '.DS_Store', 'comparison.md']
69+
exclude_patterns = ["build", "Thumbs.db", ".DS_Store", "comparison.md"]
7470

7571
# The name of the Pygments (syntax highlighting) style to use.
76-
pygments_style = None
72+
pygments_style = "sphinx"
7773

7874
# -- Options for HTML output -------------------------------------------------
7975

8076
# The theme to use for HTML and HTML Help pages. See the documentation for
8177
# a list of builtin themes.
8278
#
83-
html_theme = "sphinx_rtd_theme"
79+
html_theme = "alabaster"
80+
8481

8582
# Theme options are theme-specific and customize the look and feel of a theme
8683
# further. For a list of options available for each theme, see the
8784
# documentation.
8885
#
89-
# html_theme_options = {}
86+
html_theme_options = {
87+
"description": "A virtual emulator/testbed designed for the book: Computing in Communication Networks: From Theory to Practice",
88+
"fixed_sidebar": True,
89+
}
9090

9191
# Add any paths that contain custom static files (such as style sheets) here,
9292
# relative to this directory. They are copied after the builtin static files,
@@ -106,23 +106,20 @@
106106
# -- Options for HTMLHelp output ---------------------------------------------
107107

108108
# Output file base name for HTML help builder.
109-
htmlhelp_basename = 'ComNetsEmudoc'
109+
htmlhelp_basename = "ComNetsEmudoc"
110110

111111
# -- Options for LaTeX output ------------------------------------------------
112112

113113
latex_elements = {
114114
# The paper size ('letterpaper' or 'a4paper').
115115
#
116116
# 'papersize': 'letterpaper',
117-
118117
# The font size ('10pt', '11pt' or '12pt').
119118
#
120119
# 'pointsize': '10pt',
121-
122120
# Additional stuff for the LaTeX preamble.
123121
#
124122
# 'preamble': '',
125-
126123
# Latex figure (float) alignment
127124
#
128125
# 'figure_align': 'htbp',
@@ -132,25 +129,30 @@
132129
# (source start file, target name, title,
133130
# author, documentclass [howto, manual, or own class]).
134131
latex_documents = [
135-
(master_doc, 'ComNetsEmu.tex', 'ComNetsEmu Documentation', 'Zuo Xiang',
136-
'manual'),
132+
(master_doc, "ComNetsEmu.tex", "ComNetsEmu Documentation", "Zuo Xiang", "manual"),
137133
]
138134

139135
# -- Options for manual page output ------------------------------------------
140136

141137
# One entry per manual page. List of tuples
142138
# (source start file, name, description, authors, manual section).
143-
man_pages = [(master_doc, 'comnetsemu', 'ComNetsEmu Documentation', [author],
144-
1)]
139+
man_pages = [(master_doc, "comnetsemu", "ComNetsEmu Documentation", [author], 1)]
145140

146141
# -- Options for Texinfo output ----------------------------------------------
147142

148143
# Grouping the document tree into Texinfo files. List of tuples
149144
# (source start file, target name, title, author,
150145
# dir menu entry, description, category)
151146
texinfo_documents = [
152-
(master_doc, 'ComNetsEmu', 'ComNetsEmu Documentation', author,
153-
'ComNetsEmu', 'One line description of project.', 'Miscellaneous'),
147+
(
148+
master_doc,
149+
"ComNetsEmu",
150+
"ComNetsEmu Documentation",
151+
author,
152+
"ComNetsEmu",
153+
"One line description of project.",
154+
"Miscellaneous",
155+
),
154156
]
155157

156158
# -- Options for Epub output -------------------------------------------------
@@ -168,4 +170,4 @@
168170
# epub_uid = ''
169171

170172
# A list of files that should not be packed into the epub file.
171-
epub_exclude_files = ['search.html']
173+
epub_exclude_files = ["search.html"]

doc/dependencies.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/faq.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
1-
# FAQ #
1+
# FAQ
22

3-
## General Questions ##
3+
## General Questions
44

5-
##### Why not the vanilla Mininet ?
5+
### Why not the vanilla Mininet ?
66

7-
Default Mininet (the latest version) does not support running Docker containers applications directly inside Mininet Host with sufficient network isolation.
8-
ComNetsEmu adds a new node type: DockerHost to deploy internal Docker application containers.
7+
Default Mininet (the latest version) does not support running Docker containers
8+
applications directly inside Mininet Host with sufficient network isolation.
9+
ComNetsEmu adds a new node type: DockerHost to deploy internal Docker
10+
application containers.
911

10-
##### Why not Containernet ?
12+
### Why not Containernet ?
1113

1214
Containernet did a fork (hold all source codes of Mininet in its own Repo) of the Mininet.
1315
New features and fixes from upstream Mininet can not be **merged** into Containernet **directly**.
1416
ComNetsEmu is only an extension of the upstream Mininet:
1517

1618
- Mininet's Python modules are installed with its built-in installer and only used as **dependencies**.
1719

18-
- ComNetsEmu's Python modules only create sub-classes of **essential and minimal** classes of Mininet to add its
19-
features. So Mininet must be installed before installing ComNetsEmu.
20+
- ComNetsEmu's Python modules only create sub-classes of **essential and
21+
minimal** classes of Mininet to add its features.
22+
So Mininet must be installed before installing ComNetsEmu.
2023

21-
- With this development profile, upstream's commits can be updated easily by running the installer's update function.
24+
- With this development profile, upstream's commits can be updated easily by
25+
running the installer's update function.
2226

23-
- ComNetsEmu tries its best to keep the comparability with upstream Mininet. All examples, CLI commands of Mininet
24-
should also work on ComNetsEmu.
27+
- ComNetsEmu tries its best to keep the comparability with upstream Mininet.
28+
All examples, CLI commands of Mininet should also work on ComNetsEmu.
2529

26-
##### Why not Kubernetes(K8s)?
30+
### Why not Kubernetes(K8s)?
2731

2832
For teaching and emulation on a single laptop, K8s is too heavy and complex.
2933
ComNetsEmu can emulate typical K8s setup with more lightweight virtualisation.
30-
And thanks to Mininet, all links on the data plane can be configured with different bandwidth, link losses or transport delay (Use Linux TC utility). It is great for teaching.
34+
And thanks to Mininet, all links on the data plane can be configured with
35+
different bandwidth, link losses or transport delay (Use Linux TC utility).
36+
It is great for teaching.

doc/index.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@
33
but it should at least contain the root `toctree` directive.
44
55
ComNetsEmu's Documentation!
6-
==========================
6+
===========================
77

8-
ComNetsEmu is a tested and network emulator designed for the NFV/SDN teaching book "Computing in Communication Networks: From Theory to Practice".
8+
A virtual emulator/testbed designed for the book:
9+
`Computing in Communication Networks: From Theory to
10+
Practice <https://www.amazon.com/Computing-Communication-Networks-Theory-Practice-ebook/dp/B088ZS597R>`_
911

10-
The design focus on emulating all examples and applications on a single computer, e.g. on a single laptop.
11-
ComNetsEmu extends the famous `Mininet <http://mininet.org/>`_ emulator to support better emulation of versatile NFV/SDN network **applications**.
12+
Check the `README <https://github.com/stevelorenz/comnetsemu/blob/master/README.md>`_ for project description.
13+
14+
This online page is mainly for ComNetsEmu API documentation.
1215

1316
.. toctree::
1417
:maxdepth: 2
1518

1619
api/modules
17-
dependencies
20+
installation
21+
1822
faq
1923
ref_links
24+
roadmap
25+
vm_setup_issues
2026

2127

2228
Indices and tables

0 commit comments

Comments
 (0)