Step 1 - Building and Uploading the Extension
Go ahead and run the UIP: Build
command
If you inspect the output, you will see two build artifacts were generated:
Anytime the zip_safe
flag in src/extension.yml
is set to false
, both the final extension zip (ue_task-1.0.0-py3.7.zip
) and the platform specific dependency wheel file (ue_task-1.0.0-cp37-cp37-linux_x86_64.whl
) will be generated. The final extension zip actually embeds the wheel file inside it.
The wheel file contains all the dependencies; in this case, that would be the requests
and psutil
module. 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 using a Python 3.7 virtual environment on a Linux x86-64 system.
Now that we have built the Extension, use the UIP: Upload
command to update the Extension on the Controller side:
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 the new build artifact.
Step 2 - Running the Extension
Now that the Extension is updated on the Controller, go ahead and launch the task.
In STDOUT, you should see the output from psutil.test()
If the Extension fails with an import error, ensure
- the
zip_safe
flag was set tofalse
insrc/extension.yml
- the Python interpreter used to launch the Extension matches the wheel file. Inspect the Agent Log to ensure this.