Skip to content

Commit

Permalink
Enable arm64 build, add R,W tags to listed locators (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetkillioglu authored Aug 8, 2024
1 parent b6b7d0a commit 2078c91
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
.github/
.git/
.github/
fognav_msgs/.git/
fognav_msgs/.github/
.vscode/
.dockerignore
.gitignore
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/fastdds-locator-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64, arm64

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -40,7 +45,9 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ COPY fastdds_statistics_backend.repos $UNDERLAY_WS/src/fastdds_monitor_tutorial/

# Import the underlay dependencies that doesn't exist in SDK image
RUN vcs import ./src/ < $UNDERLAY_WS/src/fastdds_monitor_tutorial/underlay.repos
COPY locator.patch $UNDERLAY_WS/src/fastdds_statistics_backend/locator.patch

RUN ls -la $UNDERLAY_WS/src && \
git -C $UNDERLAY_WS/src/fastdds_statistics_backend apply locator.patch && \
. /usr/bin/ros_setup.bash && \
colcon build --cmake-args -DBUILD_TESTING=0

Expand Down
44 changes: 44 additions & 0 deletions locator.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/src/cpp/StatisticsBackend.cpp b/src/cpp/StatisticsBackend.cpp
index d0a041b..f3eef37 100644
--- a/src/cpp/StatisticsBackend.cpp
+++ b/src/cpp/StatisticsBackend.cpp
@@ -531,7 +531,7 @@ Info StatisticsBackend::get_info(
info[QOS_INFO_TAG] = participant->qos;

// Locators associated to endpoints
- std::set<std::string> locator_set;
+ std::map<std::string, std::set<std::string>> locator_map;

// Writers registered in the participant
for (const auto& writer : participant->data_writers)
@@ -539,7 +539,7 @@ Info StatisticsBackend::get_info(
// Locators associated to each writer
for (const auto& locator : writer.second.get()->locators)
{
- locator_set.insert(locator.second.get()->name);
+ locator_map[locator.second.get()->name].insert("W");
}
}

@@ -549,14 +549,18 @@ Info StatisticsBackend::get_info(
// Locators associated to each reader
for (const auto& locator : reader.second.get()->locators)
{
- locator_set.insert(locator.second.get()->name);
+ locator_map[locator.second.get()->name].insert("R");
}
}

DatabaseDump locators = DatabaseDump::array();
- for (const auto& locator : locator_set)
+ for (const auto& locator : locator_map)
{
- locators.push_back(locator);
+ std::string sources = std::accumulate(std::next(locator.second.begin()), locator.second.end(), *locator.second.begin(),
+ [](std::string a, std::string b) {
+ return a + ',' + b;
+ });
+ locators.push_back(locator.first + " [" + sources + "]");
}
info[LOCATOR_CONTAINER_TAG] = locators;
break;

0 comments on commit 2078c91

Please sign in to comment.