Skip to content
Merged
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
67 changes: 15 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ jobs:
image: ubuntu:jammy-20230126
env:
working-directory: /asn1_codec
BUILD_WRAPPER_OUT_DIR: "$GITHUB_WORKSPACE/bw-output"
options: "--user root"
steps:
- name: checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
# Checkout the code from the repository

- name: Install necessary dependencies
Expand Down Expand Up @@ -76,70 +75,34 @@ jobs:
echo "export CC=gcc" >> ~/.bashrc
working-directory: ${{ env.working-directory }}

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3
# Install SonarScanner and build-wrapper for code analysis

- name: Build and Generate test coverage
run: |
sudo su - root
sudo chmod o+w /root
sudo chmod 755 -R /__w/asn1_codec/asn1_codec/
export BUILD_WRAPPER_OUT_DIR=$GITHUB_WORKSPACE/bw-output
build-wrapper-linux-x86-64 --out-dir $GITHUB_WORKSPACE/bw-output ./build.sh
mkdir coverage
cd coverage
gcov $GITHUB_WORKSPACE/kafka-test/src/*.cpp --object-directory /__w/asn1-codec/asn1-codec/build/kafka-test/CMakeFiles/Kafka-TestLib.dir/src/
gcov $GITHUB_WORKSPACE/src/*.cpp --object-directory /__w/asn1-codec/asn1-codec/build/CMakeFiles/ppm_tests.dir/src/
chmod +x build.sh
./build.sh
mkdir -p coverage
gcovr \
--root $GITHUB_WORKSPACE \
--object-directory $GITHUB_WORKSPACE/build \
--sonarqube coverage/coverage.xml \
--exclude '.*pugixml.*' \
--exclude '.*librdkafka.*'
working-directory: ${{ env.working-directory }}

- name: Archive code coverage results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: asn1-codec
path: /__w/asn1-codec/asn1-codec/coverage/
# Archive code coverage results for later reference

- name: Archive buildwrapper output
uses: actions/upload-artifact@v4
with:
name: asn1-codec
path: /home/runner/work/asn1-codec/asn1-codec/bw-output
# Archive build-wrapper output

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'

- name: Setup SonarScanner
uses: warchant/setup-sonar-scanner@v7

- name: Generate sonar properties file
run: |
# Generate SonarScanner properties file
cat <<EOF > /tmp/sonar-scanner.properties
sonar.host.url=https://sonarcloud.io
sonar.projectName=asn1-codec
sonar.projectVersion=1.0
sonar.projectKey=usdot-jpo-ode_asn1-codec
sonar.organization=usdot-jpo-ode
sonar.sources=src,kafka-test/src,include
sonar.cfamily.build-wrapper-output=bw-output
sonar.cfamily.gcov.reportsPath=/__w/asn1-codec/asn1-codec/coverage/
sonar.sonar.projectBaseDir=/home/runner/work/asn1-codec/asn1-codec/
sonar.exclusions=**/*.java
sonar.coverage.exclusions=**/*.java
sonar.exclusions=pugixml/tests/data/**
# Set Git as SCM sensor
sonar.scm.disabled=true
sonar.scm.provider=git
sonar.sourceEncoding=UTF-8
EOF
- name: SonarScanner
if: github.event.pull_request.base.repo.owner.login == 'usdot-jpo-ode'
- name: SonarScanner
if: github.event_name != 'pull_request' || github.event.pull_request.base.repo.owner.login == 'usdot-jpo-ode'
uses: usdot-fhwa-stol/actions/sonar-scanner@main
with:
sonar-properties-path: /tmp/sonar-scanner.properties
sonar-token: ${{ secrets.SONAR_TOKEN }}
working-dir: $GITHUB_WORKSPACE
working-dir: ${{ github.workspace }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# === RUNTIME DEPENDENCIES IMAGE ===
FROM alpine:3.18 as runtime-deps

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]
Expand All @@ -8,11 +8,12 @@
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
librdkafka-dev \
supervisor


# === BUILDER IMAGE ===
FROM runtime-deps as builder

Check warning on line 16 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 16 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 16 in Dockerfile

View workflow job for this annotation

GitHub Actions / build / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 16 in Dockerfile

View workflow job for this annotation

GitHub Actions / publish / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]
Expand Down Expand Up @@ -70,6 +71,7 @@
# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
COPY ./supervisord.conf /etc/

# Use jemalloc for better performance than Alpine's built-in memory allocator, esp. with multithreading
RUN apk add --upgrade --no-cache jemalloc
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ VOLUME ["/asn1_codec_share"]
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
librdkafka-dev \
supervisor


# === BUILDER IMAGE ===
Expand Down Expand Up @@ -74,6 +75,7 @@ ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
COPY ./supervisord.conf /etc/

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ VOLUME ["/asn1_codec_share"]
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
librdkafka-dev \
supervisor


# === BUILDER IMAGE ===
Expand Down Expand Up @@ -75,7 +76,8 @@ RUN apk update && apk add vim nano

# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
COPY --from=builder /build /build
COPY ./supervisord.conf /etc/

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ VOLUME ["/asn1_codec_share"]
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev
librdkafka-dev \
supervisor


# === BUILDER IMAGE ===
Expand Down Expand Up @@ -66,6 +67,7 @@ ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
COPY ./supervisord.conf /etc/

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
4 changes: 3 additions & 1 deletion Dockerfile.testing
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ RUN apk add --upgrade --no-cache \
bash \
python3 \
librdkafka \
librdkafka-dev
librdkafka-dev \
supervisor


# === BUILDER IMAGE ===
Expand Down Expand Up @@ -75,6 +76,7 @@ ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build
COPY ./supervisord.conf /etc/

# run ACM
RUN chmod 7777 /asn1_codec/run_acm.sh
Expand Down
Binary file modified asn1c_combined/generated-files/2016.tar.gz
Binary file not shown.
Binary file modified asn1c_combined/generated-files/2020.tar.gz
Binary file not shown.
Binary file modified asn1c_combined/generated-files/2024.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- Version: 2.3.0-draft
-- Date: 2016-07-06
-- Updated by Frank perry at Leidos
-- Version: 2.3.0.1-draft
-- Date: 2025-06-03
-- Updated by Daniel McCoy Stephenson at Trihydro Corporation
-- Previously updated by Frank perry at Leidos
-- Developed by Purser Sturgeon II
-- at Southwest Research Institute
-- for the USDOT Connected Vehicle Test Bed
Expand Down Expand Up @@ -28,6 +29,7 @@
-- Add TimeToLive to ServiceRecord
-- Changed Weather/wipers/DSRC.WiperStatusFront to DSRC.WiperStatus
-- Changed Weather/wipers/DSRC.WiperStatusRear to DSRC.WiperStatus
-- 2.3.0.1: Updated OCTET STRING constraint for advisoryMessage to (0..7000) to support multi-region ASD TIMs


SEMI DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Expand Down Expand Up @@ -411,13 +413,13 @@ AdvisoryDetails ::= SEQUENCE {
distType DistributionType,
startTime DSRC.DFullTime OPTIONAL,
stopTime DSRC.DFullTime OPTIONAL,
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

AdvisoryBroadcast ::= SEQUENCE {
messagePsid Psid, -- PSID of advisory message
broadcastInst BroadcastInstructions OPTIONAL, -- Broadcast instructions
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

BroadcastInstructions ::= SEQUENCE {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Version: 2.4.0-draft
-- Date: 2023-12-12
-- Version: 2.4.0.1-draft
-- Date: 2025-06-03
-- Updated by Daniel McCoy Stephenson at Trihydro
-- Previously updated by Frank perry at Leidos
-- Developed by Purser Sturgeon II
Expand Down Expand Up @@ -30,6 +30,7 @@
-- Changed Weather/wipers/DSRC.WiperStatusFront to DSRC.WiperStatus
-- Changed Weather/wipers/DSRC.WiperStatusRear to DSRC.WiperStatus
-- 2.4.0: Imported dependencies from J2735 ASN 2020 files
-- 2.4.0.1: Updated OCTET STRING constraint for advisoryMessage to (0..7000) to support multi-region ASD TIMs


SEMI DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Expand Down Expand Up @@ -436,13 +437,13 @@ AdvisoryDetails ::= SEQUENCE {
distType DistributionType,
startTime DFullTime OPTIONAL,
stopTime DFullTime OPTIONAL,
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

AdvisoryBroadcast ::= SEQUENCE {
messagePsid Psid, -- PSID of advisory message
broadcastInst BroadcastInstructions OPTIONAL, -- Broadcast instructions
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

BroadcastInstructions ::= SEQUENCE {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Version: 2.4.1-draft
-- Date: 2024-11-15
-- Updated by Ivan Yourshaw at Neaera Consulting
-- Previously updated by Daniel McCoy Stephenson at Trihydro
-- Version: 2.4.2-draft
-- Date: 2025-05-09
-- Updated by Daniel McCoy Stephenson at Trihydro Corporation
-- Previously updated by Ivan Yourshaw at Neaera Consulting
-- Previously updated by Frank perry at Leidos
-- Developed by Purser Sturgeon II
-- at Southwest Research Institute
Expand Down Expand Up @@ -32,6 +32,7 @@
-- Changed Weather/wipers/DSRC.WiperStatusRear to DSRC.WiperStatus
-- 2.4.0: Imported dependencies from J2735 ASN 2020 files
-- 2.4.1: Update OIDs for imported modules to match J2735 2024 ASN files
-- 2.4.2: Updated OCTET STRING constraint for advisoryMessage to (0..7000) to support multi-region ASD TIMs


SEMI DEFINITIONS AUTOMATIC TAGS ::= BEGIN
Expand Down Expand Up @@ -441,13 +442,13 @@ AdvisoryDetails ::= SEQUENCE {
distType DistributionType,
startTime DFullTime OPTIONAL,
stopTime DFullTime OPTIONAL,
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

AdvisoryBroadcast ::= SEQUENCE {
messagePsid Psid, -- PSID of advisory message
broadcastInst BroadcastInstructions OPTIONAL, -- Broadcast instructions
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
}

BroadcastInstructions ::= SEQUENCE {
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ls -la && pwd
# build asn1_codec
mkdir build
cd build
cmake ..
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cmake --build .
make
ctest --output-on-failure
1 change: 1 addition & 0 deletions data/InputData.encoding.asd.tim.16regions.1008nodes.xml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/InputData.encoding.asd.tim.7regions.441nodes.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docker-compose-confluent-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
ACM_LOG_TO_CONSOLE: "true"
ACM_LOG_TO_FILE: "false"
ACM_LOG_LEVEL: ${ACM_LOG_LEVEL}
ACM_NUMBER_OF_PROCESSES: ${ACM_NUMBER_OF_PROCESSES:-1}
CONFLUENT_KEY: ${CONFLUENT_KEY}
CONFLUENT_SECRET: ${CONFLUENT_SECRET}
restart: on-failure
Expand All @@ -25,6 +26,7 @@ services:
ACM_LOG_TO_CONSOLE: "true"
ACM_LOG_TO_FILE: "false"
ACM_LOG_LEVEL: ${ACM_LOG_LEVEL}
ACM_NUMBER_OF_PROCESSES: ${ACM_NUMBER_OF_PROCESSES:-1}
CONFLUENT_KEY: ${CONFLUENT_KEY}
CONFLUENT_SECRET: ${CONFLUENT_SECRET}
restart: on-failure
4 changes: 1 addition & 3 deletions docker-compose-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ services:
build:
context: .
dockerfile: Dockerfile.debug
ports:
- "8080:8080"
- "9090:9090"
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
KAFKA_TYPE: "ON-PREM"
ACM_CONFIG_FILE: adm.properties
ACM_LOG_TO_CONSOLE: "${ACM_LOG_TO_CONSOLE}"
ACM_LOG_TO_FILE: "${ACM_LOG_TO_FILE}"
ACM_LOG_LEVEL: "${ACM_LOG_LEVEL}"
ACM_NUMBER_OF_PROCESSES: ${ACM_NUMBER_OF_PROCESSES:-1}
restart: on-failure
22 changes: 1 addition & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: ${DOCKER_HOST_IP}
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "j2735asn1xer:1:1,j2735asn1per:1:1,topic.Asn1DecoderInput:1:1,topic.Asn1DecoderOutput:1:1,topic.Asn1EncoderInput:1:1,topic.Asn1EncoderOutput:1:1"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
asn1_codec:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
- "9090:9090"
depends_on:
- kafka
links:
- kafka
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
KAFKA_TYPE: "ON-PREM"
ACM_CONFIG_FILE: adm.properties
ACM_LOG_TO_CONSOLE: "${ACM_LOG_TO_CONSOLE}"
ACM_LOG_TO_FILE: "${ACM_LOG_TO_FILE}"
ACM_LOG_LEVEL: "${ACM_LOG_LEVEL}"
ACM_NUMBER_OF_PROCESSES: ${ACM_NUMBER_OF_PROCESSES:-1}
restart: on-failure
11 changes: 11 additions & 0 deletions docs/Release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
asn1_codec Release Notes
----------------------------

Version 3.3.0, released April 2026
----------------------------------------
### **Summary**
This release adds support for running multiple Kafka consumer/producer processes to make efficient use
of resources within containers.

Enhancements in this release:
- [Support multiple processes/consumers](https://github.com/neaeraconsulting/asn1_codec/pull/1)
- [Increase advisoryMessage Byte Limit to Support Full TIM Region Capacity](https://github.com/usdot-jpo-ode/asn1_codec/pull/77)
- [Update SonarCloud C/C++ Analysis Using compile_commands.json](https://github.com/usdot-jpo-ode/asn1_codec/pull/80)

Version 3.2.0, released October 2025
----------------------------------------
### **Summary**
Expand Down
Loading
Loading