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

Update instructions for DDS Video #704

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ ngc-cli/
.local/
tmp/

# Licenses
rti_license.dat
5 changes: 1 addition & 4 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ add_holohub_application(colonoscopy_segmentation DEPENDS OPERATORS aja_source)

add_holohub_application(cvcuda_basic DEPENDS OPERATORS cvcuda_holoscan_interop)

add_holohub_application(dds_video DEPENDS
OPERATORS dds_shapes_subscriber
dds_video_publisher
dds_video_subscriber)
add_subdirectory(dds)

add_holohub_application(deltacast_transmitter DEPENDS
OPERATORS deltacast_videomaster
Expand Down
23 changes: 23 additions & 0 deletions applications/dds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.20)
project(distributed_applications LANGUAGES NONE)


add_holohub_application(dds_video DEPENDS
OPERATORS dds_shapes_subscriber
dds_video_publisher
dds_video_subscriber)
91 changes: 91 additions & 0 deletions applications/dds/dds_video/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# syntax=docker/dockerfile:1

# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE
ARG GPU_TYPE

############################################################
# Base image
############################################################

ARG BASE_IMAGE
ARG GPU_TYPE

FROM ${BASE_IMAGE} AS base

ARG DEBIAN_FRONTEND=noninteractive

# --------------------------------------------------------------------------
#
# Holohub run setup
#

RUN mkdir -p /tmp/scripts
COPY run /tmp/scripts/
RUN mkdir -p /tmp/scripts/utilities
COPY utilities/holohub_autocomplete /tmp/scripts/utilities/
RUN chmod +x /tmp/scripts/run
RUN /tmp/scripts/run setup

# Enable autocomplete
RUN echo ". /etc/bash_completion.d/holohub_autocomplete" >> /etc/bash.bashrc

# - This variable is consumed by all dependencies below as an environment variable (CMake 3.22+)
# - We use ARG to only set it at docker build time, so it does not affect cmake builds
# performed at docker run time in case users want to use a different BUILD_TYPE
ARG CMAKE_BUILD_TYPE=Release

# Qcap dependency
RUN apt update \
&& apt install --no-install-recommends -y \
libgstreamer1.0-0 \
libgstreamer-plugins-base1.0-0 \
libgles2 \
libopengl0

# For benchmarking
RUN apt update \
&& apt install --no-install-recommends -y \
libcairo2-dev \
libgirepository1.0-dev \
gobject-introspection \
libgtk-3-dev \
libcanberra-gtk-module \
graphviz\
ninja-build

RUN pip install meson

RUN if ! grep -q "VERSION_ID=\"22.04\"" /etc/os-release; then \
pip install setuptools; \
fi
COPY benchmarks/holoscan_flow_benchmarking/requirements.txt /tmp/benchmarking_requirements.txt
RUN pip install -r /tmp/benchmarking_requirements.txt

# For RTI Connext DDS
RUN apt update \
&& apt install --no-install-recommends -y \
openjdk-21-jre
RUN echo 'export JREHOME=$(readlink /etc/alternatives/java | sed -e "s/\/bin\/java//")' >> /etc/bash.bashrc

# Set default Holohub data directory
ENV HOLOSCAN_INPUT_PATH=/workspace/holohub/data

ENV NDDSHOME=/opt/rti.com/rti_connext_dds-7.3.0
ENV RTI_CONNEXT_DDS_DIR=$NDDSHOME

CMD ["/bin/bash", "-c", "source $NDDSHOME/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash && exec /bin/bash"]
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,31 @@ Holoviz output.

![DDS Video Application Workflow](docs/workflow_dds_video_app.png)

## Prerequisites

- This application requires [RTI Connext](https://content.rti.com/l/983311/2024-04-30/pz1wms)
be installed and configured with a valid RTI Connext license prior to use.
- V4L2 capable device

> [!NOTE]
> Instructions below are based on the `.run' installer from RTI Connext. Refer to the
> [Linux installation](https://community.rti.com/static/documentation/developers/get-started/full-install.html)
> for details.


## Quick Start

```bash
# Start the publisher
./dev_container build_and_run dds_video --container_args "-v $HOME/rti_connext_dds-7.3.0:/opt/rti.com/rti_connext_dds-7.3.0/" --run_args "-p"

# Start the subscriber
./dev_container build_and_run dds_video --container_args "-v $HOME/rti_connext_dds-7.3.0:/opt/rti.com/rti_connext_dds-7.3.0/" --run_args "-s"
```


## Building the Application

This application requires [RTI Connext](https://content.rti.com/l/983311/2024-04-30/pz1wms)
be installed and configured with a valid RTI Connext license prior to use.
To build on an IGX devkit (using the `armv8` architecture), follow the
[instructions to build Connext DDS applications for embedded Arm targets](https://community.rti.com/kb/how-do-i-create-connext-dds-application-rti-code-generator-and-build-it-my-embedded-target-arm)
up to, and including, step 5 (Installing Java and setting JREHOME).
Expand All @@ -48,9 +69,18 @@ the `NDDSHOME` and `CONNEXTDDS_ARCH` environment variables are set (which can be
done using the RTI `setenv` script) and use the following:

```sh
./dev_container launch --docker_opts "-v $NDDSHOME:/opt/dds -e NDDSHOME=/opt/dds -e CONNEXTDDS_ARCH=$CONNEXTDDS_ARCH"
# 1. Build the container
./dev_container build --docker_file applications/dds/dds_video/Dockerfile
# 2. Launch the container
./dev_container launch --docker_opts "-v $HOME/rti_connext_dds-7.3.0:/opt/rti.com/rti_connext_dds-7.3.0/"
# 3. Build the application
./run build dds_video
# Continue to the next section to run the application with the publisher.
# Open a new terminal to repeat step #2 and launch a new container for the subscriber.
```



## Running the Application

Both a publisher and subscriber process must be launched to see the result of
Expand Down
4 changes: 4 additions & 0 deletions applications/dds/dds_video/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

source /opt/rti.com/rti_connext_dds-7.3.0/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash
exec /bin/bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@
"affiliation": "NVIDIA"
}
],
"language": "C++",
"language": "C++",
"version": "1.0",
"changelog": {
"1.0": "Initial Release"
},
"dockerfile": "applications/dds/dds_video/Dockerfile",
"holoscan_sdk": {
"minimum_required_version": "2.0.0",
"tested_versions": [
"2.0.0"
]
},
"platforms": ["amd64", "arm64"],
"tags": ["DDS", "RTI Connext", "Video", "Shapes"],
"platforms": [
"amd64",
"arm64"
],
"tags": [
"DDS",
"RTI Connext",
"Video",
"Shapes"
],
"ranking": 2,
"dependencies": {
"packages": [
Expand All @@ -37,4 +46,4 @@
"workdir": "holohub_app_bin"
}
}
}
}
2 changes: 1 addition & 1 deletion dev_container
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ build_and_run() {
local app_language=""
local container_build_args=()
local container_launch_args=""
local docker_opts="--entrypoint=bash"
local docker_opts="--entrypoint=bash "
local build_app=1
local image_name=""
local docker_file=""
Expand Down