Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GCC and remove the dependency on GCC8's experimental std::filesystem implementation #20893

Merged
merged 9 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose build type: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 8)
message(FATAL_ERROR "GCC version must be greater than or equal to 8")
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
message(FATAL_ERROR "GCC version must be greater than or equal to 9")
endif()

# Options
@@ -1300,12 +1300,6 @@ if (onnxruntime_USE_TVM)
list(APPEND onnxruntime_EXTERNAL_DEPENDENCIES tvm)
endif()

# needs to link with stdc++fs in Linux
if (UNIX AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
set(FS_STDLIB stdc++fs)
endif()
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${FS_STDLIB})

# onnxruntime-extensions
if (onnxruntime_USE_EXTENSIONS)
include(extensions)
@@ -1474,16 +1468,6 @@ if (onnxruntime_USE_CUDA)
endif()
endif()

if (onnxruntime_USE_TENSORRT)
# needs to link with stdc++fs in Linux
if (UNIX)
if (NOT APPLE)
set(FS_STDLIB stdc++fs)
endif()
endif()
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${FS_STDLIB})
endif()

if (onnxruntime_USE_MIGRAPHX)
if (WIN32)
message(FATAL_ERROR "MIGraphX does not support build in Windows!")
2 changes: 1 addition & 1 deletion cmake/onnxruntime_providers_migraphx.cmake
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
target_compile_options(onnxruntime_providers_migraphx PRIVATE -Wno-error=sign-compare)
set_property(TARGET onnxruntime_providers_migraphx APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
set_property(TARGET onnxruntime_providers_migraphx APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/migraphx/version_script.lds -Xlinker --gc-sections")
target_link_libraries(onnxruntime_providers_migraphx PRIVATE nsync::nsync_cpp stdc++fs)
target_link_libraries(onnxruntime_providers_migraphx PRIVATE nsync::nsync_cpp)

include(CheckLibraryExists)
check_library_exists(migraphx::c "migraphx_program_run_async" "/opt/rocm/migraphx/lib" HAS_STREAM_SYNC)
2 changes: 1 addition & 1 deletion cmake/onnxruntime_providers_tensorrt.cmake
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@
elseif(UNIX)
set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/tensorrt/version_script.lds -Xlinker --gc-sections")
target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync::nsync_cpp stdc++fs)
target_link_libraries(onnxruntime_providers_tensorrt PRIVATE nsync::nsync_cpp)
elseif(WIN32)
set_property(TARGET onnxruntime_providers_tensorrt APPEND_STRING PROPERTY LINK_FLAGS "-DEF:${ONNXRUNTIME_ROOT}/core/providers/tensorrt/symbols.def")
else()
Original file line number Diff line number Diff line change
@@ -8,15 +8,14 @@
#include <sstream>
#include <iostream>
#include <filesystem>
#include <experimental/filesystem>
#include "flatbuffers/idl.h"
#include "ort_trt_int8_cal_table.fbs.h"
#include <NvInferVersion.h>
#include "core/providers/cuda/cuda_pch.h"
#include "core/common/path_string.h"
#include "core/framework/murmurhash3.h"

namespace fs = std::experimental::filesystem;
namespace fs = std::filesystem;

namespace onnxruntime {

Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ resources:
variables:
- template: templates/common-variables.yml
- name: docker_base_image
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
- name: linux_trt_version
value: 10.0.1.6-1.cuda11.8
- name: Repository
Original file line number Diff line number Diff line change
@@ -48,9 +48,9 @@ parameters:
variables:
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240531.1

- name: Repository
${{ if eq(parameters.CudaVersion, '11.8') }}:
Original file line number Diff line number Diff line change
@@ -38,9 +38,9 @@ parameters:
variables:
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240531.1
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ stages:
machine_pool: 'Onnxruntime-Linux-GPU'
python_wheel_suffix: '_gpu'
timeout: 480
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
trt_version: '10.0.1.6-1.cuda11.8'
cuda_version: '11.8'

Original file line number Diff line number Diff line change
@@ -141,9 +141,9 @@ stages:
value: false
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240530.3
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240531.1
timeoutInMinutes: 60

steps:
Original file line number Diff line number Diff line change
@@ -26,20 +26,14 @@ stages:
value: '12'
- name: CUDA_VERSION
value: ${{ parameters.CudaVersion }}
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
steps:
- template: ../templates/set-version-number-variables-step.yml
- template: ../templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}
DockerBuildArgs: "
--build-arg BUILD_UID=$( id -u )
--build-arg BASEIMAGE=${{ parameters.docker_base_image }}
"
Repository: onnxruntimecuda${{ variables.CUDA_VERSION_MAJOR }}build

@@ -89,21 +83,15 @@ stages:
value: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: 10.0.1.6-1.cuda12.4
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
steps:
- checkout: self
clean: true
submodules: recursive
- template: ../templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}
DockerBuildArgs: "
--build-arg BASEIMAGE=${{ variables.docker_base_image }}
--build-arg TRT_VERSION=${{ variables.linux_trt_version }}
--build-arg BUILD_UID=$( id -u )
"
@@ -164,11 +152,6 @@ stages:
value: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: 10.0.1.6-1.cuda12.4
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
steps:
- checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime
submodules: false
@@ -182,8 +165,8 @@ stages:
- template: ../templates/get-docker-image-steps.yml
parameters:
ScriptName: $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/get_docker_image.py
Dockerfile: $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/github/linux/docker/inference/x86_64/default/gpu/Dockerfile
Context: $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/github/linux/docker/inference/x86_64/default/gpu
Dockerfile: $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile
Context: $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}
DockerBuildArgs: "--build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }} --build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecuda${{ variables.CUDA_VERSION_MAJOR }}xtrt86build
UpdateDepsTxt: false
Original file line number Diff line number Diff line change
@@ -78,8 +78,8 @@ stages:
cmake_build_type: ${{ parameters.cmake_build_type }}
cuda_version: ${{ parameters.cuda_version }}
${{ if eq(parameters.cuda_version, '11.8') }}:
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
trt_version: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.cuda_version, '12.2') }}:
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240530.3
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240531.1
trt_version: 10.0.1.6-1.cuda12.4
Original file line number Diff line number Diff line change
@@ -472,7 +472,7 @@ stages:
parameters:
arch: 'x86_64'
machine_pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
extra_build_arg: ${{ parameters.build_py_parameters }}
cmake_build_type: ${{ parameters.cmake_build_type }}
trt_version: '10.0.1.6-1.cuda11.8'
2 changes: 1 addition & 1 deletion tools/ci_build/github/linux/docker/Dockerfile.aten_cpu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240531.1

ADD scripts /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/manylinux/install_centos.sh && /tmp/scripts/manylinux/install_deps_aten.sh && rm -rf /tmp/scripts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240531.1

ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20240531.1
ARG PYTHON_VERSION=3.9
ARG TORCH_VERSION=2.0.0
ARG OPSET_VERSION=17
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12:20240531.1

ARG PYTHON_VERSION=3.9
ARG TORCH_VERSION=2.1.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc12:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc12:20240531.1

ADD scripts /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
# Licensed under the MIT License.

# This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline
ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8
FROM $BASEIMAGE
ARG TRT_VERSION
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11_dotnet:20240531.1

ARG TRT_VERSION
RUN rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm && dnf install -y msopenjdk-11
#Install TensorRT only if TRT_VERSION is not empty
RUN if [ -n "$TRT_VERSION" ]; then \
echo "TRT_VERSION is $TRT_VERSION" && \
@@ -31,13 +31,13 @@ else \
echo "TRT_VERSION is none skipping Tensor RT Installation" ; \
fi

ENV PATH /usr/lib/jvm/msopenjdk-11/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH /usr/lib/jvm/msopenjdk-11/bin:$PATH
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11

ENV CUDAHOSTCXX /opt/rh/gcc-toolset-11/root/usr/bin/g++
ADD scripts /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts

ARG BUILD_UID=1001
ARG BUILD_USER=onnxruntimedev
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@ mkdir -p /tmp/src
cd /tmp/src

echo "Installing cmake"
GetFile https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-`uname -m`.tar.gz /tmp/src/cmake-3.26.3-linux-`uname -m`.tar.gz
tar -zxf /tmp/src/cmake-3.26.3-linux-`uname -m`.tar.gz --strip=1 -C /usr
GetFile https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-`uname -m`.tar.gz /tmp/src/cmake-3.29.3-linux-`uname -m`.tar.gz
tar -zxf /tmp/src/cmake-3.29.3-linux-`uname -m`.tar.gz --strip=1 -C /usr

echo "Installing Ninja"
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12_dotnet:20240531.1
ARG TRT_VERSION

#Install TensorRT only if TRT_VERSION is not empty
RUN if [ -n "$TRT_VERSION" ]; then \
echo "TRT_VERSION is $TRT_VERSION" && \
dnf -y install \
libnvinfer10-${TRT_VERSION} \
libnvinfer-headers-devel-${TRT_VERSION} \
libnvinfer-devel-${TRT_VERSION} \
libnvinfer-lean10-${TRT_VERSION} \
libnvonnxparsers10-${TRT_VERSION} \
libnvonnxparsers-devel-${TRT_VERSION} \
libnvinfer-dispatch10-${TRT_VERSION} \
libnvinfer-plugin10-${TRT_VERSION} \
libnvinfer-vc-plugin10-${TRT_VERSION} \
libnvinfer-bin-${TRT_VERSION} \
libnvinfer-plugin10-${TRT_VERSION} \
libnvinfer-plugin-devel-${TRT_VERSION} \
libnvinfer-vc-plugin-devel-${TRT_VERSION} \
libnvinfer-lean-devel-${TRT_VERSION} \
libnvinfer-dispatch-devel-${TRT_VERSION} \
libnvinfer-headers-plugin-devel-${TRT_VERSION} && \
dnf clean dbcache ; \
else \
echo "TRT_VERSION is none skipping Tensor RT Installation" ; \
fi



ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

ENV CUDAHOSTCXX /opt/rh/gcc-toolset-12/root/usr/bin/g++
ADD scripts /tmp/scripts
RUN sed -i 's/enabled\s*=\s*1/enabled = 1\nexclude=dotnet* aspnet* netstandard*/g' /etc/yum.repos.d/ubi.repo && \
rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm && dnf install -y msopenjdk-11 && cd /tmp/scripts && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts
ENV PATH /usr/lib/jvm/msopenjdk-11/bin:$PATH
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11
ARG BUILD_UID=1001
ARG BUILD_USER=onnxruntimedev
RUN adduser --uid $BUILD_UID $BUILD_USER
WORKDIR /home/$BUILD_USER
USER $BUILD_USER
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash
set -e -x

# Download a file from internet
function GetFile {
local uri=$1
local path=$2
local force=${3:-false}
local download_retries=${4:-5}
local retry_wait_time_seconds=${5:-30}

if [[ -f $path ]]; then
if [[ $force = false ]]; then
echo "File '$path' already exists. Skipping download"
return 0
else
rm -rf $path

Check warning on line 17 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:17:14: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi
fi

if [[ -f $uri ]]; then
echo "'$uri' is a file path, copying file to '$path'"
cp $uri $path

Check warning on line 23 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:23:8: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check warning on line 23 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:23:13: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
return $?
fi

echo "Downloading $uri"
# Use aria2c if available, otherwise use curl
if command -v aria2c > /dev/null; then
aria2c -q -d $(dirname $path) -o $(basename $path) "$uri"

Check warning on line 30 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Quote this to prevent word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:30:18: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)

Check warning on line 30 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:30:28: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check warning on line 30 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Quote this to prevent word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:30:38: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)

Check warning on line 30 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:30:49: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
else
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail

Check warning on line 32 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:32:30: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check warning on line 32 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:32:62: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi

return $?
}
mkdir -p /tmp/src

cd /tmp/src

echo "Installing cmake"
GetFile https://github.com/Kitware/CMake/releases/download/v3.29.3/cmake-3.29.3-linux-`uname -m`.tar.gz /tmp/src/cmake-3.29.3-linux-`uname -m`.tar.gz

Check warning on line 42 in tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Quote this to prevent word splitting. Raw Output: ./tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/scripts/install_deps.sh:42:87: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)
tar -zxf /tmp/src/cmake-3.29.3-linux-`uname -m`.tar.gz --strip=1 -C /usr

echo "Installing Ninja"
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
tar -zxf ninja-linux.tar.gz
pushd ninja-1.10.0
cmake -Bbuild-cmake -H.
cmake --build build-cmake
mv ./build-cmake/ninja /usr/bin
popd

echo "Installing Node.js"
CPU_ARCH=`uname -m`
if [[ "$CPU_ARCH" = "x86_64" ]]; then
NODEJS_ARCH=x64
elif [[ "$CPU_ARCH" = "aarch64" ]]; then
NODEJS_ARCH=arm64
else
NODEJS_ARCH=$CPU_ARCH
fi
# The EOL for nodejs v18.17.1 LTS is April 2025
GetFile https://nodejs.org/dist/v18.17.1/node-v18.17.1-linux-${NODEJS_ARCH}.tar.gz /tmp/src/node-v18.17.1-linux-${NODEJS_ARCH}.tar.gz
tar --strip 1 -xf /tmp/src/node-v18.17.1-linux-${NODEJS_ARCH}.tar.gz -C /usr

cd /
rm -rf /tmp/src

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240530.3
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc12:20240531.1

ADD scripts /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts