Skip to content

Release Windows

Tom Mitchell edited this page Mar 3, 2017 · 6 revisions

Windows related tickets

This page describes:

  1. Running omni as a Python program on Windows
  2. Converting omni into a native Windows executable
  3. Creating an installer for omni.exe
  4. to do list and future work
  5. attachments (completed installer and scripts)

To recreate the process, everything under used by omni 2.4.2 should work. There was an attempt to update package versions in omni 2.5, and where they differ is noted in the instructions.

Get Omni Working on Windows 7 Pre-Setup VM

Go here Cranking Out the Windows Omni Release if you have have the Windows 7 VM that is already set up using the steps below.

Instructions for installing and running omni on Windows 7

These instructions are for running omni as a Python program on Windows 7

Install required programs and libraries

Most of these libraries/programs have several versions available. Make sure you download and install the one that matches your OS and Python version

Most dependencies mentioned here are cached: http://www.gpolab.bbn.com/internal/projects/gcf/dependencies/

A. Python 2.7 Python

  1. omni 2.4.2 used http://python.org/ftp/python/2.7.5/python-2.7.5.msi
  2. omni 2.5.2 used http://python.org/ftp/python/2.7.6/python-2.7.6.msi

B. M2Crypto M2Crypto

  1. you need to specifically download M2Crypto-0.20.2.win32-py2.7

C. pyOpenSSL pyOpenSSL

  1. omni 2.4.2 used https://launchpad.net/pyopenssl/main/0.11/+download/pyOpenSSL-0.11.winxp32-py2.7.msi
  2. omni 2.5.2 used pip to install pyOpenSSL v0.14 (pip install pyOpenSSL==0.14)

D. swigwin (swig for Windows) swig

  1. omni 2.4.2 extracts into `C:\Program Files\swig" the following http://sourceforge.net/projects/swig/files/swigwin/swigwin-2.0.11/swigwin-2.0.11.zip/download?use_mirror=hivelocity
  2. omni 2.5.2 extracts into `C:\Program Files\swig" the following http://sourceforge.net/projects/swig/files/swigwin/swigwin-2.0.12/swigwin-2.0.12.zip/download?use_mirror=hivelocity
  • winzip or 7-zip http://www.7-zip.org/download.htmlis needed to unzip the swig zip file and the package needs to be moved to C:\Program Files\swig" if you cannot successfully unzip there.

E. OpenSSL http://slproweb.com/products/Win32OpenSSL.html

  1. omni 2.4.2 used BOTH: http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF and http://slproweb.com/download/Win32OpenSSL-1_0_1e.exe
  2. omni 2.5.2 used BOTH: http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF and http://slproweb.com/download/Win32OpenSSL-1_0_1g.exe

F. dateutil python dateutil

  1. omni 2.4.2 used http://labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz
  • after extracting the file into C:\Python27\Lib\site-packages, copy the dateutil folder and paste it into the \Lib\site-packages\ folder in your Python folder (usually C:\Python27\)

G. mkdir C:\tmp

  1. on Windows XP there was an IOError: [Errno 2] No such file or directory: 'C:\\tmp\\sfa.log' when trying to run omni.py (no arguments). The solution was to create C:\tmp

H. Download git http://git-scm.com/download/win

  • Choose: Run from the command prompt

I. Create a .gcf in your local directory. You need to at least configure your user.name and user.email when pulling from git.

J. Clone the geni-tools repository. Make sure you know which branch you should be building.

  • After the initial checkout, it may be necessary to checkout the correct branch i.e. git checkout rel-2.5. Note: I had a lot of trouble with using git from the command line. I ended up resorting to the GUI to get my initial clone checkout to work. And then I could use git from the command line.

    git clone https://github.com/GENI-NSF/geni-tools.git
    

Set Windows Environment Variables

  1. Set PYTHONPATH to C:\gcf\src;C:\gcf\examples C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\gcf\src;C:\gcf\src\omnilib\frameworks\;C:\gcf\src\sfa
  2. Add to PATH: ;C:\Python27;C:\gcf\src;C:\gcf\examples

Omni Quick Start Instructions

Use Omni Quick Start instructions

  1. Download the omni bundle and leave it in the Downloads folder

  2. In the Windows CMD shell, run:

    omni-configure.py
    

i. If there are warnings about your key permissions ignore them and enter your passphrase for your cert when prompted. This generates geni_cert_portal.PEM in the .ssl folder and geni_key_portal and geni_key_portal.pub in .ssh. It should also generate omni-config in .gcf.

Testing omni

Run omni, from the src folder in the gcf install, run

omni.py -h 

The arguments are the same as omni on Unix, e.g.

omni.py createslice myslice

Try running at least

omni.py getusercred
omni.py -a gpo-ig getversion

This ensures that omni can talk to the clearinghouse and at least 1 aggregate manager.

Even better, do a real run of stitcher and then readyToLogin.

Converting omni.py to omni.exe

These instructions are for generating omni.exe using py2exe

This should create a Windows executable that does not require Python to run. However, for the py2exe compilation to work, omni must first be running as a Python program. Once py2exe is run successfully, the dist folder should contain everything needed to run the executable.

Also note: py2exe needs all imports explicit and not on the fly. This should be already changed in the main version of omni.py and you shouldn't have to deal with it. In particular, the following includes need to be explicit (a .* does not work)

import gcf.omnilib.frameworks.framework_apg
import gcf.omnilib.frameworks.framework_base
import gcf.omnilib.frameworks.framework_gcf
import gcf.omnilib.frameworks.framework_gch
import gcf.omnilib.frameworks.framework_gib
import gcf.omnilib.frameworks.framework_of
import gcf.omnilib.frameworks.framework_pg
import gcf.omnilib.frameworks.framework_pgch
import gcf.omnilib.frameworks.framework_sfa
  1. install py2exe py2exe i. omni 2.4.2 used: http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download

  2. In the Windows CMD shell, go to your gcf installation's src folder. From that folder run

    cd gcf/src
    python ..\windows_install\setup.py py2exe
    
  3. This should create two folders in src, dist which is the files to be distributed and that are necessary to run your .exe and build. Test that the executables were created:

    cd dist
    omni.exe -h # should work
    omni-configure.exe -h # should work
    readyToLogin.exe -h # should work
    clear-passphrases.exe -h # should work
    stitcher.exe -h
    addMemberToSliceAndSlivers.exe -h
    
  4. More fully test, particularly if new files have been added to the installer (like config files). For example, use stitcher to reserve a stitched toplogy, then readyToLogin to confirm the resources are ready.

Creating a Windows Installer for Omni Packages

These instructions are for creating a Windows installer for omni.exe - leveraging the work done from below.

Since there is already a package_builder.iss file, the only thing really necessary to do is to run the Inno Setup Tool using the package_builder.iss. The only thing necessary is to install the Inno Setup Tool. A file in gcf/windows_install called, package_builder.iss, is all that is necessary to open in the Inno Tool and then run. This will create on omniTools-rel#-win-rc#-setup.exe, ex omniTools-2.5.3-win-rc4-setup.exe. Updating the field, OutputBaseFilename, in the file is usually all that is necessary unless new files need to be added to the omniTools package.

The other big difference is that Windows 7 has a new notion of running things as sudo, [administrator]. To get the instructions below to work - the ISTool needs to be run as administrator. Running as a regular user does not allow the ISTool to get associated with .iss files. And installation of things is done in the /Users/local_user space instead of in generic system directories. So, the omniTools package will be found in /Users/local_user/gcf/executables as specified by the package_builder.iss file. And setting up the ISTool was not verified when omni 2.5 was built.

Creating a Windows Installer for omni 2.4

These instructions are for creating a Windows installer for omni.exe

I created an installer using Inno Setup, ISTool, and a Windows VB Script that installs Omni and then downloads and installs OpenSSH and OpenSSL for Windows. This uses hardcoded direct links to download OpenSSH and OpenSSL from their respective host sites and may break if those pages are ever taken down.

  1. Download and install Inno Setup and ISTool

    1. Inno Setup

    2. ISTool

    Inno Setup is the program to create a Windows installer, ISTool is a GUI to generate Inno Setup scripts.

  2. Open ISTool to create the Inno Setup script

In Windows 7 and above, ISTool needs to be explicitly run as Administrator. When choosing the app, you have to right-click to ask the program to be run as administrator.

Emily adapted this ISTool tutorial to create the Inno Setup script, which is in git under gcf/windows_install/package_builder.iss. Opening this file in ISTool will allow you to see all the options that were used to make the file.

To sum up the steps to create the script (Note that the latest version of the script is in gcf/windows_install/package_builder.iss):

  1. In ISTools under Preferences select the button "Associated IS Tool with Inno Setup scripts"

  2. Save the blank project as a new Inno Setup Script

  3. Under Project -> Setup Options

    1. Under the Compiler tab, edit the Output Directory to be where the final setup executable will be saved, and the Output Based Filename to be the name of the setup executable

      • Output directory: C:\Program Files\gcf\executables
      • Output base filename: omni-tools-X.X.X-setup (where X.X.X is the version number eg omni-2.4.2-setup)
    2. The name, version and privileges required are set in the Application tab. Also under this tab, BBN may want to add files to the Info Before, Info After, or License area so they are displayed during setup.

      • Application name: Omni
      • Application version: Omni Tools vX.X.X (this should include the "Application Name followed by the version number (e.g. omni v2.4.2))
      • Application copyright: 2010-2013 (where the final year is the present year)
      • Info after file: InfoAfterFile.rtf (found in the gcf/windows_install directory)
      • License file: license.rtf (found in the gcf/windows_install directory)
    3. App Directory tab is where you set the directory the program will be installed into.

      • Create application directory: {pf}\omniTools (where {pf} will generate the Program Files directory)
    4. Under Program Group put Omni Tools as the group name.

      • Default group name: Omni Tools
    5. Pages has options for what steps appear during the installation

  4. Go to the Files and Dirs section in the main ISTool window. Select everything in the dist folder and drag and drop it into this area

  5. Drag and drop the following files to this page as well:

    1. install.vbs
    2. swdev.ico
  6. Configure Icons (add an icon by right clicking and selecting New item...)

    1. Documentation

      • Name: {group}\Documentation
      • Filename: https://github.com/GENI-NSF/geni-tools
      • Comment: omni wiki
    2. Configuration

      • Name: {group}\How To Configure Omni
      • Filename: https://github.com/GENI-NSF/geni-tools/wiki/Omni-Configuration-Automatically
      • Comment: Instructions for configuring omni
    3. Uninstall

      • Project menu -> "Create Uninstall Icon"
  7. Go to the Install Run section

    1. click the New Item icon that looks like a little file with a pen
    2. From the Filename dropdown find install.vbs
    3. Select "Shell execute". This is necessary because the script is not an .exe or .com file
  8. hit ctl+F9 to generate omnisetup.exe

After running omnisetup.exe to install omni, the user should be able to navigate to that folder in the Windows CMD Shell and run omni.exe as they would the python version. By default it is installed in Program Files (x86)\omniTools.