Installer Guide
Overview
WasmEdge installer is designed for installing the Core Tools (wasmedge, wasmedge compile), the Libraries (libwasmedge), the Extensions(wasmedge-tensorflow), and the Plugins(wasi-nn, wasi-crytpo).
Dependencies
In the first version of the installer, WasmEdge provides a pure shell script implementation. However, it's not easy to maintain and unsuitable when we want to include the extensions and plugins matrix.
To reduce the maintenance cost and improve the development performance, we decided to move forward to a brand new installer written in python and compatible with both Python 2 and 3.
To be compatible with the old one, we use the same entry point, install.sh.
Usage
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- ${OPTIONS}
Roles
install.sh
The installer entry point.
Process
- Check if the
gitis installed; otherwise, exit with an errorPlease install git. - If
PYTHON_EXECUTABLEis given, try to use$PYTHON_EXECUTABLEto execute theinstall.py. Otherwise, go to step 3. - If
PYTHON_EXECUTABLEis not set,whichcommand is needed to determine the python-X executable. If it is not found installer exits else, it moves on to the next step. - Check if the
python3is installed. If so, go to step 6. Otherwise, go to step 5. - Check if the
python2is installed. If so, go to step 6. Otherwise, go to step 6. - Check if the
pythonis installed. If so, go to step 7. Otherwise, exit with an errorPlease install python or provide python path via $PYTHON_EXECUTABLE. - Print the detected python version
Using Python: $PYTHON_EXECUTABLE. - Download
install.pywithcurlorwget. If the URL ofinstall.pyis unreachable due to a network issue, exit with an error$INSTALL_PY_URL not reachable. If thecurlandwgetare unavailable, exit with an errorcurl or wget could not be found. - Execute the
install.pywith all received arguments.
install.py
The actual installer handles all stuff. It supports python2.7 (not tested on earlier versions) and the latest python versions python3.x.
Options
Help Msg
- Short Option:
-h - Full Option:
--help - Description: Show this help message and exit.
Verbose
- Short Option:
-D - Full Option:
--debug - Description: Enable verbosity debug
Specify the version of WasmEdge to install
- Short Option:
-v VERSION - Full Option:
--version VERSION - Description: Install the given VERSION of WasmEdge
- Available Value: VERSION
{{ wasmedge_version }}or other valid release versions. - Note - If supplied an invalid or nonexistent version, the installer exists with an error.
Installation path
- Short Option:
-p PATH - Full Option:
--path PATH - Description: Install WasmEdge into the given PATH. The default Path is
$HOME/.wasmedge. - Note - Any paths other than the ones starting with
/usrare treated as non-system paths in the internals of the installer. The consequences are different directory structures for both. - Note - If the path not exists, the folder will be created.
Uninstallation
Run uninstaller before installing
- Short Option:
-r {yes,no} - Full Option:
--remove-old {yes, no} - Description: Run the uninstaller script before installing. Default
yes.
Use a specific version of the uninstaller
- Short Option:
-u UNINSTALL_SCRIPT_TAG - Full Option:
--uninstall-script-tag UNINSTALL_SCRIPT_TAG - Description: Use the given GitHub tag to uninstall the script
Install Extensions
- Short Option:
-e [EXTENSIONS [EXTENSIONS ...]] - Full Option:
--extension [EXTENSIONS [EXTENSIONS ...]] - Description: Install wasmedge-extension tools.
- Available Value (case sensitive): Supported Extensions
'tensorflow', 'image', 'all'.
Tensorflow Extensions Library Version
- Full Option:
--tf-version TF_VERSION - Description: Install the given VERSION of the library of the Tensorflow and Tensorflow lite extension. Only available when the
Extensionsis set toallortensorflow. - Note - It's the same as the WasmEdge version if not specified.
Tensorflow Extensions Dependencies Version
- Full Option:
--tf-deps-version TF_DEPS_VERSION - Description: Install the given VERSION of the dependencies of the Tensorflow and Tensorflow lite extension. Only available when the
Extensionsis set toallortensorflow. - Note - It's the same as the WasmEdge version if not specified.
Tensorflow Extensions Tools Version
- Full Option:
--tf-tools-version TF_TOOLS_VERSION - Description: Install the given VERSION of the tools of the Tensorflow and Tensorflow lite extension. Only available when the
Extensionsis set toallortensorflow. - Note - It's the same as the WasmEdge version if not specified.
Image Extensions Version
- Full Option:
--image-version IMAGE_VERSION - Description: Install the given VERSION of the Image extension. Only available when the
Extensionsis set toallorimage. - Note - It's the same as the WasmEdge version if not specified.
Plugins
Note - Currently,
--pluginsis an experimental option.Full Option:
--plugins wasi_crypto:0.12.0Note - The format for this argument is
<plugin_name>:<version_number>.<version_number>is not compulsory. For example,--plugins wasi_cryptois a valid option.Note -
<plugin_name>is cases sensitive. Allowed values are stated here in theRust Cratecolumn. The logic is that the release name should be the same.Note - It's the same as the WasmEdge version if not specified.
DIST
- Full Option:
--dist ubuntu20.04or--dist manylinux2014 - Note - the
ubuntu20.04andmanylinux2014values are case insensitive and only these two are currently supported. - Note - Specifying
--distvalue forDarwinhas no effect. - Note - For
Linuxplatform if the distribution matches exactly asUbuntu 20.04, which is checked usinglsb_releaseand python'splatform.dist()functionality is then set toubuntu20.04if not specified, or it is used without questioning. However different release packages for WasmEdge are available only after0.11.1release, below which there is no effect of specifying this option.
Platform and OS
- Full Option:
--platform PLATFORMor--os OS - Description: Install the given
PLATFORMorOSversion of WasmEdge. This value should be case insensitive to make the maximum compatibility. - Available Value (case insensitive): "Linux", "Darwin", "Windows".
Machine and Arch
- Full Option:
--machine MACHINEor--arch ARCH - Description: Install the
MACHINEorARCHversion of WasmEdge. - Available Value: "x86_64", "aarch64".
Behavior
- If an installation exists at
$HOME/.wasmedge, to be noted as the default installation path, it is removed with or without the uninstaller's invocation. - WasmEdge installation appends all the files it installs to a file which is located in the installer directory named
envwith its path as$INSTALLATION_PATH/env.
Shell and it's configuration
- Source string in shell configuration is given as
. $INSTALLATION_PATH/envso that it exports the necessary environment variables for WasmEdge. - Shell configuration file is appended with source string if it cannot find the source string in that file.
- Currently, it detects only
Bashandzshshells. - If the above shells are found, then their respective configuration files
$HOME/.bashrcand$HOME/.zshrcare updated along with$HOME/.zprofileand$HOME/.bash_profilein the case of Linux. - In the case of
Darwin, only$HOME/.zprofileis updated with the source string.