diff --git a/.github/actions/download-onnxruntime-osx.sh b/.github/actions/download-onnxruntime-osx.sh new file mode 100755 index 0000000..7548bca --- /dev/null +++ b/.github/actions/download-onnxruntime-osx.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" || exit + +echo +echo "Select onnxruntime version to download:" +RAW_LIST=$(curl -s -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/microsoft/onnxruntime/releases/latest \ + | grep browser_download_url \ + | grep -E "onnxruntime-osx-universal([0-9]?)-([.0-9]+)tgz" \ + | awk '{print $2}' \ + | tr -d '"') + +item=${RAW_LIST[0]} + +FILENAME=$(basename "$item") + +echo +echo "Downloading $item" +echo + +wget -q "$item" + +sudo mkdir -p /usr/local/onnxruntime +sudo tar vzxf "$FILENAME" -C /usr/local/onnxruntime --strip-components=2 + +rm -f "$FILENAME" + +echo +echo "Done" +echo diff --git a/.github/workflows/cmake-macos.yml b/.github/workflows/cmake-macos.yml index 8a52638..d548cd3 100644 --- a/.github/workflows/cmake-macos.yml +++ b/.github/workflows/cmake-macos.yml @@ -31,7 +31,12 @@ jobs: shell: bash run: | brew update - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake onnxruntime boost openssl googletest + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake boost openssl googletest + + - name: Prepare container(onnxruntime) + shell: bash + run: | + ./.github/actions/download-onnxruntime-osx.sh - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. diff --git a/README.md b/README.md index c127885..15c6715 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ONNX Runtime Server -[![ONNX Runtime](https://img.shields.io/github/v/release/microsoft/onnxruntime?filter=v1.19.2&label=ONNX%20Runtime)](https://github.com/microsoft/onnxruntime) +[![ONNX Runtime](https://img.shields.io/github/v/release/microsoft/onnxruntime?filter=v1.20.0&label=ONNX%20Runtime)](https://github.com/microsoft/onnxruntime) [![CMake on Linux](https://github.com/kibae/onnxruntime-server/actions/workflows/cmake-linux.yml/badge.svg)](https://github.com/kibae/onnxruntime-server/actions/workflows/cmake-linux.yml) [![CMake on MacOS](https://github.com/kibae/onnxruntime-server/actions/workflows/cmake-macos.yml/badge.svg)](https://github.com/kibae/onnxruntime-server/actions/workflows/cmake-macos.yml) [![License](https://img.shields.io/github/license/kibae/onnxruntime-server)](https://github.com/kibae/onnxruntime-server/blob/main/LICENSE) @@ -158,11 +158,11 @@ sudo cmake --install build --prefix /usr/local/onnxruntime-server # Docker - Docker hub: [kibaes/onnxruntime-server](https://hub.docker.com/r/kibaes/onnxruntime-server) - - [`1.19.2-linux-cuda12`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda12.dockerfile) amd64(CUDA 12.x, cuDNN 9.x) - - [`1.19.2-linux-cpu`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cpu.dockerfile) amd64, arm64 + - [`1.20.0-linux-cuda11`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda11.dockerfile) amd64(CUDA 11.x, cuDNN 8.x) + - [`1.20.0-linux-cpu`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cpu.dockerfile) amd64, arm64 ```shell -DOCKER_IMAGE=kibae/onnxruntime-server:1.19.2-linux-cuda12 # or kibae/onnxruntime-server:1.19.2-linux-cpu +DOCKER_IMAGE=kibae/onnxruntime-server:1.20.0-linux-cuda11 # or kibae/onnxruntime-server:1.20.0-linux-cpu docker pull ${DOCKER_IMAGE} diff --git a/deploy/build-docker/README.md b/deploy/build-docker/README.md index b2105d5..f161dca 100644 --- a/deploy/build-docker/README.md +++ b/deploy/build-docker/README.md @@ -2,7 +2,7 @@ ## x64 with CUDA -- [ONNX Runtime Binary](https://github.com/microsoft/onnxruntime/releases) v1.19.2(latest) requires CUDA 11/12, cudnn 8. +- [ONNX Runtime Binary](https://github.com/microsoft/onnxruntime/releases) v1.20.0(latest) requires CUDA 11/12, cudnn 8/9. ``` $ ldd libonnxruntime_providers_cuda.so linux-vdso.so.1 (0x00007fffa4bf8000) diff --git a/deploy/build-docker/VERSION b/deploy/build-docker/VERSION index fa5211e..df41292 100644 --- a/deploy/build-docker/VERSION +++ b/deploy/build-docker/VERSION @@ -1,2 +1,2 @@ -export VERSION=1.19.2 +export VERSION=1.20.0 export IMAGE_PREFIX=kibaes/onnxruntime-server diff --git a/deploy/build-docker/build.sh b/deploy/build-docker/build.sh index 8ddcc6d..8e3a80c 100755 --- a/deploy/build-docker/build.sh +++ b/deploy/build-docker/build.sh @@ -29,19 +29,19 @@ if [ "$1" != "--target=cpu" ]; then # | | | | | | | | | | / /_\ \ |______> < | '_ \ |__ _| # | `----.| `--' | | '--' | / _____ \ / . \ | (_) | | | # \______| \______/ |_______/ /__/ \__\ /__/ \__\ \___/ |_| -# POSTFIX=linux-cuda11 -# IMAGE_NAME=${IMAGE_PREFIX}:${VERSION}-${POSTFIX} -# -# docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --load . || exit 1 -# ./deploy/build-docker/docker-image-test.sh ${IMAGE_NAME} 1 || exit 1 -# docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --push . || exit 1 - - - POSTFIX=linux-cuda12 + POSTFIX=linux-cuda11 IMAGE_NAME=${IMAGE_PREFIX}:${VERSION}-${POSTFIX} docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --load . || exit 1 ./deploy/build-docker/docker-image-test.sh ${IMAGE_NAME} 1 || exit 1 docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --push . || exit 1 + + +# POSTFIX=linux-cuda12 +# IMAGE_NAME=${IMAGE_PREFIX}:${VERSION}-${POSTFIX} +# +# docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --load . || exit 1 +# ./deploy/build-docker/docker-image-test.sh ${IMAGE_NAME} 1 || exit 1 +# docker buildx build --platform linux/amd64 -t ${IMAGE_NAME} -f deploy/build-docker/${POSTFIX}.dockerfile --push . || exit 1 fi diff --git a/deploy/build-docker/docker-compose.yaml b/deploy/build-docker/docker-compose.yaml index 995acf1..5530e62 100644 --- a/deploy/build-docker/docker-compose.yaml +++ b/deploy/build-docker/docker-compose.yaml @@ -5,7 +5,7 @@ services: onnxruntime_server_simple: # After the docker container is up, you can use the REST API (http://localhost:8080). # API documentation will be available at http://localhost:8080/api-docs. - image: kibaes/onnxruntime-server:1.19.2-linux-cuda12 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda11 ports: - "8080:80" # for http backend volumes: @@ -29,7 +29,7 @@ services: onnxruntime_server_advanced: # After the docker container is up, you can use the REST API (http://localhost, https://localhost). # API documentation will be available at http://localhost/api-docs. - image: kibaes/onnxruntime-server:1.19.2-linux-cuda12 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda11 ports: - "80:80" # for http backend - "443:443" # for https backend diff --git a/deploy/build-docker/linux-cuda12.dockerfile b/deploy/build-docker/linux-cuda12.dockerfile index 40a450a..ac266f6 100644 --- a/deploy/build-docker/linux-cuda12.dockerfile +++ b/deploy/build-docker/linux-cuda12.dockerfile @@ -15,7 +15,7 @@ RUN case ${TARGETPLATFORM} in \ "linux/amd64") ./download-onnxruntime.sh linux x64-gpu ;; \ esac -RUN cmake -DCUDA_SDK_ROOT_DIR=/usr/local/cuda-12 -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON -B build -S . -DCMAKE_BUILD_TYPE=Release +RUN cmake -DCUDA_SDK_ROOT_DIR=/usr/local/cuda -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON -B build -S . -DCMAKE_BUILD_TYPE=Release RUN cmake --build build --parallel 4 --target onnxruntime_server_standalone RUN cmake --install build --prefix /app/onnxruntime-server @@ -28,5 +28,5 @@ WORKDIR /app RUN mkdir -p models logs certs ENV ONNX_SERVER_CONFIG_PRIORITY=env -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12/lib64:/usr/local/onnxruntime/lib +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/onnxruntime/lib ENTRYPOINT ["/app/bin/onnxruntime_server", "--model-dir", "models", "--log-file", "logs/app.log", "--access-log-file", "logs/access.log", "--tcp-port", "6432", "--http-port", "80"] diff --git a/docs/docker.md b/docs/docker.md index b7f737b..119234e 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -5,8 +5,8 @@ # Supported tags and respective Dockerfile links -- [`1.19.2-linux-cuda12`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda12.dockerfile) amd64(CUDA 12.x, cuDNN 9.x) -- [`1.19.2-linux-cpu`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cpu.dockerfile) amd64, arm64 +- [`1.20.0-linux-cuda11`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda11.dockerfile) amd64(CUDA 11.x, cuDNN 8.x) +- [`1.20.0-linux-cpu`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cpu.dockerfile) amd64, arm64 # How to use this image @@ -28,7 +28,7 @@ - API documentation will be available at http://localhost/api-docs. ```shell -DOCKER_IMAGE=kibae/onnxruntime-server:1.19.2-linux-cuda12 # or kibae/onnxruntime-server:1.19.2-linux-cpu +DOCKER_IMAGE=kibae/onnxruntime-server:1.20.0-linux-cuda11 # or kibae/onnxruntime-server:1.20.0-linux-cpu docker pull ${DOCKER_IMAGE} @@ -69,7 +69,7 @@ services: onnxruntime_server_simple: # After the docker container is up, you can use the REST API (http://localhost:8080). # API documentation will be available at http://localhost:8080/api-docs. - image: kibaes/onnxruntime-server:1.19.2-linux-cuda12 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda11 ports: - "8080:80" # for http backend volumes: @@ -101,7 +101,7 @@ services: onnxruntime_server_advanced: # After the docker container is up, you can use the REST API (http://localhost, https://localhost). # API documentation will be available at http://localhost/api-docs. - image: kibaes/onnxruntime-server:1.19.2-linux-cuda12 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda11 ports: - "80:80" # for http backend - "443:443" # for https backend diff --git a/docs/swagger/openapi.yaml b/docs/swagger/openapi.yaml index 5d9f3ad..4e952ba 100644 --- a/docs/swagger/openapi.yaml +++ b/docs/swagger/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: ONNX Runtime Server description: |- - version: 1.19.2 + version: 1.20.0 externalDocs: description: ONNX Runtime Server url: https://github.com/kibae/onnxruntime-server diff --git a/src/test/test_lib_version.cpp b/src/test/test_lib_version.cpp index 6bcadaa..aa8a649 100644 --- a/src/test/test_lib_version.cpp +++ b/src/test/test_lib_version.cpp @@ -6,5 +6,5 @@ #include "./test_common.hpp" TEST(test_lib_version, LibVersion) { - EXPECT_EQ(onnxruntime_server::onnx::version(), "1.19.2"); + EXPECT_EQ(onnxruntime_server::onnx::version(), "1.20.0"); }