Skip to content

Commit 39d6b0b

Browse files
Merge branch 'master' into develop
2 parents c1a6403 + c94803b commit 39d6b0b

File tree

105 files changed

+4289
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4289
-259
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ on:
1818

1919
jobs:
2020
build:
21-
runs-on: ubuntu-20.04
21+
strategy:
22+
matrix:
23+
architecture: [{name: x64Linux4gcc7.3.0, os: ubuntu-20.04}]
24+
25+
runs-on: ${{ matrix.architecture.os }}
2226
name: Build examples
2327

2428
# This job will be executed if the "PR handler" finalized successfully or
@@ -33,6 +37,50 @@ jobs:
3337

3438
steps:
3539

40+
# Download the artifacts generated by "PR Handler" if this workflow was
41+
# triggered by a workflow_run event.
42+
- name: Download artifact
43+
if: ${{ github.event_name == 'workflow_run' }}
44+
uses: actions/[email protected]
45+
with:
46+
script: |
47+
var fs = require('fs');
48+
var artifacts = await github.actions.listWorkflowRunArtifacts({
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
run_id: ${{ github.event.workflow_run.id }},
52+
});
53+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
54+
return artifact.name == "targetbranch"
55+
})[0];
56+
var download = await github.actions.downloadArtifact({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
artifact_id: matchArtifact.id,
60+
archive_format: 'zip',
61+
});
62+
fs.writeFileSync('${{github.workspace}}/targetbranch.zip', Buffer.from(download.data));
63+
64+
# Unzip the artifacts.
65+
- name: Unzip artifact
66+
if: ${{ github.event_name == 'workflow_run' }}
67+
run: unzip targetbranch.zip
68+
69+
# Save the PR number to send messages to the user that opened it.
70+
- name: Get target branch
71+
if: ${{ github.event_name == 'workflow_run' }}
72+
id: target_branch
73+
run: echo "TARGET_BRANCH=$(cat targetbranch)" >> $GITHUB_OUTPUT
74+
75+
# Sparse-checkout: we clone just the scripts from the target branch for
76+
# sefaty reasons.
77+
- uses: actions/checkout@v4
78+
with:
79+
ref: ${{ steps.target_branch.outputs.TARGET_BRANCH }}
80+
sparse-checkout: resources/ci_cd/
81+
sparse-checkout-cone-mode: false
82+
if: ${{ github.event_name == 'workflow_run' }}
83+
3684
# Download the artifacts generated by "PR Handler" if this workflow was
3785
# triggered by a workflow_run event.
3886
- name: Download artifact
@@ -60,13 +108,13 @@ jobs:
60108
# Unzip the artifacts.
61109
- name: Unzip artifact
62110
if: ${{ github.event_name == 'workflow_run' }}
63-
run: unzip pr.zip
111+
run: unzip -n pr.zip
64112

65113
# Save the PR number to send messages to the user that opened it.
66-
- name: Save PR number
114+
- name: Get PR number
67115
if: ${{ github.event_name == 'workflow_run' }}
68116
id: pr_number
69-
run: echo '::set-output name=PR_NUMBER::'$(cat NR)
117+
run: echo "PR_NUMBER=$(cat NR)" >> $GITHUB_OUTPUT
70118

71119
# Send an information message to the user that opened the pull request.
72120
- name: Send information message
@@ -91,10 +139,10 @@ jobs:
91139
if: ${{ github.event_name == 'push' }}
92140

93141
# Setup Python. If you need another version, just change it below.
94-
- name: Setup Python 3.7
142+
- name: Setup Python 3.11
95143
uses: actions/setup-python@v2
96144
with:
97-
python-version: 3.7
145+
python-version: 3.11
98146

99147
- name: Set up Clang
100148
uses: egor-tensin/setup-clang@v1
@@ -105,14 +153,17 @@ jobs:
105153
# Install the dependencies to run the Python scripts.
106154
- name: Install dependencies
107155
run: |
108-
pip install scan-build
156+
pip install -r resources/ci_cd/requirements.txt
109157
110158
# This script downloads the mandatory libraries of RTI Connext DDS for
111159
# compiling the examples
112160
- name: Install RTI Connext DDS
113-
run: python resources/ci_cd/linux_install.py
161+
run: python resources/ci_cd/linux_install.py -a ${{ matrix.architecture.name }}
114162
env:
115-
RTI_MIN_PACKAGE_URL: ${{ secrets.RTI_MIN_PACKAGE_URL }}
163+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
164+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
165+
RTI_AWS_BUCKET: ${{ secrets.RTI_AWS_BUCKET }}
166+
RTI_AWS_PATH: ${{ secrets.RTI_AWS_PATH }}
116167

117168
# This script will compile the examples and execute the static analysis.
118169
- name: Build all the examples

.github/workflows/prhandler.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,30 @@ jobs:
2525
- name: Save PR number
2626
run: echo ${{ github.event.number }} > ${{ github.workspace }}/NR
2727

28+
# Save the PR number for the next workflow to create the current
29+
# workflow artifact along with the repository itself.
30+
- name: Save target branch
31+
run: echo ${{ github.base_ref }} > ${{ github.workspace }}/targetbranch
32+
2833
# Upload the artifacts to GitHub so that they can be used in the next
2934
# workflow.
30-
- name: Upload generated artifact
35+
- name: Upload PR changes
3136
uses: actions/upload-artifact@v3
3237
with:
3338
name: pr
34-
path: ${{ github.workspace }}
39+
path: |
40+
${{ github.workspace }}
41+
!${{ github.workspace }}/resources/ci_cd
42+
!${{ github.workspace }}/.git
43+
!${{ github.workspace }}/targetbranch
44+
if-no-files-found: error
45+
46+
# Upload the artifacts to GitHub so that they can be used in the next
47+
# workflow.
48+
- name: Upload target branch name
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: targetbranch
52+
path: |
53+
${{ github.workspace }}/targetbranch
3554
if-no-files-found: error

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ for further information about how to contribute with new examples to this reposi
1616
The examples contained in the
1717
[master](https://github.com/rticommunity/rticonnextdds-examples/tree/master)
1818
branch of this repository have been built and tested against RTI Connext DDS
19-
7.1.0. If you need examples that have been built and tested against older
19+
7.2.0. If you need examples that have been built and tested against older
2020
versions of RTI Connext DDS, please check out the appropriate branch:
2121

22+
- [release/7.1.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/7.1.0)
2223
- [release/7.0.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/7.0.0)
2324
- [release/6.1.1](https://github.com/rticommunity/rticonnextdds-examples/tree/release/6.1.1)
2425
- [release/6.1.0](https://github.com/rticommunity/rticonnextdds-examples/tree/release/6.1.0)

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.2.0

examples/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,33 @@ option(CONNEXTDDS_BUILD_WEB_INTEGRATION_SERVICE_EXAMPLES
3434
OFF
3535
)
3636

37+
option(CONNEXTDDS_BUILD_CONNEXT_SECURE_EXAMPLES
38+
"Build Connext Secure examples"
39+
OFF
40+
)
41+
3742
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/connext_dds")
3843

3944
if(CONNEXTDDS_BUILD_PERSISTENCE_SERVICE_EXAMPLES)
4045
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/persistence_service")
4146
endif()
47+
4248
if(CONNEXTDDS_BUILD_RECORDING_SERVICE_EXAMPLES)
4349
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/recording_service")
4450
endif()
51+
4552
if(CONNEXTDDS_BUILD_ROUTING_SERVICE_EXAMPLES)
4653
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/routing_service")
4754
endif()
55+
4856
if(CONNEXTDDS_BUILD_WEB_INTEGRATION_SERVICE_EXAMPLES)
4957
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/web_integration_service")
5058
endif()
59+
5160
if(CONNEXTDDS_BUILD_CLOUD_DISCOVERY_SERVICE_EXAMPLES)
5261
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/cloud_discovery_service")
5362
endif()
63+
64+
if(CONNEXTDDS_BUILD_CONNEXT_SECURE_EXAMPLES)
65+
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/connext_secure")
66+
endif()

examples/connext_dds/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ if(NOT DEFINED CONNEXTDDS_CONNEXT_DDS_EXAMPLES)
7575
"custom_transport"
7676
"deadline_contentfilter"
7777
# "discovery_snapshot"
78+
"distributed_logger"
7879
"dynamic_data_using_publisher_subscriber"
7980
"flat_data_api"
8081
"flat_data_latency"

examples/connext_dds/asynchronous_publication/cs/AsyncPublicationExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.0.0" />
9+
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.2.0" />
1010
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1"/>
1111
</ItemGroup>
1212

examples/connext_dds/coherent_presentation/c++11/application.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919

2020
namespace application {
2121

22+
// Catch control-C and tell application to shut down
23+
bool shutdown_requested = false;
24+
25+
inline void stop_handler(int)
26+
{
27+
shutdown_requested = true;
28+
std::cout << "preparing to shut down..." << std::endl;
29+
}
30+
31+
inline void setup_signal_handlers()
32+
{
33+
signal(SIGINT, stop_handler);
34+
signal(SIGTERM, stop_handler);
35+
}
36+
37+
2238
enum class ParseReturn { ok, failure, exit };
2339

2440
struct ApplicationArguments {

examples/connext_dds/custom_flow_controller/cs/FlowControllerExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.0.0" />
9+
<PackageReference Include="Rti.ConnextDds.Extra" Version="7.2.0" />
1010
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1"/>
1111
</ItemGroup>
1212

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Example Code: Distributed Logger
2+
3+
## Concept
4+
5+
RTI Distributed Logger is an API that allows publishing log messages to a DDS Topic.
6+
This will allow your distributed application to send log messages that can be monitored
7+
using tools such as RTI Spy or RTI Admin Console.
8+
9+
It is also possible to use the API directly, creating your own logging infrastructure.
10+
11+
## Example Description
12+
13+
Similar examples are available in other programming languages in the
14+
`rti_workspace/<version>/examples/distributed_logger/<language>/`
15+
folder created under your home directory when RTI Connext is installed.
16+
17+
This example shows a simple application running Distributed Logger to
18+
log several messages using different configurations.
19+
20+
The log messages can then be visualized using RTI Tools such as RTI Spy
21+
or RTI Admin Console.
22+
For example, you may find RTI Spy in your RTI Connext DDS installation
23+
and run it from a terminal as follows:
24+
25+
```sh
26+
cd rti_connext_dds-7.2.0/bin
27+
./rtiddsspy -printSample
28+
```
29+
30+
Once the Distributed Logger example is running in a different terminal,
31+
you should start seeing state information along with the logged messages
32+
on RTI Spy:
33+
34+
```txt
35+
RTI Connext DDS Spy built with DDS version: 7.2.0
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
rtiddsspy is listening for data, press CTRL+C to stop it.
38+
39+
[...]
40+
41+
09:02:38 New data from 192.168.1.228 : topic="rti/distlog" type="com::rti::dl::LogMessage"
42+
hostAndAppId:
43+
rtps_host_id: 16867916
44+
rtps_app_id: 1940525435
45+
level: 400
46+
category: ""
47+
message: "This is a warning message"
48+
messageId: 1
49+
50+
[...]
51+
```
52+
53+
To learn more about the *Distributed Logger*, refer to the Connext DDS
54+
API online documentation. (Eg.
55+
[Modern C++ Distributed Logger](https://community.rti.com/static/documentation/connext-dds/7.2.0/doc/api/connext_dds/distributed_logger/api_cpp2/index.html)).

0 commit comments

Comments
 (0)