From d7aa0e1145d2f574bbbb7af414886fd4edc28505 Mon Sep 17 00:00:00 2001 From: Anjan Rayamajhi <18730915+arayama@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:29:24 -0400 Subject: [PATCH 01/20] Update manifest.json --- src/v2i-hub/CARMACloudPlugin/manifest.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/v2i-hub/CARMACloudPlugin/manifest.json b/src/v2i-hub/CARMACloudPlugin/manifest.json index 66aa1aaf0..bc58a1f05 100644 --- a/src/v2i-hub/CARMACloudPlugin/manifest.json +++ b/src/v2i-hub/CARMACloudPlugin/manifest.json @@ -28,6 +28,11 @@ "default":"127.0.0.1", "description":"Server IP address for V2X hub" }, + { + "key":"fetchTime", + "default":1, + "description":"Time from while the TCMs are requested, in days" + }, { "key":"WebServicePort", "default":"22222", From 5c90924d2e3b30c3c7229b8ac9870548a8d0e520 Mon Sep 17 00:00:00 2001 From: Anjan Rayamajhi <18730915+arayama@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:30:23 -0400 Subject: [PATCH 02/20] Update CARMACloudPlugin.h --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h index 3c2061463..88d0f973f 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h @@ -92,6 +92,7 @@ class CARMACloudPlugin: public PluginClient { int Main(); uint16_t webport; std::string webip; + unsigned int fetchtime; protected: void UpdateConfigSettings(); From 6cb0e7e5a29bded9f9b81ad22ab430054756869c Mon Sep 17 00:00:00 2001 From: Anjan Rayamajhi <18730915+arayama@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:31:17 -0400 Subject: [PATCH 03/20] Update CARMACloudPlugin.cpp --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp index 7497079ec..11462597a 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp @@ -22,6 +22,7 @@ CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { std::lock_guard lock(_cfgLock); GetConfigValue("WebServiceIP",webip); GetConfigValue("WebServicePort",webport); + GetConfigValue("fetchTime",fetchTime); AddMessageFilter < tsm4Message > (this, &CARMACloudPlugin::HandleCARMARequest); // Subscribe to all messages specified by the filters above. @@ -64,7 +65,7 @@ void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &r strcpy(bounds_str,""); // get current time - std::time_t tm = std::time(0)/60-1*24*60; // T minus 24 hours in min + std::time_t tm = std::time(0)/60-fetchTime*24*60; // T minus 24 hours in min while(cnt Date: Mon, 19 Jul 2021 12:33:21 -0400 Subject: [PATCH 04/20] Update manifest.json --- src/v2i-hub/CARMACloudPlugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/manifest.json b/src/v2i-hub/CARMACloudPlugin/manifest.json index bc58a1f05..fe0d31177 100644 --- a/src/v2i-hub/CARMACloudPlugin/manifest.json +++ b/src/v2i-hub/CARMACloudPlugin/manifest.json @@ -30,7 +30,7 @@ }, { "key":"fetchTime", - "default":1, + "default":"1", "description":"Time from while the TCMs are requested, in days" }, { From 7b8629d46ccd622da447a9d3b2fba0c6d9a735c0 Mon Sep 17 00:00:00 2001 From: Anjan Rayamajhi <18730915+arayama@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:33:54 -0400 Subject: [PATCH 05/20] Update CARMACloudPlugin.h --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h index 88d0f973f..629669a5c 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h @@ -92,7 +92,7 @@ class CARMACloudPlugin: public PluginClient { int Main(); uint16_t webport; std::string webip; - unsigned int fetchtime; + uint16_t fetchtime; protected: void UpdateConfigSettings(); From 3fb079e09a4bc0e4d5d2fa2b2d5e812b26765b1b Mon Sep 17 00:00:00 2001 From: Anjan Rayamajhi <18730915+arayama@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:34:48 -0400 Subject: [PATCH 06/20] Update CARMACloudPlugin.cpp --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp index 11462597a..5a149189a 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp @@ -22,7 +22,7 @@ CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { std::lock_guard lock(_cfgLock); GetConfigValue("WebServiceIP",webip); GetConfigValue("WebServicePort",webport); - GetConfigValue("fetchTime",fetchTime); + GetConfigValue("fetchTime",fetchTime); AddMessageFilter < tsm4Message > (this, &CARMACloudPlugin::HandleCARMARequest); // Subscribe to all messages specified by the filters above. From 4551c933b62c7430d076a4a4591d2a74e6f9548b Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:37:54 -0400 Subject: [PATCH 07/20] Update CARMACloudPlugin.cpp --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp index 5a149189a..86b8413b8 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp @@ -22,7 +22,7 @@ CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { std::lock_guard lock(_cfgLock); GetConfigValue("WebServiceIP",webip); GetConfigValue("WebServicePort",webport); - GetConfigValue("fetchTime",fetchTime); + GetConfigValue("fetchtime",fetchtime); AddMessageFilter < tsm4Message > (this, &CARMACloudPlugin::HandleCARMARequest); // Subscribe to all messages specified by the filters above. @@ -65,7 +65,7 @@ void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &r strcpy(bounds_str,""); // get current time - std::time_t tm = std::time(0)/60-fetchTime*24*60; // T minus 24 hours in min + std::time_t tm = std::time(0)/60-fetchtime*24*60; // T minus 24 hours in min while(cnt Date: Tue, 24 Aug 2021 10:48:42 -0400 Subject: [PATCH 08/20] fix for issue#124- red status is always flashing --- src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp b/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp index 3151874d0..ca26bec96 100644 --- a/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp +++ b/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp @@ -332,7 +332,7 @@ void Ntcip1202::populateVehicleSignalGroup(MovementState *movement, int phase) MovementEvent *stateTimeSpeed = (MovementEvent *) calloc(1, sizeof(MovementEvent)); bool isFlashing = getPhaseFlashingStatus(phase); - bool forceFlashing = isFlashingStatus() && !isPhaseFlashing(); + bool forceFlashing = isFlashingStatus(); if(getPhaseRedStatus(phase)) { From db75d315a73b31b1d59138f1976807787b562697 Mon Sep 17 00:00:00 2001 From: snallamothu Date: Tue, 24 Aug 2021 14:36:38 -0400 Subject: [PATCH 09/20] fix2 for issue#124- red status is always flashing --- src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp b/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp index ca26bec96..21c90244d 100644 --- a/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp +++ b/src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp @@ -336,7 +336,11 @@ void Ntcip1202::populateVehicleSignalGroup(MovementState *movement, int phase) if(getPhaseRedStatus(phase)) { - if(forceFlashing || isFlashing) + PLOG(logDEBUG3) << "Phase " << phase << + " Red " << getPhaseRedStatus(phase) << + ", isFlashing " << isFlashing << + ", forceFlashing " << forceFlashing ; + if(isFlashing) stateTimeSpeed->eventState = MovementPhaseState_stop_Then_Proceed; else stateTimeSpeed->eventState = MovementPhaseState_stop_And_Remain; @@ -353,8 +357,8 @@ void Ntcip1202::populateVehicleSignalGroup(MovementState *movement, int phase) } else if(getPhaseGreensStatus(phase)) { - //TODO Add protected and permissive - stateTimeSpeed->eventState = MovementPhaseState_permissive_Movement_Allowed; + //TODO Add logic for permissive which I am not sure we can figure out based on what's in the Spat status being provide by the controller. + stateTimeSpeed->eventState = MovementPhaseState_protected_Movement_Allowed; } else { From 0fc3ed1ba8c2965fa0e1a58cc134709ae1dcc797 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Mon, 2 Aug 2021 10:44:53 -0400 Subject: [PATCH 10/20] Issue-228:No volume PHP image Issue-228:Corrected Docker-compose Issue-228: Moved dockerfile and rmv line Issue-228:Undo docker-compose arm changes --- .circleci/config.yml | 4 ++++ configuration/amd64/docker-compose.yml | 4 +--- configuration/arm64/post-initialization.yml | 4 +--- docker/php.yml | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 docker/php.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 30f8a271d..d224b5365 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,6 +164,7 @@ jobs: cd configuration/amd64/ docker-compose up -d db cd ../../ + docker build -f docker/php.yml -t usdotfhwaops/php:${CIRCLE_BRANCH,,} . docker build --network=host -t usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} . - run: @@ -172,6 +173,7 @@ jobs: command: | echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} + docker push usdotfhwaops/php:${CIRCLE_BRANCH,,} docker_build&push_develop : machine: image: ubuntu-1604:202004-01 @@ -184,6 +186,7 @@ jobs: cd configuration/amd64/ docker-compose up -d db cd ../../ + docker build -f docker/php.yml -t usdotfhwaops/php:latest . docker build --network=host -t usdotfhwaops/v2xhubamd:latest . - run: @@ -192,6 +195,7 @@ jobs: command: | echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:latest + docker push usdotfhwaops/php:latest workflows: version: 2 build: diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 898c1dc80..dc43d78b7 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -18,10 +18,8 @@ services: - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql php: - image: php:7.2.2-apache + image: usdotfhwaops/php:latest container_name: php - volumes: - - ../../web/:/var/www/html/ network_mode: host depends_on: - db diff --git a/configuration/arm64/post-initialization.yml b/configuration/arm64/post-initialization.yml index 1d7dca5f7..cf9ee5255 100644 --- a/configuration/arm64/post-initialization.yml +++ b/configuration/arm64/post-initialization.yml @@ -20,10 +20,8 @@ services: - ./mysql/script_credentials.sh:/docker-entrypoint-initdb.d/script_credentials.sh php: - image: php:7.2.2-apache + image: usdotfhwaops/php:latest container_name: php - volumes: - - ../../web/:/var/www/html/ network_mode: host restart: always depends_on: diff --git a/docker/php.yml b/docker/php.yml new file mode 100644 index 000000000..7e4846469 --- /dev/null +++ b/docker/php.yml @@ -0,0 +1,2 @@ +FROM php:7.2.2-apache +COPY web/ /var/www/html/ From 9359b368e02041fc97d8ae6087bceb3101817ff3 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Wed, 30 Jun 2021 18:15:56 -0400 Subject: [PATCH 11/20] Issue-201: Removed Plain text password Issue-201: Rmv mysql dependency from Dockerfile + Moved plugin install calls to service.sh script + Added Docker secrets to docker-compose + Changed tmx/ivp to load MYSQL_PASSWORD as a path to a file Issue-201: Removed secrets from commits Issue-201: Removed old scripts and add new script Issue-201: Added initialization script back Issue-201:Remove network=host from docker build Issue-201: Miriad DB Issue-201:Removed Sonarscanner messagelogger Issue-201: Revert sonar-scanner.properties Issue-201:Final Commit --- .circleci/config.yml | 20 ++-- Dockerfile | 19 ---- configuration/amd64/docker-compose.yml | 19 +++- configuration/amd64/initialization.sh | 29 +----- configuration/amd64/mysql/add_v2xhub_user.sh | 29 ++++++ .../amd64/mysql/script_credentials.sh | 2 - configuration/arm64/docker-compose.yml | 48 +++++++--- configuration/arm64/initialization.sh | 94 ++----------------- configuration/arm64/mysql/add_v2xhub_user.sh | 29 ++++++ configuration/arm64/mysql/install_db.sh | 5 - .../arm64/mysql/script_credentials.sh | 2 - configuration/arm64/post-initialization.yml | 44 --------- container/service.sh | 20 ++++ data/DatabaseSetup/install_db.sh | 36 ------- src/tmx/TmxCore/src/ivpcore.cpp | 11 ++- .../src/database/DbConnectionPool.cpp | 14 ++- 16 files changed, 165 insertions(+), 256 deletions(-) create mode 100755 configuration/amd64/mysql/add_v2xhub_user.sh delete mode 100644 configuration/amd64/mysql/script_credentials.sh create mode 100755 configuration/arm64/mysql/add_v2xhub_user.sh delete mode 100644 configuration/arm64/mysql/install_db.sh delete mode 100644 configuration/arm64/mysql/script_credentials.sh delete mode 100644 configuration/arm64/post-initialization.yml delete mode 100755 data/DatabaseSetup/install_db.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index d224b5365..20427563f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -159,17 +159,13 @@ jobs: - checkout - run: name: Docker Build - # Run MYSQL image and build v2xhub docker image + # Build v2xhub and php docker branch images command: | - cd configuration/amd64/ - docker-compose up -d db - cd ../../ docker build -f docker/php.yml -t usdotfhwaops/php:${CIRCLE_BRANCH,,} . - docker build --network=host -t usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} . - + docker build -t usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} . - run: name: Docker Push - # Push v2xhub docker image to usdotfhwaops dockerhub + # Push v2xhub and php docker images to usdotfhwaops dockerhub command: | echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} @@ -181,17 +177,13 @@ jobs: - checkout - run: name: Docker Build - # Run MYSQL image and build v2xhub docker image develop image + # Build v2xhub and php docker images develop images command: | - cd configuration/amd64/ - docker-compose up -d db - cd ../../ docker build -f docker/php.yml -t usdotfhwaops/php:latest . - docker build --network=host -t usdotfhwaops/v2xhubamd:latest . - + docker build -t usdotfhwaops/v2xhubamd:latest . - run: name: Docker Push - # Push v2xhub docker image to usdotfhwaops dockerhub + # Push v2xhub and php docker images to usdotfhwaops dockerhub command: | echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:latest diff --git a/Dockerfile b/Dockerfile index f0663ab15..9015666b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ RUN mkdir /usr/local/lib/googletest RUN ln -s /usr/lib/libgtest.a /usr/local/lib/googletest/libgtest.a RUN ln -s /usr/lib/libgtest_main.a /usr/local/lib/googletest/libgtest_main.a RUN ldconfig -ENV MYSQL_ROOT_PASSWORD ivp RUN mkdir ~/V2X-Hub COPY . /home/V2X-Hub @@ -121,7 +120,6 @@ RUN chmod +x /home/V2X-Hub/container/wait-for-it.sh WORKDIR /var/www/ RUN mkdir ~/plugins WORKDIR /home/V2X-Hub/src/v2i-hub/ -RUN tmxctl --plugin-install CommandPlugin.zip WORKDIR /var/www/plugins/ RUN mkdir /var/www/plugins/MAP RUN mkdir /var/www/plugins/.ssl @@ -132,23 +130,6 @@ RUN openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout tmxcmd.key -out tm RUN chown plugin * RUN chgrp www-data * WORKDIR /home/V2X-Hub/src/v2i-hub/ -RUN tmxctl --plugin-install CswPlugin.zip -RUN tmxctl --plugin-install DmsPlugin.zip -RUN tmxctl --plugin-install DsrcImmediateForwardPlugin.zip -RUN tmxctl --plugin-install LocationPlugin.zip -RUN tmxctl --plugin-install MapPlugin.zip -RUN tmxctl --plugin-install MessageReceiverPlugin.zip -RUN tmxctl --plugin-install ODEPlugin.zip -RUN tmxctl --plugin-install RtcmPlugin.zip -RUN tmxctl --plugin-install SpatPlugin.zip -RUN tmxctl --plugin-install PreemptionPlugin.zip -RUN tmxctl --plugin-install SPaTLoggerPlugin.zip -RUN tmxctl --plugin-install MessageLoggerPlugin.zip -RUN tmxctl --plugin-install PedestrianPlugin.zip -RUN tmxctl --plugin-install TimPlugin.zip -RUN tmxctl --plugin-install CARMACloudPlugin.zip -RUN tmxctl --plugin-install MobilityOperationPlugin.zip -RUN tmxctl --plugin-install ODELoggerPlugin.zip RUN sudo mkdir /home/V2X-Hub/.base-image diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index dc43d78b7..da7f207f3 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -8,13 +8,13 @@ services: environment: - MYSQL_DATABASE=IVP - MYSQL_USER=IVP - - MYSQL_PASSWORD=ivp - - MYSQL_ROOT_PASSWORD=ivp - - username=${username} - - password=${password} + - MYSQL_PASSWORD_FILE=/run/secrets/mysql_password + - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password network_mode: host + secrets: + - mysql_password + - mysql_root_password volumes: - - ./mysql/script_credentials.sh:/docker-entrypoint-initdb.d/script_credentials.sh - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql php: @@ -33,6 +33,15 @@ services: restart: always depends_on: - php + environment: + - MYSQL_PASSWORD=/run/secrets/mysql_password + secrets: + - mysql_password volumes: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP +secrets: + mysql_password: + file: ./secrets/mysql_password.txt + mysql_root_password: + file: ./secrets/mysql_root_password.txt diff --git a/configuration/amd64/initialization.sh b/configuration/amd64/initialization.sh index a29f0515a..9a9f68e18 100755 --- a/configuration/amd64/initialization.sh +++ b/configuration/amd64/initialization.sh @@ -1,30 +1,4 @@ #!/bin/bash - -# takes user-provided username and password for docker-compose.yml and stores in .env file -echo "Please enter a username: " -read USER -echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol." -echo "Please enter a password: " -read -s PASS - -PASS_LENGTH=`echo $PASS | wc -c` - -if [ $PASS_LENGTH -ge 8 ] && echo $PASS | grep -q [a-z] && echo $PASS | grep -q [A-Z] && echo $PASS | grep -q [0-9] && echo $PASS | grep -q [\$\!\.\+_-\*@\#\^%\?~]; then - sudo echo "username=$USER" > .env - sudo echo "password=$PASS" >> .env - echo "Confirm password: " - read -s CONF_PASS - while [ $CONF_PASS != $PASS ]; do - echo "Passwords do not match. Please re-enter password: " - read -s CONF_PASS - done - sudo echo "VALID PASSWORD" -else - sudo echo "INVALID PASSWORD" - sudo echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol" - exit 1 -fi - 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 @@ -34,4 +8,5 @@ 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 up -d \ No newline at end of file +sudo docker-compose pull +sudo docker-compose up -d diff --git a/configuration/amd64/mysql/add_v2xhub_user.sh b/configuration/amd64/mysql/add_v2xhub_user.sh new file mode 100755 index 000000000..77672c300 --- /dev/null +++ b/configuration/amd64/mysql/add_v2xhub_user.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Fail when any command fails +#set -e +# Ensure mysql-client is installed +sudo apt-get update +sudo apt-get install mysql-client + +# Adds V2X-Hub user to mysql db +read -p "Please enter a username: " USER +echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol." +read -s -p "Please enter a password: " PASS + +PASS_LENGTH=`echo $PASS | wc -c` + +if [ $PASS_LENGTH -ge 8 ] && echo $PASS | grep -q [a-z] && echo $PASS | grep -q [A-Z] && echo $PASS | grep -q [0-9] && echo $PASS | grep -q [\$\!\.\+_-\*@\#\^%\?~]; then + echo "Confirm password: " + read -s CONF_PASS + while [ $CONF_PASS != $PASS ]; do + echo "Passwords do not match. Please re-enter password: " + read -s CONF_PASS + done + echo "VALID PASSWORD" + echo "Enter MYSQL ROOT PASSWORD: " + mysql -uroot -p --silent -h127.0.0.1 -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('$USER', '$PASS', 3)" +else + echo "INVALID PASSWORD" + echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol" + exit 1 +fi diff --git a/configuration/amd64/mysql/script_credentials.sh b/configuration/amd64/mysql/script_credentials.sh deleted file mode 100644 index 147ab360f..000000000 --- a/configuration/amd64/mysql/script_credentials.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -x -mysql -uroot -pivp --silent -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('$username', '$password', 3)" diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index 9478da218..cab2e4176 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -6,18 +6,44 @@ services: container_name: mysql restart: always environment: - MYSQL_DATABASE: IVP - MYSQL_USER: IVP - MYSQL_PASSWORD: ivp - MYSQL_ROOT_PASSWORD: ivp - username: ${username} - password: ${password} + - MYSQL_DATABASE=IVP + - MYSQL_USER=IVP + - MYSQL_PASSWORD_FILE=/run/secrets/mysql_password + - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password network_mode: host + secrets: + - mysql_password + - mysql_root_password volumes: - - "mysql_db:/var/lib/mysql" - - ./mysql/install_db.sh:/docker-entrypoint-initdb.d/install_db.sh - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - - ./mysql/script_credentials.sh:/docker-entrypoint-initdb.d/script_credentials.sh -volumes: - mysql_db: + php: + image: php:7.2.2-apache + container_name: php + volumes: + - ../../web/:/var/www/html/ + network_mode: host + depends_on: + - db + stdin_open: true + tty: true + + v2xhub: + image: usdotfhwaops/v2xhubarm:latest + container_name: v2xhub + network_mode: host + restart: always + depends_on: + - php + environment: + - MYSQL_PASSWORD=/run/secrets/mysql_password + secrets: + - mysql_password + volumes: + - ./logs:/var/log/tmx + - ./MAP:/var/www/plugins/MAP +secrets: + mysql_password: + file: ./secrets/mysql_password.txt + mysql_root_password: + file: ./secrets/mysql_root_password.txt diff --git a/configuration/arm64/initialization.sh b/configuration/arm64/initialization.sh index 371873a6e..f438f3ec1 100755 --- a/configuration/arm64/initialization.sh +++ b/configuration/arm64/initialization.sh @@ -1,85 +1,11 @@ #!/bin/bash - -set -e - -# takes user-provided username and password for docker-compose.yml and stores in .env file -echo "Please enter a username: " -read USER -echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol." -echo "Please enter a password: " -read -s PASS - -PASS_LENGTH=`echo $PASS | wc -c` - -if [ $PASS_LENGTH -ge 8 ] && echo $PASS | grep -q [a-z] && echo $PASS | grep -q [A-Z] && echo $PASS | grep -q [0-9] && echo $PASS | grep -q [\$\!\.\+_-\*@\#\^%\?~]; then - sudo echo "username=$USER" > .env - sudo echo "password=$PASS" >> .env - echo "Confirm password: " - read -s CONF_PASS - while [ $CONF_PASS != $PASS ]; do - echo "Passwords do not match. Please re-enter password: " - read -s CONF_PASS - done - sudo echo "VALID PASSWORD" -else - sudo echo "INVALID PASSWORD" - sudo echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol" - exit 1 -fi - -# Max query attempts before consider setup failed -MAX_TRIES=10 - -if - cat initializationLog.txt | grep "First Initialization Complete." -then - function postInitialization() { - sudo docker-compose up -d - } - - postInitialization "MariaDB" - -else - 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=arm64] 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 up -d - # Return true-like values if and only if logs - # contain the expected "ready" line - function dbIsReady() { - sudo docker-compose logs db | grep "MySQL init process done. Ready for start up." - } - - function waitUntilServiceIsReady() { - attempt=1 - while [ $attempt -le $MAX_TRIES ]; do - if "$@"; then - echo "MariaDB container is up!" - echo "First Initialization Complete." >> initializationLog.txt - sleep 60 - sudo rm docker-compose.yml - sudo mv post-initialization.yml docker-compose.yml - sudo docker stop $(sudo docker ps -a -q) - sudo docker-compose up -d - sleep 5 - break - fi - echo "Waiting for MariaDB container... (attempt: $((attempt++)))" - sleep 60 - done - - if [ $attempt -gt $MAX_TRIES ]; then - echo "Error: MariaDB not responding, cancelling set up" - exit 1 - fi - } - - waitUntilServiceIsReady dbIsReady "MariaDB" - -fi +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 up -d diff --git a/configuration/arm64/mysql/add_v2xhub_user.sh b/configuration/arm64/mysql/add_v2xhub_user.sh new file mode 100755 index 000000000..77672c300 --- /dev/null +++ b/configuration/arm64/mysql/add_v2xhub_user.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Fail when any command fails +#set -e +# Ensure mysql-client is installed +sudo apt-get update +sudo apt-get install mysql-client + +# Adds V2X-Hub user to mysql db +read -p "Please enter a username: " USER +echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol." +read -s -p "Please enter a password: " PASS + +PASS_LENGTH=`echo $PASS | wc -c` + +if [ $PASS_LENGTH -ge 8 ] && echo $PASS | grep -q [a-z] && echo $PASS | grep -q [A-Z] && echo $PASS | grep -q [0-9] && echo $PASS | grep -q [\$\!\.\+_-\*@\#\^%\?~]; then + echo "Confirm password: " + read -s CONF_PASS + while [ $CONF_PASS != $PASS ]; do + echo "Passwords do not match. Please re-enter password: " + read -s CONF_PASS + done + echo "VALID PASSWORD" + echo "Enter MYSQL ROOT PASSWORD: " + mysql -uroot -p --silent -h127.0.0.1 -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('$USER', '$PASS', 3)" +else + echo "INVALID PASSWORD" + echo "Password must be 8-12 charcters, and contain at least one of each of the following: uppercase letter, lowercase letter, number, and symbol" + exit 1 +fi diff --git a/configuration/arm64/mysql/install_db.sh b/configuration/arm64/mysql/install_db.sh deleted file mode 100644 index 4c69cff93..000000000 --- a/configuration/arm64/mysql/install_db.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -x - -mysql -uroot -pivp --silent -e "SHOW STATUS WHERE Variable_name = 'Uptime' and Value > 0;" -mysql -uroot -pivp -e "CREATE DATABASE IF NOT EXISTS IVP; GRANT ALL PRIVILEGES ON IVP.* To 'IVP'@'127.0.0.1' IDENTIFIED BY 'ivp';" -mysql -v -uIVP -pivp IVP < /docker-entrypoint-initdb.d/localhost.sql diff --git a/configuration/arm64/mysql/script_credentials.sh b/configuration/arm64/mysql/script_credentials.sh deleted file mode 100644 index 147ab360f..000000000 --- a/configuration/arm64/mysql/script_credentials.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -x -mysql -uroot -pivp --silent -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('$username', '$password', 3)" diff --git a/configuration/arm64/post-initialization.yml b/configuration/arm64/post-initialization.yml deleted file mode 100644 index cf9ee5255..000000000 --- a/configuration/arm64/post-initialization.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: '3.7' - -services: - db: - image: mariadb:10.4 - container_name: mysql - restart: always - environment: - MYSQL_DATABASE: IVP - MYSQL_USER: IVP - MYSQL_PASSWORD: ivp - MYSQL_ROOT_PASSWORD: ivp - username: ${username} - password: ${password} - network_mode: host - volumes: - - "mysql_db:/var/lib/mysql" - - ./mysql/install_db.sh:/docker-entrypoint-initdb.d/install_db.sh - - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - - ./mysql/script_credentials.sh:/docker-entrypoint-initdb.d/script_credentials.sh - - php: - image: usdotfhwaops/php:latest - container_name: php - network_mode: host - restart: always - depends_on: - - db - stdin_open: true - tty: true - - v2xhub: - image: usdotfhwaops/v2xhubarm:latest - container_name: v2xhub - network_mode: host - restart: always - depends_on: - - php - volumes: - - ./logs:/var/log/tmx - - ./MAP:/var/www/plugins/MAP - -volumes: - mysql_db: diff --git a/container/service.sh b/container/service.sh index f29970b79..808754dad 100644 --- a/container/service.sh +++ b/container/service.sh @@ -2,5 +2,25 @@ chmod +x /home/V2X-Hub/container/wait-for-it.sh /home/V2X-Hub/container/wait-for-it.sh 127.0.0.1:3306 chmod 777 /var/log/tmx +echo ${MYSQL_ROOT_PASSWORD} +tmxctl --plugin-install CommandPlugin.zip +tmxctl --plugin-install CswPlugin.zip +tmxctl --plugin-install DmsPlugin.zip +tmxctl --plugin-install DsrcImmediateForwardPlugin.zip +tmxctl --plugin-install LocationPlugin.zip +tmxctl --plugin-install MapPlugin.zip +tmxctl --plugin-install MessageReceiverPlugin.zip +tmxctl --plugin-install ODEPlugin.zip +tmxctl --plugin-install RtcmPlugin.zip +tmxctl --plugin-install SpatPlugin.zip +tmxctl --plugin-install PreemptionPlugin.zip +tmxctl --plugin-install SPaTLoggerPlugin.zip +tmxctl --plugin-install MessageLoggerPlugin.zip +tmxctl --plugin-install PedestrianPlugin.zip +tmxctl --plugin-install TimPlugin.zip +tmxctl --plugin-install CARMACloudPlugin.zip +tmxctl --plugin-install MobilityOperationPlugin.zip +tmxctl --plugin-install ODELoggerPlugin.zip + tmxctl --plugin CommandPlugin --enable /usr/local/bin/tmxcore diff --git a/data/DatabaseSetup/install_db.sh b/data/DatabaseSetup/install_db.sh deleted file mode 100755 index efe9e0d10..000000000 --- a/data/DatabaseSetup/install_db.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -x - - -DBROOTUSER="root" - -DBROOTPASS=$MYSQL_ROOT_PASSWORD - -# Test out the connection to the server -mysql -u$DBROOTUSER -p$DBROOTPASS --silent -e "SHOW STATUS WHERE Variable_name = 'Uptime' and Value > 0;" - -# Install the database -DBUSER="IVP" -DBPASS=$MYSQL_ROOT_PASSWORD -mysql -u$DBROOTUSER -p$DBROOTPASS -e "CREATE DATABASE IF NOT EXISTS $DBUSER; GRANT ALL PRIVILEGES ON $DBUSER.* To '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASS';" -if [ -f ./localhost.sql ]; then - mysql -v -u$DBUSER -p$DBPASS < ./localhost.sql -fi - -mysql -u$DBROOTUSER -p$DBROOTPASS -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('_battelle', 'B@ttelle', 3)" - -mysql -u$DBROOTUSER -p$DBROOTPASS -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('v2iadmin', 'V2iHub#321', 3)" - -set +e -id plugin >/dev/null 2>&1 -if [ $? -ne 0 ]; then - adduser --system --disabled-login --disabled-password --gecos --no-create-home plugin -fi - -usermod -a -G dialout plugin - -mkdir -p /var/log/tmx -chmod 755 /var/log/tmx - -mkdir -p /var/www/plugins -chown plugin:adm /var/www /var/www/plugins -chmod 755 /var/www/plugins diff --git a/src/tmx/TmxCore/src/ivpcore.cpp b/src/tmx/TmxCore/src/ivpcore.cpp index 941ec4f3d..50dd49d96 100644 --- a/src/tmx/TmxCore/src/ivpcore.cpp +++ b/src/tmx/TmxCore/src/ivpcore.cpp @@ -128,7 +128,7 @@ void addSystemDefinedMessageTypes() std::string GetPwd(){ - const char* EnvVar = "MYSQL_ROOT_PASSWORD"; + const char* EnvVar = "MYSQL_PASSWORD"; const char* pwd; pwd = std::getenv(EnvVar); @@ -137,8 +137,13 @@ std::string GetPwd(){ return ""; } else{ - std::string PwdStr(pwd); - return PwdStr; + std::ifstream t(pwd); + std::stringstream buffer; + buffer << t.rdbuf(); + if ( buffer.str() != "") { + std::string PwdStr = buffer.str(); + return PwdStr; + } } return ""; } diff --git a/src/tmx/TmxUtils/src/database/DbConnectionPool.cpp b/src/tmx/TmxUtils/src/database/DbConnectionPool.cpp index 411a78627..f0bebe3ae 100644 --- a/src/tmx/TmxUtils/src/database/DbConnectionPool.cpp +++ b/src/tmx/TmxUtils/src/database/DbConnectionPool.cpp @@ -120,17 +120,23 @@ void DbConnectionPool::SetConnectionUrl(std::string connectionUrl) { } std::string DbConnectionPool::GetPwd(){ - const char* EnvVar = "MYSQL_ROOT_PASSWORD"; + const char* EnvVar = "MYSQL_PASSWORD"; const char* pwd; pwd = std::getenv(EnvVar); if(pwd == NULL){ - PLOG(logERROR) << "Unable to set MYSQL_ROOT_PASSWORD)"; + PLOG(logERROR) << "Unable to set MYSQL_PASSWORD)"; return ""; } else{ - std::string PwdStr(pwd); - return PwdStr; + std::ifstream t(pwd); + std::stringstream buffer; + buffer << t.rdbuf(); + if ( buffer.str() != "") { + std::string PwdStr = buffer.str(); + PLOG(logERROR)<< "PWD " << PwdStr << "!" << std::endl; + return PwdStr; + } } return ""; } From e38498644beaa09b29f59540f68ae692dc1f22b5 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Wed, 25 Aug 2021 15:10:05 -0400 Subject: [PATCH 12/20] Issue-237: ARM CircleCI build Issue-237:Fix config.yml error Issue-237: Change to support image for ARM resource Issue-237:Fix directory name Issue-237: Added latest job and arm image names --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 20427563f..60c5eb2d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -188,6 +188,42 @@ jobs: echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:latest docker push usdotfhwaops/php:latest + + arm_build&push : + machine: + image: ubuntu-2004:202101-01 + resource_class: arm.medium + steps: + - checkout + - run: + name: Docker Build + # Run MYSQL image and build v2xhub docker image + command: | + docker build -t usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} . + + - run: + name: Docker Push + # Push v2xhub docker image to usdotfhwaops dockerhub + command: | + echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin + docker push usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} + arm_build&push_develop : + machine: + image: ubuntu-1604:202004-01 + steps: + - checkout + - run: + name: Docker Build + # Run MYSQL image and build v2xhub docker image develop image + command: | + docker build -t usdotfhwaops/v2xhubarm:latest . + + - run: + name: Docker Push + # Push v2xhub docker image to usdotfhwaops dockerhub + command: | + echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin + docker push usdotfhwaops/v2xhubarm:latest workflows: version: 2 build: @@ -201,4 +237,14 @@ workflows: branches: ignore: develop - build + - arm_build&push: + filters: + branches: + ignore: develop + - arm_build&push_develop : + filters: + branches: + only: develop + + From 7d834314fdf210a0532ad4517e966dc0e6aa6a29 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Wed, 8 Sep 2021 18:08:32 -0400 Subject: [PATCH 13/20] Issue-237: Develop ARM fix --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60c5eb2d7..2c6504e16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -210,6 +210,7 @@ jobs: arm_build&push_develop : machine: image: ubuntu-1604:202004-01 + resource_class: arm.medium steps: - checkout - run: From 84b9dbc014d3cfac6016856e1be49ae5a9c0ae50 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Thu, 9 Sep 2021 17:11:47 -0400 Subject: [PATCH 14/20] Issue-186: Corrected image name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c6504e16..5d551aef9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,7 +209,7 @@ jobs: docker push usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} arm_build&push_develop : machine: - image: ubuntu-1604:202004-01 + image: ubuntu-2004:202101-01 resource_class: arm.medium steps: - checkout From 02959a0c6453b7d5abd32af3f12b77335b13fe44 Mon Sep 17 00:00:00 2001 From: Paul K Bourelly Date: Wed, 4 Aug 2021 15:56:47 -0400 Subject: [PATCH 15/20] Issue-186:Added coverage to sonar-scanner.properties and removed sonar-scanner from V2X-Hub image Issue-186:Uncomment sonar-scanner command for non PRs Issue-186:Include only modules with test directory Issue-186:Removed MessageLoggerPlugin from properties Issue-186: fixed comments Issue-186:Attempt Sonar with docker image Issue-186:Fix directoy in scanner Issue-186:Attempt with new base image for java version Issue-186:Install java11jdk on dockerfile and use this branch image Issue-186: Set JavaHome Issue-186:Dockerfile change Issue-186:Print CircleCI java version Issue-186: Required workflows and new scanner version Issue-186:Fixed path from carma to V2X-Hub Issue-186: Remove CARMACloudPlugin Issue-186:Build-wrapper build Issue-186:Dockfile fix Issue-187:Removed extraneous Dockerfile Issue-186:CircleCI and Dockerfile changes Issue-186:Test Coverage fix Issue-186:Fix Dockerfile to use build.sh Issue-186: Source init-env.sh Issue-186:Move buildwrapper call to circleCI Issue-186: Fix bw-output Issue-186: Move coverage reports Issue-186: Fix mkdir command Issue-186:Fix file name Issue-186: CircleCI build before coverage Issue-186: Only use module coverage directory Issue-186:Remove ls Issue-186: Set host URL in command Issue-186:Test code coverage Issue-186: Fix coverage script Issue-186: Get coverage to work Issue-186: Adding Static for all code Issue-186: Correct Properties Issue-186:Adding conditions to see if code coverage changes Issue-186:Revert to Sonar setup --- .circleci/config.yml | 113 +++--------------- .sonarqube/Dockerfile | 65 ----------- .sonarqube/sonar-scanner.properties | 174 +++++++++++++++++----------- Dockerfile | 9 +- src/coverage.sh | 12 +- 5 files changed, 138 insertions(+), 235 deletions(-) delete mode 100644 .sonarqube/Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 60c5eb2d7..d6beaf394 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,16 +24,16 @@ version: 2 # Upload test results # Every run command should start with source ${INIT_ENV} to ensure all default dependencies are available jobs: - build: + sonar-scanner: # Pull docker image # XTERM used for better make output docker: - - image: ubuntu:bionic-20190807 + - image: usdotfhwaops/v2xhubamd:186-sonar-scanner-fix environment: TERM: xterm - + INIT_ENV: /home/V2X-Hub/.base-image/init-env.sh # Set working directory - working_directory: "/home/V2X-Hub-build" + working_directory: "/home/V2X-Hub" # Pull code and execute tests | # Name of each run command defines purpose use steps: @@ -42,103 +42,23 @@ jobs: docker_layer_caching: false # Checkout PR branch - checkout: - - run: - name: Install Sonar & Dependencies - command: | - set -x - apt-get update - apt-get -y install curl unzip sudo cmake gcovr gcc-7 g++-7 libboost1.65-dev libboost-thread1.65-dev libboost-regex1.65-dev libboost-log1.65-dev libboost-program-options1.65-dev libboost1.65-all-dev libxerces-c-dev libcurl4-openssl-dev libsnmp-dev libmysqlclient-dev libjsoncpp-dev uuid-dev libusb-dev libusb-1.0-0-dev libftdi-dev swig liboctave-dev gpsd libgps-dev portaudio19-dev libsndfile1-dev libglib2.0-dev libglibmm-2.4-dev libpcre3-dev libsigc++-2.0-dev libxml++2.6-dev libxml2-dev liblzma-dev dpkg-dev libmysqlcppconn-dev libev-dev libuv-dev git vim zip build-essential libssl-dev qtbase5-dev qtbase5-dev-tools curl libqhttpengine-dev libgtest-dev libcpprest-dev librdkafka-dev - - cd /home/V2X-Hub-build/ - mkdir -p ext - cd /home/V2X-Hub-build/ext/ - git clone https://github.com/usdot-fhwa-OPS/libwebsockets.git - cd /home/V2X-Hub-build/ext/libwebsockets/ - cmake -DLWS_WITH_SHARED=OFF . - make - make install - cd ../../../.. - cd /home/V2X-Hub-build/ext - git clone https://github.com/usdot-fhwa-OPS/qhttpengine.git - cd /home/V2X-Hub-build/ext/qhttpengine - cmake . - make - make install - - cd /home/V2X-Hub-build/ext/server - cmake . - make - make install - - cd /home/V2X-Hub-build/ext/ccserver - cmake . - make - make install - - cd /usr/src/googletest - mkdir build - cd /usr/src/googletest/build - cmake .. - make - make install - cd /usr/src/googletest - rm -rf build - ln -s /usr/local/lib/libgtest.a /usr/lib/libgtest.a - ln -s /usr/local/lib/libgtest_main.a /usr/lib/libgtest_main.a - cd /usr/local/lib/ - ldconfig - - cd /home/V2X-Hub-build/ext/ - git clone https://github.com/HowardHinnant/date.git - cd /home/V2X-Hub-build/ext/date - cmake . - make - make install - ldconfig - - - cd ../../../../.. - cd /home/V2X-Hub-build - mkdir .base-image - SONAR_DIR=/opt/sonarqube - mkdir $SONAR_DIR - curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip - curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip - curl -sL https://deb.nodesource.com/setup_10.x | bash - - sudo apt-get install -y nodejs - mkdir /opt/jq - curl -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -o /opt/jq/jq - chmod +x /opt/jq/jq - cd $SONAR_DIR - unzip $SONAR_DIR/sonar-scanner.zip -d . - unzip $SONAR_DIR/build-wrapper.zip -d . - rm $SONAR_DIR/sonar-scanner.zip - rm $SONAR_DIR/build-wrapper.zip - mv $(ls $SONAR_DIR | grep "sonar-scanner-") $SONAR_DIR/sonar-scanner/ - mv $(ls $SONAR_DIR | grep "build-wrapper-") $SONAR_DIR/build-wrapper/ - echo "export PATH=$PATH:/opt/jq/:$SONAR_DIR/sonar-scanner/bin/:$SONAR_DIR/build-wrapper/" > /home/V2X-Hub-build/.base-image/init-env.sh - - run: - name: Build V2I-Hub - command: | - set -x - source /home/V2X-Hub-build/.base-image/init-env.sh - cd /home/V2X-Hub-build/src - build-wrapper-linux-x86-64 --out-dir ../bw-output ./build.sh - run: name: Run Tests & Generate Gcovr Reports command: | - set -x - cd /home/V2X-Hub-build/src + source ${INIT_ENV} + cd /home/V2X-Hub/src + build-wrapper-linux-x86-64 --out-dir /home/V2X-Hub/bw-output bash build.sh ./coverage.sh - run: name: Run Sonar Scanner command: | - set -x - source /home/V2X-Hub-build/.base-image/init-env.sh + source ${INIT_ENV} + echo $PATH + cd /home/V2X-Hub/src/ if [ -z "${CIRCLE_PULL_REQUEST}" ]; then echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}" - # cd /home/V2X-Hub-build - # sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} + cd /home/V2X-Hub/ + sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} exit 0; else echo "PR branch ${CIRCLE_BRANCH}" @@ -149,8 +69,8 @@ jobs: export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') echo "Target Branch = ${TARGET_BRANCH}" - # git merge origin/${TARGET_BRANCH} - sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + cd /home/V2X-Hub/ + sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} fi docker_build&push : machine: @@ -236,7 +156,6 @@ workflows: filters: branches: ignore: develop - - build - arm_build&push: filters: branches: @@ -245,6 +164,8 @@ workflows: filters: branches: only: develop - + - sonar-scanner: + requires: + - docker_build&push diff --git a/.sonarqube/Dockerfile b/.sonarqube/Dockerfile deleted file mode 100644 index 48a75ddd6..000000000 --- a/.sonarqube/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2018-2019 LEIDOS. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# V2X-Hub CI Image Docker Configuration Script - - - -# Set environment variable for SonarQube Binaries -# Two binaries are will go in this repo. -# The Build Wrapper which executes a code build to capture C++ -# The Sonar Scanner which evaluates both C++ and Java then uploads the results to SonarCloud -ENV SONAR_DIR=/opt/sonarqube - -# Pull scanner from internet -RUN sudo apt-get -y install curl && \ - sudo mkdir $SONAR_DIR && \ - sudo curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip && \ - sudo curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && \ - # Install Dependancy of NodeJs 6+ - sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && \ - sudo sudo apt-get install -y nodejs && \ - # Install JQ Json Parser Tool - sudo mkdir /opt/jq && \ - sudo curl -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -o /opt/jq/jq && \ - sudo chmod +x /opt/jq/jq - - -# Unzip scanner -RUN cd $SONAR_DIR && \ - sudo apt-get -y install unzip && \ - sudo unzip $SONAR_DIR/sonar-scanner.zip -d . && \ - sudo unzip $SONAR_DIR/build-wrapper.zip -d . && \ - # Remove zip files - sudo rm $SONAR_DIR/sonar-scanner.zip && \ - sudo rm $SONAR_DIR/build-wrapper.zip && \ - # Rename files - sudo mv $(ls $SONAR_DIR | grep "sonar-scanner-") $SONAR_DIR/sonar-scanner/ && \ - sudo mv $(ls $SONAR_DIR | grep "build-wrapper-") $SONAR_DIR/build-wrapper/ && \ - # Add scanner, wrapper, and jq to PATH - sudo echo 'export PATH=$PATH:/opt/jq/:$SONAR_DIR/sonar-scanner/bin/:$SONAR_DIR/build-wrapper/' >> /home/carma/.base-image/init-env.sh - -# Set metadata labels -LABEL org.label-schema.schema-version="1.0" -LABEL org.label-schema.name="V2X-Hub-SonarCloud" -LABEL org.label-schema.description="Base image for CARMA CI testing using SonarCloud" -LABEL org.label-schema.vendor="Leidos" -LABEL org.label-schema.version="${VERSION}" -LABEL org.label-schema.url="https://highways.dot.gov/research/research-programs/operations" -LABEL org.label-schema.vcs-url="https://github.com/usdot-fhwa-ops/V2X-HUB" -LABEL org.label-schema.vcs-ref=${VCS_REF} -LABEL org.label-schema.build-date=${BUILD_DATE} - -# Setup environment on login - diff --git a/.sonarqube/sonar-scanner.properties b/.sonarqube/sonar-scanner.properties index 8b0a71b52..334ba3ebb 100644 --- a/.sonarqube/sonar-scanner.properties +++ b/.sonarqube/sonar-scanner.properties @@ -16,9 +16,11 @@ sonar.projectKey=usdot-fhwa-ops_V2X-Hub sonar.organization=usdot-fhwa-ops -sonar.cfamily.build-wrapper-output=bw-output +sonar.cfamily.build-wrapper-output=/home/V2X-Hub/bw-output sonar.host.url=https://sonarcloud.io sonar.sourceEncoding=UTF-8 +sonar.cfamily.threads=1 +sonar.cfamily.cache.enabled=false # Set Git as SCM sensor @@ -27,86 +29,128 @@ sonar.scm.enabled=true sonar.scm.provider=git # Modules starting with Java packages then C++ packages -sonar.modules= MessageLoggerPlugin, \ - DsrcImmediateForwardPlugin, \ - MessageReceiverPlugin, \ - PedestrianPlugin, \ +sonar.modules= PedestrianPlugin, \ PreemptionPlugin, \ - TimPlugin - # LocationPlugin, \ - # MapPlugin, \ - # ODEPlugin, \ - # RtcmPlugin, \ - # SPaTLoggerPlugin, \ - # SpatPlugin, \ - # CswPlugin, \ - # DmsPlugin, \ - # TmxCore, \ - # TmxCtl, \ - # TmxTools, \ - # TmxUtils + TmxUtils, \ + CARMACloudPlugin, \ + TimPlugin, \ + LocationPlugin, \ + MapPlugin, \ + ODEPlugin, \ + RtcmPlugin, \ + SPaTLoggerPlugin, \ + SpatPlugin, \ + CswPlugin, \ + DmsPlugin, \ + TmxCore, \ + TmxCtl, \ + TmxTools, \ + MessageLoggerPlugin, \ + CommandPlugin, \ + MobilityOperationPlugin, \ + ODELoggerPlugin, \ + DsrcImmediateForwardPlugin, \ + MessageReceiverPlugin + -# TmxCore.sonar.projectBaseDir =/home/V2X-Hub-build/src/tmx/TmxCore -# TmxCtl.sonar.projectBaseDir =/home/V2X-Hub-build/src/tmx/TmxCtl -# TmxTools.sonar.projectBaseDir =/home/V2X-Hub-build/src/tmx/TmxTools -# TmxUtils.sonar.projectBaseDir =/home/V2X-Hub-build/src/tmx/TmxUtils -MessageLoggerPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/MessageLoggerPlugin -#CswPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/CswPlugin -#DmsPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/DmsPlugin -DsrcImmediateForwardPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/DsrcImmediateForwardPlugin -#LocationPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/LocationPlugin -# MapPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/MapPlugin -MessageReceiverPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/MessageReceiverPlugin -# ODEPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/ODEPlugin -PedestrianPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/PedestrianPlugin -PreemptionPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/PreemptionPlugin -# RtcmPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/RtcmPlugin -# SPaTLoggerPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/SPaTLoggerPlugin -# SpatPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/SpatPlugin -TimPlugin.sonar.projectBaseDir =/home/V2X-Hub-build/src/v2i-hub/TimPlugin +TmxCore.sonar.projectBaseDir =/home/V2X-Hub/src/tmx/TmxCore +TmxCtl.sonar.projectBaseDir =/home/V2X-Hub/src/tmx/TmxCtl +TmxTools.sonar.projectBaseDir =/home/V2X-Hub/src/tmx/TmxTools +TmxUtils.sonar.projectBaseDir =/home/V2X-Hub/src/tmx/TmxUtils +CARMACloudPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/CARMACloudPlugin +CommandPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/CommandPlugin +CswPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/CswPlugin +MobilityOperationPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/MobilityOperationPlugin +ODELoggerPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/ODELoggerPlugin +MessageLoggerPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/MessageLoggerPlugin +DmsPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/DmsPlugin +DsrcImmediateForwardPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/DsrcImmediateForwardPlugin +LocationPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/LocationPlugin +MapPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/MapPlugin +MessageReceiverPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/MessageReceiverPlugin +ODEPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/ODEPlugin +PedestrianPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/PedestrianPlugin +PreemptionPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/PreemptionPlugin +RtcmPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/RtcmPlugin +SPaTLoggerPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/SPaTLoggerPlugin +SpatPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/SpatPlugin +TimPlugin.sonar.projectBaseDir =/home/V2X-Hub/src/v2i-hub/TimPlugin # C++ Package differences # Sources -# TmxCore.sonar.sources =src -# TmxCtl.sonar.sources =src -# TmxTools.sonar.sources =src -# TmxUtils.sonar.sources =src +TmxCore.sonar.sources =src +TmxCtl.sonar.sources =src +TmxTools.sonar.sources =src +TmxUtils.sonar.sources =src MessageLoggerPlugin.sonar.sources =src -# CswPlugin.sonar.sources =src -# DmsPlugin.sonar.sources =src +CswPlugin.sonar.sources =src +DmsPlugin.sonar.sources =src DsrcImmediateForwardPlugin.sonar.sources =src -# LocationPlugin.sonar.sources =src -# MapPlugin.sonar.sources =src +LocationPlugin.sonar.sources =src +MapPlugin.sonar.sources =src MessageReceiverPlugin.sonar.sources =src -# ODEPlugin.sonar.sources =src +ODEPlugin.sonar.sources =src PedestrianPlugin.sonar.sources =src PreemptionPlugin.sonar.sources =src -# RtcmPlugin.sonar.sources =src -# SPaTLoggerPlugin.sonar.sources =src -# SpatPlugin.sonar.sources =src +RtcmPlugin.sonar.sources =src +SPaTLoggerPlugin.sonar.sources =src +SpatPlugin.sonar.sources =src TimPlugin.sonar.sources =src +CARMACloudPlugin.sonar.sources =src +CommandPlugin.sonar.sources =src +ODELoggerPlugin.sonar.sources =src +MobilityOperationPlugin.sonar.sources =src + + + + # Gcov reports path -# TmxCore.sonar.cfamily.gcov.reportsPath =coverage -# TmxCtl.sonar.cfamily.gcov.reportsPath =coverage -# TmxTools.sonar.cfamily.gcov.reportsPath =coverage -# TmxUtils.sonar.cfamily.gcov.reportsPath =coverage -MessageLoggerPlugin.sonar.cfamily.gcov.reportsPath =coverage -# CswPlugin.sonar.cfamily.gcov.reportsPath =coverage -# DmsPlugin.sonar.cfamily.gcov.reportsPath =coverage -DsrcImmediateForwardPlugin.sonar.cfamily.gcov.reportsPath =coverage -# LocationPlugin.sonar.cfamily.gcov.reportsPath =coverage -# MapPlugin.sonar.cfamily.gcov.reportsPath =coverage -MessageReceiverPlugin.sonar.cfamily.gcov.reportsPath =coverage -# ODEPlugin.sonar.cfamily.gcov.reportsPath =coverage +#TmxCore.sonar.cfamily.gcov.reportsPath =coverage +#TmxCtl.sonar.cfamily.gcov.reportsPath =coverage +#TmxTools.sonar.cfamily.gcov.reportsPath =coverage +TmxUtils.sonar.cfamily.gcov.reportsPath =coverage +#MessageLoggerPlugin.sonar.cfamily.gcov.reportsPath =coverage +#CswPlugin.sonar.cfamily.gcov.reportsPath =coverage +#DmsPlugin.sonar.cfamily.gcov.reportsPath =coverage +#DsrcImmediateForwardPlugin.sonar.cfamily.gcov.reportsPath =coverage +#LocationPlugin.sonar.cfamily.gcov.reportsPath =coverage +#MapPlugin.sonar.cfamily.gcov.reportsPath =coverage +#MessageReceiverPlugin.sonar.cfamily.gcov.reportsPath =coverage +#ODEPlugin.sonar.cfamily.gcov.reportsPath =coverage PedestrianPlugin.sonar.cfamily.gcov.reportsPath =coverage PreemptionPlugin.sonar.cfamily.gcov.reportsPath =coverage -# RtcmPlugin.sonar.cfamily.gcov.reportsPath =coverage -# SPaTLoggerPlugin.sonar.cfamily.gcov.reportsPath =coverage -# SpatPlugin.sonar.cfamily.gcov.reportsPath =coverage -TimPlugin.sonar.cfamily.gcov.reportsPath =coverage +#RtcmPlugin.sonar.cfamily.gcov.reportsPath =coverage +#SPaTLoggerPlugin.sonar.cfamily.gcov.reportsPath =coverage +#SpatPlugin.sonar.cfamily.gcov.reportsPath =coverage +#TimPlugin.sonar.cfamily.gcov.reportsPath =coverage +#CARMACloudPlugin.sonar.cfamily.gcov.reportsPath =coverage +#MobilityOperationPlugin.sonar.cfamily.gcov.reportsPath =coverage +#ODELoggerPlugin.sonar.cfamily.gcov.reportsPath =coverage +#CommandPlugin.cfamily.gcov.reportsPath =coverage # Tests # Note: For C++ setting this field does not cause test analysis to occur. It only allows the test source code to be evaluated. -# TmxUtils.sonar.tests=test +TmxUtils.sonar.tests=test +#TmxCore.sonar.tests=test +#TmxCtl.sonar.tests=test +#TmxTools.sonar.tests=test +#MessageLoggerPlugin.sonar.tests=test +#CswPlugin.sonar.tests=test +#DmsPlugin.sonar.tests=test +#DsrcImmediateForwardPlugin.sonar.tests=test +#LocationPlugin.sonar.tests=test +#MapPlugin.sonar.tests=test +#MessageReceiverPlugin.sonar.tests=test +#ODEPlugin.sonar.tests=test +PedestrianPlugin.sonar.tests=test +PreemptionPlugin.sonar.tests=test +#RtcmPlugin.sonar.tests=test +#SPaTLoggerPlugin.sonar.tests=test +#SpatPlugin.sonar.tests=test +#TimPlugin.sonar.tests=test +#CARMACloudPlugin.sonar.tests=test +#MobilityOperationPlugin.sonar.tests=test +#ODELoggerPlugin.sonar.tests=test +#CommandPlugin.sonar.tests=test diff --git a/Dockerfile b/Dockerfile index 9015666b8..0085b6fb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -137,7 +137,7 @@ ENV SONAR_DIR=/opt/sonarqube # Pull scanner from internet RUN sudo mkdir $SONAR_DIR && \ - sudo curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip && \ + sudo curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip && \ sudo curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && \ # Install Dependancy of NodeJs 6+ sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && \ @@ -157,7 +157,12 @@ RUN cd $SONAR_DIR && \ sudo mv $(ls $SONAR_DIR | grep "sonar-scanner-") $SONAR_DIR/sonar-scanner/ && \ sudo mv $(ls $SONAR_DIR | grep "build-wrapper-") $SONAR_DIR/build-wrapper/ && \ # Add scanner, wrapper, and jq to PATH - sudo echo "export PATH=$PATH:/opt/jq/:$SONAR_DIR/sonar-scanner/bin/:$SONAR_DIR/build-wrapper/" > /home/V2X-Hub/.base-image/init-env.sh + sudo echo 'export PATH=$PATH:/opt/jq/:$SONAR_DIR/sonar-scanner/bin/:$SONAR_DIR/build-wrapper/' >> /home/V2X-Hub/.base-image/init-env.sh + +# Install gcovr for code coverage tests and add code_coverage script folder to path +RUN sudo apt-get -y install gcovr && \ + sudo echo 'export PATH=$PATH:/home/V2X-Hub/.ci-image/engineering_tools/code_coverage/' >> /home/V2X-Hub/.base-image/init-env.sh + # Set metadata labels LABEL org.label-schema.schema-version="1.0" diff --git a/src/coverage.sh b/src/coverage.sh index 59f64528d..b3cd2ebec 100755 --- a/src/coverage.sh +++ b/src/coverage.sh @@ -27,10 +27,9 @@ do echo "$TESTS built" cd $d $TESTS - gcovr -k . mkdir coverage - PLUGIN=`echo $d | cut -d "/" -f 2` - mv $(ls | grep [a-zA-Z0-9#-]*$PLUGIN | grep -v test# | grep gcov) coverage + gcovr -k -r . + mv *.gcov coverage cd ../.. else echo "no tests built" @@ -47,13 +46,12 @@ do echo "$TESTS built" cd $d $TESTS - gcovr -k . mkdir coverage - TMX=`echo $d | cut -d "/" -f 2` - mv $(ls | grep [a-zA-Z0-9#-]*$TMX | grep -v test# | grep gcov) coverage + gcovr -k -r . + mv *.gcov coverage cd ../.. else echo "no tests built" fi fi -done \ No newline at end of file +done From 4c35da013af8c98656a82061d03b5c685ae6e107 Mon Sep 17 00:00:00 2001 From: paulbourelly999 <77466294+paulbourelly999@users.noreply.github.com> Date: Thu, 16 Sep 2021 12:54:43 -0400 Subject: [PATCH 16/20] 186 add develop scanner workflow (#244) * Issue-186:Add develop scanner workflow * Issue-186:Filtered Jobs are not considered for required * Issue-186:Seperate workflow for feature branch * Issue-186: pipeline variable * Issue-186:Updated config to 2.1 for pipeline param * Issue-186:Fixed validation errors --- .circleci/config.yml | 77 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a818901cb..d5a45658f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -version: 2 +version: 2.1 # Copyright (C) 2019-2020 LEIDOS. # @@ -28,7 +28,7 @@ jobs: # Pull docker image # XTERM used for better make output docker: - - image: usdotfhwaops/v2xhubamd:186-sonar-scanner-fix + - image: usdotfhwaops/v2xhubamd:<< pipeline.git.branch >> environment: TERM: xterm INIT_ENV: /home/V2X-Hub/.base-image/init-env.sh @@ -41,7 +41,7 @@ jobs: - setup_remote_docker : docker_layer_caching: false # Checkout PR branch - - checkout: + - checkout - run: name: Run Tests & Generate Gcovr Reports command: | @@ -72,7 +72,55 @@ jobs: cd /home/V2X-Hub/ sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} fi - docker_build&push : + sonar-scanner_develop: + # Pull docker image + # XTERM used for better make output + docker: + - image: usdotfhwaops/v2xhubamd:latest + environment: + TERM: xterm + INIT_ENV: /home/V2X-Hub/.base-image/init-env.sh + # Set working directory + working_directory: "/home/V2X-Hub" + # Pull code and execute tests | + # Name of each run command defines purpose use + steps: + #setup remote docker + - setup_remote_docker : + docker_layer_caching: false + # Checkout PR branch + - checkout + - run: + name: Run Tests & Generate Gcovr Reports + command: | + source ${INIT_ENV} + cd /home/V2X-Hub/src + build-wrapper-linux-x86-64 --out-dir /home/V2X-Hub/bw-output bash build.sh + ./coverage.sh + - run: + name: Run Sonar Scanner + command: | + source ${INIT_ENV} + echo $PATH + cd /home/V2X-Hub/src/ + if [ -z "${CIRCLE_PULL_REQUEST}" ]; then + echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}" + cd /home/V2X-Hub/ + sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} + exit 0; + else + echo "PR branch ${CIRCLE_BRANCH}" + echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" + echo "URL ${CIRCLE_PULL_REQUEST}" + export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7` + echo "PR number ${PR_NUM}" + export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" + export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') + echo "Target Branch = ${TARGET_BRANCH}" + cd /home/V2X-Hub/ + sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + fi + docker_build_push : machine: image: ubuntu-1604:202004-01 steps: @@ -90,7 +138,7 @@ jobs: echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} docker push usdotfhwaops/php:${CIRCLE_BRANCH,,} - docker_build&push_develop : + docker_build_push_develop : machine: image: ubuntu-1604:202004-01 steps: @@ -109,7 +157,7 @@ jobs: docker push usdotfhwaops/v2xhubamd:latest docker push usdotfhwaops/php:latest - arm_build&push : + arm_build_push : machine: image: ubuntu-2004:202101-01 resource_class: arm.medium @@ -127,7 +175,7 @@ jobs: command: | echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin docker push usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} - arm_build&push_develop : + arm_build_push_develop : machine: image: ubuntu-2004:202101-01 resource_class: arm.medium @@ -149,24 +197,27 @@ workflows: version: 2 build: jobs: - - docker_build&push_develop: + - docker_build_push_develop: filters: branches: only: develop - - docker_build&push: + - docker_build_push: filters: branches: ignore: develop - - arm_build&push: + - arm_build_push: filters: branches: ignore: develop - - arm_build&push_develop : + - arm_build_push_develop : filters: - branches: + branches: only: develop - sonar-scanner: requires: - - docker_build&push + - docker_build_push + - sonar-scanner_develop: + requires: + - docker_build_push_develop From 2d3de8cb4153b76ab2cd3e9152f539852b36783f Mon Sep 17 00:00:00 2001 From: Sudhakar Nallamothu Date: Fri, 17 Sep 2021 07:12:13 -0400 Subject: [PATCH 17/20] Update manifest.json Changed fetch time parameter value to 15 days. --- src/v2i-hub/CARMACloudPlugin/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/manifest.json b/src/v2i-hub/CARMACloudPlugin/manifest.json index fe0d31177..619cdd596 100644 --- a/src/v2i-hub/CARMACloudPlugin/manifest.json +++ b/src/v2i-hub/CARMACloudPlugin/manifest.json @@ -30,7 +30,7 @@ }, { "key":"fetchTime", - "default":"1", + "default":"15", "description":"Time from while the TCMs are requested, in days" }, { From cf2efb23bac50034f060d7f376ab09eba63b727c Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Mon, 20 Sep 2021 13:08:23 -0700 Subject: [PATCH 18/20] typo --- src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp index 86b8413b8..8aa5fa415 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp @@ -22,7 +22,7 @@ CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { std::lock_guard lock(_cfgLock); GetConfigValue("WebServiceIP",webip); GetConfigValue("WebServicePort",webport); - GetConfigValue("fetchtime",fetchtime); + GetConfigValue("fetchTime",fetchtime); AddMessageFilter < tsm4Message > (this, &CARMACloudPlugin::HandleCARMARequest); // Subscribe to all messages specified by the filters above. @@ -222,6 +222,7 @@ void CARMACloudPlugin::UpdateConfigSettings() { std::lock_guard lock(_cfgLock); GetConfigValue("WebServiceIP",webip); GetConfigValue("WebServicePort",webport); + GetConfigValue("fetchTime",fetchtime); } From 7f0438a39a2eaee019688b58c1d577a3262f46ad Mon Sep 17 00:00:00 2001 From: dan-du-car <62157949+dan-du-car@users.noreply.github.com> Date: Mon, 27 Sep 2021 10:56:22 -0700 Subject: [PATCH 19/20] Merge develop to release6.1 (#259) * Creating smaller deployment image Lightweight Docker Container Remove mysql calls Issue-255: Create lightweight docker image + added .dockerignore and modified dockerfile Issue-255: Dockerfile-dev Issue-255: CircleCI arm lightweight build * Issue-255: Added +x permissions to container scripts * Issue-255: Remove unnecessary checkoutstep * Issue-255: Rm git files from dockerignore. * Issue-255: Remove git files from build context + Remove checkout step from CircleCI sonar-scanner workflow * Issue-255:Rename dockerfile * Issue-255:SonarScanner needs git files * Issue-255:Dockerfile WRKDIR necessary for run script * Issue-257:Fix logging Co-authored-by: Paul K Bourelly --- .circleci/config.yml | 8 +- .dockerignore | 16 ++ container/database.sh | 3 - container/library.sh | 0 container/service.sh | 0 container/wait-for-it.sh | 0 docker/Dockerfile-depl | 147 ++++++++++++++++++ .../j2735_messages/J2735MessageFactory.hpp | 2 - .../src/database/DbConnectionPool.cpp | 1 - 9 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 .dockerignore mode change 100644 => 100755 container/database.sh mode change 100644 => 100755 container/library.sh mode change 100644 => 100755 container/service.sh mode change 100644 => 100755 container/wait-for-it.sh create mode 100644 docker/Dockerfile-depl diff --git a/.circleci/config.yml b/.circleci/config.yml index d5a45658f..75b665fd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,8 +40,6 @@ jobs: #setup remote docker - setup_remote_docker : docker_layer_caching: false - # Checkout PR branch - - checkout - run: name: Run Tests & Generate Gcovr Reports command: | @@ -88,8 +86,6 @@ jobs: #setup remote docker - setup_remote_docker : docker_layer_caching: false - # Checkout PR branch - - checkout - run: name: Run Tests & Generate Gcovr Reports command: | @@ -167,7 +163,7 @@ jobs: name: Docker Build # Run MYSQL image and build v2xhub docker image command: | - docker build -t usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} . + docker build -f docker/Dockerfile-depl -t usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} . - run: name: Docker Push @@ -185,7 +181,7 @@ jobs: name: Docker Build # Run MYSQL image and build v2xhub docker image develop image command: | - docker build -t usdotfhwaops/v2xhubarm:latest . + docker build -f docker/Dockerfile-depl -t usdotfhwaops/v2xhubarm:latest . - run: name: Docker Push diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..4f9521841 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +# Files to be ignored by the Docker context +# Any files mentioned here will not trigger Docker to force an image reuild +# if they change +.circleci +.vscode +/configuration +/data +/docker +/docs +/examples +/tests +/tools +*/*/secrets +Dockerfile +docker-compose.yml +*.md diff --git a/container/database.sh b/container/database.sh old mode 100644 new mode 100755 index 3ad021f91..8253f2110 --- a/container/database.sh +++ b/container/database.sh @@ -1,7 +1,4 @@ #!/bin/sh -x - -mysql -uroot -pivp -h127.0.0.1 -e "INSERT INTO IVP.user (IVP.user.username, IVP.user.password, IVP.user.accessLevel) VALUES('v2xadmin', 'V2xHub#321', 3)" - set +e id plugin >/dev/null 2>&1 if [ $? -ne 0 ]; then diff --git a/container/library.sh b/container/library.sh old mode 100644 new mode 100755 diff --git a/container/service.sh b/container/service.sh old mode 100644 new mode 100755 diff --git a/container/wait-for-it.sh b/container/wait-for-it.sh old mode 100644 new mode 100755 diff --git a/docker/Dockerfile-depl b/docker/Dockerfile-depl new file mode 100644 index 000000000..caeae84a1 --- /dev/null +++ b/docker/Dockerfile-depl @@ -0,0 +1,147 @@ +FROM ubuntu:bionic-20190807 AS install_dependencies + +RUN apt-get update && apt-get install -y cmake git build-essential libgtest-dev libssl-dev qtbase5-dev \ + zip libmysqlcppconn-dev libboost1.65-all-dev libmysqlclient-dev uuid-dev libxerces-c-dev qtbase5-dev \ + libcurl4-openssl-dev libgps-dev libsnmp-dev librdkafka-dev libev-dev libuv-dev libcpprest-dev +# Build and install GTest +WORKDIR cd /usr/src/googletest/googletest +RUN mkdir ~/build +WORKDIR /usr/src/googletest/googletest/build +RUN cmake .. +RUN make +RUN cp libgtest* /usr/lib/ +WORKDIR cd /usr/src/googletest/googletest +RUN rm -rf build +RUN mkdir /usr/local/lib/googletest +RUN ln -s /usr/lib/libgtest.a /usr/local/lib/googletest/libgtest.a +RUN ln -s /usr/lib/libgtest_main.a /usr/local/lib/googletest/libgtest_main.a +RUN ldconfig + +# Build and install tmx +RUN mkdir ~/V2X-Hub +COPY ./src /home/V2X-Hub/src/ +WORKDIR /home/V2X-Hub/src/tmx/ +RUN cmake . +RUN make +RUN make install + +# Scripts +COPY ./ext /home/V2X-Hub/ext +COPY ./container /home/V2X-Hub/container +WORKDIR /home/V2X-Hub/container/ +RUN /home/V2X-Hub/container/database.sh +RUN /home/V2X-Hub/container/library.sh +RUN ldconfig + +WORKDIR /home/V2X-Hub/ +RUN mkdir -p /home/V2X-Hub/ext +WORKDIR /home/V2X-Hub/ext/ +RUN git clone https://github.com/usdot-fhwa-OPS/libwebsockets.git +WORKDIR /home/V2X-Hub/ext/libwebsockets/ +RUN cmake -DLWS_WITH_SHARED=OFF . +RUN make +RUN make install + +WORKDIR /home/V2X-Hub/ext +RUN git clone https://github.com/usdot-fhwa-OPS/qhttpengine.git +WORKDIR /home/V2X-Hub/ext/qhttpengine +RUN cmake . +RUN make +RUN make install + +WORKDIR /home/V2X-Hub/ext/ +RUN git clone https://github.com/HowardHinnant/date.git +WORKDIR /home/V2X-Hub/ext/date +RUN cmake . +RUN make +RUN make install +RUN ldconfig + + + +COPY ext/ /home/V2X-Hub/ext +WORKDIR /home/V2X-Hub/ext/server +RUN cmake . +RUN make +RUN make install + +WORKDIR /home/V2X-Hub/ext/ccserver +RUN cmake . +RUN make +RUN make install +WORKDIR /home/V2X-Hub/ext/ccserver +RUN rm -rf /home/V2X-Hub/ext/ + + + +WORKDIR /home/V2X-Hub/src/v2i-hub/ +RUN cmake . -DqserverPedestrian_DIR=/usr/local/share/qserverPedestrian/cmake -Dv2xhubWebAPI_DIR=/usr/local/share/v2xhubWebAPI/cmake/ +RUN make + +RUN ln -s ../bin CommandPlugin/bin +RUN zip CommandPlugin.zip CommandPlugin/bin/CommandPlugin CommandPlugin/manifest.json +RUN ln -s ../bin CswPlugin/bin +RUN zip CswPlugin.zip CswPlugin/bin/CswPlugin CswPlugin/manifest.json +RUN ln -s ../bin DmsPlugin/bin +RUN zip DmsPlugin.zip DmsPlugin/bin/DmsPlugin DmsPlugin/manifest.json +RUN ln -s ../bin DsrcImmediateForwardPlugin/bin +RUN zip DsrcImmediateForwardPlugin.zip DsrcImmediateForwardPlugin/bin/DsrcImmediateForwardPlugin DsrcImmediateForwardPlugin/manifest.json +RUN ln -s ../bin LocationPlugin/bin +RUN zip LocationPlugin.zip LocationPlugin/bin/LocationPlugin LocationPlugin/manifest.json +RUN ln -s ../bin MapPlugin/bin +RUN zip MapPlugin.zip MapPlugin/bin/MapPlugin MapPlugin/manifest.json +RUN ln -s ../bin MessageReceiverPlugin/bin +RUN zip MessageReceiverPlugin.zip MessageReceiverPlugin/bin/MessageReceiverPlugin MessageReceiverPlugin/manifest.json +RUN ln -s ../bin ODEPlugin/bin +RUN zip ODEPlugin.zip ODEPlugin/bin/ODEPlugin ODEPlugin/manifest.json +RUN ln -s ../bin RtcmPlugin/bin +RUN zip RtcmPlugin.zip RtcmPlugin/bin/RtcmPlugin RtcmPlugin/manifest.json +RUN ln -s ../bin SpatPlugin/bin +RUN zip SpatPlugin.zip SpatPlugin/bin/SpatPlugin SpatPlugin/manifest.json +RUN ln -s ../bin PreemptionPlugin/bin +RUN zip PreemptionPlugin.zip PreemptionPlugin/bin/PreemptionPlugin PreemptionPlugin/manifest.json +RUN ln -s ../bin SPaTLoggerPlugin/bin +RUN zip SPaTLoggerPlugin.zip SPaTLoggerPlugin/bin/SPaTLoggerPlugin SPaTLoggerPlugin/manifest.json +RUN ln -s ../bin MessageLoggerPlugin/bin +RUN zip MessageLoggerPlugin.zip MessageLoggerPlugin/bin/MessageLoggerPlugin MessageLoggerPlugin/manifest.json +RUN ln -s ../bin PedestrianPlugin/bin +RUN zip PedestrianPlugin.zip PedestrianPlugin/bin/PedestrianPlugin PedestrianPlugin/manifest.json +RUN ln -s ../bin TimPlugin/bin +RUN zip TimPlugin.zip TimPlugin/bin/TimPlugin TimPlugin/manifest.json +RUN ln -s ../bin CARMACloudPlugin/bin +RUN zip CARMACloudPlugin.zip CARMACloudPlugin/bin/CARMACloudPlugin CARMACloudPlugin/manifest.json +RUN ln -s ../bin MobilityOperationPlugin/bin +RUN zip MobilityOperationPlugin.zip MobilityOperationPlugin/bin/MobilityOperationPlugin MobilityOperationPlugin/manifest.json +RUN ln -s ../bin ODELoggerPlugin/bin +RUN zip ODELoggerPlugin.zip ODELoggerPlugin/bin/ODELoggerPlugin ODELoggerPlugin/manifest.json + +WORKDIR /home/V2X-Hub/src/tmx/TmxCore/ +RUN cp tmxcore.service /lib/systemd/system/ && cp tmxcore.service /usr/sbin/ +WORKDIR /home/V2X-Hub/container/ +RUN chmod +x /home/V2X-Hub/container/service.sh && chmod +x /home/V2X-Hub/container/wait-for-it.sh +WORKDIR /var/www/ +RUN mkdir ~/plugins +WORKDIR /home/V2X-Hub/src/v2i-hub/ +WORKDIR /var/www/plugins/ +RUN mkdir /var/www/plugins/MAP +RUN mkdir /var/www/plugins/.ssl +RUN chown plugin .ssl +RUN chgrp www-data .ssl +WORKDIR /var/www/plugins/.ssl/ +RUN openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout tmxcmd.key -out tmxcmd.crt -subj "/CN= <127.0.0.1> " -days 3650 +RUN chown plugin * +RUN chgrp www-data * +WORKDIR /home/V2X-Hub/src/v2i-hub/ + +# Set metadata labels +LABEL org.label-schema.schema-version="1.0" +LABEL org.label-schema.name="V2X-Hub-Deployment" +LABEL org.label-schema.description="Image V2X-Hub Deployment" +LABEL org.label-schema.vendor="Leidos" +LABEL org.label-schema.version="${VERSION}" +LABEL org.label-schema.url="https://highways.dot.gov/research/research-programs/operations" +LABEL org.label-schema.vcs-url="https://github.com/usdot-fhwa-ops/V2X-HUB" +LABEL org.label-schema.vcs-ref=${VCS_REF} +LABEL org.label-schema.build-date=${BUILD_DATE} + +ENTRYPOINT ["/home/V2X-Hub/container/service.sh"] diff --git a/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp b/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp index 38227ec52..cc75299a6 100644 --- a/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp +++ b/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp @@ -385,7 +385,6 @@ class J2735MessageFactory if(msgidindex = TmxJ2735ExtendedBytes(bytes)) { std::string byteStr(bytes.begin(),bytes.end()); - std::cout<<" Return = "<< msgidindex<< ", Extended bytes found, sanitized::"; } @@ -424,7 +423,6 @@ class J2735MessageFactory #endif int id = Codec.decode_contentId(bytes); - std::cout<<" Codec ID = "<< id < Date: Tue, 19 Oct 2021 14:57:27 -0400 Subject: [PATCH 20/20] Update Release_notes.md --- docs/Release_notes.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/Release_notes.md b/docs/Release_notes.md index 8de9e31d4..b152d4861 100644 --- a/docs/Release_notes.md +++ b/docs/Release_notes.md @@ -1,6 +1,20 @@ V2X-Hub Release Notes ---------------------------- +Version 6.1, released Oct 15th, 2021 +-------------------------------------------------------- + +**Summary:** +V2X Hub release version 6.1 is a hotfix release for 6.0. + +Fixes in this release: +- Issue 233: Fixed SPaT message to report green status as "permissive" vs "protected" correctly. +- Issue 124: Fixed issue with interpreting when the signal controller is in flash state. +- Issue 245: Added configurable parameter for Carma cloud plugin to use for the “oldest” parameter in the TCR request to get controls created within the time period specified by this field in days. +- Issue 247: Added TCM PSID to messages forwarded to RSU for broadcast. +- Issue 186: Fixed sonar-scanner settings with code coverage to generate the coverage metrics in sonar cloud. +- Issue 201: Update docker-compose to manage sensitive data like mysql username and password with Docker secrets. + Version 6.0, released July 30th, 2021 --------------------------------------------------------