Skip to content

Commit

Permalink
Merge release/lavida (4.5.0) branch into master (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 authored Apr 10, 2024
2 parents 4a23bac + df49749 commit a3fbec0
Show file tree
Hide file tree
Showing 213 changed files with 13,764 additions and 919 deletions.
26 changes: 26 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# CARMA Streets Dev Container Setup
## Introduction
This is the setup for the VSCode extension [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) extension, which allows developers to standup a containerized development environment with the VS Code IDE. The current configuration includes the installation of common VSCode plugins for C++, CMake, Python, Mark Down and more. A complete list of VS Code installed plugins can be found in the `./devcontainer/devcontainer.json` under `"customizations.vscode.extensions` attribute. The setup also stands up the CARMA Streets [docker compose file](../docker-compose.yml) , which provides your development environment with easy access to Kafka and CARMA Streets services for integration testing of functionality.
## Suggested Structure of CARMA Street Service
```bash
├── <streets_service_name>
│ ├── src/ # Source Code
│ ├── include/ # Headers
│ ├── manifest.json # CARMA Streets Service configuration file
│ ├── CMakeLists.txt # CMake build file
│ ├── README.md # Documentation about Service
│ ├── build.sh # Build script to build streets_util libraries for service and service itself
| ├── install_dependencies.sh # Optional file to install external dependencies not included in base image
│ └── Dockerfile # Dockerfile to build streets serivce
```
## Setup for new CARMA Streets Service
* Select a streets base image ([streets base images](../README.md#base-images)) and uncomment appropriate lines in `.devcontainer/devcontainer.json` and `.devcontainer/docker-compose-devcontainer.yml` (See comments in files)
* Use ctrl-shift-P (Command Pallette) and select *Dev Containers: Open Folder in Container*.
* Use VS Code terminals to build new streets service, preferably using a `build.sh` script under your new service directory(see [Sensor Data Sharing Service](../sensor_data_sharing_service/README.md)).
## Setup for existing CARMA Streets Service
* Select a streets base image ([streets base images](../README.md#base-images)) and uncomment appropriate lines in `.devcontainer/devcontainer.json` and `.devcontainer/docker-compose-devcontainer.yml` (See comments in files)
* Comment out existing service inside `docker-compose.yml`
* Use ctrl-shift-P (Command Pallette) and select *Dev Containers: Open Folder in Container*.
* Use VS Code terminals to build existing streets service, preferably using a `build.sh` script under your new service directory(see [Sensor Data Sharing Service](../sensor_data_sharing_service/README.md)).


42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "Existing Docker Compose (Extend)",
// First "../docker-compose.yml launches all of CARMA Street including Kafka, V2X-Hub and existing CARMA Streets service
// Second "docker-compose-devcontainer.yml" lauches dev container for developing and integration testing new and existing
// CARMA Streets services
"dockerComposeFile": [
"../docker-compose.yml",
"docker-compose-devcontainer.yml"
],

// Uncomment for Streets Service Base dev environment
"service": "streets_service_base",
// Uncomment for Streets Service Base Lanelet aware dev environment
// "service": "streets_service_base_lanelet_aware",
// Specify the services you want to run
"runServices": ["php", "v2xhub", "db", "zookeeper", "kafka", "kowl"],
// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/home/carma-streets/",

// Uncomment for Sensor Data Sharing Service .
// "postCreateCommand": "/home/carma-streets/sensor_data_sharing_service/build.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"github.vscode-github-actions",
"yzhang.markdown-all-in-one",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.isort",
"streetsidesoftware.code-spell-checker",
"sonarsource.sonarlint-vscode",
"esbenp.prettier-vscode"
]
}
},
"shutdownAction": "stopCompose"

}
39 changes: 39 additions & 0 deletions .devcontainer/docker-compose-devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3.7'
services:
# Uncomment for streets service base dev environment
streets_service_base:
# Replace bionic with distro of choice
image: usdotfhwastoldev/streets_service_base:bionic
# Remove build parameter to force pull from dockerhub
build:
context: .
dockerfile: ./streets_service_base/Dockerfile
args:
UBUNTU_CODENAME: bionic
network_mode: host
command: /bin/sh -c "while sleep 1000; do :; done"


# Uncomment for streets service base lanelet aware dev environment
streets_service_base_lanelet_aware:
image: usdotfhwastoldev/streets_service_base_lanelet_aware:bionic
# Remove build parameter to force pull from dockerhub
build:
context: .
dockerfile: ./streets_service_base_lanelet_aware/Dockerfile
network_mode: host


volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/home/carma-streets:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

154 changes: 0 additions & 154 deletions .github/workflows/ci.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: develop
on:
push:
branches: [develop]
jobs:
docker-build:
strategy:
matrix:
include:
- ubuntu-codename: bionic
build_lanelet_aware: true
# Currently install_lanelet2_dependencies.sh script only works for bionic. Disabled lanelet_aware build on newer distributions pending script updates.
- ubuntu-codename: focal
build_lanelet_aware: false
# Currently install_lanelet2_dependencies.sh script only works for bionic. Disabled lanelet_aware build on newer distributions pending script updates.
- ubuntu-codename: jammy
build_lanelet_aware: false
runs-on: ubuntu-latest
steps:
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Streets Service Base
uses: docker/build-push-action@v3
with:
push: true
build-args: |
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
tags: usdotfhwastol/streets_service_base:${{ matrix.ubuntu-codename }}
file: ./streets_service_base/Dockerfile
- name: Docker Build Streets Service Base Lanelet Aware
if: ${{ matrix.build_lanelet_aware }}
uses: docker/build-push-action@v3
with:
push: true
tags: usdotfhwastol/streets_service_base_lanelet_aware:${{ matrix.ubuntu-codename }}
file: ./streets_service_base_lanelet_aware/Dockerfile
build:
needs: docker-build
defaults:
run:
shell: bash
runs-on: ubuntu-latest-8-cores
container:
image: usdotfhwastoldev/streets_service_base_lanelet_aware:bionic
env:
DEBIAN_FRONTEND: noninteractive
SONAR_SCANNER_VERSION: "5.0.1.3006"
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: |
cd /home/carma-streets/build_scripts
./install_test_dependencies.sh
mkdir -p /home/carma-streets/ext
./install_rest_server_dependencies.sh
- name: Install net-snmp
run: |
cd /home/carma-streets/ext/
apt-get install -y libperl-dev curl
curl -k -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: Set up JDK 17
uses: actions/setup-java@v3 # The setup-java action provides the functionality for GitHub Actions runners for Downloading and setting up a requested version of Java
with:
java-version: 17
distribution: "temurin"
- 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 unzip
# Set the JAVA_HOME to a compatible version of Java, e.g., Java 17
export JAVA_HOME=$GITHUB_WORKSPACE/java-17
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
env:
JAVA_HOME: $GITHUB_WORKSPACE/java-17

- name: Check Java Version
run: |
java -version
echo $JAVA_HOME
- name: Build
run: |
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/
ldconfig
./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
Loading

0 comments on commit a3fbec0

Please sign in to comment.