Skip to content

Commit 33aa258

Browse files
committed
Remove hard-coded openvino version
1 parent 48cc4f1 commit 33aa258

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -43,6 +43,21 @@
4343
),
4444
}
4545

46+
OPENVINO_VERSION_MAP = {
47+
"2023.3.0": (
48+
"2023.3", # OpenVINO short version
49+
"2023.3.0.13775.ceeafaf64f3", # OpenVINO version with build number
50+
),
51+
"2024.0.0": (
52+
"2024.0", # OpenVINO short version
53+
"2024.0.0.14509.34caeefd078", # OpenVINO version with build number
54+
),
55+
"2024.1.0": (
56+
"2024.1", # OpenVINO short version
57+
"2024.1.0.15008.f4afc983258", # OpenVINO version with build number
58+
),
59+
}
60+
4661

4762
def target_platform():
4863
if FLAGS.target_platform is not None:
@@ -127,20 +142,29 @@ def dockerfile_for_linux(output_file):
127142
# Install OpenVINO
128143
ARG ONNXRUNTIME_OPENVINO_VERSION
129144
ENV INTEL_OPENVINO_DIR /opt/intel/openvino_${ONNXRUNTIME_OPENVINO_VERSION}
145+
"""
146+
df += """
147+
ARG OPENVINO_SHORT_VERSION={}
148+
ARG OPENVINO_VERSION_WITH_BUILD_NUMBER={}
149+
""".format(
150+
OPENVINO_VERSION_MAP[FLAGS.ort_openvino][0],
151+
OPENVINO_VERSION_MAP[FLAGS.ort_openvino][1],
152+
)
130153

154+
df += """
131155
# Step 1: Download and install core components
132-
# Ref: https://docs.openvino.ai/2023.3/openvino_docs_install_guides_installing_openvino_from_archive_linux.html#step-1-download-and-install-the-openvino-core-components
133-
RUN curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.3/linux/l_openvino_toolkit_ubuntu22_2023.3.0.13775.ceeafaf64f3_x86_64.tgz --output openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
156+
# Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html#step-1-download-and-install-the-openvino-core-components
157+
RUN curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_SHORT_VERSION}/linux/l_openvino_toolkit_ubuntu22_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64.tgz --output openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
134158
tar -xf openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
135159
mkdir -p ${INTEL_OPENVINO_DIR} && \
136-
mv l_openvino_toolkit_ubuntu22_2023.3.0.13775.ceeafaf64f3_x86_64/* ${INTEL_OPENVINO_DIR} && \
160+
mv l_openvino_toolkit_ubuntu22_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64/* ${INTEL_OPENVINO_DIR} && \
137161
rm openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
138162
(cd ${INTEL_OPENVINO_DIR}/install_dependencies && \
139163
./install_openvino_dependencies.sh -y) && \
140164
ln -s ${INTEL_OPENVINO_DIR} ${INTEL_OPENVINO_DIR}/../openvino_`echo ${ONNXRUNTIME_OPENVINO_VERSION} | awk '{print substr($0,0,4)}'`
141165
142166
# Step 2: Configure the environment
143-
# Ref: https://docs.openvino.ai/2023.3/openvino_docs_install_guides_installing_openvino_from_archive_linux.html#step-2-configure-the-environment
167+
# Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html#step-2-configure-the-environment
144168
ENV InferenceEngine_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
145169
ENV ngraph_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
146170
ENV OpenVINO_DIR=$INTEL_OPENVINO_DIR/runtime/cmake

0 commit comments

Comments
 (0)