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

Transition to J2735 ASN 2020, Dockerfile Optimization & Updated SCMS Files #42

Merged
merged 65 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f11d59d
Switched over to using alpine:3.12 for the base image in dockerfiles.
dmccoystephenson Jul 24, 2023
d2928bb
Removing unnecessary packages
dmccoystephenson Jul 25, 2023
3f85e0b
Installed librdkafka from alpine's stable branch instead of edge.
dmccoystephenson Jul 25, 2023
494b84e
Removed test data from default dockerfile.
dmccoystephenson Sep 11, 2023
fb1f57b
Added image documentation to `docs/dockerhub.md`
dmccoystephenson Nov 10, 2023
febd5f9
Changed 'Asn.1' to 'ASN.1' in dockerhub documentation.
dmccoystephenson Nov 27, 2023
3edb810
Updated `doIt.sh` script to use all J2735 ASN files in a specified di…
dmccoystephenson Dec 5, 2023
f59d659
Revised README in `asn1c_combined` directory
dmccoystephenson Dec 5, 2023
31ab073
Added 2020 files to `asn1c_combined/j2735-asn-files/2020` directory
dmccoystephenson Dec 8, 2023
e87ce9b
Removed submodule
dmccoystephenson Dec 8, 2023
18a9dfa
Added 'mouse07410/asn1c' submodule
dmccoystephenson Dec 8, 2023
ebb5782
Modified dockerfiles to use installation process for 'mouse07410/asn1c'
dmccoystephenson Dec 8, 2023
7f37ac1
Modified `doIt.sh` script to point towards 2020 files.
dmccoystephenson Dec 8, 2023
686742d
Added error message for the ASDFRAME case in the `encode_frame_data` …
dmccoystephenson Dec 8, 2023
97ea6ed
Modified asn1c parameters in `doIt.sh` script
dmccoystephenson Dec 8, 2023
0b3a93b
Modified data files to conform to 2020 standard.
dmccoystephenson Dec 8, 2023
0f89148
Modified some logging in `acm.cpp` to improve clarity.
dmccoystephenson Dec 8, 2023
4286398
Reorganized `tests.cpp` and commented out test cases related to ASD
dmccoystephenson Dec 12, 2023
6a9380d
Added test case for encoding a TIM
dmccoystephenson Dec 12, 2023
bc1ab9f
Updated SEMI file to be compatible with J2735 ASN 2020
dmccoystephenson Dec 12, 2023
3da9390
Modified dockerfiles to include `data` directory for unit testing.
dmccoystephenson Dec 12, 2023
680a317
Commented out unit tests related to encoding BSMs
dmccoystephenson Dec 12, 2023
ad0923b
Added J2735 conformance check for incoming to-be-encoded MessageFrame…
dmccoystephenson Dec 12, 2023
ace996a
Corrected Date comment in SEMI_v2.4.0_121223_j2020.asn file.
dmccoystephenson Dec 12, 2023
bcc0d5b
Added a unit test for decoding a BSM
dmccoystephenson Dec 12, 2023
27f87d8
Added a unit test for encoding a TIM with payload type 'OdeAsdPayload'
dmccoystephenson Dec 13, 2023
362ee33
Transitioned to using updated SCMS files
dmccoystephenson Dec 19, 2023
cca7fb1
Updated SCMS files & included *Crl*.asn files
dmccoystephenson Dec 26, 2023
e928888
Merge pull request #14 from CDOT-CV/use-alpine-as-base-image
payneBrandon Jan 4, 2024
db7c5c6
Merge pull request #18 from CDOT-CV/handle-multiple-j2735-asn-files
drewjj Jan 10, 2024
8fc13d8
Merge remote-tracking branch 'origin/develop' into j2735/transition-t…
dmccoystephenson Jan 10, 2024
32c9757
Merge branch 'j2735/transition-to-2020' into 1609dot2/transition-to-e…
dmccoystephenson Jan 10, 2024
0533d94
Improved clarity of J2735 conformance check
dmccoystephenson Jan 11, 2024
213ef71
Updated dockerfiles to install flex & bison using apk
dmccoystephenson Jan 11, 2024
821f7d5
Merge branch 'j2735/transition-to-2020' into 1609dot2/transition-to-e…
dmccoystephenson Jan 12, 2024
189ede3
Committed override file for NodeOffsetPointXY class
dmccoystephenson Jan 15, 2024
f279429
Removed line in `doIt.sh` script to copy .c overrides
dmccoystephenson Jan 15, 2024
56fbe2e
Merge branch 'j2735/transition-to-2020' into 1609dot2/transition-to-e…
dmccoystephenson Jan 15, 2024
9ca7f3d
Removed ASN files & updated README with SAE links.
dmccoystephenson Jan 16, 2024
ab2560b
Modified j2735 .gitignore files to include *.ASN
dmccoystephenson Jan 16, 2024
1623536
Merge branch 'j2735/transition-to-2020' into 1609dot2/transition-to-e…
dmccoystephenson Jan 16, 2024
1311d88
Merge pull request #19 from CDOT-CV/j2735/transition-to-2020
payneBrandon Jan 16, 2024
2cec6f8
Merge pull request #17 from CDOT-CV/docs/dockerhub-description
payneBrandon Jan 16, 2024
03e60a1
Merge branch 'develop' into 1609dot2/transition-to-etsi-v2.1.1
dmccoystephenson Jan 18, 2024
e875f33
Added generated implementation/header files to source control
dmccoystephenson Jan 19, 2024
e25d1b4
Merge remote-tracking branch 'origin/asn1c/include-generated-files' i…
dmccoystephenson Jan 19, 2024
3b6b26d
Added link to `asn1c_combined/README.md` to root README
dmccoystephenson Jan 19, 2024
ef978e3
Fixed incorrect script name reference in asn1c_combined README
dmccoystephenson Jan 19, 2024
ff4ec5f
Update sonar-scanner
drewjj Jan 19, 2024
ca529d8
Merge remote-tracking branch 'origin/asn1c/include-generated-files' i…
dmccoystephenson Jan 19, 2024
241ef0f
Ran `generate-file.sh` script to update the 2020 tarball
dmccoystephenson Jan 19, 2024
16cd52f
Ran `generate-files.sh` script to update the 2016 tarball
dmccoystephenson Jan 19, 2024
bc8894a
Merge pull request #21 from CDOT-CV/asn1c/include-generated-files
payneBrandon Jan 26, 2024
a32baff
Merge branch 'usdot-jpo-ode:develop' into develop
dmccoystephenson Jan 30, 2024
ca4f4c5
Added release notes for v1.6.0
dmccoystephenson Jan 30, 2024
d565fe3
Merge pull request #20 from CDOT-CV/1609dot2/transition-to-etsi-v2.1.1
payneBrandon Jan 30, 2024
3ef47d6
Merge remote-tracking branch 'origin/develop' into docs/release-notes…
dmccoystephenson Jan 30, 2024
85762d1
Modified release notes for v1.6.0 to include updated SCMS files
dmccoystephenson Jan 30, 2024
0daa2b6
Merge pull request #22 from CDOT-CV/docs/release-notes-for-1.6.0
drewjj Jan 31, 2024
8809076
Removed unnecessary `RUN apk update` instructions in dockerfiles
dmccoystephenson Feb 1, 2024
65383c1
Added documentation for contents of the `data` & `unit-test-data` dir…
dmccoystephenson Feb 1, 2024
d98246d
Modified kafkaType check in `acm.cpp`
dmccoystephenson Feb 1, 2024
346265b
Added KAFKA_TYPE & confluent env vars to sample.env
dmccoystephenson Feb 1, 2024
f10bc08
Refactored logger setup code to improve clarity.
dmccoystephenson Feb 1, 2024
64489b2
Merge pull request #23 from CDOT-CV/addressing-usdot-pr-comments-2-1-…
drewjj Feb 1, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ jobs:
path: /home/runner/work/asn1-codec/asn1-codec/bw-output
# Archive build-wrapper output

- name: Setup SonarScanner
uses: warchant/setup-sonar-scanner@v4
- uses: actions/setup-java@v3
with:
version: 4.8.0.2856
# Set up SonarScanner for code analysis
distribution: 'temurin'
java-version: '17'

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

- name: Generate sonar properties file
run: |
Expand Down
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "asn1c"]
path = asn1c
url = https://github.com/vlm/asn1c.git
[submodule "pugixml"]
path = pugixml
url = https://github.com/zeux/pugixml.git
[submodule "scms-asn1"]
path = scms-asn1
url = https://github.com/usdot-jpo-ode/scms-asn1.git
[submodule "asn1c"]
path = asn1c
url = https://github.com/mouse07410/asn1c
67 changes: 42 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
FROM ubuntu:18.04
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root

WORKDIR /asn1_codec

VOLUME ["/asn1_codec_share"]

# Add build tools.
RUN apt-get update && apt-get install -y software-properties-common wget git make gcc-7 g++-7 gcc-7-base && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100

# Install cmake.
RUN apt-get install -y cmake

# install libtool and automake
RUN apt-get install -y automake libtool

# Install librdkafka.
RUN apt-get install -y sudo
RUN wget -qO - https://packages.confluent.io/deb/7.3/archive.key | sudo apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/7.3 stable main"
RUN add-apt-repository "deb https://packages.confluent.io/clients/deb $(lsb_release -cs) main"
RUN apt update
RUN apt-get install -y libsasl2-modules libsasl2-modules-gssapi-mit libsasl2-dev libssl-dev
RUN apt install -y librdkafka-dev
# add build dependencies
RUN apk add --upgrade --no-cache --virtual .build-deps \
cmake \
g++ \
make \
bash \
automake \
libtool \
autoconf \
librdkafka \
librdkafka-dev \
flex \
bison

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
RUN cd /asn1_codec/asn1c && aclocal && test -f configure || autoreconf -iv && ./configure && make && make install
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

dan-du-car marked this conversation as resolved.
Show resolved Hide resolved
# Generate ASN.1 API.
# Make generated files available to the build & compile example
RUN export LD_LIBRARY_PATH=/usr/local/lib
ADD ./asn1c_combined /asn1_codec/asn1c_combined
ADD ./scms-asn1 /asn1_codec/scms-asn1
RUN cd /asn1_codec/asn1c_combined && bash doIt.sh
dan-du-car marked this conversation as resolved.
Show resolved Hide resolved

# Remove any lingering .asn files
RUN rm -rf /asn1c_codec/asn1c_combined/j2735-asn-files
RUN rm -rf /asn1c_codec/asn1c_combined/semi-asn-files
RUN rm -rf /asn1c_codec/asn1c_combined/scms-asn-files

# Remove duplicate files
RUN rm -rf /asn1c_codec/asn1c_combined/generated-files

# add the source and build files
ADD CMakeLists.txt /asn1_codec
ADD ./config /asn1_codec/config
ADD ./include /asn1_codec/include
ADD ./src /asn1_codec/src
ADD ./kafka-test /asn1_codec/kafka-test
ADD ./unit-test-data /asn1_codec/unit-test-data
ADD ./data /asn1_codec/data
ADD ./run_acm.sh /asn1_codec
ADD ./data /asn1_codec/data

RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.profile
RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
Expand All @@ -54,8 +58,21 @@ RUN echo "export CC=gcc" >> ~/.bashrc
# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]

# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev

# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build

# run ACM
RUN chmod 7777 /asn1_codec/run_acm.sh
Expand Down
73 changes: 45 additions & 28 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
FROM ubuntu:18.04
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root

WORKDIR /asn1_codec

VOLUME ["/asn1_codec_share"]

# Add build tools.
RUN apt-get update && apt-get install -y software-properties-common wget git make gcc-7 g++-7 gcc-7-base && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100

#install editors vim and nano
RUN apt-get update && apt-get install -y vim
RUN apt-get update && apt-get install -y nano

# Install cmake.
RUN wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && tar -xvf cmake-3.7.2.tar.gz
RUN cd cmake-3.7.2 && ./bootstrap && make && make install && cd /home

# install libtool and automake
RUN apt-get update && apt-get install -y automake libtool

# Install librdkafka.
RUN apt-get install -y sudo
RUN wget -qO - https://packages.confluent.io/deb/7.3/archive.key | sudo apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/7.3 stable main"
RUN add-apt-repository "deb https://packages.confluent.io/clients/deb $(lsb_release -cs) main"
RUN apt update
RUN apt-get install -y libsasl2-modules libsasl2-modules-gssapi-mit libsasl2-dev libssl-dev
RUN apt install -y librdkafka-dev
# add build dependencies
RUN apk add --upgrade --no-cache --virtual .build-deps \
cmake \
g++ \
make \
bash \
automake \
libtool \
autoconf \
librdkafka \
librdkafka-dev \
flex \
bison

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
RUN cd /asn1_codec/asn1c && aclocal && test -f configure || autoreconf -iv && ./configure && make && make install
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

# Generate ASN.1 API.
# Make generated files available to the build & compile example
RUN export LD_LIBRARY_PATH=/usr/local/lib
ADD ./asn1c_combined /asn1_codec/asn1c_combined
ADD ./scms-asn1 /asn1_codec/scms-asn1
RUN cd /asn1_codec/asn1c_combined && bash doIt.sh

# Remove any lingering .asn files
RUN rm -rf /asn1c_codec/asn1c_combined/j2735-asn-files
RUN rm -rf /asn1c_codec/asn1c_combined/semi-asn-files

# Remove duplicate files
RUN rm -rf /asn1c_codec/asn1c_combined/generated-files

# add the source and build files
ADD CMakeLists.txt /asn1_codec
ADD ./config /asn1_codec/config
ADD ./include /asn1_codec/include
ADD ./src /asn1_codec/src
ADD ./kafka-test /asn1_codec/kafka-test
ADD ./unit-test-data /asn1_codec/unit-test-data
ADD ./data /asn1_codec/data
ADD ./run_acm.sh /asn1_codec
ADD ./data /asn1_codec/data

RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.profile
RUN echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
Expand All @@ -59,6 +57,25 @@ RUN echo "export CC=gcc" >> ~/.bashrc
# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make

# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec
VOLUME ["/asn1_codec_share"]

# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev

# install editors vim and nano
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

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test

Expand Down
64 changes: 41 additions & 23 deletions Dockerfile.standalone
Original file line number Diff line number Diff line change
@@ -1,52 +1,70 @@
FROM ubuntu:18.04
# === BUILDER IMAGE ===
FROM alpine:3.12 as builder
USER root

WORKDIR /asn1_codec

# Add build tools.
RUN apt-get update && apt-get install -y software-properties-common wget git make gcc-7 g++-7 gcc-7-base && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100

# Install cmake.
RUN wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && tar -xvf cmake-3.7.2.tar.gz
RUN cd cmake-3.7.2 && ./bootstrap && make && make install && cd /home

# install libtool and automake
RUN apt-get update && apt-get install -y automake libtool

# Install librdkafka.
RUN apt-get install -y sudo
RUN wget -qO - https://packages.confluent.io/deb/7.3/archive.key | sudo apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/7.3 stable main"
RUN add-apt-repository "deb https://packages.confluent.io/clients/deb $(lsb_release -cs) main"
RUN apt update
RUN apt-get install -y libsasl2-modules libsasl2-modules-gssapi-mit libsasl2-dev libssl-dev
RUN apt install -y librdkafka-dev
# add build dependencies
RUN apk add --upgrade --no-cache --virtual .build-deps \
cmake \
g++ \
make \
bash \
automake \
libtool \
autoconf \
librdkafka \
librdkafka-dev \
flex \
bison

# Install pugixml
ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
RUN cd /asn1_codec/asn1c && aclocal && test -f configure || autoreconf -iv && ./configure && make && make install
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

# Generate ASN.1 API.
# Make generated files available to the build & compile example
RUN export LD_LIBRARY_PATH=/usr/local/lib
ADD ./asn1c_combined /asn1_codec/asn1c_combined
ADD ./scms-asn1 /asn1_codec/scms-asn1
RUN cd /asn1_codec/asn1c_combined && bash doIt.sh

# Remove any lingering .asn files
RUN rm -rf /asn1c_codec/asn1c_combined/j2735-asn-files
RUN rm -rf /asn1c_codec/asn1c_combined/semi-asn-files

# Remove duplicate files
RUN rm -rf /asn1c_codec/asn1c_combined/generated-files

# add the source and build files
ADD CMakeLists.txt /asn1_codec
ADD ./config /asn1_codec/config
ADD ./include /asn1_codec/include
ADD ./src /asn1_codec/src
ADD ./kafka-test /asn1_codec/kafka-test
ADD ./unit-test-data /asn1_codec/unit-test-data
ADD ./data /asn1_codec/data
ADD ./run_acm.sh /asn1_codec
ADD ./data /asn1_codec/data

# Build acm.
RUN mkdir -p /build && cd /build && cmake /asn1_codec && make

# === RUNTIME IMAGE ===
FROM alpine:3.12
USER root
WORKDIR /asn1_codec

# add runtime dependencies
RUN apk add --upgrade --no-cache \
bash \
librdkafka \
librdkafka-dev

# copy the built files from the builder
COPY --from=builder /asn1_codec /asn1_codec
COPY --from=builder /build /build

# Add test data. This changes frequently so keep it low in the file.
ADD ./docker-test /asn1_codec/docker-test
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,8 @@ There is a provided docker-compose file (docker-compose-confluent-cloud.yml) tha

## Note
This has only been tested with Confluent Cloud but technically all SASL authenticated Kafka brokers can be reached using this method.

# Generating C Files from ASN.1 Definitions
Check here for instructions on how to generate C files from ASN.1 definitions: [ASN.1 C File Generation](asn1c_combined/README.md)

This should only be necessary if the ASN.1 definitions change. The generated files are already included in the repository.
2 changes: 1 addition & 1 deletion asn1c
Submodule asn1c updated 844 files
8 changes: 4 additions & 4 deletions asn1c_combined/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.c
*.h
*.o
Makefile*
./*.c
./*.h
./*.o
./Makefile*

Loading
Loading