Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The wheel file contains all the dependencies; in this case, that would be the requests and psutil module modules. Furthermore, the wheel file was generated using a Python 3.7.16 virtual environment on a Linux x86-64 machine. As a result, it can run, only if the Extension is running NOT run using a Python 3.7 virtual environment on a Linux x86-64 system, the wheel file will not be used, and the extension may end up failing.

Info

If your Extension supports various Python environments and systems, you must activate the desired virtual environment on the target machine and run the UIP: Build Dependency Wheel Only (or if using only the CLI, run uip build --dep-whl-only) command. Once the dependency wheel file is built, copy it to the dist/dep folder on the Extension development environment. For instance, the Extension above targets Python 3.7.16 on Linux x86-64. If you wish to target Python 3.7.16 on Windows:

  1. activate the Python 3.7.16 virtual environment on Windows
  2. replicate the Extension development environment
  3. Run uip build --dep-whl-only. This should create a wheel file in dist/dep folder
  4. Copy the dist/dep/<wheel file> to the Linux x86-64 Extension development environment
  5. On the Linux x86-64 system, run uip build again to embed the wheel file in the final extension zip

Now that we have built the Extension, use the UIP: Upload command to update the Extension on the Controller side:

...

Note

If you run into issues uploading the Extension because of size limitations, make sure to adjust

  • OMS Maximum Message Size using the MAX_MSG_SIZE configuration option
  • Universal Template Extension Maximum Bytes Controller Property (See doc for more details)

Alternatively, the UIP: Push command could also have been used, but Build + Upload approach was used to point out highlight the new build artifact.

Step 2 - Running the Extension

...

In STDOUT, you should see the output from psutil.test()

Info

If the Extension fails with an import error, ensure

  • the zip_safe flag was set to false in src/extension.yml
  • the Python interpreter used to launch the Extension matches the wheel file. Inspect the Agent Log to ensure this.

< Previous     Next >