Skip to content

Commit 6c3e1e8

Browse files
authored
Merge pull request #121 from pipeless-ai/build-arm-docker
feat(container): Support Linux ARM image
2 parents 4a6a76a + 466bdc1 commit 6c3e1e8

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The following is a **non-exhaustive** set of relevant features that Pipeless inc
6565

6666
## Requirements ☝️
6767

68-
* Python. Pre-built binaries are linked to Python 3.10 in Linux and 3.12 in macOS. If you have a different Python version, just provide the `--build` flag to the install script (or update your version and use a pre-built binary).
68+
* **Python**. Pre-built binaries are linked to Python 3.10 in Linux amd64, 3.8 in Linux arm64, and 3.12 in macOS. If you have a different Python version, provide the `--build` flag to the install script to build from source so Pipeless links to your installed Python version (or update your version and use a pre-built binary, which is simpler).
6969
* **Gstreamer 1.20.3**. Verify with `gst-launch-1.0 --gst-version`. Installation instructions [here](https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=python)
7070

7171
## Installation 🛠️

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ fail_trap() {
419419
# help provides possible cli installation arguments
420420
help () {
421421
echo "Accepted cli arguments are:"
422-
echo -e "\t[--help|-h ] ->> prints this help"
422+
echo -e "\t[--help|-h ] -> prints this help"
423423
echo -e "\t[--version|-v <desired_version>] . When not defined it fetches the latest release from GitHub"
424424
echo -e "\te.g. --version v1.0.0"
425-
echo -e "\t[--build] ->> Force the build from source"
425+
echo -e "\t[--build] -> Force the build from source"
426426
}
427427

428428
# cleanup temporary files

package/scripts/libpipeless.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pipeless_install_user_python_deps() {
3131

3232
########################
3333
# Install system packages required by the user code to run the worker
34-
# These need to be installed at buildtime
3534
# Globals:
3635
# PIPELESS_*
3736
# Arguments:
@@ -56,7 +55,6 @@ pipeless_install_user_system_deps() {
5655

5756
########################
5857
# Install pipeless
59-
# These need to be installed at buildtime
6058
# Globals:
6159
# PIPELESS_*
6260
# Arguments:
@@ -65,14 +63,42 @@ pipeless_install_user_system_deps() {
6563
# None
6664
#########################
6765
pipeless_install() {
66+
ARCH=$(uname -m)
67+
if [[ "$ARCH" == "aarch64" ]]; then
68+
pipeless_download_onnxruntime_arm
69+
# The cargo build command in the install script will use these to locate the onnxruntime library
70+
export ORT_STRATEGY="system"
71+
export ORT_LIB_LOCATION="${HOME}/.pipeless/"
72+
fi
73+
6874
(
6975
cd /tmp
7076
wget https://raw.githubusercontent.com/pipeless-ai/pipeless/main/install.sh
7177
chmod +x install.sh
78+
# Build Pipeless to ensure it links to the Python version of the image
7279
bash install.sh --build
7380
)
7481
# Cleanup
7582
rm -rf /tmp/*
7683
rm -rf /.rustup/*
7784
rm -rf /.cargo/*
7885
}
86+
87+
########################
88+
# Download onnxruntime libraries for arm from our own S3 bucket since microsoft does not provide gpu flavors for arm
89+
# Globals:
90+
# PIPELESS_*
91+
# Arguments:
92+
# None
93+
# Returns:
94+
# None
95+
#########################
96+
pipeless_download_onnxruntime_arm() {
97+
local -r os_arch="linux-arm64"
98+
local -r version="1.16.3"
99+
wget -P "${HOME}/.pipeless" "https://pipeless-public.s3.eu-west-3.amazonaws.com/onnxruntime/${os_arch}/${version}/libonnxruntime.so.1.16.3"
100+
wget -P "${HOME}/.pipeless" "https://pipeless-public.s3.eu-west-3.amazonaws.com/onnxruntime/${os_arch}/${version}/libonnxruntime_providers_cuda.so"
101+
wget -P "${HOME}/.pipeless" "https://pipeless-public.s3.eu-west-3.amazonaws.com/onnxruntime/${os_arch}/${version}/libonnxruntime_providers_shared.so"
102+
wget -P "${HOME}/.pipeless" "https://pipeless-public.s3.eu-west-3.amazonaws.com/onnxruntime/${os_arch}/${version}/libonnxruntime_providers_tensorrt.so"
103+
wget -P "${HOME}/.pipeless" "https://pipeless-public.s3.eu-west-3.amazonaws.com/onnxruntime/${os_arch}/${version}/libonnxruntime.so"
104+
}

0 commit comments

Comments
 (0)