From 66eb15b9146b0982f9702b202edffaf1fd7d843e Mon Sep 17 00:00:00 2001 From: paulbourelly999 <77466294+paulbourelly999@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:37:42 -0800 Subject: [PATCH 1/9] Issue-290: Add mysql volume (#296) --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fdafddd6a..fd408b7ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,7 +54,7 @@ services: - mysql_root_password volumes: - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - + - mysql-datavolume:/var/lib/mysql php: image: usdotfhwaops/php:latest container_name: php @@ -79,8 +79,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - + - /etc/timezone:/etc/timezone:ro scheduling_service: image: usdotfhwastoldev/scheduling_service:develop command: sh -c "/wait && /home/carma-streets/scheduling_service/build/scheduling_service" @@ -196,4 +195,5 @@ secrets: file: ./secrets/mysql_password.txt mysql_root_password: file: ./secrets/mysql_root_password.txt - +volumes: + mysql-datavolume: From c3cec7d2e6445c441fb0fa7f779260249cd76178 Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Wed, 18 Jan 2023 10:40:33 -0500 Subject: [PATCH 2/9] Add Doxygen mainpage.md (#302) --- Doxyfile | 3 ++- docs/mainpage.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 docs/mainpage.md diff --git a/Doxyfile b/Doxyfile index c3e3c9e2d..b155620d0 100644 --- a/Doxyfile +++ b/Doxyfile @@ -906,7 +906,8 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = docs/ISSUE_TEMPLATE.md \ + docs/PULL_REQUEST_TEMPLATE.md # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/docs/mainpage.md b/docs/mainpage.md new file mode 100644 index 000000000..71490f6d5 --- /dev/null +++ b/docs/mainpage.md @@ -0,0 +1,47 @@ +| CicleCI Build Status | Sonar Code Quality | +|----------------------|---------------------| +|[![CircleCI](https://circleci.com/gh/usdot-fhwa-stol/carma-streets.svg?style=svg)](https://circleci.com/gh/usdot-fhwa-stol/carma-streets) | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-stol_carma-streets&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-stol_carma-streets) | +# DockerHub Release Builds +| Scheduling Service | Message Services | Intersection Model | Signal Opt Service | Tsc Service | +|-----|-----|-----|-----|-----| +[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/scheduling_service?label=scheduling%20service)](https://hub.docker.com/repository/docker/usdotfhwastol/scheduling_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/message_services?label=message%20services)](https://hub.docker.com/repository/docker/usdotfhwastol/message_services) | [ ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/intersection_model?label=intersection%20model)](https://hub.docker.com/repository/docker/usdotfhwastol/intersection_model) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/signal_opt_service?label=signal%20opt%20service)](https://hub.docker.com/repository/docker/usdotfhwastol/signal_opt_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/tsc_service?label=tsc%20service&logoColor=%232496ED)](https://hub.docker.com/repository/docker/usdotfhwastol/tsc_service) | +# DockerHub Release Candidate Builds +| Scheduling Service | Message Services | Intersection Model | Signal Opt Service | Tsc Service | +|----|----|----|----|----| +[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/scheduling_service?label=tsc%20service&logoColor=%232496ED)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/scheduling_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/message_services?label=message%20services)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/message_services) | [ ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/intersection_model?label=intersection%20model)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/intersection_model) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/signal_opt_service?label=signal%20opt%20service)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/signal_opt_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/tsc_service?label=tsc%20service&logoColor=%232496ED)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/tsc_service) | +# DockerHub Develop Builds +| Scheduling Service | Message Services | Intersection Model | Signal Opt Service | Tsc Service | +|-----|-----|-----|-----|-----| +[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/scheduling_service?label=scheduling%20service)](https://hub.docker.com/repository/docker/usdotfhwastoldev/scheduling_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/message_services?label=message%20services)](https://hub.docker.com/repository/docker/usdotfhwastoldev/message_services) | [ ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/intersection_model?label=intersection%20model)](https://hub.docker.com/repository/docker/usdotfhwastoldev/intersection_model) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/signal_opt_service?label=signal%20opt%20service)](https://hub.docker.com/repository/docker/usdotfhwastoldev/signal_opt_service) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/tsc_service?label=tsc%20service&logoColor=%232496ED)](https://hub.docker.com/repository/docker/usdotfhwastoldev/tsc_service) | + +CARMA Streets is a component of CARMA ecosystem, which enables such a coordination among different transportation users. This component provides an interface for CDA participants to interact with the road infrastructure. CARMA Streets is also an edge-computing unit that improves the efficiency and performance of the Transportation Systems Management and Operations (TSMO) strategies. + +## Architecture +CARMA Streets architecture is based on a scalable services and layered architecture pattern that allows for easy deployment. Service components are packaged to contain one or more modules (classes) that represent a specific reusable function (e.g., decode a particular ASN.1 message) or an independently deployable business function (e.g., control interface to a signal controller). Services interact with each other via lightweight messaging service (e.g., Kafka) which allows for them be deployed either together or distributed for scalability and performance. A high-level abstract view of the architecture to communicate the design pattern is shown in Upcoming Figure. A more detailed Unified Modeling Language class and packaging diagrams to define the interfaces between services and layers and their interactions will be developed and documented here during implementation following an Agile Development Methodology. + +## Deployment +Docker is the primary deployment mechanism to containerize one or more services. The CARMA Streets application and other major frameworks such as Kafka will run in their own separate containers. This document will be updated with a detailed Docker deployment strategy during later design phases. + +# CARMAPlatform +The primary carma-streets repository can be found [here](https://github.com/usdot-fhwa-stol/carma-streets) and is part of the [USDOT FHWA STOL](https://github.com/usdot-fhwa-stol/) +github organization. Documentation on how the carma-streets functions, how it will evolve over time, and how you can contribute can be found at the above links as well + +## Contribution +Welcome to the CARMA contributing guide. Please read this guide to learn about our development process, how to propose pull requests and improvements, and how to build and test your changes to this project. [CARMA Contributing Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md) + +## Code of Conduct +Please read our [CARMA Code of Conduct](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Code_of_Conduct.md) which outlines our expectations for participants within the CARMA community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community. + +## Attribution +The development team would like to acknowledge the people who have made direct contributions to the design and code in this repository. [CARMA Attribution](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/ATTRIBUTION.md) + +## License +By contributing to the Federal Highway Administration (FHWA) Connected Automated Research Mobility Applications (CARMA), you agree that your contributions will be licensed under its Apache License 2.0 license. [CARMA License](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/docs/License.md) + +## Contact +Please click on the CARMA logo below to visit the Federal Highway Adminstration(FHWA) CARMA website. + +[![CARMA Image](https://raw.githubusercontent.com/usdot-fhwa-stol/CARMAPlatform/develop/docs/image/CARMA_icon.png)](https://highways.dot.gov/research/research-programs/operations/CARMA) + + + From d37f1722033e326c3f27823b65cf695c7bd76fd9 Mon Sep 17 00:00:00 2001 From: Cody Garver Date: Wed, 25 Jan 2023 15:15:06 -0500 Subject: [PATCH 3/9] Delete ISSUE_TEMPLATE.md since we use YAML issue templates --- docs/ISSUE_TEMPLATE.md | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 docs/ISSUE_TEMPLATE.md diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 0eb32fc6a..000000000 --- a/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,29 +0,0 @@ -### Types of Issue - - - -- [ ] Anomaly report (something appears to not work correctly) -- [ ] Enhancement request (describe the enhancement being requested) -- [ ] Other (please ensure the description clarifies why the issue doesn’t fall into either of the above categories) - -### Descriptive summary - - - -### Carma streets version where this issue was discovered - - - -### Expected behavior - -### Actual behavior - - -### Steps to reproduce the actual behavior - -1. Do this -1. Then do this... - -### Related work - - From 1c59e38b8246923dcb656f13841359e401099c76 Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:05:11 -0500 Subject: [PATCH 4/9] Delete PULL_REQUEST_TEMPLATE.md (#308) --- docs/PULL_REQUEST_TEMPLATE.md | 44 ----------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 docs/PULL_REQUEST_TEMPLATE.md diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 5bc2cf423..000000000 --- a/docs/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,44 +0,0 @@ - - -# PR Details -## Description - - - -## 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. -[CARMA Contributing Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md) -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. From 0dd9d62e05b3e559694c504b294ae00d44e34bbf Mon Sep 17 00:00:00 2001 From: SaikrishnaBairamoni Date: Tue, 21 Feb 2023 09:08:19 -0500 Subject: [PATCH 5/9] revert dockertags from carma-system-4.3.0 to develop --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8e568d4af..658f6aa21 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,7 +60,7 @@ services: - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:7.4.0 + image: usdotfhwaops/php:latest container_name: php network_mode: host depends_on: @@ -69,7 +69,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:7.4.0 + image: usdotfhwaops/v2xhubamd:latest container_name: v2xhub network_mode: host restart: always @@ -85,7 +85,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro scheduling_service: - image: usdotfhwastol/scheduling_service:carma-system-4.3.0 + image: usdotfhwastoldev/scheduling_service:develop command: sh -c "/wait && /home/carma-streets/scheduling_service/build/scheduling_service" build: context: . @@ -110,7 +110,7 @@ services: - /etc/timezone:/etc/timezone:ro message_services: - image: usdotfhwastol/message_services:carma-system-4.3.0 + image: usdotfhwastoldev/message_services:develop build: context: . dockerfile: message_services/Dockerfile @@ -128,7 +128,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro intersection_model: - image: usdotfhwastol/intersection_model:carma-system-4.3.0 + image: usdotfhwastoldev/intersection_model:develop build: context: . dockerfile: intersection_model/Dockerfile @@ -146,7 +146,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro signal_opt_service: - image: usdotfhwastol/signal_opt_service:carma-system-4.3.0 + image: usdotfhwastoldev/signal_opt_service:develop command: sh -c "/wait && /home/carma-streets/signal_opt_service/build/signal_opt_service" build: context: . @@ -172,7 +172,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro tsc_service: - image: usdotfhwastol/tsc_service:carma-system-4.3.0 + image: usdotfhwastoldev/tsc_service:develop command: sh -c "/wait && /home/carma-streets/tsc_client_service/build/traffic_signal_controller_service" build: context: . From e0ad291343c4d763fb9983a75ae1667b44320cf0 Mon Sep 17 00:00:00 2001 From: Cody Garver Date: Wed, 22 Feb 2023 10:20:37 -0500 Subject: [PATCH 6/9] build.sh: optimize and clean up (#311) --- build.sh | 136 ++++++++++++++----------------------------------------- 1 file changed, 34 insertions(+), 102 deletions(-) diff --git a/build.sh b/build.sh index 2b4528c9d..9faa7c605 100755 --- a/build.sh +++ b/build.sh @@ -19,105 +19,37 @@ set -e COVERAGE_FLAGS="-g --coverage -fprofile-arcs -ftest-coverage" -cd /home/carma-streets/streets_utils/streets_service_base -mkdir build -cd /home/carma-streets/streets_utils/streets_service_base/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_vehicle_list -mkdir build -cd /home/carma-streets/streets_utils/streets_vehicle_list/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_tsc_configuration -mkdir build -cd /home/carma-streets/streets_utils/streets_tsc_configuration/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_desired_phase_plan -mkdir build -cd /home/carma-streets/streets_utils/streets_desired_phase_plan/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_signal_phase_and_timing -mkdir build -cd /home/carma-streets/streets_utils/streets_signal_phase_and_timing/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - - -cd /home/carma-streets/streets_utils/streets_api/intersection_client_api -mkdir build -cd /home/carma-streets/streets_utils/streets_api/intersection_client_api/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_vehicle_scheduler -mkdir build -cd /home/carma-streets/streets_utils/streets_vehicle_scheduler/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_api/intersection_server_api -mkdir build -cd /home/carma-streets/streets_utils/streets_api/intersection_server_api/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/kafka_clients -mkdir build -cd /home/carma-streets/kafka_clients/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/streets_utils/streets_signal_optimization -mkdir build -cd /home/carma-streets/streets_utils/streets_signal_optimization/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make -make install - -cd /home/carma-streets/scheduling_service -mkdir build -cd /home/carma-streets/scheduling_service/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make - -cd /home/carma-streets/intersection_model -mkdir build -cd /home/carma-streets/intersection_model/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make - -cd /home/carma-streets/message_services -mkdir build -cd /home/carma-streets/message_services/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make - - -cd /home/carma-streets/signal_opt_service -mkdir build -cd /home/carma-streets/signal_opt_service/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make - -cd /home/carma-streets/tsc_client_service -mkdir build -cd /home/carma-streets/tsc_client_service/build -cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. -make - +# make install for these subdirectories +MAKE_INSTALL_DIRS=( + "streets_utils/streets_service_base" + "streets_utils/streets_vehicle_list" + "streets_utils/streets_tsc_configuration" + "streets_utils/streets_desired_phase_plan" + "streets_utils/streets_signal_phase_and_timing" + "streets_utils/streets_api/intersection_client_api" + "streets_utils/streets_vehicle_scheduler" + "streets_utils/streets_api/intersection_server_api" + "kafka_clients" + "streets_utils/streets_signal_optimization" +) + +# only make for these subdirectories +MAKE_ONLY_DIRS=( + "scheduling_service" + "intersection_model" + "message_services" + "signal_opt_service" + "tsc_client_service" +) + +for DIR in "${MAKE_INSTALL_DIRS[@]}" "${MAKE_ONLY_DIRS[@]}"; do + mkdir /home/carma-streets/"$DIR"/build + cd /home/carma-streets/"$DIR"/build + cmake -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" .. + make -j + for MAKE_INSTALL_DIR in "${MAKE_INSTALL_DIRS[@]}"; do + if [ "$DIR" == "$MAKE_INSTALL_DIR" ]; then + make -j install + fi + done +done From c6a4700bceb0f6bb21b02dd53af8e3feef60a80a Mon Sep 17 00:00:00 2001 From: Cody Garver Date: Wed, 22 Feb 2023 13:22:55 -0500 Subject: [PATCH 7/9] CI: replace CircleCI with GitHub Actions (#312) * CI: delete CircleCI config * CI: Add GitHub Actions Workflow CI.yml --- .circleci/config.yml | 207 -------------------- .github/workflows/ci.yml | 169 ++++++++++++++++ .github/workflows/{main.yml => doxygen.yml} | 0 .sonarqube/sonar-scanner.properties | 1 - 4 files changed, 169 insertions(+), 208 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml rename .github/workflows/{main.yml => doxygen.yml} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 12b1f6dfe..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,207 +0,0 @@ -version: 2.1 - -# Copyright (C) 2019-2022 LEIDOS. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# - -# Configuration file for Circle CI -# CI will report failure if any executed command returns and error status -# Operations performed are as follows -# Build source code -# Run unit tests for C++ -# Run static code analyzer for SourceCloud -# Upload test results -# Every run command should start with source ${INIT_ENV} to ensure all default dependencies are available -jobs: - build: - # Pull docker image - # XTERM used for better make output - docker: - - image: ubuntu:bionic-20190807 - environment: - TERM: xterm - INIT_ENV: /home/carma-streets/.base-image/init-env.sh - resource_class: xlarge - # Set working directory - working_directory: "/home/carma-streets" - # Pull code and execute tests | - # Name of each run command defines purpose use - steps: - #setup remote docker - - setup_remote_docker : - docker_layer_caching: false - # Checkout PR branch - - checkout - - run: - name: Install Sonar & Dependencies - command: | - set -x - apt-get update - apt-get update && apt-get install -y cmake git build-essential libboost1.65-all-dev curl unzip gcc-7 g++-7 autotools-dev automake qtbase5-dev qtbase5-dev-tools libqhttpengine-dev libssl-dev libpugixml-dev libgeographic-dev sqlite3 libsqlite3-dev python3-pip - pip3 install gcovr - - mkdir -p /home/carma-streets/ext - cd /home/carma-streets/ext - git clone https://github.com/google/googletest/ - cd /home/carma-streets/ext/googletest/ - cmake . - make - make install - - cd /home/carma-streets/ext - git clone https://github.com/edenhill/librdkafka - cd /home/carma-streets/ext/librdkafka/ - ./configure --prefix=/usr - make - make install - - cd /home/carma-streets/ext - git clone https://github.com/gabime/spdlog.git - cd /home/carma-streets/ext/spdlog/ - mkdir build - cd /home/carma-streets/ext/spdlog/build - cmake .. && make -j - make install - - cd /home/carma-streets/ext - git clone https://github.com/Tencent/rapidjson - cd /home/carma-streets/ext/rapidjson/ - mkdir build - cd /home/carma-streets/ext/rapidjson/build - cmake .. && make -j - make install - - #Install net-snmp - cd /home/carma-streets/ext/ - apt-get update && apt-get install -y wget libperl-dev - wget http://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.1/net-snmp-5.9.1.tar.gz - tar -xvzf /home/carma-streets/ext/net-snmp-5.9.1.tar.gz - cd net-snmp-5.9.1/ - ./configure --with-default-snmp-version="1" --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" - make - make install - - # Install qhttpengine - cd /home/carma-streets/ext - git clone https://github.com/etherealjoy/qhttpengine.git - cd /home/carma-streets/ext/qhttpengine/ - mkdir build - cd /home/carma-streets/ext/qhttpengine/build - cmake .. && make -j - make install - - # Install PROJ, a package for coordinate transformations - git clone https://github.com/OSGeo/PROJ.git /home/carma-streets/PROJ --branch 6.2.1 && \ - cd /home/carma-streets/PROJ && \ - ./autogen.sh && \ - ./configure && \ - make && \ - make install - - export DEBIAN_FRONTEND=noninteractive - - # Download a cmake module for PROJ - cd /usr/share/cmake-3.10/Modules && curl -O https://raw.githubusercontent.com/mloskot/cmake-modules/master/modules/FindPROJ4.cmake - apt update - apt install -y lsb-release - sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' - curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - - - apt-get update && \ - apt-get install -y ros-melodic-catkin - - cd /opt/ros/melodic/ - ls -a - - - cd /home/carma-streets/ - mkdir carma_lanelet2 && \ - cd carma_lanelet2 && \ - mkdir src && \ - cd src && \ - git init && \ - echo "temp" && \ - git remote add origin -f https://github.com/usdot-fhwa-stol/autoware.ai.git && \ - git config core.sparsecheckout true && \ - echo "common/hardcoded_params/*" >> .git/info/sparse-checkout && \ - echo "common/lanelet2_extension/*" >> .git/info/sparse-checkout && \ - echo "lanelet2/*" >> .git/info/sparse-checkout && \ - echo "mrt_cmake_modules/*" >> .git/info/sparse-checkout && \ - git pull --depth 1 origin refactor_lanelet2_extension && \ - git checkout refactor_lanelet2_extension && \ - rm -r lanelet2/lanelet2_python && \ - rm -r lanelet2/lanelet2_examples - - cd /home/carma-streets/carma_lanelet2 - source /opt/ros/melodic/setup.bash && \ - apt-get install -y python-rospkg && \ - apt-get install -y libeigen3-dev && \ - ROS_VERSION=1 LANELET2_EXTENSION_LOGGER_TYPE=1 catkin_make install - - cd /home/carma-streets/carma_lanelet2/install/ - ls -a - - cd /home/carma-streets - mkdir .base-image - SONAR_DIR=/opt/sonarqube - mkdir $SONAR_DIR - curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip - curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip - curl -sL https://deb.nodesource.com/setup_10.x | bash - - apt-get install -y nodejs - mkdir /opt/jq - curl -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -o /opt/jq/jq - chmod +x /opt/jq/jq - cd $SONAR_DIR - unzip $SONAR_DIR/sonar-scanner.zip -d . - unzip $SONAR_DIR/build-wrapper.zip -d . - rm $SONAR_DIR/sonar-scanner.zip - rm $SONAR_DIR/build-wrapper.zip - mv $(ls $SONAR_DIR | grep "sonar-scanner-") $SONAR_DIR/sonar-scanner/ - mv $(ls $SONAR_DIR | grep "build-wrapper-") $SONAR_DIR/build-wrapper/ - - echo "export PATH=$PATH:/opt/jq/:$SONAR_DIR/sonar-scanner/bin/:$SONAR_DIR/build-wrapper/" > /home/carma-streets/.base-image/init-env.sh - echo "source /opt/ros/melodic/setup.bash" >> /home/carma-streets/.base-image/init-env.sh - echo "source /home/carma-streets/carma_lanelet2/install/setup.bash" >> /home/carma-streets/.base-image/init-env.sh - cat /home/carma-streets/.base-image/init-env.sh - - run: - name: Build source code & Run Tests & Generate Gcovr Reports - command: | - source ${INIT_ENV} - cd /home/carma-streets/ - build-wrapper-linux-x86-64 --out-dir /home/carma-streets/bw-output bash build.sh - ./coverage.sh - - store_test_results: - path: test_results - - run: - name: Run Sonar Scanner - command: | - source ${INIT_ENV} - if [ -z "${CIRCLE_PULL_REQUEST}" ]; then - echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}" - cd /home/carma-streets/ - sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} - exit 0; - else - echo "PR branch ${CIRCLE_BRANCH}" - echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" - echo "URL ${CIRCLE_PULL_REQUEST}" - export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7` - echo "PR number ${PR_NUM}" - export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" - export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') - echo "Target Branch = ${TARGET_BRANCH}" - cd /home/carma-streets/ - sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} - fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..8a679284b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,169 @@ +name: CI +on: + push: +jobs: + build: + defaults: + run: + shell: bash + runs-on: ubuntu-latest-8-cores + container: + image: ubuntu:bionic-20210702 + env: + DEBIAN_FRONTEND: noninteractive + INIT_ENV: "/home/carma-streets/.base-image/init-env.sh" + SONAR_SCANNER_VERSION: "4.6.2.2472" + TERM: xterm + options: "--user root" + steps: + # Bionic's git version is not sufficient for actions/checkout 0 fetch-depth, + # remove this step after rebasing carma-streets to newer Ubuntu release + - name: Install newer git for checkout + run: | + apt-get update + apt-get install -y software-properties-common + add-apt-repository -u ppa:git-core/ppa + apt-get install -y git + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@v3.3.0 + with: + path: ${{ github.event.repository.name }} + fetch-depth: 0 + - name: Move source code + run: mv $GITHUB_WORKSPACE/${{ github.event.repository.name }} /home/carma-streets + - name: Install dependencies + run: | + apt-get update + apt-get install -y cmake git build-essential libboost-all-dev curl unzip gcc-7 g++-7 autotools-dev automake jq qtbase5-dev qtbase5-dev-tools libqhttpengine-dev libssl-dev libpugixml-dev libgeographic-dev sqlite3 libsqlite3-dev python3-pip + pip3 install gcovr + mkdir -p /home/carma-streets/ext + - name: Install gtest + run: | + git clone --depth 1 https://github.com/google/googletest/ /home/carma-streets/ext/googletest + cd /home/carma-streets/ext/googletest/ + cmake . + make -j + make install + - name: Install librdkafka + run: | + git clone --depth 1 https://github.com/edenhill/librdkafka /home/carma-streets/ext/librdkafka + cd /home/carma-streets/ext/librdkafka/ + ./configure --prefix=/usr + make -j + make install + - name: Install spdlog + run: | + git clone --depth 1 https://github.com/gabime/spdlog.git /home/carma-streets/ext/spdlog + mkdir -p /home/carma-streets/ext/spdlog/build + cd /home/carma-streets/ext/spdlog/build + cmake .. + make -j + make install + - name: Install rapidjson + run: | + git clone --depth 1 https://github.com/Tencent/rapidjson /home/carma-streets/ext/rapidjson + mkdir -p /home/carma-streets/ext/rapidjson/build + cd /home/carma-streets/ext/rapidjson/build + cmake .. + make -j + make install + - name: Install net-snmp + run: | + cd /home/carma-streets/ext/ + apt-get install -y libperl-dev + curl -L -O http://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.1/net-snmp-5.9.1.tar.gz + tar -xvzf /home/carma-streets/ext/net-snmp-5.9.1.tar.gz + cd net-snmp-5.9.1/ + ./configure --with-default-snmp-version="1" --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" + make -j + make install + - name: Install qhttpengine + run: | + git clone --depth 1 https://github.com/etherealjoy/qhttpengine.git /home/carma-streets/ext/qhttpengine + mkdir -p /home/carma-streets/ext/qhttpengine/build + cd /home/carma-streets/ext/qhttpengine/build + cmake .. + make -j + make install + - name: Install PROJ for coordinate transformations + run: | + git clone --depth 1 https://github.com/OSGeo/PROJ.git /home/carma-streets/PROJ --branch 6.2.1 + cd /home/carma-streets/PROJ + ./autogen.sh + ./configure + make -j + make install + - name: Download a cmake module for PROJ + run: | + cd /usr/share/cmake-3.10/Modules + curl -O https://raw.githubusercontent.com/mloskot/cmake-modules/master/modules/FindPROJ4.cmake + - name: Install ROS melodic + run: | + apt install -y lsb-release + sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' + curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc |apt-key add - + apt-get update + apt-get install -y ros-melodic-catkin + cd /opt/ros/melodic/ + ls -a + mkdir -p /home/carma-streets/.base-image + echo "source /opt/ros/melodic/setup.bash" > "$INIT_ENV" + - name: Install carma_lanelet2 + run: | + mkdir -p /home/carma-streets/carma_lanelet2/src + cd /home/carma-streets/carma_lanelet2/src + git init + echo "temp" + git remote add origin -f https://github.com/usdot-fhwa-stol/autoware.ai.git + git config core.sparsecheckout true + echo "common/hardcoded_params/*" >> .git/info/sparse-checkout + echo "common/lanelet2_extension/*" >> .git/info/sparse-checkout + echo "lanelet2/*" >> .git/info/sparse-checkout + echo "mrt_cmake_modules/*" >> .git/info/sparse-checkout + git pull --depth 1 origin refactor_lanelet2_extension + git checkout refactor_lanelet2_extension + rm -r lanelet2/lanelet2_python + rm -r lanelet2/lanelet2_examples + cd /home/carma-streets/carma_lanelet2 + source /opt/ros/melodic/setup.bash + apt-get install -y libeigen3-dev python-rospkg + ROS_VERSION=1 LANELET2_EXTENSION_LOGGER_TYPE=1 catkin_make install + cd /home/carma-streets/carma_lanelet2/install/ + ls -a + echo "source /home/carma-streets/carma_lanelet2/install/setup.bash" >> "$INIT_ENV" + - name: Install Sonar + run: | + SONAR_DIR=/opt/sonarqube + mkdir $SONAR_DIR + curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip + curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip + curl -sL https://deb.nodesource.com/setup_16.x |bash - + apt-get install -y nodejs + cd $SONAR_DIR + for ZIP in *.zip; do + unzip "$ZIP" -d . + rm "$ZIP" + done + mv $(ls $SONAR_DIR |grep "sonar-scanner-") $SONAR_DIR/sonar-scanner/ + mv $(ls $SONAR_DIR |grep "build-wrapper-") $SONAR_DIR/build-wrapper/ + echo $SONAR_DIR/sonar-scanner/bin >> $GITHUB_PATH + echo $SONAR_DIR/build-wrapper >> $GITHUB_PATH + - name: Build + run: | + source ${INIT_ENV} + cd /home/carma-streets/ + build-wrapper-linux-x86-64 --out-dir /home/carma-streets/bw-output ./build.sh + - name: Tests + run: | + cd /home/carma-streets/ + ./coverage.sh + - name: Archive test results + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: /home/carma-streets/test_results + - name: Run SonarScanner + uses: usdot-fhwa-stol/actions/sonar-scanner@main + with: + sonar-token: ${{ secrets.SONAR_TOKEN }} + working-dir: /home/carma-streets diff --git a/.github/workflows/main.yml b/.github/workflows/doxygen.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/doxygen.yml diff --git a/.sonarqube/sonar-scanner.properties b/.sonarqube/sonar-scanner.properties index 49aa2e97c..a358d2939 100644 --- a/.sonarqube/sonar-scanner.properties +++ b/.sonarqube/sonar-scanner.properties @@ -20,7 +20,6 @@ sonar.host.url=https://sonarcloud.io sonar.projectKey=usdot-fhwa-stol_carma-streets sonar.organization=usdot-fhwa-stol sonar.cfamily.build-wrapper-output=/home/carma-streets/bw-output -sonar.cfamily.threads=1 sonar.cfamily.cache.enabled=false sonar.coverageReportPaths= /home/carma-streets/kafka_clients/coverage/coverage.xml, \ /home/carma-streets/intersection_model/coverage/coverage.xml, \ From 402a3a708a52eb620e9a4774a3873773a02e3887 Mon Sep 17 00:00:00 2001 From: Cody Garver Date: Wed, 22 Mar 2023 08:44:11 -0400 Subject: [PATCH 8/9] coverage.sh: fail on errors (#317) * coverage.sh: fail on errors * CI: also run on pull_request --- .github/workflows/ci.yml | 1 + coverage.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a679284b..bbac2e186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: push: + pull_request: jobs: build: defaults: diff --git a/coverage.sh b/coverage.sh index 91a245d2e..a3df08571 100755 --- a/coverage.sh +++ b/coverage.sh @@ -16,6 +16,8 @@ # script to run tests, generate test-coverage, and store coverage reports in a place # easily accessible to sonar. Test names should follow convention runTests +set -e + cd /home/carma-streets mkdir test_results From c5bc503f9edfdf3dabce975e77bde7a752ea9f55 Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Fri, 5 May 2023 12:45:14 -0400 Subject: [PATCH 9/9] updated docker compose to point carma-system 4.4.0 --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 658f6aa21..5581caf90 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,7 +60,7 @@ services: - ./mysql/localhost.sql:/docker-entrypoint-initdb.d/localhost.sql - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:latest + image: usdotfhwaops/php:7.5.0 container_name: php network_mode: host depends_on: @@ -69,7 +69,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:latest + image: usdotfhwaops/v2xhubamd:7.5.0 container_name: v2xhub network_mode: host restart: always @@ -85,7 +85,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro scheduling_service: - image: usdotfhwastoldev/scheduling_service:develop + image: usdotfhwastol/scheduling_service:carma-system-4.4.0 command: sh -c "/wait && /home/carma-streets/scheduling_service/build/scheduling_service" build: context: . @@ -110,7 +110,7 @@ services: - /etc/timezone:/etc/timezone:ro message_services: - image: usdotfhwastoldev/message_services:develop + image: usdotfhwastol/message_services:carma-system-4.4.0 build: context: . dockerfile: message_services/Dockerfile @@ -128,7 +128,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro intersection_model: - image: usdotfhwastoldev/intersection_model:develop + image: usdotfhwastol/intersection_model:carma-system-4.4.0 build: context: . dockerfile: intersection_model/Dockerfile @@ -146,7 +146,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro signal_opt_service: - image: usdotfhwastoldev/signal_opt_service:develop + image: usdotfhwastol/signal_opt_service:carma-system-4.4.0 command: sh -c "/wait && /home/carma-streets/signal_opt_service/build/signal_opt_service" build: context: . @@ -172,7 +172,7 @@ services: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro tsc_service: - image: usdotfhwastoldev/tsc_service:develop + image: usdotfhwastol/tsc_service:carma-system-4.4.0 command: sh -c "/wait && /home/carma-streets/tsc_client_service/build/traffic_signal_controller_service" build: context: .