diff --git a/.github/workflows/test-install-script.yml b/.github/workflows/test-install-script.yml index aadab0847890..fd4a9a48d45f 100644 --- a/.github/workflows/test-install-script.yml +++ b/.github/workflows/test-install-script.yml @@ -109,53 +109,28 @@ jobs: - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V - - name: Install deprecated WasmEdge specific release (0.8.2) + - name: Install deprecated WasmEdge specific release (0.9.0) run: | - bash utils/install.sh -v 0.8.2 -D + bash utils/install.sh -v 0.9.0 -D - name: Uninstall WasmEdge run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) with all extensions + - name: Install WasmEdge specific release (0.9.0) with all extensions run: | - bash utils/install.sh -e all -v 0.8.2 -D + bash utils/install.sh -e all -v 0.9.0 -D - name: Install WasmEdge and test for arm extension installation run: | bash utils/install.sh -e all --version=0.9.1-beta.1 \ --tf-version=0.9.1-beta.1 --tf-deps-version=0.9.1-beta.1 --tf-tools-version=0.9.1-beta.1 \ - --image-version=0.9.1-beta.1 --image-deps-version=0.9.1-beta.1 + --image-version=0.9.1-beta.1 - name: Uninstall WasmEdge with all extensions run: | - bash utils/uninstall.sh -q -V - - name: Install wasmedge-image-deps with 0.8.2 - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - if echo "$(bash utils/install.sh -e image -v 0.8.2 --image-version=0.8.2 --image-deps-version=0.8.2 2>&1 | tee output.log)" | grep -qE deps;then echo "Pass: Deps found in 0.8.2";\ - else echo "Failed: Deps not found in 0.8.2" && cat output.log && exit 1; fi; - - name: Uninstall WasmEdge with Image extensions - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - bash utils/uninstall.sh -q -V - - name: Installs wasmedge-image-deps with 0.8.1 - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - echo "$(bash utils/install.sh -e image -v 0.8.1 --image-version=0.8.1 --image-deps-version=0.8.1 2>&1 | tee output.log)" | grep -qE deps && echo "Pass: Deps found in 0.8.1" \ - || (echo "Failed: Deps not found in 0.8.1" && cat output.log && exit 1) - - name: Uninstall WasmEdge with Image extensions - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - bash utils/uninstall.sh -q -V - - name: Don't install wasmedge-image-deps with 0.9.0-rc.1 - run: | - if echo "$(bash utils/install.sh -e image -v 0.9.0-rc.1 --image-version=0.9.0-rc.1 --image-deps-version=0.9.0-rc.1 2>&1 | tee output.log)" | grep -qE deps;then echo "Failed: Deps found in 0.9.0-rc.1" \ - && cat output.log && exit 1; else echo "Pass: Deps not found in 0.9.0-rc.1"; fi; - - name: Uninstall WasmEdge with Image extensions - run: | - bash utils/uninstall.sh -q -V + bash utils/uninstall.sh -q -V - name: Install versions multiple times run: | bash utils/install.sh -e all -D - bash utils/install.sh -e all -v 0.9.0-rc.1 -D - bash utils/install.sh -e all -v 0.8.1 -D + bash utils/install.sh -e all -v 0.9.1 -D + bash utils/install.sh -e all -v 0.9.0 -D - name: Uninstall WasmEdge run: | bash utils/uninstall.sh -q -V @@ -225,15 +200,15 @@ jobs: - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V - - name: Install deprecated WasmEdge specific release (0.8.2) + - name: Install deprecated WasmEdge specific release (0.9.0) run: | - bash utils/install.sh -v 0.8.2 -D + bash utils/install.sh -v 0.9.0 -D - name: Uninstall WasmEdge run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) with all extensions + - name: Install WasmEdge specific release (0.9.0) with all extensions run: | - bash utils/install.sh -e all -v 0.8.2 -D + bash utils/install.sh -e all -v 0.9.0 -D - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V diff --git a/.github/workflows/test-python-install-script.yml b/.github/workflows/test-python-install-script.yml index 9a6daf993bdd..6e0136adda46 100644 --- a/.github/workflows/test-python-install-script.yml +++ b/.github/workflows/test-python-install-script.yml @@ -108,64 +108,31 @@ jobs: - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) + - name: Install WasmEdge specific release (0.9.0) if: ${{ matrix.name != 'manylinux2014 aarch64' }} run: | - ${{ matrix.python2_ex }} utils/install.py -v 0.8.2 -D - ${{ matrix.python3_ex }} utils/install.py -v 0.8.2 -D + ${{ matrix.python2_ex }} utils/install.py -v 0.9.0 -D + ${{ matrix.python3_ex }} utils/install.py -v 0.9.0 -D - name: Uninstall WasmEdge if: ${{ matrix.name != 'manylinux2014 aarch64' }} run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) with all extensions + - name: Install WasmEdge specific release (0.9.0) with all extensions if: ${{ matrix.name != 'manylinux2014 aarch64' }} run: | - ${{ matrix.python2_ex }} utils/install.py -e all -v 0.8.2 -D - ${{ matrix.python3_ex }} utils/install.py -e all -v 0.8.2 -D + ${{ matrix.python2_ex }} utils/install.py -e all -v 0.9.0 -D + ${{ matrix.python3_ex }} utils/install.py -e all -v 0.9.0 -D - name: Install WasmEdge with all extensions compatible with min version for all platforms run: | ${{ matrix.python2_ex }} utils/install.py -e all --version=0.9.1-beta.1 \ --tf-version=0.9.1-beta.1 --tf-deps-version=0.9.1-beta.1 --tf-tools-version=0.9.1-beta.1 \ - --image-version=0.9.1-beta.1 --image-deps-version=0.9.1-beta.1 -D + --image-version=0.9.1-beta.1 -D ${{ matrix.python3_ex }} utils/install.py -e all --version=0.9.1-beta.1 \ --tf-version=0.9.1-beta.1 --tf-deps-version=0.9.1-beta.1 --tf-tools-version=0.9.1-beta.1 \ - --image-version=0.9.1-beta.1 --image-deps-version=0.9.1-beta.1 -D + --image-version=0.9.1-beta.1 -D - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V - - name: Install wasmedge-image-deps with 0.8.2 - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - if echo "$(${{ matrix.python2_ex }} utils/install.py -e image -v 0.8.2 --image-version=0.8.2 --image-deps-version=0.8.2 2>&1 | tee output.log)" | grep -qE deps;then echo "Pass: Deps found in 0.8.2";\ - else echo "Failed: Deps not found in 0.8.2" && cat output.log && exit 1; fi; - if echo "$(${{ matrix.python3_ex }} utils/install.py -e image -v 0.8.2 --image-version=0.8.2 --image-deps-version=0.8.2 2>&1 | tee output.log)" | grep -qE deps;then echo "Pass: Deps found in 0.8.2";\ - else echo "Failed: Deps not found in 0.8.2" && cat output.log && exit 1; fi; - - name: Uninstall WasmEdge with Image extensions - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - bash utils/uninstall.sh -q -V - - name: Installs wasmedge-image-deps with 0.8.1 - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - echo "$(${{ matrix.python2_ex }} utils/install.py -e image -v 0.8.1 --image-version 0.8.1 --image-deps-version 0.8.1 2>&1 | tee output.log)" | grep -qE "Installing image deps" && echo "Pass: Deps found in 0.8.1" \ - || (echo "Failed: Deps not found in 0.8.1" && cat output.log && exit 1) - echo "$(${{ matrix.python3_ex }} utils/install.py -e image -v 0.8.1 --image-version 0.8.1 --image-deps-version 0.8.1 2>&1 | tee output.log)" | grep -qE "Installing image deps" && echo "Pass: Deps found in 0.8.1" \ - || (echo "Failed: Deps not found in 0.8.1" && cat output.log && exit 1) - - name: Uninstall WasmEdge with Image extensions - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - bash utils/uninstall.sh -q -V - - name: Don't install wasmedge-image-deps with 0.9.0-rc.1 - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - if echo "$(${{ matrix.python2_ex }} utils/install.py -e image -v 0.9.0-rc.1 --image-version=0.9.0-rc.1 --image-deps-version=0.9.0-rc.1 2>&1 | tee output.log)" | grep -qE deps;then echo "Failed: Deps found in 0.9.0-rc.1" \ - && cat output.log && exit 1; else echo "Pass: Deps not found in 0.9.0-rc.1"; fi; - if echo "$(${{ matrix.python3_ex }} utils/install.py -e image -v 0.9.0-rc.1 --image-version=0.9.0-rc.1 --image-deps-version=0.9.0-rc.1 2>&1 | tee output.log)" | grep -qE deps;then echo "Failed: Deps found in 0.9.0-rc.1" \ - && cat output.log && exit 1; else echo "Pass: Deps not found in 0.9.0-rc.1"; fi; - - name: Uninstall WasmEdge with Image extensions - if: ${{ matrix.name != 'manylinux2014 aarch64' }} - run: | - bash utils/uninstall.sh -q -V - name: Install versions multiple times run: | ${{ matrix.python2_ex }} utils/install.py -e all -D @@ -223,19 +190,19 @@ jobs: if: ${{ matrix.name == 'Ubuntu 20.04' }} run: | # Multiple plugin download - ${{ matrix.python2_ex }} utils/install.py --plugins wasi_nn-openvino wasi_crypto -D - ls ~/.wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python2_ex }} utils/install.py -p ~/new_wasmedge --plugins wasi_nn-openvino wasi_crypto -D - ls ~/new_wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python2_ex }} utils/install.py -p /usr --plugins wasi_nn-openvino wasi_crypto -D - (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python2_ex }} utils/install.py --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + ls ~/.wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python2_ex }} utils/install.py -p ~/new_wasmedge --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + ls ~/new_wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python2_ex }} utils/install.py -p /usr --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py --plugins wasi_nn-openvino wasi_crypto -D - ls ~/.wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py -p ~/new_wasmedge --plugins wasi_nn-openvino wasi_crypto -D - ls ~/new_wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py -p /usr --plugins wasi_nn-openvino wasi_crypto -D - (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python3_ex }} utils/install.py --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + ls ~/.wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python3_ex }} utils/install.py -p ~/new_wasmedge --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + ls ~/new_wasmedge/plugin/ | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) + ${{ matrix.python3_ex }} utils/install.py -p /usr --plugins wasi_nn-openvino wasi_crypto wasi_nn-pytorch wasi_nn-tensorflowlite wasmedge_httpsreq -D + (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep -E libwasmedgePluginWasiNN.so\|libwasmedgePluginWasiCrypto.so\|libwasmedgePluginHttpsReq.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - name: Externally Specified plugins install check (wrong name)(Ubuntu) if: ${{ matrix.name == 'Ubuntu 20.04' }} @@ -250,18 +217,18 @@ jobs: if: ${{ matrix.name != 'manylinux2014 aarch64' }} run: | # Single plugin download - ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-alpha.1 --plugins wasi_crypto -D + ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-rc.1 --plugins wasi_crypto -D ls ~/.wasmedge/plugin/ | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-alpha.1 -p ~/new_wasmedge --plugins wasi_crypto -D + ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-rc.1 -p ~/new_wasmedge --plugins wasi_crypto -D ls ~/new_wasmedge/plugin/ | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-alpha.1 -p /usr --plugins wasi_crypto -D + ${{ matrix.python2_ex }} utils/install.py -v 0.10.1-rc.1 -p /usr --plugins wasi_crypto -D (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-alpha.1 --plugins wasi_crypto -D + ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-rc.1 --plugins wasi_crypto -D ls ~/.wasmedge/plugin/ | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-alpha.1 -p ~/new_wasmedge --plugins wasi_crypto -D + ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-rc.1 -p ~/new_wasmedge --plugins wasi_crypto -D ls ~/new_wasmedge/plugin/ | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-alpha.1 -p /usr --plugins wasi_crypto -D + ${{ matrix.python3_ex }} utils/install.py -v 0.10.1-rc.1 -p /usr --plugins wasi_crypto -D (ls /usr/lib/wasmedge/; ls /usr/lib/wasmedge/;)2>&1 | grep libwasmedgePluginWasiCrypto.so && echo "Pass: Plugins found" || (echo "Fail: Plugins not found" && exit 1) - name: Check for differences in the installation @@ -303,15 +270,15 @@ jobs: - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) + - name: Install WasmEdge specific release (0.9.0) run: | - python utils/install.py -v 0.8.2 -D + python utils/install.py -v 0.9.0 -D - name: Uninstall WasmEdge run: | bash utils/uninstall.sh -q -V - - name: Install WasmEdge specific release (0.8.2) with all extensions + - name: Install WasmEdge specific release (0.9.0) with all extensions run: | - python utils/install.py -e all -v 0.8.2 -D + python utils/install.py -e all -v 0.9.0 -D - name: Uninstall WasmEdge with all extensions run: | bash utils/uninstall.sh -q -V diff --git a/utils/install.py b/utils/install.py index 7f19745b5d75..eb00dceead58 100644 --- a/utils/install.py +++ b/utils/install.py @@ -9,7 +9,6 @@ with_statement, ) from contextlib import contextmanager -from posixpath import lexists import shutil import sys import argparse @@ -33,17 +32,10 @@ import re import logging -try: - from future_builtins import ascii, filter, hex, map, oct, zip -except: - pass - download_url = None # Define version specific things if sys.version_info[0] == 3: - xrange = range - import urllib.request download_url = urllib.request.urlretrieve @@ -159,9 +151,9 @@ def extract_archive( fname = fname.replace("lib64", "lib", 1) if "Plugin" in fname: if is_default_path(args): - fname = fname.replace("lib64/wasmedge", "plugin").replace( - "lib/wasmedge", "plugin" - ) + fname = join(ipath, "plugin", fname) + else: + fname = join(ipath, CONST_lib_dir, "wasmedge", fname) else: if ipath not in fname: fname = join(ipath, fname) @@ -252,14 +244,14 @@ def compare(self, version2, separator=". |-", ignorecase=True): } SUPPORTED_MIN_VERSION = { - "Linux" + "x86_64": VersionString("0.8.0"), - "Linux" + "amd64": VersionString("0.8.0"), - "Linux" + "arm64": VersionString("0.8.0"), - "Linux" + "armv8": VersionString("0.8.1"), - "Linux" + "aarch64": VersionString("0.8.1"), - "Darwin" + "x86_64": VersionString("0.8.2"), - "Darwin" + "arm64": VersionString("0.8.2"), - "Darwin" + "arm": VersionString("0.8.2"), + "Linux" + "x86_64": VersionString("0.9.0"), + "Linux" + "amd64": VersionString("0.9.0"), + "Linux" + "arm64": VersionString("0.9.0"), + "Linux" + "armv8": VersionString("0.9.0"), + "Linux" + "aarch64": VersionString("0.9.0"), + "Darwin" + "x86_64": VersionString("0.9.0"), + "Darwin" + "arm64": VersionString("0.9.0"), + "Darwin" + "arm": VersionString("0.9.0"), } WASMEDGE = "WasmEdge" @@ -270,19 +262,8 @@ def compare(self, version2, separator=". |-", ignorecase=True): TENSORFLOW_LITE_DEPS = "tensorflow_lite_deps" TENSORFLOW_TOOLS = "tensorflow_tools" IMAGE = "image" -IMAGE_DEPS = "image_deps" EXTENSIONS = [TENSORFLOW, IMAGE] -DEPENDENCIES = { - TENSORFLOW: [ - TENSORFLOW_DEPS, - TENSORFLOW_TOOLS, - ], - IMAGE: [ - IMAGE_DEPS, - ], -} - SUPPORTED_EXTENSIONS = { "Linux" + "x86_64": EXTENSIONS, "Linux" + "amd64": EXTENSIONS, @@ -295,32 +276,33 @@ def compare(self, version2, separator=". |-", ignorecase=True): } SUPPORTED_EXTENSIONS_VERSION = { - "Linux" + "x86_64" + TENSORFLOW: VersionString("0.8.1"), - "Linux" + "x86_64" + IMAGE: VersionString("0.8.1"), - "Linux" + "x86_64" + IMAGE_DEPS: VersionString("0.8.2"), - "Linux" + "amd64" + TENSORFLOW: VersionString("0.8.1"), - "Linux" + "amd64" + IMAGE: VersionString("0.8.1"), - "Linux" + "arm64" + TENSORFLOW: VersionString("0.8.1"), - "Linux" + "arm64" + IMAGE: VersionString("0.8.1"), - "Linux" + "armv8" + TENSORFLOW: VersionString("0.8.1"), - "Linux" + "armv8" + IMAGE: VersionString("0.8.1"), + "Linux" + "x86_64" + TENSORFLOW: VersionString("0.9.0"), + "Linux" + "x86_64" + IMAGE: VersionString("0.9.0"), + "Linux" + "amd64" + TENSORFLOW: VersionString("0.9.0"), + "Linux" + "amd64" + IMAGE: VersionString("0.9.0"), + "Linux" + "arm64" + TENSORFLOW: VersionString("0.9.0"), + "Linux" + "arm64" + IMAGE: VersionString("0.9.0"), + "Linux" + "armv8" + TENSORFLOW: VersionString("0.9.0"), + "Linux" + "armv8" + IMAGE: VersionString("0.9.0"), "Linux" + "aarch64" + TENSORFLOW: VersionString("0.9.1-beta.1"), "Linux" + "aarch64" + IMAGE: VersionString("0.9.1-beta.1"), "Darwin" + "x86_64" + TENSORFLOW: VersionString("0.10.0-alpha.1"), "Darwin" + "x86_64" + IMAGE: VersionString("0.10.0-alpha.1"), "Darwin" + "arm64" + TENSORFLOW: VersionString("0.10.0-alpha.1"), - # "Darwin" + "arm64" + IMAGE: VersionString("0.8.1"), "Darwin" + "arm" + TENSORFLOW: VersionString("0.10.0-alpha.1"), - # "Darwin" + "arm" + IMAGE: VersionString("0.8.1"), } WASI_NN_OPENVINO = "wasi_nn-openvino" WASI_CRYPTO = "wasi_crypto" WASI_NN_PYTORCH = "wasi_nn-pytorch" +WASI_NN_TENSORFLOW_LITE = "wasi_nn-tensorflowlite" +WASMEDGE_HTTPSREQ = "wasmedge_httpsreq" PLUGINS_AVAILABLE = [ WASI_NN_OPENVINO, WASI_CRYPTO, WASI_NN_PYTORCH, + WASI_NN_TENSORFLOW_LITE, + WASMEDGE_HTTPSREQ, ] SUPPORTTED_PLUGINS = { @@ -330,6 +312,17 @@ def compare(self, version2, separator=". |-", ignorecase=True): "manylinux2014" + "arm64" + WASI_CRYPTO: VersionString("0.10.1-rc.1"), "ubuntu20.04" + "x86_64" + WASI_NN_OPENVINO: VersionString("0.10.1-alpha.1"), "ubuntu20.04" + "x86_64" + WASI_NN_PYTORCH: VersionString("0.11.1-alpha.1"), + "manylinux2014" + "x86_64" + WASI_NN_PYTORCH: VersionString("0.11.2-alpha.1"), + "manylinux2014" + + "x86_64" + + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-alpha.1"), + "manylinux2014" + + "aarch64" + + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-alpha.1"), + "ubuntu20.04" + "x86_64" + WASI_NN_TENSORFLOW_LITE: VersionString("0.11.2-rc.1"), + "ubuntu20.04" + "x86_64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"), + "manylinux2014" + "x86_64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"), + "manylinux2014" + "aarch64" + WASMEDGE_HTTPSREQ: VersionString("0.11.1"), } HOME = expanduser("~") @@ -641,168 +634,6 @@ def install_image_extension(args, compat): join(args.path, "bin", file), ) - if compat.prefix() + IMAGE_DEPS in SUPPORTED_EXTENSIONS_VERSION: - if ( - SUPPORTED_EXTENSIONS_VERSION[compat.prefix() + IMAGE_DEPS].compare( - args.image_deps_version - ) - >= 0 - ): - print("Installing image deps") - image_deps_pkg = ( - "WasmEdge-image-deps-" - + args.image_deps_version - + "-" - + "manylinux1_x86_64.tar.gz" - ) - download_url( - CONST_urls[IMAGE_DEPS], join(TEMP_PATH, image_deps_pkg), show_progress - ) - - # Extract archieve - extract_archive( - join(TEMP_PATH, image_deps_pkg), - join(args.path, CONST_lib_dir), - join(TEMP_PATH, "WasmEdge-image-deps"), - env_file_path=CONST_env_path, - remove_finished=True, - ) - - copytree( - join(TEMP_PATH, "WasmEdge-image-deps"), join(args.path, CONST_lib_dir) - ) - - for file in listdir(join(args.path, CONST_lib_dir)): - if ("jpeg" not in file) and ("png" not in file): - continue - try: - # check if it contains any digits - if not any(i.isdigit() for i in file): - continue - if compat.platform == "Linux": - name, version = file.split(CONST_lib_ext, 1) - if version[0] == ".": - version = version[1:] - no_v_env_path = join( - args.path, - CONST_lib_dir, - name + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - no_v_env_path, - ) - single_v_env_path = join( - args.path, - CONST_lib_dir, - name + CONST_lib_ext + "." + version.split(".")[0], - ) - symlink( - join(args.path, CONST_lib_dir, file), - single_v_env_path, - ) - double_v_env_path = join( - args.path, - CONST_lib_dir, - name - + CONST_lib_ext - + "." - + version.split(".")[0] - + "." - + version.split(".")[1], - ) - symlink( - join(args.path, CONST_lib_dir, file), - double_v_env_path, - ) - no_v_png_path = None - if "png16" in name: - no_v_png_path = join( - args.path, - CONST_lib_dir, - name.split("16")[0] + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - no_v_png_path, - ) - elif compat.platform == "Darwin": - name, version = file.split(CONST_lib_ext, 1)[0].split(".", 1) - no_v_env_path = join( - args.path, - CONST_lib_dir, - name + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - no_v_env_path, - ) - single_v_env_path = join( - args.path, - CONST_lib_dir, - name + "." + version.split(".")[0] + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - single_v_env_path, - ) - double_v_env_path = join( - args.path, - CONST_lib_dir, - name - + "." - + version.split(".")[0] - + "." - + version.split(".")[1] - + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - double_v_env_path, - ) - no_v_png_path = None - if "png16" in name: - no_v_png_path = join( - args.path, - CONST_lib_dir, - name.split("16")[0] + CONST_lib_ext, - ) - symlink( - join(args.path, CONST_lib_dir, file), - no_v_png_path, - ) - else: - reraise( - Exception( - "Functionality not implemented for platform {0}".format( - compat.platform - ) - ) - ) - with opened_w_error(CONST_env_path, "a") as env_file: - if env_file is not None: - env_file.write("#" + no_v_env_path + "\n") - logging.debug("Appending:%s", no_v_env_path) - env_file.write("#" + single_v_env_path + "\n") - logging.debug("Appending:%s", single_v_env_path) - env_file.write("#" + double_v_env_path + "\n") - logging.debug("Appending:%s", double_v_env_path) - if no_v_png_path is not None: - env_file.write("#" + no_v_png_path + "\n") - logging.debug("Appending:%s", no_v_png_path) - else: - logging.error( - "Not able to append installed files to env file" - ) - - except Exception as e: - logging.critical(e) - - else: - logging.debug("Image deps not needed: {0}".format(args.image_deps_version)) - else: - logging.debug("Image deps not needed: {0}".format(compat.prefix())) - fix_gnu_sparse(args) return 0 @@ -1152,9 +983,7 @@ def install_plugins(args, compat): continue else: if plugin_version_supplied is None: - plugin_version_supplied = SUPPORTTED_PLUGINS[ - compat.dist + compat.machine + plugin_name - ].version + plugin_version_supplied = args.version elif ( SUPPORTTED_PLUGINS[ compat.dist + compat.machine + plugin_name @@ -1184,7 +1013,7 @@ def install_plugins(args, compat): ) extract_archive( join(TEMP_PATH, "Plugin" + plugin_name + ".tar.gz"), - join(args.path, CONST_lib_dir), + join(args.path), join(TEMP_PATH, "Plugins"), env_file_path=CONST_env_path, remove_finished=True, @@ -1216,9 +1045,6 @@ def set_consts(args, compat): IMAGE: "https://github.com/second-state/WasmEdge-image/releases/download/{0}/WasmEdge-image-{0}-{1}".format( args.image_version, CONST_release_pkg ), - IMAGE_DEPS: "https://github.com/second-state/WasmEdge-image/releases/download/{0}/WasmEdge-image-deps-{0}-{1}".format( - args.image_deps_version, "manylinux1_x86_64.tar.gz" - ), TENSORFLOW_DEPS: "https://github.com/second-state/WasmEdge-tensorflow-deps/releases/download/{0}/WasmEdge-tensorflow-deps-TF-{0}-{1}".format( args.tf_deps_version, CONST_release_pkg ), @@ -1370,9 +1196,9 @@ def __bool__(self): def bool_overload(self): if self.platform not in SUPPORTED_PLATFORM_MACHINE: reraise(Exception("Unsupported platform: {0}".format(self.platform))) - elif self.machine not in SUPPORTED_PLATFORM_MACHINE[self.platform]: + if self.machine not in SUPPORTED_PLATFORM_MACHINE[self.platform]: reraise(Exception("Unsupported machine: {0}".format(self.machine))) - elif self.extensions is not None and len(self.extensions) > 0: + if self.extensions is not None and len(self.extensions) > 0: if not ( set(self.extensions) <= set(SUPPORTED_EXTENSIONS[self.platform + self.machine]) @@ -1385,7 +1211,7 @@ def bool_overload(self): ) ) ) - elif ( + if ( self.version.compare( version2=SUPPORTED_MIN_VERSION[self.platform + self.machine].version ) @@ -1398,6 +1224,17 @@ def bool_overload(self): ) ) ) + + if not get_remote_version_availability( + "WasmEdge/WasmEdge", self.version.version + ): + reraise( + Exception( + "Version {0} does not exist in remote repository of WasmEdge".format( + self.version.version + ) + ) + ) return True def prefix(self): @@ -1632,25 +1469,24 @@ def main(args): default=None, help="Image extension version", ) - parser.add_argument( - "--image-deps-version", - dest="image_deps_version", - required=False, - default=None, - help="Image Deps version", - ) parser.add_argument( "--platform", + "--os", dest="platform", required=False, default=platform.system(), + choices=["Linux", "Darwin"], + type=lambda s: s.title(), help="Platform ex- Linux, Darwin, Windows", ) parser.add_argument( "--machine", + "--arch", dest="machine", required=False, default=platform.machine(), + choices=["x86_64", "aarch64", "arm", "arm64"], + type=lambda s: s.lower(), help="Machine ex- x86_64, aarch64", ) parser.add_argument( @@ -1658,6 +1494,8 @@ def main(args): dest="dist", required=False, default=None, + choices=["ubuntu20.04", "manylinux2014"], + type=lambda s: s.lower(), help="Dist ex- ubuntu20.04,manylinux2014", ) args = parser.parse_args() @@ -1678,8 +1516,5 @@ def main(args): if args.image_version is None: args.image_version = args.version - if args.image_deps_version is None: - args.image_deps_version = args.version - logging.debug("Python Version: %s", sys.version_info) main(args)