holoscan 2.1.0__cp38-cp38-manylinux_2_35_aarch64.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.
Files changed (138) hide show
  1. holoscan-2.1.0.data/purelib/holoscan/__init__.py +121 -0
  2. holoscan-2.1.0.data/purelib/holoscan/cli/__init__.py +32 -0
  3. holoscan-2.1.0.data/purelib/holoscan/cli/__main__.py +159 -0
  4. holoscan-2.1.0.data/purelib/holoscan/cli/common/argparse_types.py +154 -0
  5. holoscan-2.1.0.data/purelib/holoscan/cli/common/artifact_sources.py +144 -0
  6. holoscan-2.1.0.data/purelib/holoscan/cli/common/constants.py +120 -0
  7. holoscan-2.1.0.data/purelib/holoscan/cli/common/dockerutils.py +506 -0
  8. holoscan-2.1.0.data/purelib/holoscan/cli/common/enum_types.py +52 -0
  9. holoscan-2.1.0.data/purelib/holoscan/cli/common/exceptions.py +132 -0
  10. holoscan-2.1.0.data/purelib/holoscan/cli/common/sdk_utils.py +180 -0
  11. holoscan-2.1.0.data/purelib/holoscan/cli/common/utils.py +131 -0
  12. holoscan-2.1.0.data/purelib/holoscan/cli/logging.json +37 -0
  13. holoscan-2.1.0.data/purelib/holoscan/cli/nics/__init__.py +18 -0
  14. holoscan-2.1.0.data/purelib/holoscan/cli/nics/nics.py +34 -0
  15. holoscan-2.1.0.data/purelib/holoscan/cli/packager/__init__.py +18 -0
  16. holoscan-2.1.0.data/purelib/holoscan/cli/packager/arguments.py +137 -0
  17. holoscan-2.1.0.data/purelib/holoscan/cli/packager/config_reader.py +181 -0
  18. holoscan-2.1.0.data/purelib/holoscan/cli/packager/container_builder.py +349 -0
  19. holoscan-2.1.0.data/purelib/holoscan/cli/packager/manifest_files.py +220 -0
  20. holoscan-2.1.0.data/purelib/holoscan/cli/packager/models.py +93 -0
  21. holoscan-2.1.0.data/purelib/holoscan/cli/packager/package_command.py +183 -0
  22. holoscan-2.1.0.data/purelib/holoscan/cli/packager/packager.py +123 -0
  23. holoscan-2.1.0.data/purelib/holoscan/cli/packager/parameters.py +534 -0
  24. holoscan-2.1.0.data/purelib/holoscan/cli/packager/platforms.py +405 -0
  25. holoscan-2.1.0.data/purelib/holoscan/cli/packager/sdk_downloader.py +147 -0
  26. holoscan-2.1.0.data/purelib/holoscan/cli/packager/templates/Dockerfile.jinja2 +191 -0
  27. holoscan-2.1.0.data/purelib/holoscan/cli/packager/templates/dockerignore +93 -0
  28. holoscan-2.1.0.data/purelib/holoscan/cli/packager/templates/tools.sh +416 -0
  29. holoscan-2.1.0.data/purelib/holoscan/cli/py.typed +0 -0
  30. holoscan-2.1.0.data/purelib/holoscan/cli/runner/__init__.py +18 -0
  31. holoscan-2.1.0.data/purelib/holoscan/cli/runner/resources.py +174 -0
  32. holoscan-2.1.0.data/purelib/holoscan/cli/runner/run_command.py +204 -0
  33. holoscan-2.1.0.data/purelib/holoscan/cli/runner/runner.py +306 -0
  34. holoscan-2.1.0.data/purelib/holoscan/cli/version/__init__.py +18 -0
  35. holoscan-2.1.0.data/purelib/holoscan/cli/version/version.py +50 -0
  36. holoscan-2.1.0.data/purelib/holoscan/conditions/__init__.py +45 -0
  37. holoscan-2.1.0.data/purelib/holoscan/conditions/_conditions.cpython-38-aarch64-linux-gnu.so +0 -0
  38. holoscan-2.1.0.data/purelib/holoscan/core/__init__.py +367 -0
  39. holoscan-2.1.0.data/purelib/holoscan/core/_core.cpython-38-aarch64-linux-gnu.so +0 -0
  40. holoscan-2.1.0.data/purelib/holoscan/executors/__init__.py +26 -0
  41. holoscan-2.1.0.data/purelib/holoscan/executors/_executors.cpython-38-aarch64-linux-gnu.so +0 -0
  42. holoscan-2.1.0.data/purelib/holoscan/graphs/__init__.py +32 -0
  43. holoscan-2.1.0.data/purelib/holoscan/graphs/_graphs.cpython-38-aarch64-linux-gnu.so +0 -0
  44. holoscan-2.1.0.data/purelib/holoscan/gxf/__init__.py +57 -0
  45. holoscan-2.1.0.data/purelib/holoscan/gxf/_gxf.cpython-38-aarch64-linux-gnu.so +0 -0
  46. holoscan-2.1.0.data/purelib/holoscan/lib/gxf_extensions/libgxf_holoscan_wrapper.so +0 -0
  47. holoscan-2.1.0.data/purelib/holoscan/lib/gxf_extensions/libgxf_holoscan_wrapper_lib.so +0 -0
  48. holoscan-2.1.0.data/purelib/holoscan/lib/gxf_extensions/libgxf_ucx_holoscan.so +0 -0
  49. holoscan-2.1.0.data/purelib/holoscan/lib/gxf_extensions/libgxf_ucx_holoscan_lib.so +0 -0
  50. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_app.so +0 -0
  51. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_core.so +0 -0
  52. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_cuda.so +0 -0
  53. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_logger.so +0 -0
  54. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_multimedia.so +0 -0
  55. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_sample.so +0 -0
  56. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_serialization.so +0 -0
  57. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_std.so +0 -0
  58. holoscan-2.1.0.data/purelib/holoscan/lib/libgxf_ucx.so +0 -0
  59. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_core.so.2.1.0 +0 -0
  60. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_infer.so.2.1.0 +0 -0
  61. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_infer_onnx_runtime.so.2.1.0 +0 -0
  62. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_infer_torch.so.2.1.0 +0 -0
  63. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_infer_utils.so.2.1.0 +0 -0
  64. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_logger.so.2.1.0 +0 -0
  65. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_aja.so.2.1.0 +0 -0
  66. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_async_ping_rx.so.2.1.0 +0 -0
  67. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_async_ping_tx.so.2.1.0 +0 -0
  68. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_bayer_demosaic.so.2.1.0 +0 -0
  69. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_format_converter.so.2.1.0 +0 -0
  70. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_gxf_codelet.so.2.1.0 +0 -0
  71. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_holoviz.so.2.1.0 +0 -0
  72. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_inference.so.2.1.0 +0 -0
  73. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_inference_processor.so.2.1.0 +0 -0
  74. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_ping_rx.so.2.1.0 +0 -0
  75. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_ping_tx.so.2.1.0 +0 -0
  76. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_segmentation_postprocessor.so.2.1.0 +0 -0
  77. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_v4l2.so.2.1.0 +0 -0
  78. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_video_stream_recorder.so.2.1.0 +0 -0
  79. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_op_video_stream_replayer.so.2.1.0 +0 -0
  80. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_spdlog_logger.so.2.1.0 +0 -0
  81. holoscan-2.1.0.data/purelib/holoscan/lib/libholoscan_viz.so.2.1.0 +0 -0
  82. holoscan-2.1.0.data/purelib/holoscan/lib/libucm.so.0.0.0 +0 -0
  83. holoscan-2.1.0.data/purelib/holoscan/lib/libucp.so.0.0.0 +0 -0
  84. holoscan-2.1.0.data/purelib/holoscan/lib/libucs.so.0.0.0 +0 -0
  85. holoscan-2.1.0.data/purelib/holoscan/lib/libucs_signal.so.0.0.0 +0 -0
  86. holoscan-2.1.0.data/purelib/holoscan/lib/libuct.so.0.0.0 +0 -0
  87. holoscan-2.1.0.data/purelib/holoscan/lib/libyaml-cpp.so.0.7.0 +0 -0
  88. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libucm_cuda.so.0.0.0 +0 -0
  89. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libuct_cma.so.0.0.0 +0 -0
  90. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libuct_cuda.so.0.0.0 +0 -0
  91. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libuct_cuda_gdrcopy.so.0.0.0 +0 -0
  92. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libuct_ib.so.0.0.0 +0 -0
  93. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libuct_rdmacm.so.0.0.0 +0 -0
  94. holoscan-2.1.0.data/purelib/holoscan/lib/ucx/libucx_perftest_cuda.so.0.0.0 +0 -0
  95. holoscan-2.1.0.data/purelib/holoscan/logger/__init__.py +37 -0
  96. holoscan-2.1.0.data/purelib/holoscan/logger/_logger.cpython-38-aarch64-linux-gnu.so +0 -0
  97. holoscan-2.1.0.data/purelib/holoscan/network_contexts/__init__.py +28 -0
  98. holoscan-2.1.0.data/purelib/holoscan/network_contexts/_network_contexts.cpython-38-aarch64-linux-gnu.so +0 -0
  99. holoscan-2.1.0.data/purelib/holoscan/operators/__init__.py +93 -0
  100. holoscan-2.1.0.data/purelib/holoscan/operators/aja_source/__init__.py +22 -0
  101. holoscan-2.1.0.data/purelib/holoscan/operators/aja_source/_aja_source.cpython-38-aarch64-linux-gnu.so +0 -0
  102. holoscan-2.1.0.data/purelib/holoscan/operators/bayer_demosaic/__init__.py +24 -0
  103. holoscan-2.1.0.data/purelib/holoscan/operators/bayer_demosaic/_bayer_demosaic.cpython-38-aarch64-linux-gnu.so +0 -0
  104. holoscan-2.1.0.data/purelib/holoscan/operators/format_converter/__init__.py +23 -0
  105. holoscan-2.1.0.data/purelib/holoscan/operators/format_converter/_format_converter.cpython-38-aarch64-linux-gnu.so +0 -0
  106. holoscan-2.1.0.data/purelib/holoscan/operators/gxf_codelet/__init__.py +67 -0
  107. holoscan-2.1.0.data/purelib/holoscan/operators/gxf_codelet/_gxf_codelet.cpython-38-aarch64-linux-gnu.so +0 -0
  108. holoscan-2.1.0.data/purelib/holoscan/operators/holoviz/__init__.py +230 -0
  109. holoscan-2.1.0.data/purelib/holoscan/operators/holoviz/_holoviz.cpython-38-aarch64-linux-gnu.so +0 -0
  110. holoscan-2.1.0.data/purelib/holoscan/operators/inference/__init__.py +23 -0
  111. holoscan-2.1.0.data/purelib/holoscan/operators/inference/_inference.cpython-38-aarch64-linux-gnu.so +0 -0
  112. holoscan-2.1.0.data/purelib/holoscan/operators/inference_processor/__init__.py +23 -0
  113. holoscan-2.1.0.data/purelib/holoscan/operators/inference_processor/_inference_processor.cpython-38-aarch64-linux-gnu.so +0 -0
  114. holoscan-2.1.0.data/purelib/holoscan/operators/ping_rx/__init__.py +45 -0
  115. holoscan-2.1.0.data/purelib/holoscan/operators/ping_tx/__init__.py +46 -0
  116. holoscan-2.1.0.data/purelib/holoscan/operators/segmentation_postprocessor/__init__.py +23 -0
  117. holoscan-2.1.0.data/purelib/holoscan/operators/segmentation_postprocessor/_segmentation_postprocessor.cpython-38-aarch64-linux-gnu.so +0 -0
  118. holoscan-2.1.0.data/purelib/holoscan/operators/v4l2_video_capture/__init__.py +23 -0
  119. holoscan-2.1.0.data/purelib/holoscan/operators/v4l2_video_capture/_v4l2_video_capture.cpython-38-aarch64-linux-gnu.so +0 -0
  120. holoscan-2.1.0.data/purelib/holoscan/operators/video_stream_recorder/__init__.py +22 -0
  121. holoscan-2.1.0.data/purelib/holoscan/operators/video_stream_recorder/_video_stream_recorder.cpython-38-aarch64-linux-gnu.so +0 -0
  122. holoscan-2.1.0.data/purelib/holoscan/operators/video_stream_replayer/__init__.py +22 -0
  123. holoscan-2.1.0.data/purelib/holoscan/operators/video_stream_replayer/_video_stream_replayer.cpython-38-aarch64-linux-gnu.so +0 -0
  124. holoscan-2.1.0.data/purelib/holoscan/resources/__init__.py +138 -0
  125. holoscan-2.1.0.data/purelib/holoscan/resources/_resources.cpython-38-aarch64-linux-gnu.so +0 -0
  126. holoscan-2.1.0.data/purelib/holoscan/schedulers/__init__.py +32 -0
  127. holoscan-2.1.0.data/purelib/holoscan/schedulers/_schedulers.cpython-38-aarch64-linux-gnu.so +0 -0
  128. holoscan-2.1.0.data/purelib/holoscan-2.1.0.pth +1 -0
  129. holoscan-2.1.0.dist-info/LICENSE.txt +202 -0
  130. holoscan-2.1.0.dist-info/METADATA +111 -0
  131. holoscan-2.1.0.dist-info/NOTICE.txt +170 -0
  132. holoscan-2.1.0.dist-info/NVIDIA-AI-PRODUCT-EULA.txt +243 -0
  133. holoscan-2.1.0.dist-info/RECORD +138 -0
  134. holoscan-2.1.0.dist-info/WHEEL +5 -0
  135. holoscan-2.1.0.dist-info/axle.lck +0 -0
  136. holoscan-2.1.0.dist-info/entry_points.txt +3 -0
  137. holoscan-2.1.0.dist-info/symlinks.txt +72 -0
  138. holoscan-2.1.0.dist-info/top_level.txt +3 -0
@@ -0,0 +1,191 @@
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
+ {% if application_type == 'CppCMake' %}
19
+ FROM {{ build_image }} as builder
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+
22
+ RUN apt-get update && \
23
+ apt-get install -y jq
24
+
25
+ WORKDIR /src
26
+ COPY ./app/* /src
27
+
28
+ RUN mkdir -p /install/.cmake/api/v1/query/ && \
29
+ touch /install/.cmake/api/v1/query/codemodel-v2
30
+ RUN cd /src && \
31
+ cmake -S . -DHOLOHUB_DOWNLOAD_DATASETS=OFF {{ cmake_args }} -B /install && \
32
+ cmake --build /install -j && \
33
+ export OUTNAME=$(cat $(find /install/.cmake/api/v1/reply -type f | xargs grep -l "nameOnDisk") | jq -r '.nameOnDisk') && \
34
+ cd /install && \
35
+ if [ "${OUTNAME}" != "{{ command_filename }}" ]; then mv ./${OUTNAME} ./{{ command_filename }}; fi
36
+
37
+ RUN rm /install/CMakeCache.txt /install/Makefile /install/cmake_install.cmake && \
38
+ rm -r /install/CMakeFiles/ /install/.cmake/
39
+ {% endif %}
40
+
41
+ FROM {{ base_image }}
42
+
43
+ ENV DEBIAN_FRONTEND=noninteractive
44
+ ENV TERM=xterm-256color
45
+
46
+ ARG UNAME
47
+ ARG UID
48
+ ARG GID
49
+
50
+ RUN mkdir -p /etc/holoscan/ \
51
+ && mkdir -p /opt/holoscan/ \
52
+ && mkdir -p {{ working_dir }} \
53
+ && mkdir -p {{ app_dir }} \
54
+ && mkdir -p {{ full_input_path }} \
55
+ && mkdir -p {{ full_output_path }}
56
+
57
+ LABEL base="{{ base_image }}"
58
+ LABEL tag="{{ tag }}"
59
+ LABEL org.opencontainers.image.title="{{ title }}"
60
+ LABEL org.opencontainers.image.version="{{ version }}"
61
+ LABEL org.nvidia.holoscan="{{ holoscan_sdk_version }}"
62
+ {% if sdk_type == 'monai-deploy' %}
63
+ LABEL org.monai.deploy.app-sdk="{{ monai_deploy_app_sdk_version }}"
64
+ {% endif %}
65
+
66
+
67
+ ENV HOLOSCAN_ENABLE_HEALTH_CHECK=true
68
+ ENV HOLOSCAN_INPUT_PATH={{ full_input_path }}
69
+ ENV HOLOSCAN_OUTPUT_PATH={{ full_output_path }}
70
+ ENV HOLOSCAN_WORKDIR={{ working_dir }}
71
+ ENV HOLOSCAN_APPLICATION={{ app_dir }}
72
+ ENV HOLOSCAN_TIMEOUT={{ timeout }}
73
+ ENV HOLOSCAN_MODEL_PATH={{ models_dir }}
74
+ ENV HOLOSCAN_DOCS_PATH={{ docs_dir }}
75
+ ENV HOLOSCAN_CONFIG_PATH={{ config_file_path }}
76
+ ENV HOLOSCAN_APP_MANIFEST_PATH={{ app_json }}
77
+ ENV HOLOSCAN_PKG_MANIFEST_PATH={{ pkg_json }}
78
+ ENV HOLOSCAN_LOGS_PATH={{ logs_dir }}
79
+ ENV PATH=/root/.local/bin:/opt/nvidia/holoscan:$PATH
80
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libtorch/1.13.1/lib/:/opt/nvidia/holoscan/lib
81
+
82
+ RUN apt-get update \
83
+ && apt-get install -y curl jq \
84
+ && rm -rf /var/lib/apt/lists/*
85
+
86
+ {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
87
+ ENV PYTHONPATH="{{ app_dir }}:$PYTHONPATH"
88
+ {% endif %}
89
+
90
+ {% if application_type == 'CppCMake' or application_type == 'Binary' %}
91
+ {% if custom_base_image == True or custom_holoscan_sdk == True %}
92
+ # Update NV GPG repo key
93
+ # https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
94
+ RUN if [ $(uname -m) = "aarch64" ]; then ARCH=sbsa; else ARCH=x86_64; fi \
95
+ && curl -OL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/$ARCH/cuda-keyring_1.0-1_all.deb \
96
+ && dpkg -i cuda-keyring_1.0-1_all.deb
97
+
98
+ # Use user-specified Holoscan SDK Debian Package
99
+ COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
100
+ RUN apt-get update \
101
+ && apt-get install -y /tmp/{{ holoscan_sdk_filename }} \
102
+ && rm -rf /var/lib/apt/lists/*
103
+ {% else %}
104
+ # Use embedded Holoscan SDK
105
+ {# no op here #}
106
+ {% endif %}
107
+ {% endif %}
108
+
109
+ RUN groupadd -f -g $GID $UNAME
110
+ RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME
111
+ RUN chown -R holoscan {{ working_dir }}
112
+ RUN chown -R holoscan {{ full_input_path }}
113
+ RUN chown -R holoscan {{ full_output_path }}
114
+
115
+ # Set the working directory
116
+ WORKDIR {{ working_dir }}
117
+
118
+ # Copy HAP/MAP tool script
119
+ COPY ./tools {{ working_dir }}/tools
120
+ RUN chmod +x {{ working_dir }}/tools
121
+
122
+
123
+ # Copy gRPC health probe
124
+ {% if health_probe is defined %}
125
+
126
+ RUN curl -L -o /bin/grpc_health_probe {{ health_probe | pprint }} \
127
+ && chmod +x /bin/grpc_health_probe && ls -l /bin/grpc_health_probe
128
+
129
+ HEALTHCHECK --interval=10s --timeout=1s \
130
+ CMD /bin/grpc_health_probe -addr=:8777 || exit 1
131
+ {% endif %}
132
+
133
+ USER $UNAME
134
+
135
+ ENV PATH=/root/.local/bin:/home/holoscan/.local/bin:/opt/nvidia/holoscan:$PATH
136
+
137
+ {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
138
+ COPY ./pip/requirements.txt /tmp/requirements.txt
139
+
140
+ RUN pip install --upgrade pip
141
+ RUN pip install --no-cache-dir --user -r /tmp/requirements.txt
142
+
143
+ {# Use Holoscan SDK in the image unless specified by the user.
144
+ For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file. #}
145
+ {% if sdk_type == 'holoscan' %}
146
+
147
+ {% if custom_holoscan_sdk == True %}
148
+ # Copy user-specified Holoscan SDK wheel file
149
+ COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
150
+ RUN pip install /tmp/{{ holoscan_sdk_filename }}
151
+ {% elif custom_base_image == True %}
152
+ # Install Holoscan SDK wheel from PyPI
153
+ RUN pip install holoscan=={{ holoscan_sdk_version }}
154
+ {% else %}
155
+ # Use embedded Holoscan SDK
156
+ {# no op here #}
157
+ {% endif %}
158
+ {% else %}
159
+ # MONAI Deploy
160
+
161
+ {% if custom_monai_deploy_sdk %}
162
+ # Copy user-specified MONAI Deploy SDK file
163
+ COPY ./{{ monai_deploy_sdk_filename }} /tmp/{{ monai_deploy_sdk_filename }}
164
+ RUN pip install /tmp/{{ monai_deploy_sdk_filename }}
165
+ {% else %}
166
+ # Install MONAI Deploy from PyPI org
167
+ RUN pip install monai-deploy-app-sdk=={{ monai_deploy_app_sdk_version }}
168
+ {% endif %}
169
+
170
+ {% endif %}
171
+ {% endif %}
172
+
173
+ {% if models is defined %}
174
+ COPY ./models {{ models_dir }}
175
+ {% endif %}
176
+
177
+ {%- if docs is defined %}
178
+ COPY ./docs {{ docs_dir }}
179
+ {% endif %}
180
+
181
+ COPY ./map/app.json {{ app_json }}
182
+ COPY ./app.config {{ config_file_path }}
183
+ COPY ./map/pkg.json {{ pkg_json }}
184
+
185
+ {% if application_type == 'CppCMake' %}
186
+ COPY --from=builder /install {{ app_dir }}
187
+ {% else %}
188
+ COPY ./app {{ app_dir }}
189
+ {% endif %}
190
+
191
+ ENTRYPOINT ["/var/holoscan/tools"]
@@ -0,0 +1,93 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 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
+
16
+ # Git
17
+ **/.git
18
+ **/.gitignore
19
+ **/.gitconfig
20
+
21
+ # CI
22
+ **/.codeclimate.yml
23
+ **/.travis.yml
24
+ **/.taskcluster.yml
25
+
26
+ # Docker
27
+ **/docker-compose.yml
28
+ **/.docker
29
+
30
+ # Byte-compiled/optimized/DLL files for Python
31
+ **/__pycache__
32
+ **/*.pyc
33
+ **/.Python
34
+ **/*$py.class
35
+
36
+ # Conda folders
37
+ **/.conda
38
+ **/conda-bld
39
+
40
+ # Distribution / packaging
41
+ **/.Python
42
+ **/.cmake
43
+ **/cmake-build*/
44
+ **/build-*/
45
+ **/develop-eggs/
46
+ **/.eggs/
47
+ **/sdist/
48
+ **/wheels/
49
+ **/*.egg-info/
50
+ **/.installed.cfg
51
+ **/*.egg
52
+ **/MANIFEST
53
+
54
+ # PyInstaller
55
+ # Usually these files are written by a python script from a template
56
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
57
+ **/*.manifest
58
+ **/*.spec
59
+
60
+ # Installer logs
61
+ **/pip-log.txt
62
+ **/pip-delete-this-directory.txt
63
+
64
+ # Unit test / coverage reports
65
+ **/htmlcov/
66
+ **/.tox/
67
+ **/.coverage
68
+ **/.coverage.*
69
+ **/.cache
70
+ **/nosetests.xml
71
+ **/coverage.xml
72
+ **/*.cover
73
+ **/*.log
74
+ **/.hypothesis/
75
+ **/.pytest_cache/
76
+
77
+ # mypy
78
+ **/.mypy_cache/
79
+
80
+ ## VSCode IDE
81
+ **/.vscode
82
+
83
+ # Jupyter Notebook
84
+ **/.ipynb_checkpoints
85
+
86
+ # Environments
87
+ **/.env
88
+ **/.venv
89
+ **/env/
90
+ **/venv/
91
+ **/ENV/
92
+ **/env.bak/
93
+ **/venv.bak/
@@ -0,0 +1,416 @@
1
+ #!/bin/bash
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+
19
+ #===============================================================================
20
+ # Default values for environment variables.
21
+ #===============================================================================
22
+
23
+ init_globals() {
24
+ if [ "$0" != "/bin/bash" ] && [ "$0" != "bash" ]; then
25
+ SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
26
+ export RUN_SCRIPT_FILE="$(readlink -f "$0")"
27
+ else
28
+ export RUN_SCRIPT_FILE="$(readlink -f "${BASH_SOURCE[0]}")"
29
+ fi
30
+
31
+ export TOP=$(dirname "${RUN_SCRIPT_FILE}")
32
+
33
+ export HOLOSCAN_APPLICATION="${HOLOSCAN_APPLICATION:=/opt/holoscan/app}"
34
+ export HOLOSCAN_INPUT_PATH="${HOLOSCAN_INPUT_PATH:=/var/holoscan/input}"
35
+ export HOLOSCAN_OUTPUT_PATH="${HOLOSCAN_OUTPUT_PATH:=/var/holoscan/output}"
36
+ export HOLOSCAN_WORKDIR="${HOLOSCAN_WORKDIR:=/var/holoscan/}"
37
+ export HOLOSCAN_MODEL_PATH="${HOLOSCAN_MODEL_PATH:=/opt/holoscan/models/}"
38
+ export HOLOSCAN_DOCS="${HOLOSCAN_DOCS:=/opt/holoscan/docs/}"
39
+ export HOLOSCAN_CONFIG_PATH="${HOLOSCAN_CONFIG_PATH:=/var/holoscan/app.config}"
40
+ export HOLOSCAN_APP_MANIFEST_PATH="${HOLOSCAN_APP_MANIFEST_PATH:=/etc/holoscan/app.json}"
41
+ export HOLOSCAN_PKG_MANIFEST_PATH="${HOLOSCAN_PKG_MANIFEST_PATH:=/etc/holoscan/pkg.json}"
42
+ }
43
+
44
+ ################################################################################
45
+ # Utility functions
46
+ ################################################################################
47
+
48
+
49
+ c_str() {
50
+ local old_color=39
51
+ local old_attr=0
52
+ local color=39
53
+ local attr=0
54
+ local text=""
55
+ local mode="color"
56
+ if [ "${1:-}" = "color" ]; then
57
+ mode="color"
58
+ shift
59
+ elif [ "${1:-}" = "nocolor" ]; then
60
+ mode="nocolor"
61
+ shift
62
+ fi
63
+
64
+ for i in "$@"; do
65
+ case "$i" in
66
+ r|R)
67
+ color=31
68
+ ;;
69
+ g|G)
70
+ color=32
71
+ ;;
72
+ y|Y)
73
+ color=33
74
+ ;;
75
+ b|B)
76
+ color=34
77
+ ;;
78
+ p|P)
79
+ color=35
80
+ ;;
81
+ c|C)
82
+ color=36
83
+ ;;
84
+ w|W)
85
+ color=37
86
+ ;;
87
+
88
+ z|Z)
89
+ color=0
90
+ ;;
91
+ esac
92
+ case "$i" in
93
+ l|L|R|G|Y|B|P|C|W)
94
+ attr=1
95
+ ;;
96
+ n|N|r|g|y|b|p|c|w)
97
+ attr=0
98
+ ;;
99
+ z|Z)
100
+ attr=0
101
+ ;;
102
+ *)
103
+ text="${text}$i"
104
+ esac
105
+ if [ "${mode}" = "color" ]; then
106
+ if [ ${old_color} -ne ${color} ] || [ ${old_attr} -ne ${attr} ]; then
107
+ text="${text}\033[${attr};${color}m"
108
+ old_color=$color
109
+ old_attr=$attr
110
+ fi
111
+ fi
112
+ done
113
+ /bin/echo -en "$text"
114
+ }
115
+
116
+ c_echo() {
117
+ # Select color/nocolor based on the first argument
118
+ local mode="color"
119
+ if [ "${1:-}" = "color" ]; then
120
+ mode="color"
121
+ shift
122
+ elif [ "${1:-}" = "nocolor" ]; then
123
+ mode="nocolor"
124
+ shift
125
+ else
126
+ if [ ! -t 1 ]; then
127
+ mode="nocolor"
128
+ fi
129
+ fi
130
+
131
+ local old_opt="$(shopt -op xtrace)" # save old xtrace option
132
+ set +x # unset xtrace
133
+
134
+ if [ "${mode}" = "color" ]; then
135
+ local text="$(c_str color "$@")"
136
+ /bin/echo -e "$text\033[0m"
137
+ else
138
+ local text="$(c_str nocolor "$@")"
139
+ /bin/echo -e "$text"
140
+ fi
141
+ eval "${old_opt}" # restore old xtrace option
142
+ }
143
+
144
+ echo_err() {
145
+ >&2 echo "$@"
146
+ }
147
+
148
+ c_echo_err() {
149
+ >&2 c_echo "$@"
150
+ }
151
+
152
+ newline() {
153
+ echo
154
+ }
155
+
156
+ info() {
157
+ c_echo_err W "$(date -u '+%Y-%m-%d %H:%M:%S') [INFO] " Z "$@"
158
+ }
159
+
160
+ error() {
161
+ c_echo_err R "$(date -u '+%Y-%m-%d %H:%M:%S') [ERROR] " Z "$@"
162
+ }
163
+
164
+ fatal() {
165
+ if [ -n "$*" ]; then
166
+ c_echo_err R "$(date -u '+%Y-%m-%d %H:%M:%S') [FATAL] " Z "$@"
167
+ echo_err
168
+ fi
169
+ if [ -n "${SCRIPT_DIR}" ]; then
170
+ exit 1
171
+ else
172
+ kill -INT $$ # kill the current process instead of exit in shell environment.
173
+ fi
174
+ }
175
+
176
+ run_command() {
177
+ local status=0
178
+ local cmd="$*"
179
+
180
+ [ "$(echo -n "$@")" = "" ] && return 1 # return 1 if there is no command available
181
+
182
+ if [ "${DO_DRY_RUN}" != "true" ]; then
183
+ "$@"
184
+ status=$?
185
+ fi
186
+
187
+ return $status
188
+ }
189
+
190
+
191
+ #===============================================================================
192
+ # Section: Show
193
+ #===============================================================================
194
+
195
+ print() {
196
+ # Parse CLI arguments next
197
+ ARGS=("$@")
198
+ if [ "$ARGS" = "" ]; then
199
+ ARGS=*
200
+ fi
201
+
202
+ local i
203
+ local arg
204
+ for i in "${!ARGS[@]}"; do
205
+ arg="${ARGS[i]}"
206
+ if [[ "$arg" = "*" || "$arg" = "" ]]; then
207
+ opt=all
208
+ fi
209
+ if [ "$arg" = "app" ]; then
210
+ opt=app
211
+ fi
212
+ if [ "$arg" = "pkg" ]; then
213
+ opt=pkg
214
+ fi
215
+ done
216
+ newline
217
+ if [[ "$opt" = "all" || "$opt" = "app" ]]; then
218
+ if [ -f "${HOLOSCAN_APP_MANIFEST_PATH}" ]; then
219
+ c_echo "============================== app.json =============================="
220
+ run_command cat ${HOLOSCAN_APP_MANIFEST_PATH} | jq
221
+ else
222
+ c_echo_err "${HOLOSCAN_APP_MANIFEST_PATH} does not exists!"
223
+ fi
224
+ fi
225
+ newline
226
+ if [[ "$opt" = "all" || "$opt" = "pkg" ]]; then
227
+ if [ -f "${HOLOSCAN_PKG_MANIFEST_PATH}" ]; then
228
+ c_echo "============================== pkg.json =============================="
229
+ run_command cat ${HOLOSCAN_PKG_MANIFEST_PATH} | jq
230
+ else
231
+ c_echo_err "${HOLOSCAN_PKG_MANIFEST_PATH} does not exists!"
232
+ fi
233
+ fi
234
+ newline
235
+ }
236
+
237
+ print_env() {
238
+ run_command env -0 | sort -z | tr '\0' '\n'
239
+ }
240
+ #===============================================================================
241
+ # Section: Export
242
+ #===============================================================================
243
+
244
+ copy_app() {
245
+ info "Copying application from ${HOLOSCAN_APPLICATION} to ${EXPORT_ROOT}/app"
246
+ if [ -d "${HOLOSCAN_APPLICATION}" ]; then
247
+ run_command cp -r ${HOLOSCAN_APPLICATION} ${EXPORT_ROOT}/app
248
+ else
249
+ info "'${HOLOSCAN_APPLICATION}' cannot be found."
250
+ fi
251
+ newline
252
+ }
253
+
254
+ copy_configs() {
255
+ if [ ! -d "${EXPORT_ROOT}/config/" ]
256
+ then
257
+ mkdir -p ${EXPORT_ROOT}/config/
258
+ fi
259
+
260
+ info "Copying application manifest file from ${HOLOSCAN_APP_MANIFEST_PATH} to ${EXPORT_ROOT}/config/app.json"
261
+ if [ -f "${HOLOSCAN_APP_MANIFEST_PATH}" ]; then
262
+ run_command cp ${HOLOSCAN_APP_MANIFEST_PATH} ${EXPORT_ROOT}/config/app.json
263
+ else
264
+ info "application manifest file '${HOLOSCAN_APP_MANIFEST_PATH}' cannot be found."
265
+ fi
266
+
267
+ info "Copying pkg manifest file from ${HOLOSCAN_PKG_MANIFEST_PATH} to ${EXPORT_ROOT}/config/pkg.json"
268
+ if [ -f "${HOLOSCAN_PKG_MANIFEST_PATH}" ]; then
269
+ run_command cp ${HOLOSCAN_PKG_MANIFEST_PATH} ${EXPORT_ROOT}/config/pkg.json
270
+ else
271
+ info "package manifest file '${HOLOSCAN_PKG_MANIFEST_PATH}' cannot be found."
272
+ fi
273
+
274
+ local CONFIG_FILE_NAME=$(basename ${HOLOSCAN_CONFIG_PATH})
275
+ info "Copying application configuration from ${HOLOSCAN_CONFIG_PATH} to ${EXPORT_ROOT}/config/$CONFIG_FILE_NAME"
276
+ if [ -f "${HOLOSCAN_CONFIG_PATH}" ]; then
277
+ run_command cp ${HOLOSCAN_CONFIG_PATH} ${EXPORT_ROOT}/config/$CONFIG_FILE_NAME
278
+ else
279
+ info "Application configuration'${HOLOSCAN_CONFIG_PATH}' cannot be found."
280
+ fi
281
+ newline
282
+ }
283
+
284
+ copy_models() {
285
+ info "Copying models from ${HOLOSCAN_MODEL_PATH} to ${EXPORT_ROOT}/models"
286
+ if [ -d "${HOLOSCAN_MODEL_PATH}" ]; then
287
+ run_command cp -r ${HOLOSCAN_MODEL_PATH} ${EXPORT_ROOT}/models
288
+ else
289
+ info "'${HOLOSCAN_MODEL_PATH}' cannot be found."
290
+ fi
291
+ newline
292
+ }
293
+
294
+ copy_docs() {
295
+ info "Copying documentation from ${HOLOSCAN_DOCS} to ${EXPORT_ROOT}/docs"
296
+ if [ -d "${HOLOSCAN_DOCS}" ]; then
297
+ run_command cp -r ${HOLOSCAN_DOCS} ${EXPORT_ROOT}/docs
298
+ else
299
+ info "'${HOLOSCAN_DOCS}' cannot be found."
300
+ fi
301
+ newline
302
+ }
303
+
304
+ check_permission(){
305
+ test -w $@
306
+ if [ $? -ne 0 ]; then
307
+ fatal "Permission error: ensure the directory is created on the host first before using the 'extract' command."
308
+ fi
309
+ }
310
+
311
+
312
+ copy() {
313
+ EXPORT_ROOT=/var/run/holoscan/export
314
+
315
+ if [ -d "${EXPORT_ROOT}" ]
316
+ then
317
+ if [ -d "${EXPORT_ROOT}/app" ]; then
318
+ check_permission "${EXPORT_ROOT}/app"
319
+ copy_app
320
+ elif [ -d "${EXPORT_ROOT}/config" ]; then
321
+ check_permission "${EXPORT_ROOT}/config"
322
+ copy_configs
323
+ elif [ -d "${EXPORT_ROOT}/models" ]; then
324
+ check_permission "${EXPORT_ROOT}/models"
325
+ copy_models
326
+ elif [ -d "${EXPORT_ROOT}/docs" ]; then
327
+ copy_docs "${EXPORT_ROOT}/docs"
328
+ else
329
+ check_permission "${EXPORT_ROOT}"
330
+ copy_app
331
+ copy_configs
332
+ copy_models
333
+ copy_docs
334
+ fi
335
+ else
336
+ fatal "No volume mount found ${EXPORT_ROOT}."
337
+ fi
338
+ }
339
+
340
+ #===============================================================================
341
+
342
+
343
+ print_usage() {
344
+ local YELLOW='\033[0;93m' # YELLOW
345
+ local RED='\033[0;91m' # YELLOW
346
+ local NC='\033[0m' # No Color
347
+ c_echo "USAGE: /var/holoscan/tools [command] [arguments]..."
348
+ c_echo " Command List"
349
+ c_echo " ${YELLOW}extract${NC} --------------------------- Extract data based on mounted volume paths."
350
+ c_echo " /var/run/holoscan/export/app extract the application"
351
+ c_echo " /var/run/holoscan/export/config extract app.json and pkg.json manifest files and application YAML."
352
+ c_echo " /var/run/holoscan/export/models extract models"
353
+ c_echo " /var/run/holoscan/export/docs extract documentation files"
354
+ c_echo " /var/run/holoscan/export extract all of the above"
355
+ c_echo " ${RED}IMPORTANT${NC}: ensure the directory to be mounted for data extraction is created first on the host system"
356
+ c_echo " and has the correct permissions. If the directory had been created by the container previously"
357
+ c_echo " with the user and group being root, please delete it and manually create it again."
358
+ c_echo " ${YELLOW}show${NC} ----------------------------- Print manifest file(s): [app|pkg] to the terminal."
359
+ c_echo " ${YELLOW}app${NC} print app.json"
360
+ c_echo " ${YELLOW}pkg${NC} print pkg.json"
361
+ c_echo " ${YELLOW}env${NC} ------------------------- Print all environment variables to the terminal."
362
+ }
363
+
364
+
365
+ main() {
366
+ if [ "$1" = "show" ]; then
367
+ shift
368
+ print "$@"
369
+ elif [ "$1" = "env" ]; then
370
+ shift
371
+ print_env
372
+ elif [ "$1" = "extract" ]; then
373
+ shift
374
+ copy
375
+ elif [ "$1" = "help" ]; then
376
+ shift
377
+ print_usage
378
+ else # all other commands will launch the application
379
+ local command=$(jq -r '.command | fromjson | join(" ")' ${HOLOSCAN_APP_MANIFEST_PATH} 2>/dev/null)
380
+ if [ -n "${command}" ]; then
381
+ args=$(printf " %s" "${@}")
382
+ info "Launching application ${command} ${args:1}..."
383
+ eval ${command} "$@"
384
+ exit_code=$?
385
+ if [ $exit_code -ne 0 ] && [ -f /.dockerenv ] && [ "$HOLOSCAN_HOSTING_SERVICE" != "HOLOSCAN_RUN" ]; then
386
+ newline
387
+ c_echo "================================================================================================"
388
+ c_echo "Application exited with ${exit_code}."
389
+ newline
390
+ newline
391
+ c_echo nocolor "When running inside docker, ensure that the runtime is set to nvidia with required arguments."
392
+ newline
393
+ c_echo nocolor "For example:"
394
+ c_echo nocolor "docker run --runtime nvidia \\"
395
+ c_echo nocolor " --gpus all \\"
396
+ c_echo nocolor " -it \\"
397
+ c_echo nocolor " -e NVIDIA_DRIVER_CAPABILITIES=all \\"
398
+ c_echo nocolor " -e DISPLAY=\$DISPLAY \\"
399
+ c_echo nocolor " -v /tmp/.X11-unix:/tmp/.X11-unix \\"
400
+ c_echo nocolor " -v \${MY-INPUT-DATA}:/var/holoscan/input \\"
401
+ c_echo nocolor " my-container-image[:tag]"
402
+ newline
403
+ c_echo "================================================================================================"
404
+ newline
405
+ fi
406
+ else
407
+ fatal "Failed to launch application; failed to read/parse command from ${HOLOSCAN_APP_MANIFEST_PATH}."
408
+ fi
409
+ fi
410
+ }
411
+
412
+ init_globals
413
+
414
+ if [ -n "${SCRIPT_DIR}" ]; then
415
+ main "$@"
416
+ fi
File without changes