Skip to content

Commit fb1166b

Browse files
authored
[countersyncd]: Init counter syncd module (sonic-net#3796)
What I did This pull request introduces a new Rust-based application, countersyncd, designed for high-frequency telemetry data processing in SONiC environments. It also includes updates to the build pipeline to support the new application. The key changes are grouped into two themes: application implementation and build pipeline updates. Application Implementation: New Rust Application (countersyncd): Added countersyncd as a new Rust application for processing telemetry data, including its main entry point (countersyncd/src/main.rs) and library modules for actors and messaging (countersyncd/src/lib.rs). Defined actors (NetlinkActor, SwssActor, IpfixActor, and StatsReporterActor) and their communication channels for telemetry data processing. Introduced command-line argument parsing using clap and logging configuration with env_logger. Actor and Messaging Modules: Added actor modules (netlink, ipfix, stats_reporter, and swss) for handling specific telemetry tasks. Implemented messaging structures for inter-actor communication, including SocketBufferMessage, IPFixTemplatesMessage, and NetlinkCommand. Build Pipeline Updates: Pipeline Modifications: Updated .azure-pipelines/build-template.yml to install and configure Redis for the build environment. Added a step to run unit tests for countersyncd using cargo test. Dependencies for countersyncd: Defined dependencies in countersyncd/Cargo.toml, including libraries for async runtime (tokio), YAML parsing (yaml-rust), and logging (log, env_logger). These changes collectively enable the development and integration of countersyncd into the SONiC platform while ensuring proper build and test support. Why I did it This module is required by the document: https://github.com/sonic-net/SONiC/blob/master/doc/high-frequency-telemetry/high-frequency-telemetry-hld.md How I verified it This PR includes the unittest for countersyncd, Check Azp status Signed-off-by: Ze Gan <ganze718@gmail.com>
1 parent a65c02e commit fb1166b

30 files changed

+14078
-0
lines changed

.azure-pipelines/build-template.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ jobs:
106106
libdbus-1-dev \
107107
libteam-dev
108108
sudo pip3 install lcov_cobertura
109+
sudo apt-get install -y redis-server
110+
sudo sed -i 's/notify-keyspace-events ""/notify-keyspace-events AKE/' /etc/redis/redis.conf
111+
sudo sed -ri 's/^# unixsocket/unixsocket/' /etc/redis/redis.conf
112+
sudo sed -ri 's/^unixsocketperm .../unixsocketperm 777/' /etc/redis/redis.conf
113+
sudo sed -ri 's/redis-server.sock/redis.sock/' /etc/redis/redis.conf
114+
sudo service redis-server restart
109115
displayName: "Install dependencies"
110116
- task: DownloadPipelineArtifact@2
111117
inputs:
@@ -232,6 +238,9 @@ jobs:
232238
./autogen.sh
233239
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
234240
displayName: "Compile sonic swss"
241+
- script: |
242+
cargo test
243+
displayName: "Test countersyncd"
235244
- publish: $(System.DefaultWorkingDirectory)/
236245
artifact: ${{ parameters.artifact_name }}
237246
displayName: "Archive swss debian packages"

0 commit comments

Comments
 (0)