[Ofmfwg] Emulator instructions...

Ahlvers, Richelle richelle.ahlvers at intel.com
Wed May 12 11:45:19 PDT 2021


As noted in my demo - we will be using the Swordfish extensions to the Redfish emulator.  These contains lots of additional schema we are interested in, including Fabrics, storage, and network adapters.
If there are additional object types we need to include, we can discuss and extend.

Here's the basic overview and installation info.

The repository is here: https://github.com/SNIA/Swordfish-API-Emulator

To install from command line: git clone https://github.com/SNIA/Swordfish-API-Emulator

Notes: This can be installed on Windows (either directly, or in a shell environment such as Cygwin), or on Linux.

The current master branch of the Swordfish-API-Emulator will stand up an emulator with an ethernet attached drive as the starting point.  To change this, replace the contents of the "Resources" directory with different mockups.  (Once we have identified and created mockups for the OFMF SC demo, we can create either a container or a repository that has an emulator with this as a starting point to work from.)

Read the directions below for pre-requisites, and run the "setup.sh" script to automatically download, configure, and start the emulator in the ../Swordfish directory.

Let me know where you have questions.

Thanks,
Richelle

________________________________
Prerequisites for the emulator

The Redfish Interface Emulator and the Swordfish API Emulator both require Python 3.5 or higher. If this is not already installed, go to www.python.org<http://www.python.org/> to download and install an appropriate version of Python.

It is recommended (but not required) to run the emulator using virtualenv, because it helps keep the emulator environment separate from other Python environments running on the same system.

________________________________
Installing the Swordfish API Emulator on Windows

The Redfish Interface Emulator must be installed first, and then the Swordfish API Emulator must be installed on top of the Redfish Interface Emulator installation. This can be done on Windows using the sequence of steps given below. The steps for installing the emulator on Linux are similar.

These installation steps assume the following:

  *   The prerequisites for the emulator have been installed.
  *   The emulator is being installed in a folder named Swordfish. (This is only an example for the installation steps given below; the folder can have an arbitrary name and be located anywhere.)
  *   The GitHub code for the Redfish Interface Emulator is in a folder named Redfish-Interface-Emulator.
  *   The GitHub code for the Swordfish API Emulator is in a folder named Swordfish-API-Emulator.

Installation steps:
(1) Create a folder for the emulator.

This folder is where the Redfish Interface Emulator files will be combined with the Swordfish API Emulator files to install the Swordfish emulator. As an example in these instructions, this folder is named Swordfish.

(2) Copy the Redfish Interface Emulator files into the emulator folder.

Using the file explorer, go to the Redfish-Interface-Emulator folder, select and copy all the files using Control-A and Control-C, then go to the Swordfish folder and paste all the files into it using Control-V.

(3) Install the Python packages required by the emulator.

In a command prompt window, install the Python packages required by the emulator by entering the following commands:

pip install flask flask_restful flask_httpauth

pip install requests aniso8601 markupsafe pytz

pip install itsdangerous StringGenerator urllib3

Note that these commands can be copied from this document and pasted directly into the command window.

The Redfish Interface Emulator and its dependencies should now be installed in its default configuration in the Swordfish folder.

(4) Copy the Swordfish API Emulator files into the emulator folder, and allow some of the Redfish Interface Emulator files to be overwritten.

Using the file explorer, go to the Swordfish-API-Emulator folder, select and copy all the files using Control-A and Control-C, then go to the Swordfish folder and paste all the files into it using Control-V.

Windows will indicate that some files in the destination have the same names. Select the Windows "Replace the files in the destination" option.

The Swordfish API Emulator and its dependencies should now be installed in its default configuration in the Swordfish folder.

(5) If desired, a simple test of the Swordish API Emulator installation can now be done by running the emulator and accessing the Redfish service root using a browser.

To run the emulator, open a command window, use cd commands to change to the Swordfish folder, and enter this command:

python emulator.py

Use a browser to access http://localhost:5000/redfish/v1/ on the system where the emulator has been installed. If the emulator is working properly, the Redfish service root should be displayed on the browser, with two additional Swordfish resources added: StorageServices, and StorageSystems.

After this simple installation test, stop the emulator by closing the command prompt window.

The Swordfish API Emulator should now be ready to use in its default configuration.

Running the emulator after it is installed

To run the emulator, open a command window, use cd commands to change to the Swordfish directory, and enter this command:

python emulator.py

To stop the emulator without closing the command prompt window, enter Control-C in the command prompt window. Note that the emulator might not appear to stop until another emulator API access is attempted. A web browser can be used to access the Redfish service root to force this to happen, if no other REST client is readily available.

The emulator can also be stopped by closing the command window.


Richelle Ahlvers

Richelle.ahlvers at intel.com<mailto:Richelle.ahlvers at intel.com>
+1 720-652-5711 (work)
+1 719-659-0166 (cell)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofmfwg/attachments/20210512/83d28ac5/attachment-0001.htm>


More information about the Ofmfwg mailing list