Skip to content

Commit

Permalink
Merge lavida (7.6.0) branch into master (#595)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description

<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
[V2XHUB Contributing
Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
paulbourelly999 authored Apr 10, 2024
2 parents 83fdf79 + bce7236 commit 9c30a8a
Show file tree
Hide file tree
Showing 174 changed files with 9,867 additions and 460 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
"postCreateCommand": "container/database.sh && container/library.sh && container/setup.sh && ldconfig"
"postCreateCommand": "container/database.sh && container/library.sh && container/setup.sh && ldconfig",

"shutdownAction": "stopCompose"

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [
Expand Down
8 changes: 5 additions & 3 deletions .devcontainer/docker-compose-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ services:
- TIME_SYNC_TOPIC=time_sync
- TIME_SYNC_PORT=7575
- SIM_V2X_PORT=5757
- SIM_INTERACTION_PORT=7576
- V2X_PORT=8686
- INFRASTRUCTURE_ID=1
- KAFKA_BROKER_ADDRESS=127.0.0.1:9092
- INFRASTRUCTURE_ID=rsu_<J2735 MAP MESSAGE INTERSECTION ID>
- INFRASTRUCTURE_NAME=<RSU_NAME>
- SENSOR_JSON_FILE_PATH=/var/www/plugins/MAP/sensors.json
secrets:
- mysql_password

Expand Down Expand Up @@ -72,7 +74,7 @@ services:
DOCKER_HOST_IP: 127.0.0.1
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "time_sync:1:1"
KAFKA_CREATE_TOPICS: "time_sync:1:1,modified_spat:1:1,v2xhub_scheduling_plan_sub:1:1,v2xhub_ssm_sub:1:1"
KAFKA_LOG_DIRS: "/kafka/kafka-logs"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: Run install_dependencies.sh script
run: |
scripts/install_dependencies.sh
Expand Down
13 changes: 11 additions & 2 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ sonar.modules= PedestrianPlugin, \
MessageReceiverPlugin, \
CARMAStreetsPlugin, \
ERVCloudForwardingPlugin, \
CDASimAdapter
CDASimAdapter, \
RSUHealthMonitorPlugin, \
TelematicBridgePlugin



Expand All @@ -82,6 +84,8 @@ TimPlugin.sonar.projectBaseDir =src/v2i-hub/TimPlugin
CARMAStreetsPlugin.sonar.projectBaseDir =src/v2i-hub/CARMAStreetsPlugin
ERVCloudForwardingPlugin.sonar.projectBaseDir =src/v2i-hub/ERVCloudForwardingPlugin
CDASimAdapter.sonar.projectBaseDir =src/v2i-hub/CDASimAdapter
RSUHealthMonitorPlugin.sonar.projectBaseDir =src/v2i-hub/RSUHealthMonitorPlugin
TelematicBridgePlugin.sonar.projectBaseDir =src/v2i-hub/TelematicBridgePlugin



Expand Down Expand Up @@ -117,7 +121,10 @@ CARMAStreetsPlugin.sonar.exclusions =test/**
ERVCloudForwardingPlugin.sonar.sources =src
CDASimAdapter.sonar.sources =src
CDASimAdapter.sonar.exclusions =test/**

RSUHealthMonitorPlugin.sonar.sources =src
RSUHealthMonitorPlugin.sonar.exclusions =test/**
TelematicBridgePlugin.sonar.sources =src
TelematicBridgePlugin.sonar.exclusions =test/**

# Tests
# Note: For C++ setting this field does not cause test analysis to occur. It only allows the test source code to be evaluated.
Expand Down Expand Up @@ -145,3 +152,5 @@ SpatPlugin.sonar.tests=test
CARMAStreetsPlugin.sonar.tests=test
ERVCloudForwardingPlugin.sonar.tests=test
CDASimAdapter.sonar.tests=test
RSUHealthMonitorPlugin.sonar.tests=test
TelematicBridgePlugin.sonar.tests=test
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
| CicleCI Build Status | Sonar Code Quality |
## Develop CI/CD Processes
| V2X-Hub Docker Image Builds (x86 or AMD) | V2X-Hub Docker Image Builds (ARM) | Sonar Code Quality |
|----------------------|---------------------|---------------------|
[![Build Workflows](https://github.com/usdot-fhwa-OPS/V2X-Hub/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/usdot-fhwa-OPS/V2X-Hub/actions/workflows/build.yml)|[![CircleCI](https://dl.circleci.com/status-badge/img/gh/usdot-fhwa-OPS/V2X-Hub/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/usdot-fhwa-OPS/V2X-Hub/tree/develop)| [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-ops_V2X-Hub&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-ops_V2X-Hub) |
## Release CI/CD Processes
| V2X-Hub Docker Image Builds (x86 or AMD) | V2X-Hub Docker Image Builds (ARM) |
|----------------------|---------------------|
[![CircleCI](https://circleci.com/gh/usdot-fhwa-OPS/V2X-Hub.svg?style=svg)](https://circleci.com/gh/usdot-fhwa-OPS/V2X-Hub) | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-ops_V2X-Hub&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-ops_V2X-Hub) |

[![Build Workflows](https://github.com/usdot-fhwa-OPS/V2X-Hub/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/usdot-fhwa-OPS/V2X-Hub/actions/workflows/build.yml)|[![CircleCI](https://dl.circleci.com/status-badge/img/gh/usdot-fhwa-OPS/V2X-Hub/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/usdot-fhwa-OPS/V2X-Hub/tree/master)|
# Overview
In order to bring infrastructure components into the Connected Vehicle architecture, you need software that will facilitate the exchange of data in a format that can be understood by both vehicles and infrastructure devices The V2X Hub, takes in data from vehicles via Basic Safety Messages (BSM) in a Society of Automotive Engineers (SAE) standard format and translates the data to a National Transportation Communications for ITS Protocol (NTCIP) that infrastructure components can understand. And vice versa. It translates Signal Phase and Timing (SPaT) data from NTCIP to SAE and sends it to the Roadside Unit (RSU) for broadcast to mobile devices, including vehicles.

Expand Down
8 changes: 5 additions & 3 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php:7.5.1
image: usdotfhwaops/php:7.6.0
container_name: php
network_mode: host
depends_on:
Expand All @@ -30,21 +30,23 @@ services:
tty: true

v2xhub:
image: usdotfhwaops/v2xhubamd:7.5.1
image: usdotfhwaops/v2xhubamd:7.6.0
container_name: v2xhub
network_mode: host
restart: always
depends_on:
- db
environment:
- MYSQL_PASSWORD=/run/secrets/mysql_password
- INFRASTRUCTURE_ID=rsu_<J2735 MAP MESSAGE INTERSECTION ID>
- INFRASTRUCTURE_NAME=<RSU_NAME>
secrets:
- mysql_password
volumes:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice:7.5.1
image: usdotfhwaops/port-drayage-webservice:7.6.0
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
49 changes: 47 additions & 2 deletions configuration/amd64/initialization.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
#!/bin/bash
directory=$(pwd)
mysqlDir="$directory/mysql"

# update and upgrade commands to update linux OS
sudo apt update -y && sudo apt upgrade -y

#installing necessary and useful apps
sudo apt-get install chromium-browser -y #Chrome required for CARMA platform/V2X Hub UI(?)
sudo apt install curl -y #Curl for downloading files over internet

#install docker
curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash

#make passwords for mysql
mkdir -p secrets && cd secrets

#creates password files where user inputs password
FILE1=mysql_root_password.txt
FILE2=mysql_password.txt
if test -f "$FILE1"; then
echo "$FILE1 exists."
else
read -p "enter password for the mysql_root_password: " sql_root_pass
echo "$sql_root_pass" > sql_root_pass.txt
#remove endline characters from password files
tr -d '\n' <sql_root_pass.txt> mysql_root_password.txt && rm sql_root_pass.txt
fi

if test -f "$FILE2"; then
echo "$FILE2 exists."
else
read -p "enter password for mysql_password: " sql_pass
echo "$sql_pass" > sql_pass.txt
#remove endline characters from password files
tr -d '\n' <sql_pass.txt> mysql_password.txt && rm sql_pass.txt
fi

#AMD64 initialzation
cd $directory
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo apt -y install python3-pip
sudo pip3 install docker-compose
sudo docker-compose pull
sudo apt update -y && sudo apt upgrade -y
sudo docker-compose up -d

#create v2xhub user
cd $mysqlDir
./add_v2xhub_user.bash

chromium-browser "http://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
6 changes: 3 additions & 3 deletions configuration/arm64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php_arm:7.5.1
image: usdotfhwaops/php_arm:7.6.0
container_name: php
network_mode: host
depends_on:
Expand All @@ -30,7 +30,7 @@ services:
tty: true

v2xhub:
image: usdotfhwaops/v2xhubarm:7.5.1
image: usdotfhwaops/v2xhubarm:7.6.0
container_name: v2xhub
network_mode: host
restart: always
Expand All @@ -44,7 +44,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice_arm:7.5.1
image: usdotfhwaops/port-drayage-webservice_arm:7.6.0
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
49 changes: 47 additions & 2 deletions configuration/arm64/initialization.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
#!/bin/bash
directory=$(pwd)
mysqlDir="$directory/mysql"

# update and upgrade commands to update linux OS
sudo apt update -y && sudo apt upgrade -y

#installing necessary and useful apps
sudo apt-get install chromium-browser -y #Chrome required for CARMA platform/V2X Hub UI(?)
sudo apt install curl -y #Curl for downloading files over internet

#install docker
curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash

#make passwords for mysql
mkdir -p secrets && cd secrets

#creates password files where user inputs password
FILE1=mysql_root_password.txt
FILE2=mysql_password.txt
if test -f "$FILE1"; then
echo "$FILE1 exists."
else
read -p "enter password for the mysql_root_password: " sql_root_pass
echo "$sql_root_pass" > sql_root_pass.txt
#remove endline characters from password files
tr -d '\n' <sql_root_pass.txt> mysql_root_password.txt && rm sql_root_pass.txt
fi

if test -f "$FILE2"; then
echo "$FILE2 exists."
else
read -p "enter password for mysql_password: " sql_pass
echo "$sql_pass" > sql_pass.txt
#remove endline characters from password files
tr -d '\n' <sql_pass.txt> mysql_password.txt && rm sql_pass.txt
fi

#ARM initialization
cd $directory
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
OS=$(lsb_release -i | awk 'FS=":" {print $3;}' | awk '{print tolower($0)}')
arch=$(dpkg --print-architecture)
curl -fsSL https://download.docker.com/linux/$OS/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=$arch] https://download.docker.com/linux/$OS $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo apt -y install python3-pip
sudo pip3 install docker-compose
sudo apt update -y && sudo apt upgrade -y
sudo docker-compose up -d

#create v2xhub user
cd $mysqlDir
./add_v2xhub_user.bash

chromium-browser "http://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
33 changes: 26 additions & 7 deletions ext/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# exit on errors
set -e

# Find number of cores available
numCPU=$(nproc)

# An OPENAPI based Qt webservice is needed by the plugins for http requests processing. A custom generated code using OPENAPI framework is located in GitHub.
pushd /tmp
QHTTPENGINE_VERSION=1.0.1
wget -O qhttpengine-${QHTTPENGINE_VERSION}.tar.gz https://github.com/nitroshare/qhttpengine/archive/refs/tags/${QHTTPENGINE_VERSION}.tar.gz
tar xvf qhttpengine-${QHTTPENGINE_VERSION}.tar.gz
cd qhttpengine-${QHTTPENGINE_VERSION}/
cmake .
make
make -j${numCPU}
make install
popd

Expand All @@ -20,7 +23,7 @@ wget -O date-${DATELIB_VERSION}.tar.gz https://github.com/HowardHinnant/date/arc
tar xvf date-${DATELIB_VERSION}.tar.gz
cd date-${DATELIB_VERSION}/
cmake .
make
make -j${numCPU}
make install
popd

Expand All @@ -29,27 +32,43 @@ ldconfig
# Server for the Qt webservice
pushd server
cmake .
make
make -j${numCPU}
make install
popd

pushd ccserver
cmake .
make
make -j${numCPU}
make install
popd

pushd pdclient
cmake .
make
make -j${numCPU}
make install
popd

# GPS Parser
pushd /tmp
if [ -d "NemaTode" ]; then
rm -r NemaTode
fi
git clone https://github.com/ckgt/NemaTode.git
cd NemaTode
cmake .
make
make -j${numCPU}
make install
popd
popd

# Nats C API
pushd /tmp
if [ -d "nats.c" ]; then
rm -r nats.c
fi
git clone https://github.com/nats-io/nats.c --branch v3.7.0
cd nats.c
cmake . -DNATS_BUILD_NO_SPIN=ON
make -j${numCPU}
make install
popd

6 changes: 6 additions & 0 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ DEPENDENCIES="build-essential \
wget \
zip \
zlib1g \
rapidjson-dev \
librapidxml-dev \
libprotobuf-c-dev \
curl"

# STOL library dependencies
Expand All @@ -41,9 +44,12 @@ LIBRARY_DEPENDENCIES=" \
# install all things needed for deployment, always done
apt-get install -y $DEPENDENCIES ${LIBRARY_DEPENDENCIES}

numCPU=$(nproc)

# install gtest
cd /usr/src/googletest/
mkdir -p build/
cd build
cmake ..
make -j${numCPU}
make install
Loading

0 comments on commit 9c30a8a

Please sign in to comment.