Skip to content

Commit

Permalink
Improve Documentation (#153)
Browse files Browse the repository at this point in the history
* partial docstrings in python plugin api

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* added python docstrings in OSPlugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docs for genering plugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docstrings in RuntimePluginFDU interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Fix native plugin when creating run script

* Added docstrings in fimapi

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docstring in pyhton fimapi rest

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* added sphinx documentation generator

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added more structured docs for python api

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* fix doc for fimapi python

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* fix docs for classes inside the plugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added ocaml doc to CLI functions

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added doc build in makefile and instructions in readme

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* partial docstrings in python plugin api

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* added python docstrings in OSPlugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docs for genering plugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docstrings in RuntimePluginFDU interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docstrings in fimapi

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added docstring in pyhton fimapi rest

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* added sphinx documentation generator

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added more structured docs for python api

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* fix doc for fimapi python

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* fix docs for classes inside the plugin interface

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added ocaml doc to CLI functions

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>

* Added doc build in makefile and instructions in readme

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
  • Loading branch information
gabrik committed Oct 24, 2019
1 parent 968b112 commit 5577e17
Show file tree
Hide file tree
Showing 30 changed files with 3,611 additions and 803 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ clean:
sudo rm -rf src/pyhton/fog05.egg-info
sudo rm -rf src/pyhton/build
sudo rm -rf src/pyhton/dist


apidoc:
make -C src/api/python/api doc
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ See [INSTALL](INSTALL.md) for installation instructions

### Interact with the nodes

In the wiki you can find information about:
You can build the Python3 API doc using
```
$ make apidoc
```

- [Python3 API](https://github.com/eclipse/fog05/wiki/fog05-Python-API)

It will be available as html pages from `fog05/src/api/python/api/docs/build/html/index.html`

REST API are under development as well as CLI interface
<!-- - [CLI Interface](https://github.com/eclipse/fog05/wiki/CLI-Interface) -->
Expand All @@ -35,7 +38,7 @@ And take a look to [TODO.md](./TODO.md)
#### Use cases
In this section is possible to find some intresting use cases based on Eclipse fog05.

- Deploy of distributed Machine Learning architectures [Davide-DD/fog05-orchestrator](https://github.com/Davide-DD/fog05-orchestrator)
- Deploy of distributed Machine Learning architectures [Davide-DD/fog05-orchestrator](https://github.com/Davide-DD/fog05-orchestrator)
- VIM for Constrained Devices and ETSI MEC/NFV Converfence [5GCity/5GCity-multi-tier-orchestration](https://github.com/5GCity/5GCity-multi-tier-orchestration)
- Robotic Application Deployment [5GCoral YouTube - UC3M](https://www.youtube.com/watch?v=fyA7UKe494A)
- Edge Computing deployment for VR/AR Applications [InterDigital YouTube](https://www.youtube.com/watch?v=Wb1E4ViOY1s)
Expand Down
4 changes: 2 additions & 2 deletions fos-plugins/LXD/LXD_plugin
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,10 @@ class LXD(RuntimePluginFDU):



def before_migrate_entity_actions(self, fdu_uuid, dst=False):
def before_migrate_entity_actions(self, instance_uuid, dst=False):
pass

def after_migrate_entity_actions(self, fdu_uuid, dst=False):
def after_migrate_entity_actions(self, instance_uuid, dst=False):
pass


Expand Down
5 changes: 1 addition & 4 deletions fos-plugins/linux/linux_plugin
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,6 @@ class Linux(OSPlugin):
def remove_package(self, packages):
self.pm.removePackage(packages)

def get_pid(self, process):
raise NotImplementedError

def get_processor_information(self):
cpu = []
num_cpu = psutil.cpu_count()
Expand Down Expand Up @@ -817,7 +814,7 @@ class Linux(OSPlugin):
inft_conf = {'ipv4_address': ipv4, 'ipv4_netmask': ipv4mask, 'ipv4_gateway': ipv4gateway, 'ipv6_address':
ipv6, 'ipv6_netmask': ipv6mask}

iface_info = {'intf_name': k, 'inft_configuration': inft_conf, 'intf_mac_address': mac, 'intf_speed':
iface_info = {'intf_name': k, 'intf_configuration': inft_conf, 'intf_mac_address': mac, 'intf_speed':
speed, 'type': self.get_intf_type(k).get('result'), 'available': True, 'default_gw': False}
if k == default_gw:
iface_info.update({'available': False})
Expand Down
6 changes: 0 additions & 6 deletions fos-plugins/linuxbridge/linuxbridge_plugin
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,6 @@ class LinuxBridge(NetworkPlugin):
def allocate_bandwidth(self, intf_uuid, bandwidth):
raise NotImplementedError

def assign_interface_to_network(self, network_uuid, intf_uuid):
pass

# eval
def connect_interface_to_connection_point(self, intf_id, cp_id):
Expand Down Expand Up @@ -816,10 +814,6 @@ class LinuxBridge(NetworkPlugin):
return {'result':{'int':cp_id, 'ext':None}}



def remove_interface_from_network(self, network_uuid, intf_uuid):
pass

def delete_virtual_network(self, network_uuid):
self.logger.info('delete_virtual_network()','Deletting {}'.format(network_uuid))
net = self.networks.get(network_uuid, None)
Expand Down
2 changes: 1 addition & 1 deletion src/api/go/fog05-go/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (os *OS) SetInterfaceAvailable(facename string) (bool, error) {
}
}

// Checksum computes the checksum (SHA1SUM) for the given file
// Checksum computes the checksum (SHA256) for the given file
func (os *OS) Checksum(filepath string) (string, error) {
r, err := os.CallOSPluginFunction("checksum", map[string]interface{}{"file_path": filepath})
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion src/api/python/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ all: echo "Nothing to do..."

clean:
rm -rf build dist fog05.egg-info
make -C docs clean

install:
python3 setup.py install
rm -rf build dist fog05.egg-info

uninstall:
pip3 uninstall fog05 -y
pip3 uninstall fog05 -y

doc:
make -C docs html
19 changes: 19 additions & 0 deletions src/api/python/api/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
12 changes: 12 additions & 0 deletions src/api/python/api/docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
============
API
============


Eclipse fog05 API are provided at different levels:

.. toctree::
:maxdepth:1

fimapi
pluginapi
186 changes: 186 additions & 0 deletions src/api/python/api/docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
sys.setrecursionlimit(1500)

# -- Project information -----------------------------------------------------

project = 'fog05'
copyright = '2019, Eclipse Foundation'
author = 'Eclipse Foundation'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.0.1'


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'rinoh.frontend.sphinx',
'numpydoc',
'sphinx_rtd_theme'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Eclipsefog05doc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').

'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').

'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.

'preamble': '',

# Latex figure (float) alignment

'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Eclipsefog05.tex', 'Eclipse fog05 Documentation',
'Eclipse Foundation', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'eclipsefog05', 'Eclipse fog05 Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Eclipsefog05', 'Eclipse fog05 Documentation',
author, 'Eclipsefog05', 'One line description of project.',
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
16 changes: 16 additions & 0 deletions src/api/python/api/docs/source/fdu.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
============
FDU Types
============


Eclipse fog05 FIM Client API


FDU
--------------
.. autoclass:: fog05.interfaces.FDU.FDU

InfraFDU
----------
.. autoclass:: fog05.interfaces.InfraFDU.InfraFDU
:members:
Loading

0 comments on commit 5577e17

Please sign in to comment.