holoscan-cli 2.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holoscan_cli/__init__.py +35 -0
- holoscan_cli/__main__.py +164 -0
- holoscan_cli/common/argparse_types.py +156 -0
- holoscan_cli/common/artifact_sources.py +160 -0
- holoscan_cli/common/constants.py +119 -0
- holoscan_cli/common/dockerutils.py +521 -0
- holoscan_cli/common/enum_types.py +49 -0
- holoscan_cli/common/exceptions.py +126 -0
- holoscan_cli/common/sdk_utils.py +195 -0
- holoscan_cli/common/utils.py +137 -0
- holoscan_cli/logging.json +37 -0
- holoscan_cli/nics/__init__.py +15 -0
- holoscan_cli/nics/nics.py +33 -0
- holoscan_cli/package-source.json +32 -0
- holoscan_cli/packager/__init__.py +15 -0
- holoscan_cli/packager/arguments.py +148 -0
- holoscan_cli/packager/config_reader.py +180 -0
- holoscan_cli/packager/container_builder.py +426 -0
- holoscan_cli/packager/manifest_files.py +217 -0
- holoscan_cli/packager/models.py +90 -0
- holoscan_cli/packager/package_command.py +197 -0
- holoscan_cli/packager/packager.py +124 -0
- holoscan_cli/packager/parameters.py +603 -0
- holoscan_cli/packager/platforms.py +426 -0
- holoscan_cli/packager/templates/Dockerfile.jinja2 +479 -0
- holoscan_cli/packager/templates/dockerignore +92 -0
- holoscan_cli/packager/templates/tools.sh +414 -0
- holoscan_cli/py.typed +14 -0
- holoscan_cli/runner/__init__.py +15 -0
- holoscan_cli/runner/resources.py +185 -0
- holoscan_cli/runner/run_command.py +207 -0
- holoscan_cli/runner/runner.py +340 -0
- holoscan_cli/version/__init__.py +15 -0
- holoscan_cli/version/version.py +53 -0
- holoscan_cli-2.9.0.dist-info/LICENSE +201 -0
- holoscan_cli-2.9.0.dist-info/METADATA +102 -0
- holoscan_cli-2.9.0.dist-info/RECORD +39 -0
- holoscan_cli-2.9.0.dist-info/WHEEL +4 -0
- holoscan_cli-2.9.0.dist-info/entry_points.txt +4 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
{#
|
|
2
|
+
SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
#}
|
|
17
|
+
|
|
18
|
+
ARG GPU_TYPE=dgpu
|
|
19
|
+
|
|
20
|
+
{% if application_type == 'CppCMake' %}
|
|
21
|
+
# Build C++ application in the builder stage
|
|
22
|
+
FROM {{ build_image }} AS builder
|
|
23
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
24
|
+
|
|
25
|
+
RUN apt-get update && \
|
|
26
|
+
apt-get install -y --no-install-recommends jq
|
|
27
|
+
|
|
28
|
+
WORKDIR /src
|
|
29
|
+
COPY ./app/* /src
|
|
30
|
+
|
|
31
|
+
RUN mkdir -p /install/.cmake/api/v1/query/ && \
|
|
32
|
+
touch /install/.cmake/api/v1/query/codemodel-v2
|
|
33
|
+
RUN cd /src && \
|
|
34
|
+
cmake -S . -DHOLOHUB_DOWNLOAD_DATASETS=OFF {{ cmake_args }} -B /install && \
|
|
35
|
+
cmake --build /install -j && \
|
|
36
|
+
export OUTNAME=$(cat $(find /install/.cmake/api/v1/reply -type f | xargs grep -l "nameOnDisk") | jq -r '.nameOnDisk') && \
|
|
37
|
+
cd /install && \
|
|
38
|
+
if [ "${OUTNAME}" != "{{ command_filename }}" ]; then mv ./${OUTNAME} ./{{ command_filename }}; fi
|
|
39
|
+
|
|
40
|
+
RUN rm /install/CMakeCache.txt /install/Makefile /install/cmake_install.cmake && \
|
|
41
|
+
rm -r /install/CMakeFiles/ /install/.cmake/
|
|
42
|
+
{% endif %}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
FROM {{ base_image }} AS base
|
|
47
|
+
|
|
48
|
+
RUN apt-get update \
|
|
49
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
50
|
+
curl \
|
|
51
|
+
jq \
|
|
52
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
53
|
+
|
|
54
|
+
{% if 'torch' in includes %}
|
|
55
|
+
# Collect torch dependencies: libtorch, torchvision
|
|
56
|
+
FROM base AS torch-dependencies
|
|
57
|
+
|
|
58
|
+
ARG GPU_TYPE
|
|
59
|
+
ARG TORCHVISION_VERSION=0.20.0_24.08
|
|
60
|
+
ARG LIBTORCH_VERSION=2.5.0_24.08
|
|
61
|
+
|
|
62
|
+
# Install openmpi
|
|
63
|
+
RUN apt update && \
|
|
64
|
+
apt-get install -y --no-install-recommends --no-install-suggests \
|
|
65
|
+
bzip2 \
|
|
66
|
+
libopenmpi3=4.1.2-* \
|
|
67
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
68
|
+
|
|
69
|
+
# Download libtorch
|
|
70
|
+
WORKDIR /opt/libtorch/
|
|
71
|
+
RUN ARCH={{ target_arch }} && if [ "$ARCH" = "aarch64" ]; then ARCH="aarch64-${GPU_TYPE}"; fi && \
|
|
72
|
+
curl -S -# -o libtorch.tgz -L \
|
|
73
|
+
https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/libtorch/libtorch-${LIBTORCH_VERSION}-${ARCH}.tar.gz
|
|
74
|
+
RUN mkdir -p ${LIBTORCH_VERSION} && \
|
|
75
|
+
tar -xf libtorch.tgz -C ${LIBTORCH_VERSION} --strip-components 1 && \
|
|
76
|
+
rm -f libtorch.tgz && \
|
|
77
|
+
find . -type f -name "*Config.cmake" -exec sed -i '/kineto/d' {} +
|
|
78
|
+
|
|
79
|
+
# Download torchvision
|
|
80
|
+
WORKDIR /opt/torchvision/
|
|
81
|
+
RUN ARCH={{ target_arch }} && if [ "$ARCH" = "aarch64" ]; then ARCH="aarch64-${GPU_TYPE}"; fi && \
|
|
82
|
+
curl -S -# -o torchvision.tgz -L \
|
|
83
|
+
https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/torchvision/torchvision-${TORCHVISION_VERSION}-${ARCH}.tar.gz
|
|
84
|
+
RUN mkdir -p ${TORCHVISION_VERSION}
|
|
85
|
+
RUN tar -xf torchvision.tgz -C ${TORCHVISION_VERSION} --strip-components 1 && \
|
|
86
|
+
rm -f torchvision.tgz
|
|
87
|
+
|
|
88
|
+
# Download HPCX for libucc.so.1
|
|
89
|
+
WORKDIR /opt/hpcx
|
|
90
|
+
RUN curl -S -# -o hpcx.tbz -L \
|
|
91
|
+
https://www.mellanox.com/downloads/hpc/hpc-x/v2.15/hpcx-v2.15-gcc-inbox-ubuntu22.04-cuda12-gdrcopy2-nccl2.17-{{target_arch}}.tbz && \
|
|
92
|
+
tar -xvjf hpcx.tbz hpcx-v2.15-gcc-inbox-ubuntu22.04-cuda12-gdrcopy2-nccl2.17-{{target_arch}}/ucc/lib/libucc.so.1.0.0 && \
|
|
93
|
+
rm -f hpcx.tbz && \
|
|
94
|
+
find . -name libucc.so.1.0.0 -exec mv -f {} /opt/hpcx/libucc.so.1 \;
|
|
95
|
+
|
|
96
|
+
# End collect torch dependencies
|
|
97
|
+
{% endif %}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
{% if 'onnx' in includes %}
|
|
101
|
+
# Collect onnx dependencies
|
|
102
|
+
FROM base AS onnx-dependencies
|
|
103
|
+
ARG GPU_TYPE
|
|
104
|
+
ARG ONNX_RUNTIME_VERSION=1.18.1_38712740_24.08-cuda-12.6
|
|
105
|
+
|
|
106
|
+
WORKDIR /opt/onnxruntime
|
|
107
|
+
|
|
108
|
+
# Download onnx binaries
|
|
109
|
+
RUN curl -S -L -# -o ort.tar.gz \
|
|
110
|
+
https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-$(uname -m).tar.gz
|
|
111
|
+
RUN mkdir -p ${ONNX_RUNTIME_VERSION}
|
|
112
|
+
RUN ls -l && tar -xvzf ort.tar.gz -C ${ONNX_RUNTIME_VERSION} --strip-components 2 && \
|
|
113
|
+
rm -f ort.tar.gz
|
|
114
|
+
WORKDIR /
|
|
115
|
+
# End collect onnx dependencies
|
|
116
|
+
{% endif %}
|
|
117
|
+
|
|
118
|
+
# FROM base AS mofed-installer
|
|
119
|
+
# ARG MOFED_VERSION=23.10-2.1.3.1
|
|
120
|
+
|
|
121
|
+
# # In a container, we only need to install the user space libraries, though the drivers are still
|
|
122
|
+
# # needed on the host.
|
|
123
|
+
# # Note: MOFED's installation is not easily portable, so we can't copy the output of this stage
|
|
124
|
+
# # to our final stage, but must inherit from it. For that reason, we keep track of the build/install
|
|
125
|
+
# # only dependencies in the `MOFED_DEPS` variable (parsing the output of `--check-deps-only`) to
|
|
126
|
+
# # remove them in that same layer, to ensure they are not propagated in the final image.
|
|
127
|
+
# WORKDIR /opt/nvidia/mofed
|
|
128
|
+
# ARG MOFED_INSTALL_FLAGS="--dpdk --with-mft --user-space-only --force --without-fw-update"
|
|
129
|
+
# RUN UBUNTU_VERSION=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2) \
|
|
130
|
+
# && OFED_PACKAGE="MLNX_OFED_LINUX-${MOFED_VERSION}-ubuntu${UBUNTU_VERSION}-$(uname -m)" \
|
|
131
|
+
# && curl -S -# -o ${OFED_PACKAGE}.tgz -L \
|
|
132
|
+
# https://www.mellanox.com/downloads/ofed/MLNX_OFED-${MOFED_VERSION}/${OFED_PACKAGE}.tgz \
|
|
133
|
+
# && tar xf ${OFED_PACKAGE}.tgz \
|
|
134
|
+
# && MOFED_INSTALLER=$(find . -name mlnxofedinstall -type f -executable -print) \
|
|
135
|
+
# && MOFED_DEPS=$(${MOFED_INSTALLER} ${MOFED_INSTALL_FLAGS} --check-deps-only 2>/dev/null | tail -n1 | cut -d' ' -f3-) \
|
|
136
|
+
# && apt-get update \
|
|
137
|
+
# && apt-get install --no-install-recommends -y ${MOFED_DEPS} \
|
|
138
|
+
# && ${MOFED_INSTALLER} ${MOFED_INSTALL_FLAGS} \
|
|
139
|
+
# && rm -r * \
|
|
140
|
+
# && apt-get remove -y ${MOFED_DEPS} && apt-get autoremove -y \
|
|
141
|
+
# && rm -rf /var/lib/apt/lists/*
|
|
142
|
+
|
|
143
|
+
FROM base AS release
|
|
144
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
145
|
+
ENV TERM=xterm-256color
|
|
146
|
+
|
|
147
|
+
ARG GPU_TYPE
|
|
148
|
+
ARG UNAME
|
|
149
|
+
ARG UID
|
|
150
|
+
ARG GID
|
|
151
|
+
|
|
152
|
+
RUN mkdir -p /etc/holoscan/ \
|
|
153
|
+
&& mkdir -p /opt/holoscan/ \
|
|
154
|
+
&& mkdir -p {{ working_dir }} \
|
|
155
|
+
&& mkdir -p {{ app_dir }} \
|
|
156
|
+
&& mkdir -p {{ full_input_path }} \
|
|
157
|
+
&& mkdir -p {{ full_output_path }}
|
|
158
|
+
|
|
159
|
+
LABEL base="{{ base_image }}"
|
|
160
|
+
LABEL tag="{{ tag }}"
|
|
161
|
+
LABEL org.opencontainers.image.title="{{ title }}"
|
|
162
|
+
LABEL org.opencontainers.image.version="{{ version }}"
|
|
163
|
+
LABEL org.nvidia.holoscan="{{ holoscan_sdk_version }}"
|
|
164
|
+
|
|
165
|
+
{% if sdk_type == 'monai-deploy' %}
|
|
166
|
+
LABEL org.monai.deploy.app-sdk="{{ monai_deploy_app_sdk_version }}"
|
|
167
|
+
{% endif %}
|
|
168
|
+
|
|
169
|
+
ENV HOLOSCAN_INPUT_PATH={{ full_input_path }}
|
|
170
|
+
ENV HOLOSCAN_OUTPUT_PATH={{ full_output_path }}
|
|
171
|
+
ENV HOLOSCAN_WORKDIR={{ working_dir }}
|
|
172
|
+
ENV HOLOSCAN_APPLICATION={{ app_dir }}
|
|
173
|
+
ENV HOLOSCAN_TIMEOUT={{ timeout }}
|
|
174
|
+
ENV HOLOSCAN_MODEL_PATH={{ models_dir }}
|
|
175
|
+
ENV HOLOSCAN_DOCS_PATH={{ docs_dir }}
|
|
176
|
+
ENV HOLOSCAN_CONFIG_PATH={{ config_file_path }}
|
|
177
|
+
ENV HOLOSCAN_APP_MANIFEST_PATH={{ app_json }}
|
|
178
|
+
ENV HOLOSCAN_PKG_MANIFEST_PATH={{ pkg_json }}
|
|
179
|
+
ENV HOLOSCAN_LOGS_PATH={{ logs_dir }}
|
|
180
|
+
ENV HOLOSCAN_VERSION={{ holoscan_sdk_version }}
|
|
181
|
+
|
|
182
|
+
{% if 'debug' in includes %}
|
|
183
|
+
# Install debugging tools
|
|
184
|
+
RUN apt-get update \
|
|
185
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
186
|
+
build-essential \
|
|
187
|
+
ccache \
|
|
188
|
+
gdb \
|
|
189
|
+
strace \
|
|
190
|
+
sudo \
|
|
191
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
192
|
+
### End install debugging tools
|
|
193
|
+
{% endif %}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
{% if 'holoviz' in includes %}
|
|
197
|
+
# Install Holoviz dependencies
|
|
198
|
+
RUN apt-get update \
|
|
199
|
+
&& apt-get install --no-install-recommends --no-install-suggests --allow-downgrades --allow-change-held-packages -y \
|
|
200
|
+
libvulkan1="1.3.204.1-*" \
|
|
201
|
+
# X11 support \
|
|
202
|
+
libgl1="1.4.0-*" \
|
|
203
|
+
# Wayland support \
|
|
204
|
+
libwayland-client0="1.20.0-*" \
|
|
205
|
+
libwayland-egl1="1.20.0-*" \
|
|
206
|
+
libxkbcommon0="1.4.0-*" \
|
|
207
|
+
libdecor-0-plugin-1-cairo="0.1.0-*" \
|
|
208
|
+
libegl1="1.4.0-*" \
|
|
209
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
210
|
+
# End install Holoviz dependencies
|
|
211
|
+
{% endif %}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
{% if 'torch' in includes %}
|
|
215
|
+
# Install torch dependencies
|
|
216
|
+
ENV PYTHON_VERSION=3.10.6-1~22.04
|
|
217
|
+
ENV PYTHON_PIP_VERSION=22.0.2+dfsg-*
|
|
218
|
+
|
|
219
|
+
RUN apt update \
|
|
220
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
221
|
+
python3-minimal=${PYTHON_VERSION} \
|
|
222
|
+
libpython3-stdlib=${PYTHON_VERSION} \
|
|
223
|
+
python3=${PYTHON_VERSION} \
|
|
224
|
+
python3-venv=${PYTHON_VERSION} \
|
|
225
|
+
python3-pip=${PYTHON_PIP_VERSION} \
|
|
226
|
+
libjpeg-turbo8="2.1.2-*" \
|
|
227
|
+
libnuma1="2.0.14-*" \
|
|
228
|
+
libhwloc15="2.7.0-*" \
|
|
229
|
+
libopenblas0="0.3.20+ds-*" \
|
|
230
|
+
libevent-core-2.1-7 \
|
|
231
|
+
libevent-pthreads-2.1-7 \
|
|
232
|
+
cuda-cupti-12-6 \
|
|
233
|
+
libcudnn9-cuda-12 \
|
|
234
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
235
|
+
|
|
236
|
+
# Install NVIDIA Performance Libraries on arm64 dGPU platform
|
|
237
|
+
# as a runtime requirement for the Holoinfer `libtorch` backend (2.5.0).
|
|
238
|
+
{% if target_arch == "aarch64" and gpu_type == "dgpu" %}
|
|
239
|
+
RUN curl -L https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/cuda-keyring_1.1-1_all.deb -O \
|
|
240
|
+
&& dpkg -i cuda-keyring_1.1-1_all.deb \
|
|
241
|
+
&& apt-get update \
|
|
242
|
+
&& apt-get install --no-install-recommends -y \
|
|
243
|
+
nvpl-blas=0.2.0.1-* \
|
|
244
|
+
nvpl-lapack=0.2.2.1-* \
|
|
245
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
246
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/sbsa-linux-gnu/
|
|
247
|
+
{% endif %}
|
|
248
|
+
|
|
249
|
+
# mkl - dependency for libtorch plugin on x86_64 (match pytorch container version)
|
|
250
|
+
RUN if [ "{{ cuda_deb_arch }}" = "x86_64" ]; then \
|
|
251
|
+
python3 -m pip install --no-cache-dir \
|
|
252
|
+
mkl==2021.1.1 \
|
|
253
|
+
&& \
|
|
254
|
+
# Clean up duplicate libraries from mkl/tbb python wheel install which makes copies for symlinks.
|
|
255
|
+
# Only keep the *.so.X libs, remove the *.so and *.so.X.Y libs
|
|
256
|
+
# This can be removed once upgrading to an MKL pip wheel that fixes the symlinks
|
|
257
|
+
find /usr/local/lib -maxdepth 1 -type f -regex '.*\/lib\(tbb\|mkl\).*\.so\(\.[0-9]+\.[0-9]+\)?' -exec rm -v {} +; \
|
|
258
|
+
fi
|
|
259
|
+
|
|
260
|
+
# Copy Libtorch
|
|
261
|
+
ARG LIBTORCH_VERSION=2.5.0_24.08
|
|
262
|
+
ENV LIBTORCH=/opt/libtorch/${LIBTORCH_VERSION}/lib
|
|
263
|
+
COPY --from=torch-dependencies ${LIBTORCH} ${LIBTORCH}
|
|
264
|
+
|
|
265
|
+
# Copy TorchVision
|
|
266
|
+
ARG TORCHVISION_VERSION=0.20.0_24.08
|
|
267
|
+
ENV TORCHVISION=/opt/torchvision/${TORCHVISION_VERSION}/lib
|
|
268
|
+
COPY --from=torch-dependencies ${TORCHVISION} ${TORCHVISION}
|
|
269
|
+
|
|
270
|
+
ENV HPCX=/opt/hpcx/lib
|
|
271
|
+
COPY --from=torch-dependencies /opt/hpcx/libucc.so.1 ${LIBTORCH}/libucc.so.1
|
|
272
|
+
COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libmpi.so.40 ${LIBTORCH}/libmpi.so.40
|
|
273
|
+
COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libopen-rte.so.40 ${LIBTORCH}/libopen-rte.so.40
|
|
274
|
+
COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libopen-pal.so.40 ${LIBTORCH}/libopen-pal.so.40
|
|
275
|
+
|
|
276
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIBTORCH}:${TORCHVISION}:${HPCX}
|
|
277
|
+
WORKDIR /
|
|
278
|
+
### End install torch dependencies
|
|
279
|
+
{% endif %}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
{% if 'onnx' in includes %}
|
|
283
|
+
# Install onnx dependencies
|
|
284
|
+
ARG ONNX_RUNTIME_VERSION=1.18.1_38712740_24.08-cuda-12.6
|
|
285
|
+
ENV ONNX_RUNTIME=/opt/onnxruntime/${ONNX_RUNTIME_VERSION}/lib
|
|
286
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${ONNX_RUNTIME}
|
|
287
|
+
|
|
288
|
+
# Copy ONNX Runtime
|
|
289
|
+
COPY --from=onnx-dependencies ${ONNX_RUNTIME} ${ONNX_RUNTIME}
|
|
290
|
+
|
|
291
|
+
{% if gpu_type == "dgpu" %}
|
|
292
|
+
RUN apt-get update \
|
|
293
|
+
&& apt-get install --no-install-recommends --no-install-suggests --allow-downgrades -y \
|
|
294
|
+
libnvinfer10="10.3.*+cuda12.5" \
|
|
295
|
+
libnvinfer-plugin10="10.3.*+cuda12.5" \
|
|
296
|
+
libnvonnxparsers10="10.3.*+cuda12.5" \
|
|
297
|
+
libcusparselt0="0.6.3.2-*" \
|
|
298
|
+
libcudnn9-cuda-12 \
|
|
299
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
300
|
+
&& rm -f /usr/lib/*/libcudnn*train.so*
|
|
301
|
+
{% endif %}
|
|
302
|
+
### End install onnx dependencies
|
|
303
|
+
{% endif %}
|
|
304
|
+
|
|
305
|
+
{% if health_probe is defined %}
|
|
306
|
+
# Install gRPC health probe
|
|
307
|
+
RUN curl -L -o /bin/grpc_health_probe {{ health_probe | pprint }} \
|
|
308
|
+
&& chmod +x /bin/grpc_health_probe && ls -l /bin/grpc_health_probe
|
|
309
|
+
|
|
310
|
+
HEALTHCHECK --interval=10s --timeout=1s \
|
|
311
|
+
CMD /bin/grpc_health_probe -addr=:8765 || exit 1
|
|
312
|
+
|
|
313
|
+
# End install gRPC health probe
|
|
314
|
+
{% endif %}
|
|
315
|
+
|
|
316
|
+
{% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
|
|
317
|
+
{% if not 'torch' in includes %}
|
|
318
|
+
# If torch is installed, we can skip installing Python
|
|
319
|
+
ENV PYTHON_VERSION=3.10.6-1~22.04
|
|
320
|
+
ENV PYTHON_PIP_VERSION=22.0.2+dfsg-*
|
|
321
|
+
|
|
322
|
+
RUN apt update \
|
|
323
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
324
|
+
python3-minimal=${PYTHON_VERSION} \
|
|
325
|
+
libpython3-stdlib=${PYTHON_VERSION} \
|
|
326
|
+
python3=${PYTHON_VERSION} \
|
|
327
|
+
python3-venv=${PYTHON_VERSION} \
|
|
328
|
+
python3-pip=${PYTHON_PIP_VERSION} \
|
|
329
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
330
|
+
{% endif %}
|
|
331
|
+
|
|
332
|
+
{% if holoscan_deb_arch == "arm64" %}
|
|
333
|
+
# Requires python3-dev on aarch64
|
|
334
|
+
RUN apt update \
|
|
335
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
336
|
+
gcc \
|
|
337
|
+
python3-dev \
|
|
338
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
339
|
+
{% endif %}
|
|
340
|
+
|
|
341
|
+
{% endif %}
|
|
342
|
+
|
|
343
|
+
{% if application_type == 'CppCMake' or application_type == 'Binary' %}
|
|
344
|
+
|
|
345
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nvidia/holoscan/lib
|
|
346
|
+
|
|
347
|
+
# Update NV GPG repo key
|
|
348
|
+
# https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
|
|
349
|
+
RUN curl -OL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/{{ cuda_deb_arch }}/cuda-keyring_1.1-1_all.deb \
|
|
350
|
+
&& dpkg -i cuda-keyring_1.1-1_all.deb \
|
|
351
|
+
&& rm -f cuda-keyring_1.1-1_all.deb \
|
|
352
|
+
&& apt-get update
|
|
353
|
+
|
|
354
|
+
RUN if [ "{{ holoscan_deb_arch }}" = "arm64" ]; then \
|
|
355
|
+
GDR_REPO_ARCH=aarch64 ; \
|
|
356
|
+
else \
|
|
357
|
+
GDR_REPO_ARCH=x64 ; \
|
|
358
|
+
fi \
|
|
359
|
+
&& curl -O https://developer.download.nvidia.com/compute/redist/gdrcopy/CUDA%2012.2/ubuntu22_04/${GDR_REPO_ARCH}/libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb \
|
|
360
|
+
&& dpkg -i libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb \
|
|
361
|
+
&& rm -f libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb
|
|
362
|
+
|
|
363
|
+
{% if custom_holoscan_sdk == True %}
|
|
364
|
+
|
|
365
|
+
# Use user-specified Holoscan SDK Debian Package
|
|
366
|
+
COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
|
|
367
|
+
RUN apt-get install -y --no-install-recommends --no-install-suggests \
|
|
368
|
+
/tmp/{{ holoscan_sdk_filename }} \
|
|
369
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
370
|
+
|
|
371
|
+
{% else %}
|
|
372
|
+
|
|
373
|
+
# Install Holoscan SDK from NVIDIA APT repository
|
|
374
|
+
# Holoscan: available versions (https://pypi.org/project/holoscan/#history)
|
|
375
|
+
RUN apt-get install -y --no-install-recommends --no-install-suggests \
|
|
376
|
+
holoscan={{ holoscan_sdk_filename }} \
|
|
377
|
+
# && apt-get remove -y g++ g++-11 gcc gcc-11 gcc-11-base build-essential \
|
|
378
|
+
&& apt-get purge -y cuda-keyring \
|
|
379
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
380
|
+
|
|
381
|
+
{% endif %}
|
|
382
|
+
|
|
383
|
+
{% endif %}
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
{% if holoscan_deb_arch == "arm64" %}
|
|
387
|
+
# Requires libnuma on aarch64
|
|
388
|
+
RUN apt update \
|
|
389
|
+
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
|
390
|
+
libnuma1="2.0.14-*" \
|
|
391
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
392
|
+
{% endif %}
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
RUN groupadd -f -g $GID $UNAME
|
|
396
|
+
RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME
|
|
397
|
+
RUN chown -R holoscan {{ working_dir }} && \
|
|
398
|
+
chown -R holoscan {{ full_input_path }} && \
|
|
399
|
+
chown -R holoscan {{ full_output_path }}
|
|
400
|
+
|
|
401
|
+
# Set the working directory
|
|
402
|
+
WORKDIR {{ working_dir }}
|
|
403
|
+
|
|
404
|
+
# Copy HAP/MAP tool script
|
|
405
|
+
COPY ./tools {{ working_dir }}/tools
|
|
406
|
+
RUN chmod +x {{ working_dir }}/tools
|
|
407
|
+
|
|
408
|
+
# Set the working directory
|
|
409
|
+
WORKDIR {{ working_dir }}
|
|
410
|
+
|
|
411
|
+
USER $UNAME
|
|
412
|
+
|
|
413
|
+
ENV PATH=/home/${UNAME}/.local/bin:/opt/nvidia/holoscan/bin:$PATH
|
|
414
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/${UNAME}/.local/lib/python3.10/site-packages/holoscan/lib
|
|
415
|
+
|
|
416
|
+
{% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
|
|
417
|
+
COPY ./pip/requirements.txt /tmp/requirements.txt
|
|
418
|
+
|
|
419
|
+
RUN pip install --upgrade pip
|
|
420
|
+
RUN pip install --no-cache-dir --user -r /tmp/requirements.txt
|
|
421
|
+
|
|
422
|
+
{% if sdk_type == 'holoscan' %}
|
|
423
|
+
# Install Holoscan SDK
|
|
424
|
+
|
|
425
|
+
{% if custom_holoscan_sdk == True %}
|
|
426
|
+
# Copy user-specified Holoscan SDK wheel file
|
|
427
|
+
COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
|
|
428
|
+
RUN pip install /tmp/{{ holoscan_sdk_filename }}
|
|
429
|
+
|
|
430
|
+
{% else %}
|
|
431
|
+
# Install Holoscan SDK wheel from PyPI
|
|
432
|
+
RUN pip install holoscan=={{holoscan_sdk_filename}}
|
|
433
|
+
{% endif %}
|
|
434
|
+
{% else %}
|
|
435
|
+
|
|
436
|
+
# Install MONAI Deploy App SDK
|
|
437
|
+
{% if custom_monai_deploy_sdk == True %}
|
|
438
|
+
# Copy user-specified MONAI Deploy SDK file
|
|
439
|
+
COPY ./{{ monai_deploy_sdk_filename }} /tmp/{{ monai_deploy_sdk_filename }}
|
|
440
|
+
RUN pip install /tmp/{{ monai_deploy_sdk_filename }}
|
|
441
|
+
{% else %}
|
|
442
|
+
|
|
443
|
+
# Install MONAI Deploy from PyPI org
|
|
444
|
+
RUN pip install monai-deploy-app-sdk=={{ monai_deploy_app_sdk_version }}
|
|
445
|
+
|
|
446
|
+
{% endif %}
|
|
447
|
+
{% endif %}
|
|
448
|
+
{% endif %}
|
|
449
|
+
|
|
450
|
+
{% if models is defined %}
|
|
451
|
+
COPY ./models {{ models_dir }}
|
|
452
|
+
{% endif %}
|
|
453
|
+
|
|
454
|
+
{% if docs is defined %}
|
|
455
|
+
COPY ./docs {{ docs_dir }}
|
|
456
|
+
{% endif %}
|
|
457
|
+
|
|
458
|
+
COPY ./map/app.json {{ app_json }}
|
|
459
|
+
COPY ./app.config {{ config_file_path }}
|
|
460
|
+
COPY ./map/pkg.json {{ pkg_json }}
|
|
461
|
+
|
|
462
|
+
{% if application_type == 'CppCMake' %}
|
|
463
|
+
COPY --from=builder /install {{ app_dir }}
|
|
464
|
+
{% else %}
|
|
465
|
+
COPY ./app {{ app_dir }}
|
|
466
|
+
{% endif %}
|
|
467
|
+
|
|
468
|
+
{% if additional_lib_paths != '' %}
|
|
469
|
+
|
|
470
|
+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ additional_lib_paths }}:{{ lib_dir }}
|
|
471
|
+
COPY ./lib {{ lib_dir }}
|
|
472
|
+
|
|
473
|
+
{% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
|
|
474
|
+
ENV PYTHONPATH=$PYTHONPATH:{{ additional_lib_paths }}:{{ lib_dir }}
|
|
475
|
+
{% endif %}
|
|
476
|
+
|
|
477
|
+
{% endif %}
|
|
478
|
+
|
|
479
|
+
ENTRYPOINT ["/var/holoscan/tools"]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
# Git
|
|
16
|
+
**/.git
|
|
17
|
+
**/.gitignore
|
|
18
|
+
**/.gitconfig
|
|
19
|
+
|
|
20
|
+
# CI
|
|
21
|
+
**/.codeclimate.yml
|
|
22
|
+
**/.travis.yml
|
|
23
|
+
**/.taskcluster.yml
|
|
24
|
+
|
|
25
|
+
# Docker
|
|
26
|
+
**/docker-compose.yml
|
|
27
|
+
**/.docker
|
|
28
|
+
|
|
29
|
+
# Byte-compiled/optimized/DLL files for Python
|
|
30
|
+
**/__pycache__
|
|
31
|
+
**/*.pyc
|
|
32
|
+
**/.Python
|
|
33
|
+
**/*$py.class
|
|
34
|
+
|
|
35
|
+
# Conda folders
|
|
36
|
+
**/.conda
|
|
37
|
+
**/conda-bld
|
|
38
|
+
|
|
39
|
+
# Distribution / packaging
|
|
40
|
+
**/.Python
|
|
41
|
+
**/.cmake
|
|
42
|
+
**/cmake-build*/
|
|
43
|
+
**/build-*/
|
|
44
|
+
**/develop-eggs/
|
|
45
|
+
**/.eggs/
|
|
46
|
+
**/sdist/
|
|
47
|
+
**/wheels/
|
|
48
|
+
**/*.egg-info/
|
|
49
|
+
**/.installed.cfg
|
|
50
|
+
**/*.egg
|
|
51
|
+
**/MANIFEST
|
|
52
|
+
|
|
53
|
+
# PyInstaller
|
|
54
|
+
# Usually these files are written by a python script from a template
|
|
55
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
56
|
+
**/*.manifest
|
|
57
|
+
**/*.spec
|
|
58
|
+
|
|
59
|
+
# Installer logs
|
|
60
|
+
**/pip-log.txt
|
|
61
|
+
**/pip-delete-this-directory.txt
|
|
62
|
+
|
|
63
|
+
# Unit test / coverage reports
|
|
64
|
+
**/htmlcov/
|
|
65
|
+
**/.tox/
|
|
66
|
+
**/.coverage
|
|
67
|
+
**/.coverage.*
|
|
68
|
+
**/.cache
|
|
69
|
+
**/nosetests.xml
|
|
70
|
+
**/coverage.xml
|
|
71
|
+
**/*.cover
|
|
72
|
+
**/*.log
|
|
73
|
+
**/.hypothesis/
|
|
74
|
+
**/.pytest_cache/
|
|
75
|
+
|
|
76
|
+
# mypy
|
|
77
|
+
**/.mypy_cache/
|
|
78
|
+
|
|
79
|
+
## VSCode IDE
|
|
80
|
+
**/.vscode
|
|
81
|
+
|
|
82
|
+
# Jupyter Notebook
|
|
83
|
+
**/.ipynb_checkpoints
|
|
84
|
+
|
|
85
|
+
# Environments
|
|
86
|
+
**/.env
|
|
87
|
+
**/.venv
|
|
88
|
+
**/env/
|
|
89
|
+
**/venv/
|
|
90
|
+
**/ENV/
|
|
91
|
+
**/env.bak/
|
|
92
|
+
**/venv.bak/
|