Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

We wish to completely automate installation of OpenVisualizer. The work in SW-98 provides a standardized setup.py-based install for OpenVisualizer itself. However, we must extend this standardization to OpenVisualizer's requirements. The pip installer provides this capability for Python-based modules, and this page documents how we intend to implement pip per SW-74.

However, as we show below, pip itself usually is not sufficient for a completely automated installation. However, it provides a level of automation that is good enough for our present purposes.

Required Modules

The OpenVisualizer Confluence page lists the required modules. Some modules are Python based, and some are not. This section provides a detailed review.

Python based modules

For all platforms, OpenVisualizer requires these Python-based modules:

  • pyserial – mote communication
  • PyDispatcher – event framework
  • bottle – web application framework

Non-Python modules

Python itself may be required. Windows does not provide Python,  and some Linux distributions include Python more or less by default, depending on how the distribution is installed.

Windows adds other requirements:

  • PyWin32 – Windows extensions for Python
  • TAP for Windows – TUN/TAP local IP interface

In addition, any platform may need a USB serial driver, for example FTDI for TelosB. This requirement is as much a firmware issue as a software issue.

Complete Automation on Windows

So, if pip cannot completely automate installation of OpenVisualizer, let's look at the option to provide a completely automated installation. There are two popular open source packages:

There is a setup.py extension, bdist_nsi, to create an NSIS-based Windows installer. There also is documentation on how to include a nested installer, which is required (I think) for PyWin32 and TAP for WIndows. We could use bdist_nsi to create the initial script, extend it for PyWin32 and TAP, and then create the installer.

There is a similar setup.py extension, python-innosetup, for InnoSetup.

Combined Setup and Requirements via pip

If we don't use a traditional installer program, it is possible to install OpenVisualizer and its requirements via pip with a command like this:

   > pip install openVisualizer

This approach requires that we import setuptools rather than distutils for setup.py. setuptools provides the 'install_requires' argument that allows retrieval of requirements from Pypi. setuptools has some drawbacks, particularly the inability to install to arbitrary locations, which is required for the native install mechanism in SW-98.

Research on this topic showed that Python package installation is still under development. A recent LWN article, Rationalizing Python packaging, describes the current roadmap.

Implementation Plan

We plan to use a distutils-based setup, with the option to use pip to install requirements. Outline:

  1. User downloads OpenVisualizer sdist archive, either from the Confluence wiki or from Pypi.
  2. User extracts the archive.
  3. User installs OpenVisualizer via setup.py:
       > python setup.py install 
  4. User install pip and setuptools if necessary.
  5. User install Python requirements via pip and a requirements file provided in the archive:
       > pip install -r requirements.pip

We do not plan to pursue use of an installer a few reasons:

  • An installer seems well suited to an end-user GUI application. It would be more appropriate once we have a desktop Web UI, particularly for simulation.
  • Our users are pretty technical, and the requirement to install PyWin32 and TAP is not onerous.
  • I have never used these installers, and don't know how much work is required. In contrast, implementation of pip is small and simple.

Given the state of Python package installation tools, we likely will get to a desktop UI installer, but not just yet. (smile)

Better install/requirements documentation

  • Windows vs. Linux installation is now different enough that we need to separately call out the Windows requirements. A separate page for this documentation is worthwhile.
  • The table of requirements should be segmented into runtime vs. development, where development includes SCons, yappi, etc.

Other topics

Reuse requirements.pip

We plan to add any necessary required Python modules to the existing, top-level requirements.pip. This file can be copied to the software/openvisualizer directory for archive creation.

Package Upgrades via pip

pip does support package upgrades. See the usage page.

 

 

  • No labels