From 5e4471326828141e6800d64e08ad5723fe5676d0 Mon Sep 17 00:00:00 2001 From: Kibae Shin Date: Tue, 5 Nov 2024 08:50:27 +0900 Subject: [PATCH] ci: 1.20.0 release(fix cuda dependency) --- README.md | 4 ++-- deploy/build-docker/build.sh | 18 +++++++++--------- deploy/build-docker/docker-compose.yaml | 4 ++-- deploy/build-docker/linux-cuda12.dockerfile | 8 ++++---- docs/docker.md | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 15c6715..f22b71a 100644 --- a/README.md +++ b/README.md @@ -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.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-cuda12`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda12.dockerfile) amd64(CUDA 12.x, cuDNN 9.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.20.0-linux-cuda11 # or kibae/onnxruntime-server:1.20.0-linux-cpu +DOCKER_IMAGE=kibae/onnxruntime-server:1.20.0-linux-cuda12 # or kibae/onnxruntime-server:1.20.0-linux-cpu docker pull ${DOCKER_IMAGE} diff --git a/deploy/build-docker/build.sh b/deploy/build-docker/build.sh index 8e3a80c..8ddcc6d 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 5530e62..12df14a 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.20.0-linux-cuda11 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda12 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.20.0-linux-cuda11 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda12 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 ac266f6..c78a89f 100644 --- a/deploy/build-docker/linux-cuda12.dockerfile +++ b/deploy/build-docker/linux-cuda12.dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 AS builder +FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 AS builder RUN apt update && apt install -y curl wget git build-essential cmake pkg-config libboost-all-dev libssl-dev RUN mkdir -p /app/source @@ -15,12 +15,12 @@ RUN case ${TARGETPLATFORM} in \ "linux/amd64") ./download-onnxruntime.sh linux x64-gpu ;; \ esac -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 -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 --build build --parallel 4 --target onnxruntime_server_standalone RUN cmake --install build --prefix /app/onnxruntime-server # target -FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04 AS target +FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 AS target COPY --from=builder /app/onnxruntime-server /app COPY --from=builder /usr/local/onnxruntime /usr/local/onnxruntime @@ -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/lib64:/usr/local/onnxruntime/lib +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12/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 119234e..f983414 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -5,7 +5,7 @@ # Supported tags and respective Dockerfile links -- [`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-cuda12`](https://github.com/kibae/onnxruntime-server/blob/main/deploy/build-docker/linux-cuda12.dockerfile) amd64(CUDA 12.x, cuDNN 9.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.20.0-linux-cuda11 # or kibae/onnxruntime-server:1.20.0-linux-cpu +DOCKER_IMAGE=kibae/onnxruntime-server:1.20.0-linux-cuda12 # 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.20.0-linux-cuda11 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda12 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.20.0-linux-cuda11 + image: kibaes/onnxruntime-server:1.20.0-linux-cuda12 ports: - "80:80" # for http backend - "443:443" # for https backend