• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nvidia-holoscan / holoscan-cli / 14098662346

27 Mar 2025 04:08AM UTC coverage: 85.6% (-0.2%) from 85.772%
14098662346

Pull #33

github

mocsharp
Enhance version serialization in pyproject.toml and tidy up main.yaml

- Use GITHUB_RUN_ID in build filename to avoid error when uploading to test.pypi.org

Signed-off-by: Victor Chang <vicchang@nvidia.com>
Pull Request #33: Enable test-app with nv-gha-runner

40 of 51 new or added lines in 8 files covered. (78.43%)

3 existing lines in 3 files now uncovered.

1712 of 2000 relevant lines covered (85.6%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/holoscan_cli/runner/run_command.py
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
import logging
×
16
import os
×
17
from argparse import ArgumentParser, HelpFormatter, _SubParsersAction
×
18

19
from ..common import argparse_types
×
20
from ..common.argparse_types import valid_existing_path
×
21

22
logger = logging.getLogger("runner")
×
23

24

25
def create_run_parser(
×
26
    subparser: _SubParsersAction, command: str, parents: list[ArgumentParser]
27
) -> ArgumentParser:
28
    parser: ArgumentParser = subparser.add_parser(
×
29
        command, formatter_class=HelpFormatter, parents=parents, add_help=False
30
    )
31

32
    parser.add_argument("map", metavar="<image[:tag]>", help="HAP/MAP image name.")
×
33

34
    parser.add_argument(
×
35
        "--address",
36
        dest="address",
37
        help="address ('[<IP or hostname>][:<port>]') of the App Driver. If not specified, "
38
        "the App Driver uses the default host address ('0.0.0.0') with the default port "
39
        "number ('8765').",
40
    )
41

42
    parser.add_argument(
×
43
        "--driver",
44
        dest="driver",
45
        action="store_true",
46
        default=False,
47
        help="run the App Driver on the current machine. Can be used together with the "
48
        "'--worker' option "
49
        "to run both the App Driver and the App Worker on the same machine.",
50
    )
51

52
    parser.add_argument(
×
53
        "-i",
54
        "--input",
55
        metavar="<input>",
56
        type=argparse_types.valid_dir_path,
57
        help="input data directory path.",
58
        required=False,
59
    )
60

61
    parser.add_argument(
×
62
        "-o",
63
        "--output",
64
        metavar="<output>",
65
        type=argparse_types.valid_dir_path,
66
        help="output data directory path.",
67
        required=False,
68
    )
69

70
    parser.add_argument(
×
71
        "-f",
72
        "--fragments",
73
        dest="fragments",
74
        help="comma-separated names of the fragments to be executed by the App Worker. "
75
        "If not specified, only one fragment (selected by the App Driver) will be executed. "
76
        "'all' can be used to run all the fragments.",
77
    )
78

79
    parser.add_argument(
×
80
        "--worker",
81
        dest="worker",
82
        action="store_true",
83
        default=False,
84
        help="run the App Worker.",
85
    )
86

87
    parser.add_argument(
×
88
        "--worker-address",
89
        dest="worker_address",
90
        help="address (`[<IP or hostname>][:<port>]`) of the App Worker. If not specified, the App "
91
        "Worker uses the default host address ('0.0.0.0') with a randomly chosen port number "
92
        "between 10000 and 32767 that is not currently in use.",
93
    )
94

NEW
95
    parser.add_argument(
×
96
        "--rm",
97
        dest="rm",
98
        action="store_true",
99
        default=False,
100
        help="remove the container after it exits.",
101
    )
102

UNCOV
103
    advanced_group = parser.add_argument_group(title="advanced run options")
×
104

105
    advanced_group.add_argument(
×
106
        "--config",
107
        dest="config",
108
        type=valid_existing_path,
109
        help="path to the configuration file. This will override the configuration file embedded "
110
        "in the application.",
111
    )
112

113
    advanced_group.add_argument(
×
114
        "--name",
115
        dest="name",
116
        help="name and hostname of the container to create.",
117
    )
118
    advanced_group.add_argument(
×
119
        "--health-check",
120
        dest="health_check",
121
        action="store_true",
122
        default="False",
123
        help="enable the health check service for a distributed application.  (default: False)",
124
    )
125
    advanced_group.add_argument(
×
126
        "-n",
127
        "--network",
128
        dest="network",
129
        default="host",
130
        help="name of the Docker network this application will be connected to.  (default: host)",
131
    )
132
    advanced_group.add_argument(
×
133
        "--nic",
134
        dest="nic",
135
        help="name of the network interface to use with a distributed multi-fragment application. "
136
        "This option sets UCX_NET_DEVICES environment variable with the value specified.",
137
    )
138
    advanced_group.add_argument(
×
139
        "--use-all-nics",
140
        dest="use_all_nics",
141
        action="store_true",
142
        default=False,
143
        help="allow UCX to control the selection of network interface cards for data "
144
        "transfer. Otherwise, the network interface card specified with '--nic' is used. "
145
        "This option sets UCX_CM_USE_ALL_DEVICES to 'y'. (default: False)",
146
    )
147
    advanced_group.add_argument(
×
148
        "-r",
149
        "--render",
150
        dest="render",
151
        action="store_true",
152
        default=False,
153
        help="enable rendering (default: False); runs the container with required flags to enable "
154
        "rendering of graphics.",
155
    )
156
    advanced_group.add_argument(
×
157
        "-q",
158
        "--quiet",
159
        dest="quiet",
160
        action="store_true",
161
        default=False,
162
        help="suppress the STDOUT and print only STDERR from the application. (default: False)",
163
    )
164
    advanced_group.add_argument(
×
165
        "--shm-size",
166
        dest="shm_size",
167
        help="set the size of /dev/shm. The format is "
168
        "<number(int,float)>[MB|m|GB|g|Mi|MiB|Gi|GiB]. "
169
        "Use 'config' to read the shared memory value defined in the app.json manifest. "
170
        "If not specified, the container is launched using '--ipc=host' with host system's "
171
        "/dev/shm mounted.",
172
    )
173
    advanced_group.add_argument(
×
174
        "--terminal",
175
        dest="terminal",
176
        action="store_true",
177
        default=False,
178
        help="enter terminal with all configured volume mappings and environment variables. "
179
        "(default: False)",
180
    )
181
    advanced_group.add_argument(
×
182
        "--device",
183
        dest="device",
184
        nargs="+",
185
        action="extend",
186
        help="""Mount additional devices.
187
        For example:
188
        --device ajantv* to mount all AJA capture cards.
189
        --device ajantv0 ajantv1 to mount AJA capture card 0 and 1.
190
        --device video1 to mount V4L2 video device 1. """,
191
    )
192
    advanced_group.add_argument(
×
193
        "--gpus",
194
        dest="gpus",
195
        help="""Override the value of NVIDIA_VISIBLE_DEVICES environment variable.
196
        default: the value specified in the package manifest file or 'all' if not specified.
197
        Refer to https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#gpu-enumeration
198
        for all available options.""",
199
    )
200

201
    user_group = parser.add_argument_group(title="security options")
×
202
    user_group.add_argument(
×
203
        "--uid",
204
        type=str,
205
        default=os.getuid(),
206
        help=f"run the container with the UID. (default:{os.getuid()})",
207
    )
208
    user_group.add_argument(
×
209
        "--gid",
210
        type=str,
211
        default=os.getgid(),
212
        help=f"run the container with the GID. (default:{os.getgid()})",
213
    )
214

215
    return parser
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc