From 84251ed418bcce4be4452b3dc1e066b137f584ed Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:18:50 -0500 Subject: [PATCH 01/12] update dockercompose files to point lavida candidate images --- configuration/amd64/docker-compose.yml | 6 +++--- configuration/arm64/docker-compose.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 0c9d5feb2..032e44eb4 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:latest + image: usdotfhwaops/php:lavida container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:latest + image: usdotfhwaops/v2xhubamd:lavida container_name: v2xhub network_mode: host restart: always @@ -46,7 +46,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice:latest + image: usdotfhwaops/port-drayage-webservice:lavida container_name: port_drayage_webservice network_mode: host secrets: diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index a32c31fab..24179d2a2 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php_arm:latest + image: usdotfhwaops/php_arm:lavida container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubarm:latest + image: usdotfhwaops/v2xhubarm:lavida container_name: v2xhub network_mode: host restart: always @@ -44,7 +44,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice_arm:latest + image: usdotfhwaops/port-drayage-webservice_arm:lavida container_name: port_drayage_webservice network_mode: host secrets: From 5525e534ac7729cf236c9087fff4fa86683bce36 Mon Sep 17 00:00:00 2001 From: paulbourelly999 <77466294+paulbourelly999@users.noreply.github.com> Date: Thu, 21 Mar 2024 09:22:13 -0400 Subject: [PATCH 02/12] vh-1277: Fix README and install nats.c version (#586) Note: newest version nats 3.8.0 breaks docker build # PR Details ## Description Fix the Docker build by setting nats.c version to install. Also fix the readme. CHanges already merged to develop under https://github.com/usdot-fhwa-OPS/V2X-Hub/pull/584 ## Related Issue VH-1277 ## Motivation and Context Fix CI processes and README ## How Has This Been Tested? CI ## Types of changes - [x] 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: - [ ] 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. - [x] 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. --- README.md | 10 +++++++--- ext/build.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b5782ef46..eb5329ec6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/ext/build.sh b/ext/build.sh index 91d59ca8a..d5c773685 100755 --- a/ext/build.sh +++ b/ext/build.sh @@ -65,7 +65,7 @@ pushd /tmp if [ -d "nats.c" ]; then rm -r nats.c fi -git clone https://github.com/nats-io/nats.c +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} From 6d60d91d95af9be4532afad1e24a4fc45072cf55 Mon Sep 17 00:00:00 2001 From: Misheel Bayartsengel Date: Thu, 21 Mar 2024 13:29:58 -0400 Subject: [PATCH 03/12] add time sync logs (#583) # PR Details ## Description Adds logs to support https://github.com/usdot-fhwa-stol/carma-analytics-fotda/pull/43 ## Related Issue CDAR-774 ## Motivation and Context Data Analysis ## How Has This Been Tested? ## Types of changes - [ ] 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: - [ ] 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. --- .../CDASimAdapter/src/CDASimAdapter.cpp | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp b/src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp index b9665bcee..1986bb608 100644 --- a/src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp +++ b/src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp @@ -1,5 +1,5 @@ #include "include/CDASimAdapter.hpp" - +#include using namespace tmx::utils; @@ -18,12 +18,12 @@ namespace CDASimAdapter{ success = GetConfigValue("X", location.X); success = success && GetConfigValue("Y", location.Y); success = success && GetConfigValue("Z", location.Z); - PLOG(logINFO) << "Location of Simulated V2X-Hub updated to : {" << location.X << ", " + PLOG(logINFO) << "Location of Simulated V2X-Hub updated to : {" << location.X << ", " << location.Y << ", " << location.Z << "}." << std::endl; success = success && GetConfigValue("MaxConnectionAttempts", max_connection_attempts); success = success && GetConfigValue("ConnectionSleepTime", connection_sleep_time); if (connection_sleep_time < 1 ) { - PLOG(logWARNING) << "ConnectionSleepTime of " << connection_sleep_time << " is invalid. Valid values are <= 1." << std::endl; + PLOG(logWARNING) << "ConnectionSleepTime of " << connection_sleep_time << " is invalid. Valid values are <= 1." << std::endl; connection_sleep_time = 1; } if (!success) { @@ -33,7 +33,7 @@ namespace CDASimAdapter{ void CDASimAdapter::OnConfigChanged(const char *key, const char *value) { PluginClient::OnConfigChanged(key, value); - UpdateConfigSettings(); + UpdateConfigSettings(); } void CDASimAdapter::OnStateChange(IvpPluginState state) { @@ -41,7 +41,7 @@ namespace CDASimAdapter{ if (state == IvpPluginState_registered) { UpdateConfigSettings(); - + // While CARMA Simulation connection is down, attempt to reconnect int connection_attempts = 0; while ( (!connection || !connection->is_connected()) && (connection_attempts < max_connection_attempts || max_connection_attempts < 1 ) ) { @@ -66,22 +66,30 @@ namespace CDASimAdapter{ }else { PLOG(logERROR) << "CDASim connection failed!" << std::endl; } - + } } void CDASimAdapter::forward_time_sync_message(tmx::messages::TimeSyncMessage &msg) { + std::string payload =msg.to_string(); - PLOG(logDEBUG1) << "Sending Time Sync Message " << msg << std::endl; + // A script to validate time synchronization of tools in CDASim currently relies on the following + // log line. TODO: This line is meant to be removed in the future upon completion of this work: + // https://github.com/usdot-fhwa-stol/carma-analytics-fotda/pull/43 + auto time_now = std::chrono::system_clock::now(); + auto epoch = time_now.time_since_epoch(); + auto milliseconds = std::chrono::duration_cast(epoch); + PLOG(logDEBUG1) << "Simulation Time: " << msg.get_timestep() << " where current system time is: " << milliseconds.count() << ", where msgs: " << msg << std::endl; + this->BroadcastMessage(msg, _name, 0 , IvpMsgFlags_None); - + } void CDASimAdapter::forward_simulated_detected_message(tmx::messages::simulation::SensorDetectedObject &msg) { PLOG(logDEBUG1) << "Sending Simulated SensorDetectedObject Message " << msg << std::endl; - this->BroadcastMessage(msg, _name, 0 , IvpMsgFlags_None); + this->BroadcastMessage(msg, _name, 0 , IvpMsgFlags_None); } bool CDASimAdapter::connect() { @@ -97,7 +105,7 @@ namespace CDASimAdapter{ std::string infrastructure_id = sim::get_sim_config(sim::INFRASTRUCTURE_ID); std::string sensor_json_file_path = sim::get_sim_config(sim::SENSOR_JSON_FILE_PATH); - PLOG(logINFO) << "CDASim connecting " << simulation_ip << + PLOG(logINFO) << "CDASim connecting " << simulation_ip << "\nUsing Registration Port : " << std::to_string( simulation_registration_port) << " Time Sync Port: " << std::to_string( time_sync_port) << " and V2X Port: " << std::to_string(v2x_port) << std::endl; if ( connection ) { @@ -108,20 +116,20 @@ namespace CDASimAdapter{ connection = std::make_unique(simulation_ip, infrastructure_id, simulation_registration_port, sim_v2x_port, local_ip, time_sync_port, simulated_interaction_port, v2x_port, location, sensor_json_file_path); } - } + } catch (const TmxException &e) { PLOG(logERROR) << "Exception occured attempting to initialize CDASim Connection : " << e.what() << std::endl; return false; } catch (const std::invalid_argument &e ) { // std::stoul throws invalid arguement exception when provided with a string that contains characters that are not numbers. - PLOG(logERROR) << "Exception occured attempting to initialize CDASim Connection : " << e.what() << + PLOG(logERROR) << "Exception occured attempting to initialize CDASim Connection : " << e.what() << ". Check environment variables are set to the correct type!"; return false; - } + } return connection->connect(); } - + void CDASimAdapter::start_immediate_forward_thread() { @@ -130,10 +138,10 @@ namespace CDASimAdapter{ } immediate_forward_tick_id = immediate_forward_timer->AddPeriodicTick([this]() { this->attempt_message_from_v2xhub(); - + } // end of lambda expression , std::chrono::milliseconds(5) ); - + immediate_forward_timer->Start(); } @@ -170,19 +178,19 @@ namespace CDASimAdapter{ void CDASimAdapter::start_sensor_detected_object_detection_thread() { PLOG(logDEBUG) << "Creating Thread Timer for simulated external object" << std::endl; - try + try { if(!external_object_detection_thread_timer) { external_object_detection_thread_timer = std::make_unique(std::chrono::milliseconds(5)); - } + } external_object_detection_thread_timer->AddPeriodicTick([this](){ PLOG(logDEBUG1) << "Listening for Sensor Detected Message from CDASim." << std::endl; auto msg = connection->consume_sensor_detected_object_message(); - if ( !msg.is_empty()) { + if ( !msg.is_empty()) { this->forward_simulated_detected_message(msg); } - else + else { PLOG(logDEBUG1) << "CDASim connection has not yet received an simulated sensor detected message!" << std::endl; } @@ -190,7 +198,7 @@ namespace CDASimAdapter{ , std::chrono::milliseconds(5)); external_object_detection_thread_timer->Start(); } - catch ( const UdpServerRuntimeError &e ) + catch ( const UdpServerRuntimeError &e ) { PLOG(logERROR) << "Error occured :" << e.what() << std::endl; } @@ -238,23 +246,23 @@ namespace CDASimAdapter{ } } - + int CDASimAdapter::Main() { - PLOG(logINFO) << "Starting plugin " << _name << std::endl; + PLOG(logINFO) << "Starting plugin " << _name << std::endl; while (_plugin->state != IvpPluginState_error) { if (IsPluginState(IvpPluginState_registered)) { - + } } return EXIT_SUCCESS; } - + } From bce7236e87bbcf0b0bed3c53f158652e7dee1e09 Mon Sep 17 00:00:00 2001 From: paulbourelly999 <77466294+paulbourelly999@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:16:06 -0400 Subject: [PATCH 04/12] Update version to 7.6.0 (#596) # PR Details ## Description Update V2X-hub release version ## Related Issue ## Motivation and Context ## How Has This Been Tested? ## Types of changes - [ ] 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: - [ ] 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. @MishkaMN --- configuration/amd64/docker-compose.yml | 6 +++--- configuration/arm64/docker-compose.yml | 6 +++--- src/v2i-hub/CARMACloudPlugin/CMakeLists.txt | 2 +- src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt | 2 +- src/v2i-hub/CDASimAdapter/CMakeLists.txt | 2 +- src/v2i-hub/CommandPlugin/CMakeLists.txt | 2 +- src/v2i-hub/CswPlugin/CMakeLists.txt | 2 +- src/v2i-hub/DmsPlugin/CMakeLists.txt | 2 +- src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt | 2 +- src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt | 2 +- src/v2i-hub/LocationPlugin/CMakeLists.txt | 2 +- src/v2i-hub/MapPlugin/CMakeLists.txt | 2 +- src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt | 2 +- src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt | 2 +- src/v2i-hub/ODEForwardPlugin/CMakeLists.txt | 2 +- src/v2i-hub/PedestrianPlugin/CMakeLists.txt | 2 +- src/v2i-hub/PortDrayagePlugin/CMakeLists.txt | 2 +- src/v2i-hub/PreemptionPlugin/CMakeLists.txt | 2 +- src/v2i-hub/RSUHealthMonitorPlugin/CMakeLists.txt | 2 +- src/v2i-hub/RtcmPlugin/CMakeLists.txt | 2 +- src/v2i-hub/SpatPlugin/CMakeLists.txt | 2 +- src/v2i-hub/TelematicBridgePlugin/CMakeLists.txt | 2 +- src/v2i-hub/TimPlugin/CMakeLists.txt | 2 +- web/admin/admin.html | 2 +- 24 files changed, 28 insertions(+), 28 deletions(-) diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 032e44eb4..89a1b00a9 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:lavida + image: usdotfhwaops/php:7.6.0 container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:lavida + image: usdotfhwaops/v2xhubamd:7.6.0 container_name: v2xhub network_mode: host restart: always @@ -46,7 +46,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice:lavida + image: usdotfhwaops/port-drayage-webservice:7.6.0 container_name: port_drayage_webservice network_mode: host secrets: diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index 24179d2a2..4e378c4c5 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php_arm:lavida + image: usdotfhwaops/php_arm:7.6.0 container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubarm:lavida + image: usdotfhwaops/v2xhubarm:7.6.0 container_name: v2xhub network_mode: host restart: always @@ -44,7 +44,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice_arm:lavida + image: usdotfhwaops/port-drayage-webservice_arm:7.6.0 container_name: port_drayage_webservice network_mode: host secrets: diff --git a/src/v2i-hub/CARMACloudPlugin/CMakeLists.txt b/src/v2i-hub/CARMACloudPlugin/CMakeLists.txt index 6c913e69d..45ac871f1 100644 --- a/src/v2i-hub/CARMACloudPlugin/CMakeLists.txt +++ b/src/v2i-hub/CARMACloudPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( CARMACloudPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( CARMACloudPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "CARMACloud") add_compile_options(-fPIC) diff --git a/src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt b/src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt index 08981e25d..a4f9c63f0 100644 --- a/src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt +++ b/src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( CARMAStreetsPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( CARMAStreetsPlugin VERSION 7.6.0 LANGUAGES CXX ) BuildTmxPlugin ( ) diff --git a/src/v2i-hub/CDASimAdapter/CMakeLists.txt b/src/v2i-hub/CDASimAdapter/CMakeLists.txt index 8fbc4f376..27fdc1093 100755 --- a/src/v2i-hub/CDASimAdapter/CMakeLists.txt +++ b/src/v2i-hub/CDASimAdapter/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( CDASimAdapter VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( CDASimAdapter VERSION 7.6.0 LANGUAGES CXX ) set(CMAKE_CXX_STANDARD 17) FIND_PACKAGE( carma-clock ) diff --git a/src/v2i-hub/CommandPlugin/CMakeLists.txt b/src/v2i-hub/CommandPlugin/CMakeLists.txt index a1543ab51..3e4e8d521 100644 --- a/src/v2i-hub/CommandPlugin/CMakeLists.txt +++ b/src/v2i-hub/CommandPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( CommandPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( CommandPlugin VERSION 7.6.0 LANGUAGES CXX ) FIND_PACKAGE (OpenSSL REQUIRED) diff --git a/src/v2i-hub/CswPlugin/CMakeLists.txt b/src/v2i-hub/CswPlugin/CMakeLists.txt index 5e154a2c7..63243d902 100644 --- a/src/v2i-hub/CswPlugin/CMakeLists.txt +++ b/src/v2i-hub/CswPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( CswPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( CswPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "CSW") diff --git a/src/v2i-hub/DmsPlugin/CMakeLists.txt b/src/v2i-hub/DmsPlugin/CMakeLists.txt index 08cf09b17..f790c51fe 100644 --- a/src/v2i-hub/DmsPlugin/CMakeLists.txt +++ b/src/v2i-hub/DmsPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( DmsPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( DmsPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "Dynamic Message Sign") diff --git a/src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt b/src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt index cc456077a..ab0b8a9fb 100644 --- a/src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt +++ b/src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT(ERVCloudForwardingPlugin VERSION 7.5.1 LANGUAGES CXX) +PROJECT(ERVCloudForwardingPlugin VERSION 7.6.0 LANGUAGES CXX) SET(TMX_PLUGIN_NAME "ERVCloudForwarding") add_compile_options(-fPIC) diff --git a/src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt b/src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt index 31e28d6ae..752f486c4 100644 --- a/src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt +++ b/src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( ImmediateForwardPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( ImmediateForwardPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "Immediate Forward") diff --git a/src/v2i-hub/LocationPlugin/CMakeLists.txt b/src/v2i-hub/LocationPlugin/CMakeLists.txt index 5926227c4..cb6c943f7 100644 --- a/src/v2i-hub/LocationPlugin/CMakeLists.txt +++ b/src/v2i-hub/LocationPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -project( LocationPlugin VERSION 7.5.1 LANGUAGES CXX ) +project( LocationPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME Location) diff --git a/src/v2i-hub/MapPlugin/CMakeLists.txt b/src/v2i-hub/MapPlugin/CMakeLists.txt index 553f1e58a..e40a6c240 100644 --- a/src/v2i-hub/MapPlugin/CMakeLists.txt +++ b/src/v2i-hub/MapPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( MapPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( MapPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "MAP") diff --git a/src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt b/src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt index 514b31984..3153bd268 100644 --- a/src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt +++ b/src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( MessageLoggerPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( MessageLoggerPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "MessageLoggerPlugin") diff --git a/src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt b/src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt index 908bc1e90..38d6cd7a0 100644 --- a/src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt +++ b/src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( MessageReceiverPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( MessageReceiverPlugin VERSION 7.6.0 LANGUAGES CXX ) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/src/v2i-hub/ODEForwardPlugin/CMakeLists.txt b/src/v2i-hub/ODEForwardPlugin/CMakeLists.txt index 8c594fdbe..c574fc4b6 100644 --- a/src/v2i-hub/ODEForwardPlugin/CMakeLists.txt +++ b/src/v2i-hub/ODEForwardPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( ODEForwardPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( ODEForwardPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "ODEForwardPlugin") diff --git a/src/v2i-hub/PedestrianPlugin/CMakeLists.txt b/src/v2i-hub/PedestrianPlugin/CMakeLists.txt index ecb8c8cec..735d84e80 100755 --- a/src/v2i-hub/PedestrianPlugin/CMakeLists.txt +++ b/src/v2i-hub/PedestrianPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( PedestrianPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( PedestrianPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "Pedestrian") add_compile_options(-fPIC) diff --git a/src/v2i-hub/PortDrayagePlugin/CMakeLists.txt b/src/v2i-hub/PortDrayagePlugin/CMakeLists.txt index 199be4090..1a7a4b4da 100644 --- a/src/v2i-hub/PortDrayagePlugin/CMakeLists.txt +++ b/src/v2i-hub/PortDrayagePlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( PortDrayagePlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( PortDrayagePlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "PortDrayage") set(CMAKE_AUTOMOC ON) diff --git a/src/v2i-hub/PreemptionPlugin/CMakeLists.txt b/src/v2i-hub/PreemptionPlugin/CMakeLists.txt index 1613c3b46..a7c0db86a 100644 --- a/src/v2i-hub/PreemptionPlugin/CMakeLists.txt +++ b/src/v2i-hub/PreemptionPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( PreemptionPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( PreemptionPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "Preemption") diff --git a/src/v2i-hub/RSUHealthMonitorPlugin/CMakeLists.txt b/src/v2i-hub/RSUHealthMonitorPlugin/CMakeLists.txt index d863a4bf1..8cbcf79ce 100755 --- a/src/v2i-hub/RSUHealthMonitorPlugin/CMakeLists.txt +++ b/src/v2i-hub/RSUHealthMonitorPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT(RSUHealthMonitorPlugin VERSION 7.5.1 LANGUAGES CXX) +PROJECT(RSUHealthMonitorPlugin VERSION 7.6.0 LANGUAGES CXX) set(TMX_PLUGIN_NAME "RSU Health Monitor") diff --git a/src/v2i-hub/RtcmPlugin/CMakeLists.txt b/src/v2i-hub/RtcmPlugin/CMakeLists.txt index 694b04ef2..b4a5f0488 100644 --- a/src/v2i-hub/RtcmPlugin/CMakeLists.txt +++ b/src/v2i-hub/RtcmPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( RtcmPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( RtcmPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "RTCM") diff --git a/src/v2i-hub/SpatPlugin/CMakeLists.txt b/src/v2i-hub/SpatPlugin/CMakeLists.txt index fb28fcada..bdff7a0b8 100644 --- a/src/v2i-hub/SpatPlugin/CMakeLists.txt +++ b/src/v2i-hub/SpatPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( SpatPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( SpatPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "SPAT") diff --git a/src/v2i-hub/TelematicBridgePlugin/CMakeLists.txt b/src/v2i-hub/TelematicBridgePlugin/CMakeLists.txt index df7b1c0f7..59215c46f 100644 --- a/src/v2i-hub/TelematicBridgePlugin/CMakeLists.txt +++ b/src/v2i-hub/TelematicBridgePlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT (TelematicBridgePlugin VERSION 7.5.1 LANGUAGES CXX) +PROJECT (TelematicBridgePlugin VERSION 7.6.0 LANGUAGES CXX) set (TMX_PLUGIN_NAME "Telematic Bridge") diff --git a/src/v2i-hub/TimPlugin/CMakeLists.txt b/src/v2i-hub/TimPlugin/CMakeLists.txt index 3f8c9779e..51ad9797d 100644 --- a/src/v2i-hub/TimPlugin/CMakeLists.txt +++ b/src/v2i-hub/TimPlugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT ( TimPlugin VERSION 7.5.1 LANGUAGES CXX ) +PROJECT ( TimPlugin VERSION 7.6.0 LANGUAGES CXX ) SET (TMX_PLUGIN_NAME "TIM") add_compile_options(-fPIC) diff --git a/web/admin/admin.html b/web/admin/admin.html index 735c9b63a..2dfdaa0e1 100644 --- a/web/admin/admin.html +++ b/web/admin/admin.html @@ -49,7 +49,7 @@
-
7.4.0
+
7.6.0
From 16d93f19631f382a5f76e92a43790ece0bc6c877 Mon Sep 17 00:00:00 2001 From: dev Date: Mon, 29 Apr 2024 17:23:13 -0400 Subject: [PATCH 05/12] Uncouple docker-compose from version --- .github/workflows/build.yml | 106 ------------------ .github/workflows/build_php_docker_image.yml | 48 ++++++++ .../build_port_drayage_docker_image.yml | 48 ++++++++ .../workflows/build_v2xhub_docker_image.yml | 47 ++++++++ .github/workflows/pull_request.yml | 51 +++++++++ .github/workflows/sonar-scanner.yml | 12 +- configuration/amd64/docker-compose.yml | 20 +++- configuration/arm64/docker-compose.yml | 6 +- 8 files changed, 220 insertions(+), 118 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/build_php_docker_image.yml create mode 100644 .github/workflows/build_port_drayage_docker_image.yml create mode 100644 .github/workflows/build_v2xhub_docker_image.yml create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index eed361c5b..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Build Workflows - -on: - pull_request: - push: - -# TODO push to dockerhub with correct tags -jobs: - v2xhub-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/v2xhubamd - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - php-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/php - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - file: docker/Dockerfile-php - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - port-drayage-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/port-drayage-webservice - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: true - context: tools/port-drayage-webservice - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml new file mode 100644 index 000000000..bb9ee7cc1 --- /dev/null +++ b/.github/workflows/build_php_docker_image.yml @@ -0,0 +1,48 @@ +name: Build PHP V2X-Hub Web UI +on: + push: + branches: + - develop + - master + - 'release/**' + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: usdotfhwaops/php + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + file: ./docker/Dockerfile-php + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml new file mode 100644 index 000000000..dd9115995 --- /dev/null +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -0,0 +1,48 @@ +name: Build Port Drayage Web Service +on: + push: + branches: + - develop + - master + - 'release/**' + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: usdotfhwaops/port-drayage-webservice + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: ./tools/port-drayage-webservice/ + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml new file mode 100644 index 000000000..c8ec318d9 --- /dev/null +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -0,0 +1,47 @@ +name: Build V2X-Hub Docker Image +on: + push: + branches: + - develop + - master + - 'release/**' + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: usdotfhwaops/v2xhub + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 000000000..17d8f1dc6 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,51 @@ +name: Pull Request Workflow + +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + docker-image-builds: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: usdotfhwaops/php + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: V2X-Hub Docker build + uses: docker/build-push-action@v5 + with: + file: Dockerfile + platforms: linux/amd64,linux/arm64 + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} + - name: PHP Docker build + uses: docker/build-push-action@v5 + with: + file: docker/Dockerfile-php + platforms: linux/amd64,linux/arm64 + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} + - name: Port Drayage Docker build + uses: docker/build-push-action@v5 + with: + context: tools/port-drayage-webservice + platforms: linux/amd64,linux/arm64 + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml index 6df6b7812..f1acdd7e4 100644 --- a/.github/workflows/sonar-scanner.yml +++ b/.github/workflows/sonar-scanner.yml @@ -1,7 +1,11 @@ on: push: - # run on branches and not PRs due to secrets used branches: + - develop + - master + - "release/*" + pull_request: + types: [opened, synchronize, reopened] name: Sonar Workflow jobs: sonarcloud: @@ -9,13 +13,13 @@ jobs: container: image: ubuntu:jammy-20230126 steps: - - name: Install curl, zip, git, gcovr + - name: Install gcovr run: | apt update export DEBIAN_FRONTEND=noninteractive - apt-get install -y curl zip git gcovr + apt-get install -y gcovr - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 89a1b00a9..9e1cda0cd 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:7.6.0 + image: usdotfhwaops/php:${V2XHUB_VERSION:-develop} container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:7.6.0 + image: usdotfhwaops/v2xhubamd:${V2XHUB_VERSION:-develop} container_name: v2xhub network_mode: host restart: always @@ -38,15 +38,25 @@ services: - db environment: - MYSQL_PASSWORD=/run/secrets/mysql_password - - INFRASTRUCTURE_ID=rsu_ - - INFRASTRUCTURE_NAME= + - SIMULATION_MODE=${SIMULATION_MODE:-false} + - SIMULATION_IP=${SIMULATION_IP:-127.0.0.1} + - SIMULATION_REGISTRATION_PORT=6767 + - LOCAL_IP=${LOCAL_IP:-127.0.0.1} + - TIME_SYNC_TOPIC=time_sync + - TIME_SYNC_PORT=7575 + - SIM_V2X_PORT=5757 + - SIM_INTERACTION_PORT=7576 + - V2X_PORT=8686 + - INFRASTRUCTURE_ID=${INFRASTRUCTURE_ID:-rsu_1234} + - INFRASTRUCTURE_NAME=${INFRASTRUCTURE_NAME:-East Intersection} + - SENSOR_JSON_FILE_PATH=${SENSOR_JSON_FILE_PATH:-/var/www/plugins/MAP/sensors.json} secrets: - mysql_password volumes: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice:7.6.0 + image: usdotfhwaops/port-drayage-webservice:${V2XHUB_VERSION:-develop} container_name: port_drayage_webservice network_mode: host secrets: diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index 4e378c4c5..a7ffcce50 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php_arm:7.6.0 + image: usdotfhwaops/php_arm:${V2XHUB_VERSION:-develop} container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubarm:7.6.0 + image: usdotfhwaops/v2xhubarm:${V2XHUB_VERSION:-develop} container_name: v2xhub network_mode: host restart: always @@ -44,7 +44,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice_arm:7.6.0 + image: usdotfhwaops/port-drayage-webservice_arm:${V2XHUB_VERSION:-develop} container_name: port_drayage_webservice network_mode: host secrets: From 51f2e6e7f34359304b3acc56225bd0f8c342cc9b Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 30 Apr 2024 08:49:29 -0400 Subject: [PATCH 06/12] Add git install back to sonar-scanner workflow for checkout action --- .github/workflows/sonar-scanner.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml index f1acdd7e4..c890ae6e7 100644 --- a/.github/workflows/sonar-scanner.yml +++ b/.github/workflows/sonar-scanner.yml @@ -13,11 +13,11 @@ jobs: container: image: ubuntu:jammy-20230126 steps: - - name: Install gcovr + - name: Install gcovr and git (Checkout action) run: | apt update export DEBIAN_FRONTEND=noninteractive - apt-get install -y gcovr + apt-get install -y gcovr git - name: Checkout uses: actions/checkout@v4 with: From bc7d1ffc60e98c8292bd9e38a7d9d471ef6a4db2 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 30 Apr 2024 08:57:50 -0400 Subject: [PATCH 07/12] Undo sonar-scanner workflow changes --- .github/workflows/sonar-scanner.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml index c890ae6e7..a9f773aa5 100644 --- a/.github/workflows/sonar-scanner.yml +++ b/.github/workflows/sonar-scanner.yml @@ -13,11 +13,14 @@ jobs: container: image: ubuntu:jammy-20230126 steps: - - name: Install gcovr and git (Checkout action) + - name: Install curl, zip, git, gcovr + # Installing gcovr for unit test code coverage + # Installing git for checkout action + # installing curl/zip for sonar-cpp action run: | apt update export DEBIAN_FRONTEND=noninteractive - apt-get install -y gcovr git + apt-get install -y curl zip git gcovr - name: Checkout uses: actions/checkout@v4 with: From 23be0ae336469c4dfa2ca0326b93104a0312ef8e Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 30 Apr 2024 11:28:40 -0400 Subject: [PATCH 08/12] Added documentation for deployment --- configuration/README.md | 42 +++++++++++++++++++++++++++ configuration/amd64/initialization.sh | 1 + configuration/arm64/initialization.sh | 1 + 3 files changed, 44 insertions(+) create mode 100644 configuration/README.md diff --git a/configuration/README.md b/configuration/README.md new file mode 100644 index 000000000..507534b38 --- /dev/null +++ b/configuration/README.md @@ -0,0 +1,42 @@ +## Deployment Configuration +### Introduction +This directory contains deployment configurations for deploying V2X-Hub on both ARM64(arm64) and x86(amd64) architectures. +### Deployment Instructions +Once downloaded, navigate to the directory corresponding to your computer’s processor (1) or (2): +``` +cd ~/V2X-Hub/configuration/arm64/ +cd ~/V2X-Hub/configuration/amd64/ +``` +Run the initialization script: +``` +./initialization.sh +``` +Follow the prompts during installation. + +You will be prompted to create a mysql_password and mysql_root_password. You may make the passwords whatever you like, but you will need to remember them. +``` +Example: ivp +``` +You will also be prompted to create a V2X Hub username and password. You may make these whatever you’d like, but will need to use them to log into the web UI. Example: +``` +Username: v2xadmin + +Password: V2xHub#321 +``` +You will then need to enter the mysql_password you created in step 5a: +``` +Example: ivp +``` +After installation is complete, the script will automatically open a web browser with two tabs. + +Navigate to the tab labeled as “Privacy Error” and select the “Advanced” button. + +Click on “proceed to 127.0.0.1 (unsafe)” + +Note: This page will not do anything when clicking proceed + +Close the Privacy Error tab and wait for the initial V2X Hub tab to finish loading + +Enter the login credentials you created in step 5b and login. + +Installation complete! diff --git a/configuration/amd64/initialization.sh b/configuration/amd64/initialization.sh index eea35fc48..b24b9b4d3 100755 --- a/configuration/amd64/initialization.sh +++ b/configuration/amd64/initialization.sh @@ -35,6 +35,7 @@ else #remove endline characters from password files tr -d '\n' mysql_password.txt && rm sql_pass.txt fi +# TODO VH-1303 Allow for version and configuration selection in initialization script #AMD64 initialzation cd $directory diff --git a/configuration/arm64/initialization.sh b/configuration/arm64/initialization.sh index 7769004df..b4da293b7 100755 --- a/configuration/arm64/initialization.sh +++ b/configuration/arm64/initialization.sh @@ -35,6 +35,7 @@ else #remove endline characters from password files tr -d '\n' mysql_password.txt && rm sql_pass.txt fi +# TODO VH-1303 Allow for version and configuration selection in initialization script #ARM initialization cd $directory From 9a21060ae4ecfefaf4bd5e2bef5e58ee21e6ba61 Mon Sep 17 00:00:00 2001 From: dan-du-car <62157949+dan-du-car@users.noreply.github.com> Date: Tue, 30 Apr 2024 17:14:52 -0400 Subject: [PATCH 09/12] CARMACloudPlugin: TCR oldest issue in simulation environment (#611) # PR Details ## Description Current TCR message is populated with oldest value based on the epoch timestamp, and defined as how many minutes from now. However, in simulation environment, the clock reference is not epoch time, it is customized clock starting from 0. This can be an issue with the current oldest implementation in v2xhub because the carma-cloud application in simulation environment uses the oldest value generated by V2xHub and reference it based on the simulation time rather than epoch time. Also, carma-platform running in the vehicle cannot control the oldest value generation. This PR is to update the TCR message oldest field with data sent by carma-platform in simulation mode. ## Related Issue NA ## Motivation and Context XIL integration testing ## How Has This Been Tested? integration tested ## Types of changes - [x] 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: - [ ] 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. - [x] 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. --- .../CARMACloudPlugin/src/CARMACloudPlugin.cpp | 24 ++++++++----------- .../CARMACloudPlugin/src/CARMACloudPlugin.h | 9 ++++--- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp index d2110c575..54aa176ae 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp @@ -16,7 +16,8 @@ namespace CARMACloudPlugin { * * @param name The name to give the plugin for identification purposes */ -CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { +CARMACloudPlugin::CARMACloudPlugin(string name) : PluginClientClockAware(name) +{ UpdateConfigSettings(); std::lock_guard lock(_cfgLock); @@ -36,10 +37,8 @@ CARMACloudPlugin::CARMACloudPlugin(string name) :PluginClient(name) { _tcm_broadcast_starting_time = std::make_shared>(); std::thread Broadcast_t(&CARMACloudPlugin::TCMAckCheckAndRebroadcastTCM, this); Broadcast_t.detach(); - } - void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &routeableMsg) { auto carmaRequest = msg.get_j2735_data(); @@ -63,19 +62,18 @@ void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &r int totBounds = carmaRequest->body.choice.tcrV01.bounds.list.count; int cnt=0; char bounds_str[5000]; - strcpy(bounds_str,""); - - // get current time - std::time_t tm = std::time(0)/60-fetchtime*24*60; // T minus 24 hours in min + strcpy(bounds_str, ""); + + int oldestInMins = getClock()->nowInSeconds() / 60 - fetchtime * 24 * 60; // T minus 24 hours in min - while(cntbody.choice.tcrV01.bounds.list.array[cnt]->reflat; + long lat = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->reflat; long longg = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->reflon; - + auto oldest = std::max(oldestInMins, 0); // Replace tm with 0 if negative + long dtx0 = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->offsets.list.array[0]->deltax; long dty0 = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->offsets.list.array[0]->deltay; long dtx1 = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->offsets.list.array[1]->deltax; @@ -83,11 +81,9 @@ void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &r long dtx2 = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->offsets.list.array[2]->deltax; long dty2 = carmaRequest->body.choice.tcrV01.bounds.list.array[cnt]->offsets.list.array[2]->deltay; - sprintf(bounds_str+strlen(bounds_str),"%u%ld%ld%ld%ld%ld%ld%ld%ld",oldest,longg,lat,dtx0,dty0,dtx1,dty1,dtx2,dty2); + sprintf(bounds_str + strlen(bounds_str), "%u%ld%ld%ld%ld%ld%ld%ld%ld", oldest, longg, lat, dtx0, dty0, dtx1, dty1, dtx2, dty2); cnt++; - - } char xml_str[10000]; diff --git a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h index 9a9d85061..e092c03ab 100644 --- a/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h +++ b/src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h @@ -73,8 +73,7 @@ #include #include - - +#include using namespace std; @@ -92,7 +91,8 @@ enum acknowledgement_status { acknowledgement_status__not_acknowledged = 3 //CMV does not respond at all within the v2xhub repeatedly broadcast time period }; -class CARMACloudPlugin: public PluginClient { +class CARMACloudPlugin : public PluginClientClockAware +{ public: CARMACloudPlugin(std::string); virtual ~CARMACloudPlugin(); @@ -212,8 +212,7 @@ class CARMACloudPlugin: public PluginClient { const char *CONTENT_ENCODING_VALUE = "gzip"; std::string list_tcm = "true"; //API URL to accept TCM response - const QString TCM_REPLY="tcmreply"; - + const QString TCM_REPLY = "tcmreply"; }; std::mutex _cfgLock; } From 326bac254360703494278e30cc52d568a0cb8491 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 1 May 2024 09:52:50 -0400 Subject: [PATCH 10/12] modified: configuration/arm64/docker-compose.yml (#585) modified: configuration/arm64/initialization.sh modified: configuration/arm64/mysql/add_v2xhub_user.bash # PR Details ## Description Updated arm64 configuration files to fix initial setup, which was no longer working. Updated: mariabd-client version docker compose version docker-compose.yml ## Related Issue #594 ## Motivation and Context The initialization.sh and add_v2xhub_user.bash scripts were no longer working in arm64 configuration ## How Has This Been Tested? Tested on latest Raspberry Pi OS on a Pi 4. Initialization and user addition worked. ## Types of changes - [x] 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: - [ ] 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. - [x] 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. - [x] All new and existing tests passed. --- configuration/amd64/docker-compose.yml | 3 +- configuration/amd64/initialization.sh | 50 +++++++++--------- configuration/arm64/docker-compose.yml | 7 ++- configuration/arm64/initialization.sh | 51 ++++++++++--------- .../arm64/mysql/add_v2xhub_user.bash | 2 +- 5 files changed, 60 insertions(+), 53 deletions(-) diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 9e1cda0cd..a2dad081e 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -23,7 +23,8 @@ services: image: usdotfhwaops/php:${V2XHUB_VERSION:-develop} container_name: php network_mode: host - depends_on: + restart: always + depends_on: - db - v2xhub stdin_open: true diff --git a/configuration/amd64/initialization.sh b/configuration/amd64/initialization.sh index b24b9b4d3..5e3a86328 100755 --- a/configuration/amd64/initialization.sh +++ b/configuration/amd64/initialization.sh @@ -2,20 +2,16 @@ directory=$(pwd) mysqlDir="$directory/mysql" -# update and upgrade commands to update linux OS +# 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 necessary and useful apps +sudo apt-get install chromium-browser -y -#install docker -curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash - -#make passwords for mysql +# Make passwords for mysql mkdir -p secrets && cd secrets -#creates password files where user inputs password +# Creates password files where user inputs password FILE1=mysql_root_password.txt FILE2=mysql_password.txt if test -f "$FILE1"; then @@ -23,7 +19,7 @@ if test -f "$FILE1"; then 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 + # Remove endline characters from password files tr -d '\n' mysql_root_password.txt && rm sql_root_pass.txt fi @@ -32,25 +28,31 @@ if test -f "$FILE2"; then else read -p "enter password for mysql_password: " sql_pass echo "$sql_pass" > sql_pass.txt - #remove endline characters from password files + # Remove endline characters from password files tr -d '\n' mysql_password.txt && rm sql_pass.txt fi # TODO VH-1303 Allow for version and configuration selection in initialization script -#AMD64 initialzation +# AMD64 initialization cd $directory -sudo apt-get -y remove docker docker-engine docker.io containerd runc -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 -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 +for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done +# Add Docker's official GPG key: +sudo apt-get update +sudo apt-get install ca-certificates curl +sudo install -m 0755 -d /etc/apt/keyrings +sudo curl -fsSL https://download.docker.com/linux/$(. /etc/os-release && echo "$ID")/gpg -o /etc/apt/keyrings/docker.asc +sudo chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$(. /etc/os-release && echo "$ID") \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update +sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo docker compose up -d + +# Create V2X Hub user cd $mysqlDir ./add_v2xhub_user.bash diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index a7ffcce50..23b6e017c 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -23,7 +23,8 @@ services: image: usdotfhwaops/php_arm:${V2XHUB_VERSION:-develop} container_name: php network_mode: host - depends_on: + restart: always + depends_on: - db - v2xhub stdin_open: true @@ -34,10 +35,12 @@ services: container_name: v2xhub network_mode: host restart: always - depends_on: + depends_on: - db environment: - MYSQL_PASSWORD=/run/secrets/mysql_password + - INFRASTRUCTURE_ID=rsu_ + - INFRASTRUCTURE_NAME= secrets: - mysql_password volumes: diff --git a/configuration/arm64/initialization.sh b/configuration/arm64/initialization.sh index b4da293b7..5894602fd 100755 --- a/configuration/arm64/initialization.sh +++ b/configuration/arm64/initialization.sh @@ -2,20 +2,16 @@ directory=$(pwd) mysqlDir="$directory/mysql" -# update and upgrade commands to update linux OS +# 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 necessary and useful apps +sudo apt-get install chromium-browser -y -#install docker -curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash - -#make passwords for mysql +# Make passwords for mysql mkdir -p secrets && cd secrets -#creates password files where user inputs password +# Creates password files where user inputs password FILE1=mysql_root_password.txt FILE2=mysql_password.txt if test -f "$FILE1"; then @@ -23,7 +19,7 @@ if test -f "$FILE1"; then 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 + # Remove endline characters from password files tr -d '\n' mysql_root_password.txt && rm sql_root_pass.txt fi @@ -32,26 +28,31 @@ if test -f "$FILE2"; then else read -p "enter password for mysql_password: " sql_pass echo "$sql_pass" > sql_pass.txt - #remove endline characters from password files + # Remove endline characters from password files tr -d '\n' mysql_password.txt && rm sql_pass.txt fi # TODO VH-1303 Allow for version and configuration selection in initialization script -#ARM initialization +# ARM64 initialization cd $directory -sudo apt-get -y remove docker docker-engine docker.io containerd runc -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 -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 +for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done +# Add Docker's official GPG key: +sudo apt-get update +sudo apt-get install ca-certificates curl +sudo install -m 0755 -d /etc/apt/keyrings +sudo curl -fsSL https://download.docker.com/linux/$(. /etc/os-release && echo "$ID")/gpg -o /etc/apt/keyrings/docker.asc +sudo chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$(. /etc/os-release && echo "$ID") \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update +sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo docker compose up -d + +# Create V2X Hub user cd $mysqlDir ./add_v2xhub_user.bash diff --git a/configuration/arm64/mysql/add_v2xhub_user.bash b/configuration/arm64/mysql/add_v2xhub_user.bash index 1d8bb57c2..5b4b6f314 100755 --- a/configuration/arm64/mysql/add_v2xhub_user.bash +++ b/configuration/arm64/mysql/add_v2xhub_user.bash @@ -7,7 +7,7 @@ arch=$(dpkg --print-architecture) if [ $arch = "amd64" ]; then REQUIRED_PKG="mysql-client" else - REQUIRED_PKG="mariadb-client-10.5" + REQUIRED_PKG="mariadb-client" fi PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") echo Checking for $REQUIRED_PKG: $PKG_OK From 610d77e298b91eb6afedb8d24c28817da5f68430 Mon Sep 17 00:00:00 2001 From: DokurOmkar Date: Wed, 29 May 2024 09:25:29 -0400 Subject: [PATCH 11/12] VH 1295 - Support multi architecture docker deployment (#612) # PR Details ## Description In this PR - Updated the MySQL to 8.0 to support multi-architecture. - Removed architecture based configuration folders. - Updated the initialization and MySQL scripts to support both architectures. ## Related Issue [VH-1295](https://usdot-carma.atlassian.net/browse/VH-1295) ## Motivation and Context ## How Has This Been Tested? The updated initialization script has been tested manually on both kinds of devices to validate the update. ## Types of changes - [ ] Defect fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: - [ ] I have added any new packages to the sonar-scanner.properties file - [x] My change requires a change to the documentation. - [x] I have updated the documentation accordingly. - [x] 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. - [x] All new and existing tests passed. --- README.md | 15 +- configuration/README.md | 29 +- .../amd64/mysql/add_v2xhub_user.bash | 37 --- configuration/arm64/docker-compose.yml | 60 ----- configuration/arm64/initialization.sh | 60 ----- configuration/arm64/mysql/localhost.sql | 255 ------------------ configuration/arm64/mysql/port_drayage.sql | 91 ------- configuration/arm64/mysql/suntrax/README.txt | 1 - .../mysql/suntrax/port_area_operations.sql | 90 ------- .../mysql/suntrax/staging_area_operations.sql | 91 ------- configuration/{amd64 => }/docker-compose.yml | 4 +- configuration/{amd64 => }/initialization.sh | 0 .../{amd64 => }/logs/filewatchscript.sh | 0 .../{arm64 => }/mysql/add_v2xhub_user.bash | 1 + configuration/{amd64 => }/mysql/localhost.sql | 0 .../{amd64 => }/mysql/port_drayage.sql | 0 .../{amd64 => }/mysql/suntrax/README.txt | 0 .../mysql/suntrax/port_area_operations.sql | 0 .../mysql/suntrax/staging_area_operations.sql | 0 19 files changed, 28 insertions(+), 706 deletions(-) delete mode 100755 configuration/amd64/mysql/add_v2xhub_user.bash delete mode 100644 configuration/arm64/docker-compose.yml delete mode 100755 configuration/arm64/initialization.sh delete mode 100644 configuration/arm64/mysql/localhost.sql delete mode 100644 configuration/arm64/mysql/port_drayage.sql delete mode 100644 configuration/arm64/mysql/suntrax/README.txt delete mode 100644 configuration/arm64/mysql/suntrax/port_area_operations.sql delete mode 100644 configuration/arm64/mysql/suntrax/staging_area_operations.sql rename configuration/{amd64 => }/docker-compose.yml (95%) rename configuration/{amd64 => }/initialization.sh (100%) rename configuration/{amd64 => }/logs/filewatchscript.sh (100%) rename configuration/{arm64 => }/mysql/add_v2xhub_user.bash (96%) rename configuration/{amd64 => }/mysql/localhost.sql (100%) rename configuration/{amd64 => }/mysql/port_drayage.sql (100%) rename configuration/{amd64 => }/mysql/suntrax/README.txt (100%) rename configuration/{amd64 => }/mysql/suntrax/port_area_operations.sql (100%) rename configuration/{amd64 => }/mysql/suntrax/staging_area_operations.sql (100%) diff --git a/README.md b/README.md index eb5329ec6..c7a8b23b1 100644 --- a/README.md +++ b/README.md @@ -43,18 +43,9 @@ V2X Hub is a communication, computation, and processing platform for V2I applica * Aggregation of vehicle weather data for efficient communication to Transportation Management Entity for weather-responsive traffic management. * Multi-Modal Intelligent Traffic Signal Systems (MMITSS) “intersection level” functions including J2735 Intersection Geometry (MAP) and J2735 Signal Phase and Timing (SPaT) broadcast manager, equipped vehicle tracker, priority request server, and interface to traffic signal controller. -# Simulation Setup -To support execution in a simulated environment, V2X-Hub is in the process of integrating with CDASim, a Co-Simulation tool built as an extension of Eclipse Mosiac. This extension will incorporate integration with several other platforms including CARMA-Platform and CARLA. The setup for this simply requires setting environment variables inside the V2X-Hub docker container. - * **SIMULATION_MODE** – Environment variable for enabling simulation components for V2X-Hub. If set to "true" or "TRUE" simulation components will be enable. Otherwise, simulation components will not be enabled. - * **KAFKA_BROKER_ADDRESS** – Environment variable for storing Kafka broker connection string (including port). - * **TIME_SYNC_TOPIC** – Environment variable for storing Kafka time sync topic. - * **SIMULATION_IP** – Environment variable for storing IP address of CDASim application. - * **SIMULATION_REGISTRATION_PORT** – Environment variable for storing port on CDASim that handles registration attempts. - * **TIME_SYNC_PORT** – Environment varaible for storing port for receiving time sync messages from CDASim. - * **V2X_PORT** – Environment variable for storing port for receiving v2x messages from CDASim - * **SIM_V2X_PORT** – Environment variable for storing port for sending v2x messages to CDASim - * **LOCAL_IP** – Environment variable for storing local IP of V2X Hub. - * **INFRASTRUCTURE_ID** – Environment variable for storing infrastructure id of V2X Hub.. +## Deployment Configuration +The instructions for deployment and configuration are located here: [Instructions]() + ## Release Notes The current version and release history of the V2X Hub software platform can be found here: [Release Notes]() diff --git a/configuration/README.md b/configuration/README.md index 507534b38..7b978c398 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -1,15 +1,17 @@ -## Deployment Configuration -### Introduction -This directory contains deployment configurations for deploying V2X-Hub on both ARM64(arm64) and x86(amd64) architectures. +## Introduction +This directory contains deployment and configuration instructions for deploying V2X-Hub on both ARM64(arm64) and x86(amd64) architectures. + +> [!NOTE] +> Separate deployment files/configurations are no longer necessary for arm64 and x86 deployments. + ### Deployment Instructions -Once downloaded, navigate to the directory corresponding to your computer’s processor (1) or (2): +Once downloaded, navigate to the configuration directory: ``` -cd ~/V2X-Hub/configuration/arm64/ -cd ~/V2X-Hub/configuration/amd64/ +cd ~/V2X-Hub/configuration/ ``` Run the initialization script: ``` -./initialization.sh +sudo ./initialization.sh ``` Follow the prompts during installation. @@ -40,3 +42,16 @@ Close the Privacy Error tab and wait for the initial V2X Hub tab to finish loadi Enter the login credentials you created in step 5b and login. Installation complete! + +### Simulation Setup +To support execution in a simulated environment, V2X-Hub is in the process of integrating with CDASim, a Co-Simulation tool built as an extension of Eclipse Mosiac. This extension will incorporate integration with several other platforms including CARMA-Platform and CARLA. The setup for this simply requires setting environment variables inside the V2X-Hub docker container. + * **SIMULATION_MODE** – Environment variable for enabling simulation components for V2X-Hub. If set to "true" or "TRUE" simulation components will be enable. Otherwise, simulation components will not be enabled. + * **KAFKA_BROKER_ADDRESS** – Environment variable for storing Kafka broker connection string (including port). + * **TIME_SYNC_TOPIC** – Environment variable for storing Kafka time sync topic. + * **SIMULATION_IP** – Environment variable for storing IP address of CDASim application. + * **SIMULATION_REGISTRATION_PORT** – Environment variable for storing port on CDASim that handles registration attempts. + * **TIME_SYNC_PORT** – Environment varaible for storing port for receiving time sync messages from CDASim. + * **V2X_PORT** – Environment variable for storing port for receiving v2x messages from CDASim + * **SIM_V2X_PORT** – Environment variable for storing port for sending v2x messages to CDASim + * **LOCAL_IP** – Environment variable for storing local IP of V2X Hub. + * **INFRASTRUCTURE_ID** – Environment variable for storing infrastructure id of V2X Hub.. \ No newline at end of file diff --git a/configuration/amd64/mysql/add_v2xhub_user.bash b/configuration/amd64/mysql/add_v2xhub_user.bash deleted file mode 100755 index 0d9ab218b..000000000 --- a/configuration/amd64/mysql/add_v2xhub_user.bash +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Fail when any command fails -#set -e - -# Ensure mysql-client is installed -REQUIRED_PKG="mysql-client" -PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") -echo Checking for $REQUIRED_PKG: $PKG_OK -if [ "" = "$PKG_OK" ]; then - echo "No $REQUIRED_PKG found. Installing $REQUIRED_PKG." - sudo apt-get update - sudo apt-get --yes install $REQUIRED_PKG -fi - -# 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 [\$\!\.\+_\*@\#\^%\?~] || echo $PASS | grep -q [-] ); then - echo - read -s -p "Confirm password: " CONF_PASS - while [ $CONF_PASS != $PASS ]; do - echo - read -s -p "Passwords do not match. Please re-enter password: " 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', SHA2('$PASS', 256), 3)" - echo "V2X Hub user successfully added" -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/docker-compose.yml b/configuration/arm64/docker-compose.yml deleted file mode 100644 index 23b6e017c..000000000 --- a/configuration/arm64/docker-compose.yml +++ /dev/null @@ -1,60 +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_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/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - - ./mysql/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql - - mysql-datavolume:/var/lib/mysql - - php: - image: usdotfhwaops/php_arm:${V2XHUB_VERSION:-develop} - container_name: php - network_mode: host - restart: always - depends_on: - - db - - v2xhub - stdin_open: true - tty: true - - v2xhub: - image: usdotfhwaops/v2xhubarm:${V2XHUB_VERSION:-develop} - container_name: v2xhub - network_mode: host - restart: always - depends_on: - - db - environment: - - MYSQL_PASSWORD=/run/secrets/mysql_password - - INFRASTRUCTURE_ID=rsu_ - - INFRASTRUCTURE_NAME= - secrets: - - mysql_password - volumes: - - ./logs:/var/log/tmx - - ./MAP:/var/www/plugins/MAP - port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice_arm:${V2XHUB_VERSION:-develop} - container_name: port_drayage_webservice - network_mode: host -secrets: - mysql_password: - file: ./secrets/mysql_password.txt - mysql_root_password: - file: ./secrets/mysql_root_password.txt - -volumes: - mysql-datavolume: diff --git a/configuration/arm64/initialization.sh b/configuration/arm64/initialization.sh deleted file mode 100755 index 5894602fd..000000000 --- a/configuration/arm64/initialization.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -directory=$(pwd) -mysqlDir="$directory/mysql" - -# Update and upgrade commands to update linux OS -sudo apt update -y && sudo apt upgrade -y - -# Install necessary and useful apps -sudo apt-get install chromium-browser -y - -# 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' 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' mysql_password.txt && rm sql_pass.txt -fi -# TODO VH-1303 Allow for version and configuration selection in initialization script - -# ARM64 initialization -cd $directory -for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done -# Add Docker's official GPG key: -sudo apt-get update -sudo apt-get install ca-certificates curl -sudo install -m 0755 -d /etc/apt/keyrings -sudo curl -fsSL https://download.docker.com/linux/$(. /etc/os-release && echo "$ID")/gpg -o /etc/apt/keyrings/docker.asc -sudo chmod a+r /etc/apt/keyrings/docker.asc - -# Add the repository to Apt sources: -echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$(. /etc/os-release && echo "$ID") \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -sudo apt-get update -sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -sudo docker compose up -d - -# Create V2X Hub 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 & diff --git a/configuration/arm64/mysql/localhost.sql b/configuration/arm64/mysql/localhost.sql deleted file mode 100644 index 3ef568522..000000000 --- a/configuration/arm64/mysql/localhost.sql +++ /dev/null @@ -1,255 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.35, for Linux (x86_64) --- --- Host: 127.0.0.1 Database: IVP --- ------------------------------------------------------ --- Server version 5.7.35 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `IVP` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `IVP` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `IVP`; - --- --- Table structure for table `eventLog` --- - -DROP TABLE IF EXISTS `eventLog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `eventLog` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `description` text NOT NULL COMMENT 'The log message content', - `source` text NOT NULL COMMENT 'The name of the plugin or other agent that logged the event', - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'The date and time of the event in UTC', - `logLevel` enum('Debug','Info','Warning','Error','Fatal') NOT NULL COMMENT 'The type of event being logged, one of - Debug - Info - Warn - Error', - `uploaded` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COMMENT='This table records events generated by every IVP core component and plugin in the IVP platform. '; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `installedPlugin` --- - -DROP TABLE IF EXISTS `installedPlugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `installedPlugin` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `pluginId` int(10) unsigned NOT NULL, - `path` text NOT NULL, - `exeName` text NOT NULL, - `manifestName` text NOT NULL, - `commandLineParameters` text NOT NULL, - `enabled` tinyint(1) NOT NULL, - `maxMessageInterval` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `pluginId` (`pluginId`), - CONSTRAINT `installedPlugin_ibfk_2` FOREIGN KEY (`pluginId`) REFERENCES `plugin` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `messageActivity` --- - -DROP TABLE IF EXISTS `messageActivity`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `messageActivity` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `messageTypeId` int(10) unsigned NOT NULL COMMENT 'Foreign key into the messageType table', - `pluginId` int(10) unsigned NOT NULL, - `count` int(10) unsigned NOT NULL, - `lastReceivedTimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The date and time of the most recent message of a type in UTC.', - `averageInterval` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `messageTypeId_pluginId` (`messageTypeId`,`pluginId`), - KEY `messageTypeId` (`messageTypeId`), - KEY `pluginId` (`pluginId`), - CONSTRAINT `messageActivity_ibfk_1` FOREIGN KEY (`messageTypeId`) REFERENCES `messageType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `messageActivity_ibfk_2` FOREIGN KEY (`pluginId`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=latin1 COMMENT='This table records the most recent message activity of each active plugin in the IVP system. The data in this table is updated by the IVP plugin monitor core component for every message the plugin monitor receives.'; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `messageType` --- - -DROP TABLE IF EXISTS `messageType`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `messageType` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `type` varchar(50) NOT NULL COMMENT 'A unique message type name', - `subtype` varchar(50) NOT NULL, - `description` text COMMENT 'A description of the message type', - PRIMARY KEY (`id`), - UNIQUE KEY `type` (`type`,`subtype`) -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 COMMENT='This table lists the valid message types of every plugin loaded on the IVP platform.'; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `plugin` --- - -DROP TABLE IF EXISTS `plugin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `plugin` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `name` varchar(100) NOT NULL COMMENT 'A unique plugin name', - `description` text, - `version` text, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 COMMENT='This table lists the plugins loaded and available to run on the IVP platform.'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `pluginActivity` --- - -DROP TABLE IF EXISTS `pluginActivity`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `pluginActivity` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `msgReceivedTimestamp` bigint(20) unsigned NOT NULL COMMENT 'Timestamp in microseconds since Epoch of when message was received by destination Plugin', - `rPluginName` varchar(100) NOT NULL COMMENT 'Name of receiving plugin', - `sPluginName` varchar(100) NOT NULL COMMENT 'Name of source plugin', - `msgType` varchar(100) NOT NULL COMMENT 'Type of message', - `msgSubtype` varchar(100) NOT NULL COMMENT 'Subtype of message', - `msgCreatedTimestamp` bigint(20) NOT NULL COMMENT 'Timestamp in milliseconds since Epoch of when message was created.', - `msgHandledTimestamp` bigint(20) NOT NULL COMMENT 'Timestamp in milliseconds since Epoch of when receiving plugin finished handling message.', - `origMsgTimestamp` bigint(20) NOT NULL COMMENT 'Timestamp in milliseconds since Epoch of the original message that triggered this message sequence.', - PRIMARY KEY (`id`), - UNIQUE KEY `msgReceivedTimestamp_rPluginName` (`msgReceivedTimestamp`,`rPluginName`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table records all message activity of each active plugin in the IVP system. The data in this table is updated by each Plugin as part of PluginClient base class implementation.'; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `pluginConfigurationParameter` --- - -DROP TABLE IF EXISTS `pluginConfigurationParameter`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `pluginConfigurationParameter` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `pluginId` int(10) unsigned NOT NULL, - `key` varchar(255) NOT NULL COMMENT 'The name of a configuration parameter.', - `value` text NOT NULL COMMENT 'The value of a configuration parameter', - `defaultValue` text NOT NULL, - `description` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `pluginId_key` (`pluginId`,`key`), - KEY `pluginId` (`pluginId`), - CONSTRAINT `pluginConfigurationParameter_ibfk_1` FOREIGN KEY (`pluginId`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=latin1 COMMENT='This table lists the IVP system configuration parameters used by both core components and plugins to control the behavior of the system.'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `pluginMessageMap` --- - -DROP TABLE IF EXISTS `pluginMessageMap`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `pluginMessageMap` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `pluginId` int(10) unsigned NOT NULL COMMENT 'Foreign key into the plugin table', - `messageTypeId` int(10) unsigned NOT NULL COMMENT 'Foreign key into the messageType table.', - PRIMARY KEY (`id`), - UNIQUE KEY `pluginId` (`pluginId`,`messageTypeId`), - KEY `pluginId_2` (`pluginId`), - KEY `messageTypeId` (`messageTypeId`), - CONSTRAINT `pluginMessageMap_ibfk_1` FOREIGN KEY (`pluginId`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `pluginMessageMap_ibfk_2` FOREIGN KEY (`messageTypeId`) REFERENCES `messageType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=1592 DEFAULT CHARSET=latin1 COMMENT='This table identifies the types of messages generated by each plugin.'; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `pluginStatus` --- - -DROP TABLE IF EXISTS `pluginStatus`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `pluginStatus` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `pluginId` int(10) unsigned NOT NULL, - `key` varchar(100) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `UQ_pluginId_key` (`pluginId`,`key`), - KEY `pluginId` (`pluginId`), - CONSTRAINT `pluginStatus_ibfk_2` FOREIGN KEY (`pluginId`) REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `systemConfigurationParameter` --- - -DROP TABLE IF EXISTS `systemConfigurationParameter`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `systemConfigurationParameter` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `key` varchar(255) NOT NULL COMMENT 'The name of a configuration parameter.', - `value` text NOT NULL COMMENT 'The value of a configuration parameter', - `defaultValue` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `key` (`key`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='This table lists the IVP system configuration parameters used by both core components and plugins to control the behavior of the system.'; -/*!40101 SET character_set_client = @saved_cs_client */; - - --- --- Table structure for table `user` --- - -DROP TABLE IF EXISTS `user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', - `username` varchar(50) NOT NULL COMMENT 'The account name for the user, typically an email address', - `password` varchar(64) NOT NULL COMMENT 'An encrypted password', - `accessLevel` int(11) NOT NULL DEFAULT '1' COMMENT 'The access level permitted for this user, one of: \n 1. read-only access to portal 2. application administrator access 3. system administrator, all access', - PRIMARY KEY (`id`), - UNIQUE KEY `UQ_user_id` (`id`), - UNIQUE KEY `UQ_user_username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COMMENT='The list of accounts that can access the IVP platform via the administrative portal is held in the users table.'; -/*!40101 SET character_set_client = @saved_cs_client */; - -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/configuration/arm64/mysql/port_drayage.sql b/configuration/arm64/mysql/port_drayage.sql deleted file mode 100644 index 71c93e51f..000000000 --- a/configuration/arm64/mysql/port_drayage.sql +++ /dev/null @@ -1,91 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.34, for Linux (x86_64) --- --- Host: 127.0.0.1 Database: PORT_DRAYAGE --- ------------------------------------------------------ --- Server version 5.7.35 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `PORT_DRAYAGE` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `PORT_DRAYAGE`; - --- --- Table structure for table `first_action` --- - -DROP TABLE IF EXISTS `first_action`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `first_action` ( - `cmv_id` int(4) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `first_action` --- - -LOCK TABLES `first_action` WRITE; -/*!40000 ALTER TABLE `first_action` DISABLE KEYS */; -INSERT INTO `first_action` VALUES (123,'SOME_CARGO',38.9548890,-77.1481430,'PICKUP','4bea1c45-e421-11eb-a8cc-000c29ae389d','32320c8a-e422-11eb-a8cc-000c29ae389d'); -/*!40000 ALTER TABLE `first_action` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `freight` --- - -DROP TABLE IF EXISTS `freight`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `freight` ( - `cmv_id` int(4) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `freight` --- - -LOCK TABLES `freight` WRITE; -/*!40000 ALTER TABLE `freight` DISABLE KEYS */; -INSERT INTO `freight` VALUES (123,NULL,38.9549780,-77.1475790,'EXIT_STAGING_AREA','32320c8a-e422-11eb-a8cc-000c29ae389d','4ace39e6-ee36-11eb-9a03-0242ac130003'),(123,'SOME_CARGO',38.9548890,-77.1481430,'PICKUP','4bea1c45-e421-11eb-a8cc-000c29ae389d','32320c8a-e422-11eb-a8cc-000c29ae389d'); -/*!40000 ALTER TABLE `freight` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2021-07-21 11:42:55 diff --git a/configuration/arm64/mysql/suntrax/README.txt b/configuration/arm64/mysql/suntrax/README.txt deleted file mode 100644 index 750c98eac..000000000 --- a/configuration/arm64/mysql/suntrax/README.txt +++ /dev/null @@ -1 +0,0 @@ -These SQL files are Port Drayage actions created for SunTrax Verification Testing. \ No newline at end of file diff --git a/configuration/arm64/mysql/suntrax/port_area_operations.sql b/configuration/arm64/mysql/suntrax/port_area_operations.sql deleted file mode 100644 index abeb6e478..000000000 --- a/configuration/arm64/mysql/suntrax/port_area_operations.sql +++ /dev/null @@ -1,90 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.36, for Linux (x86_64) --- --- Host: 127.0.0.1 Database: PORT_DRAYAGE --- ------------------------------------------------------ --- Server version 5.7.36 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `PORT_DRAYAGE` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `PORT_DRAYAGE`; - --- --- Table structure for table `first_action` --- - -DROP TABLE IF EXISTS `first_action`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `first_action` ( - `cmv_id` varchar(20) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `first_action` --- - -LOCK TABLES `first_action` WRITE; -/*!40000 ALTER TABLE `first_action` DISABLE KEYS */; -/*!40000 ALTER TABLE `first_action` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `freight` --- - -DROP TABLE IF EXISTS `freight`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `freight` ( - `cmv_id` varchar(20) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `freight` --- - -LOCK TABLES `freight` WRITE; -/*!40000 ALTER TABLE `freight` DISABLE KEYS */; -INSERT INTO `freight` VALUES ('DOT-80550',NULL,28.1128156,-81.8314745,'ENTER_PORT','4ace39e6-ee36-11eb-9a03-0242ac130003','67eadd3a-38b4-11ec-930a-000145098e4f'),('DOT-80550','CARGO_A',28.1119763,-81.8312035,'DROPOFF','67eadd3a-38b4-11ec-930a-000145098e4f','0bf7ebda-38b5-11ec-930a-000145098e4f'),('DOT-80550','CARGO_B',28.1117373,-81.8309654,'PICKUP','0bf7ebda-38b5-11ec-930a-000145098e4f','9230504d-38b5-11ec-930a-000145098e4f'),('DOT-80550','CARGO_B',28.1120500,-81.8306483,'PORT_CHECKPOINT','9230504d-38b5-11ec-930a-000145098e4f','511ad052-38b6-11ec-930a-000145098e4f'),('DOT-80550','CARGO_B',28.1138052,-81.8317502,'EXIT_PORT','511ad052-38b6-11ec-930a-000145098e4f','fc15d52a-3c0c-11ec-b00d-000145098e4f'),('DOT-80550','CARGO_B',28.1232336,-81.8347566,'ENTER_STAGING_AREA','fc15d52a-3c0c-11ec-b00d-000145098e4f','5ceaab82-515c-11ec-9e2c-000145098e47'),('DOT-10004',NULL,28.1128156,-81.8314745,'ENTER_PORT','84f6b797-52c2-11ec-9105-000145098e4f','c9bba171-52c2-11ec-9105-000145098e4f'),('DOT-10004','CARGO_A',28.1119763,-81.8312035,'DROPOFF','c9bba171-52c2-11ec-9105-000145098e4f','8e1d456a-52c3-11ec-9105-000145098e4f'),('DOT-10004','CARGO_B',28.1117373,-81.8309654,'PICKUP','8e1d456a-52c3-11ec-9105-000145098e4f','744be658-52c4-11ec-9105-000145098e4f'),('DOT-10004','CARGO_B',28.1120500,-81.8306483,'PORT_CHECKPOINT','744be658-52c4-11ec-9105-000145098e4f','a4b419b9-52c5-11ec-9105-000145098e4f'),('DOT-10004','CARGO_B',28.1138052,-81.8317502,'EXIT_PORT','a4b419b9-52c5-11ec-9105-000145098e4f','20b546e3-52c6-11ec-9105-000145098e4f'),('DOT-10004','CARGO_B',28.1232336,-81.8347566,'ENTER_STAGING_AREA','20b546e3-52c6-11ec-9105-000145098e4f','53875eba-52c7-11ec-9105-000145098e4f'); -/*!40000 ALTER TABLE `freight` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2021-12-03 11:03:12 diff --git a/configuration/arm64/mysql/suntrax/staging_area_operations.sql b/configuration/arm64/mysql/suntrax/staging_area_operations.sql deleted file mode 100644 index 7332feb90..000000000 --- a/configuration/arm64/mysql/suntrax/staging_area_operations.sql +++ /dev/null @@ -1,91 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.36, for Linux (x86_64) --- --- Host: 127.0.0.1 Database: PORT_DRAYAGE --- ------------------------------------------------------ --- Server version 5.7.36 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `PORT_DRAYAGE` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `PORT_DRAYAGE`; - --- --- Table structure for table `first_action` --- - -DROP TABLE IF EXISTS `first_action`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `first_action` ( - `cmv_id` varchar(20) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `first_action` --- - -LOCK TABLES `first_action` WRITE; -/*!40000 ALTER TABLE `first_action` DISABLE KEYS */; -INSERT INTO `first_action` VALUES ('DOT-80550','CARGO_A',28.1249788,-81.8348897,'PICKUP','4bea1c45-e421-11eb-a8cc-000c29ae389d','32320c8a-e422-11eb-a8cc-000c29ae389d'),('DOT-10004','CARGO_A',28.1249788,-81.8348897,'PICKUP','66bba4a0-52c1-11ec-9105-000145098e4f','66bba4cb-52c1-11ec-9105-000145098e4f'); -/*!40000 ALTER TABLE `first_action` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `freight` --- - -DROP TABLE IF EXISTS `freight`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `freight` ( - `cmv_id` varchar(20) NOT NULL, - `cargo_id` varchar(20) DEFAULT NULL, - `destination_lat` decimal(9,7) NOT NULL, - `destination_long` decimal(9,7) NOT NULL, - `operation` varchar(20) NOT NULL, - `action_id` varchar(36) NOT NULL, - `next_action` varchar(36) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `freight` --- - -LOCK TABLES `freight` WRITE; -/*!40000 ALTER TABLE `freight` DISABLE KEYS */; -INSERT INTO `freight` VALUES ('DOT-80550',NULL,28.1232195,-81.8348278,'EXIT_STAGING_AREA','32320c8a-e422-11eb-a8cc-000c29ae389d','4ace39e6-ee36-11eb-9a03-0242ac130003'),('DOT-80550','CARGO_A',28.1249788,-81.8348897,'PICKUP','4bea1c45-e421-11eb-a8cc-000c29ae389d','32320c8a-e422-11eb-a8cc-000c29ae389d'),('DOT-80550',NULL,28.1128156,-81.8314745,'ENTER_PORT','4ace39e6-ee36-11eb-9a03-0242ac130003','67eadd3a-38b4-11ec-930a-000145098e4f'),('DOT-80550','CARGO_B',28.1232336,-81.8347566,'ENTER_STAGING_AREA','fc15d52a-3c0c-11ec-b00d-000145098e4f','5ceaab82-515c-11ec-9e2c-000145098e47'),('DOT-10004','CARGO_A',28.1249788,-81.8348897,'PICKUP','66bba4a0-52c1-11ec-9105-000145098e4f','66bba4cb-52c1-11ec-9105-000145098e4f'),('DOT-10004',NULL,28.1232195,-81.8348278,'EXIT_STAGING_AREA','66bba4cb-52c1-11ec-9105-000145098e4f','84f6b797-52c2-11ec-9105-000145098e4f'),('DOT-10004',NULL,28.1128156,-81.8314745,'ENTER_PORT','84f6b797-52c2-11ec-9105-000145098e4f','c9bba171-52c2-11ec-9105-000145098e4f'),('DOT-10004','CARGO_B',28.1232336,-81.8347566,'ENTER_STAGING_AREA','20b546e3-52c6-11ec-9105-000145098e4f','53875eba-52c7-11ec-9105-000145098e4f'); -/*!40000 ALTER TABLE `freight` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2021-12-03 11:25:03 diff --git a/configuration/amd64/docker-compose.yml b/configuration/docker-compose.yml similarity index 95% rename from configuration/amd64/docker-compose.yml rename to configuration/docker-compose.yml index a2dad081e..f73735c3b 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: db: - image: mysql:5.7 + image: mysql:8.0 container_name: mysql restart: always environment: @@ -31,7 +31,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:${V2XHUB_VERSION:-develop} + image: usdotfhwaops/v2xhub:${V2XHUB_VERSION:-develop} container_name: v2xhub network_mode: host restart: always diff --git a/configuration/amd64/initialization.sh b/configuration/initialization.sh similarity index 100% rename from configuration/amd64/initialization.sh rename to configuration/initialization.sh diff --git a/configuration/amd64/logs/filewatchscript.sh b/configuration/logs/filewatchscript.sh similarity index 100% rename from configuration/amd64/logs/filewatchscript.sh rename to configuration/logs/filewatchscript.sh diff --git a/configuration/arm64/mysql/add_v2xhub_user.bash b/configuration/mysql/add_v2xhub_user.bash similarity index 96% rename from configuration/arm64/mysql/add_v2xhub_user.bash rename to configuration/mysql/add_v2xhub_user.bash index 5b4b6f314..6ee0250e4 100755 --- a/configuration/arm64/mysql/add_v2xhub_user.bash +++ b/configuration/mysql/add_v2xhub_user.bash @@ -4,6 +4,7 @@ # Ensure mysql-client is installed arch=$(dpkg --print-architecture) +# TODO: Add a common mysql-client that works for ARM and AMD devices if [ $arch = "amd64" ]; then REQUIRED_PKG="mysql-client" else diff --git a/configuration/amd64/mysql/localhost.sql b/configuration/mysql/localhost.sql similarity index 100% rename from configuration/amd64/mysql/localhost.sql rename to configuration/mysql/localhost.sql diff --git a/configuration/amd64/mysql/port_drayage.sql b/configuration/mysql/port_drayage.sql similarity index 100% rename from configuration/amd64/mysql/port_drayage.sql rename to configuration/mysql/port_drayage.sql diff --git a/configuration/amd64/mysql/suntrax/README.txt b/configuration/mysql/suntrax/README.txt similarity index 100% rename from configuration/amd64/mysql/suntrax/README.txt rename to configuration/mysql/suntrax/README.txt diff --git a/configuration/amd64/mysql/suntrax/port_area_operations.sql b/configuration/mysql/suntrax/port_area_operations.sql similarity index 100% rename from configuration/amd64/mysql/suntrax/port_area_operations.sql rename to configuration/mysql/suntrax/port_area_operations.sql diff --git a/configuration/amd64/mysql/suntrax/staging_area_operations.sql b/configuration/mysql/suntrax/staging_area_operations.sql similarity index 100% rename from configuration/amd64/mysql/suntrax/staging_area_operations.sql rename to configuration/mysql/suntrax/staging_area_operations.sql From be9200994a0030f1779224b6b14f4f68c68c2f52 Mon Sep 17 00:00:00 2001 From: dan-du-car <62157949+dan-du-car@users.noreply.github.com> Date: Fri, 31 May 2024 09:25:19 -0400 Subject: [PATCH 12/12] Add configuration parameters for RSUHealthMonitorPlugin (#613) # PR Details ## Description Add configuration parameter to set SNMP security level. ## Related Issue https://github.com/usdot-fhwa-stol/cda-telematics/issues/213 ## JIRA https://usdot-carma.atlassian.net/browse/VH-1316 ## Motivation and Context Telematic tool integration test ## How Has This Been Tested? Unit test ## Types of changes - [x] 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: - [ ] 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. - [x] 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. --- .../RSUHealthMonitorPlugin/manifest.json | 2 +- .../src/RSUConfigurationList.cpp | 10 ++++++++++ .../src/RSUConfigurationList.h | 2 +- .../test/test_RSUConfigurationList.cpp | 18 +++++++++--------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/v2i-hub/RSUHealthMonitorPlugin/manifest.json b/src/v2i-hub/RSUHealthMonitorPlugin/manifest.json index 5cbd9dff2..c96601e69 100755 --- a/src/v2i-hub/RSUHealthMonitorPlugin/manifest.json +++ b/src/v2i-hub/RSUHealthMonitorPlugin/manifest.json @@ -19,7 +19,7 @@ }, { "key":"RSUConfigurationList", - "default":"{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }", + "default":"{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SecurityLevel\":\"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SecurityLevel\":\"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }", "description":"Configurations of the RSUs the V2X hub is connected to." } ] diff --git a/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.cpp b/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.cpp index 058ea216d..62a751551 100644 --- a/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.cpp +++ b/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.cpp @@ -83,6 +83,16 @@ namespace RSUHealthMonitor auto errMsg = "RSUConfigurationList [" + std::to_string(i + 1) + "]: RSU MIB version [" + std::string(RSUMIBVersionKey) + "] is required."; throw RSUConfigurationException(errMsg); } + + if (rsuArray[i].isMember(SecurityLevelKey)) + { + config.securityLevel = rsuArray[i][SecurityLevelKey].asString(); + } + else + { + auto errMsg = "RSUConfigurationList [" + std::to_string(i + 1) + "]: RSU Security Level [" + std::string(SecurityLevelKey) + "] is required."; + throw RSUConfigurationException(errMsg); + } tempConfigs.push_back(config); } // Only update RSU configurations when all configs are processed correctly. diff --git a/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.h b/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.h index 5938ec7fb..5ba523e76 100644 --- a/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.h +++ b/src/v2i-hub/RSUHealthMonitorPlugin/src/RSUConfigurationList.h @@ -31,7 +31,7 @@ namespace RSUHealthMonitor uint16_t snmpPort; std::string user; std::string authPassPhrase; - std::string securityLevel = "authPriv"; + std::string securityLevel; RSUMibVersion mibVersion; friend std::ostream &operator<<(std::ostream &os, const RSUConfiguration &config); }; diff --git a/src/v2i-hub/RSUHealthMonitorPlugin/test/test_RSUConfigurationList.cpp b/src/v2i-hub/RSUHealthMonitorPlugin/test/test_RSUConfigurationList.cpp index 8fb16e5a2..ae7c35974 100644 --- a/src/v2i-hub/RSUHealthMonitorPlugin/test/test_RSUConfigurationList.cpp +++ b/src/v2i-hub/RSUHealthMonitorPlugin/test/test_RSUConfigurationList.cpp @@ -12,7 +12,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; rsuConfigList->parseRSUs(rsuConfigsStr); ASSERT_EQ(2, rsuConfigList->getConfigs().size()); std::stringstream ss; @@ -23,7 +23,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_MalformatJSON) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -31,7 +31,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Missing_RSUS) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"ERROR\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"ERROR\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -39,14 +39,14 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Missing_SNMPPORT) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort_Missing\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort_Missing\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } TEST_F(test_RSUConfigurationList, parseAndGetConfigs_INVALID_SNMPPORT) { - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.01.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"INVALID_PORT\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.01.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"INVALID_PORT\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -54,7 +54,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Missing_AuthPassPhrase) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase_Missing\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase_Missing\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -62,7 +62,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Missing_User) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User_Missing\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User_Missing\": \"authOnlyUser\", \"RSUMIBVersion\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -70,7 +70,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Missing_MibVersion) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion_Missing\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion_Missing\": \"RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); } @@ -78,7 +78,7 @@ namespace RSUHealthMonitor TEST_F(test_RSUConfigurationList, parseAndGetConfigs_Invalid_MibVersion) { ASSERT_EQ(0, rsuConfigList->getConfigs().size()); - std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"INVALID_RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; + std::string rsuConfigsStr = "{ \"RSUS\": [ { \"RSUIp\": \"192.168.XX.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"161\", \"AuthPassPhrase\": \"dummy\", \"User\": \"authOnlyUser\", \"RSUMIBVersion\": \"INVALID_RSU4.1\" },{ \"RSUIp\": \"192.168.00.XX\",\"SecurityLevel\": \"authPriv\", \"SNMPPort\": \"162\", \"AuthPassPhrase\": \"tester\", \"User\": \"authPrivUser\", \"RSUMIBVersion\": \"RSU4.1\" }] }"; ASSERT_THROW(rsuConfigList->parseRSUs(rsuConfigsStr), RSUHealthMonitor::RSUConfigurationException); ASSERT_EQ(0, rsuConfigList->getConfigs().size()); }