Skip to content

Commit

Permalink
Merge release_k900 into master for 7.5.0 ERV release (#529)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->
This PR is an copy of k900 branch used for frieght ERV release
(carma-system-4.4.0), and K900 branch is kept open for the use of
simulation release.
# PR Details
## Description

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

## Related Issue

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

## Motivation and Context

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

## How Has This Been Tested?

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

## Types of changes

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

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

## Checklist:

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

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
[V2XHUB Contributing
Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
codygarver authored May 5, 2023
2 parents e522472 + a112b6a commit 4a55aae
Show file tree
Hide file tree
Showing 2,973 changed files with 7,157 additions and 428,980 deletions.
209 changes: 19 additions & 190 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,189 +24,40 @@ version: 2.1
# Upload test results
# Every run command should start with source ${INIT_ENV} to ensure all default dependencies are available
jobs:
sonar-scanner:
# Pull docker image
# XTERM used for better make output
docker:
- image: usdotfhwaops/v2xhubamd:<< pipeline.git.branch >>
environment:
TERM: xterm
INIT_ENV: /home/V2X-Hub/.base-image/init-env.sh
# Set working directory
working_directory: "/home/V2X-Hub"
# Pull code and execute tests |
# Name of each run command defines purpose use
steps:
#setup remote docker
- setup_remote_docker :
docker_layer_caching: false
- run:
name: Run Tests & Generate Gcovr Reports
command: |
source ${INIT_ENV}
cd /home/V2X-Hub/src
build-wrapper-linux-x86-64 --out-dir /home/V2X-Hub/bw-output bash build.sh
./coverage.sh
- run:
name: Run Sonar Scanner
command: |
source ${INIT_ENV}
echo $PATH
cd /home/V2X-Hub/src/
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}"
cd /home/V2X-Hub/
sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN}
exit 0;
else
echo "PR branch ${CIRCLE_BRANCH}"
echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
echo "URL ${CIRCLE_PULL_REQUEST}"
export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7`
echo "PR number ${PR_NUM}"
export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}"
export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"')
echo "Target Branch = ${TARGET_BRANCH}"
cd /home/V2X-Hub/
sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM}
fi
sonar-scanner_develop:
# Pull docker image
# XTERM used for better make output
docker:
- image: usdotfhwaops/v2xhubamd:latest
environment:
TERM: xterm
INIT_ENV: /home/V2X-Hub/.base-image/init-env.sh
# Set working directory
working_directory: "/home/V2X-Hub"
# Pull code and execute tests |
# Name of each run command defines purpose use
steps:
#setup remote docker
- setup_remote_docker :
docker_layer_caching: false
- run:
name: Run Tests & Generate Gcovr Reports
command: |
source ${INIT_ENV}
cd /home/V2X-Hub/src
build-wrapper-linux-x86-64 --out-dir /home/V2X-Hub/bw-output bash build.sh
./coverage.sh
- run:
name: Run Sonar Scanner
command: |
source ${INIT_ENV}
echo $PATH
cd /home/V2X-Hub/src/
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}"
cd /home/V2X-Hub/
sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN}
exit 0;
else
echo "PR branch ${CIRCLE_BRANCH}"
echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
echo "URL ${CIRCLE_PULL_REQUEST}"
export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7`
echo "PR number ${PR_NUM}"
export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}"
export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"')
echo "Target Branch = ${TARGET_BRANCH}"
cd /home/V2X-Hub/
sonar-scanner -X -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM}
fi
docker_build_push :
machine:
image: ubuntu-2004:202201-02
steps:
- checkout
- run:
name: Docker Build
# Build v2xhub and php docker branch images
command: |
docker build -f docker/Dockerfile-php -t usdotfhwaops/php:${CIRCLE_BRANCH,,} .
docker build -t usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,} .
cd ./tools/port-drayage-webservice/
docker build -t usdotfhwaops/port-drayage-webservice:${CIRCLE_BRANCH,,} .
- run:
name: Docker Push
# Push v2xhub and php docker images to usdotfhwaops dockerhub
command: |
echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin
docker push usdotfhwaops/v2xhubamd:${CIRCLE_BRANCH,,}
docker push usdotfhwaops/php:${CIRCLE_BRANCH,,}
docker push usdotfhwaops/port-drayage-webservice:${CIRCLE_BRANCH,,}
docker_build_push_develop :
machine:
image: ubuntu-2004:202201-02
steps:
- checkout
- run:
name: Docker Build
# Build v2xhub and php docker images develop images
command: |
docker build -f docker/Dockerfile-php -t usdotfhwaops/php:latest .
docker build -t usdotfhwaops/v2xhubamd:latest .
cd ./tools/port-drayage-webservice/
docker build -t usdotfhwaops/port-drayage-webservice:latest .
- run:
name: Docker Push
# Push v2xhub and php docker images to usdotfhwaops dockerhub
command: |
echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin
docker push usdotfhwaops/v2xhubamd:latest
docker push usdotfhwaops/php:latest
docker push usdotfhwaops/port-drayage-webservice:latest
arm_build_push :
machine:
image: ubuntu-2004:202101-01
# see https://circleci.com/docs/using-arm/ for versions
image: ubuntu-2004:current
resource_class: arm.medium
steps:
- checkout
- run:
name: Docker Build
# Run MYSQL image and build v2xhub docker image
command: |
docker build -f docker/Dockerfile-depl -t usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,} .
docker build -f docker/Dockerfile-php -t usdotfhwaops/php_arm:${CIRCLE_BRANCH,,} .
docker build -t v2xhubarm:ci-build .
docker build -f docker/Dockerfile-php -t php_arm:ci-build .
cd ./tools/port-drayage-webservice/
docker build -f Dockerfile-arm -t usdotfhwaops/port-drayage-webservice_arm:${CIRCLE_BRANCH,,} .
docker build -f Dockerfile-arm -t port-drayage-webservice_arm:ci-build .
if [ -n "$CIRCLE_PR_NUMBER" ]; then
circleci-agent step halt
fi
- run:
name: Docker Push
# Push v2xhub docker image to usdotfhwaops dockerhub
command: |
if [ "$CIRCLE_BRANCH" = "develop" ]; then
DOCKER_TAG="latest"
else
DOCKER_TAG=${CIRCLE_BRANCH/\//-}
fi
docker tag v2xhubarm:ci-build usdotfhwaops/v2xhubarm:${DOCKER_TAG}
docker tag php_arm:ci-build usdotfhwaops/php_arm:${DOCKER_TAG}
docker tag port-drayage-webservice_arm:ci-build usdotfhwaops/port-drayage-webservice_arm:${DOCKER_TAG}
echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin
docker push usdotfhwaops/v2xhubarm:${CIRCLE_BRANCH,,}
docker push usdotfhwaops/port-drayage-webservice_arm:${CIRCLE_BRANCH,,}
docker push usdotfhwaops/php_arm:${CIRCLE_BRANCH,,}
arm_build_push_develop :
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- run:
name: Docker Build
# Run MYSQL image and build v2xhub docker image develop image
command: |
docker build -f docker/Dockerfile-depl -t usdotfhwaops/v2xhubarm:latest .
docker build -f docker/Dockerfile-php -t usdotfhwaops/php_arm:latest .
cd ./tools/port-drayage-webservice/
docker build -f Dockerfile-arm -t usdotfhwaops/port-drayage-webservice_arm:latest .
- run:
name: Docker Push
# Push v2xhub docker image to usdotfhwaops dockerhub
command: |
echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin
docker push usdotfhwaops/v2xhubarm:latest
docker push usdotfhwaops/port-drayage-webservice_arm:latest
docker push usdotfhwaops/php_arm:latest
docker push usdotfhwaops/v2xhubarm:${DOCKER_TAG}
docker push usdotfhwaops/php_arm:${DOCKER_TAG}
docker push usdotfhwaops/port-drayage-webservice_arm:${DOCKER_TAG}
automated_release :
machine:
image: ubuntu-2004:202201-02
Expand Down Expand Up @@ -246,32 +97,10 @@ workflows:
version: 2
build:
jobs:
- docker_build_push_develop:
filters:
branches:
only: develop
- docker_build_push:
filters:
branches:
ignore: develop
tags:
only: /^[\.0-9]*$/
- arm_build_push:
filters:
branches:
ignore: develop
tags:
only: /^[\.0-9]*$/
- arm_build_push_develop :
filters:
branches:
only: develop
- sonar-scanner:
requires:
- docker_build_push
- sonar-scanner_develop:
requires:
- docker_build_push_develop
- automated_release:
filters:
tags:
Expand Down
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG UBUNTU_VERSION=jammy

FROM ubuntu:$UBUNTU_VERSION

ENV DEBIAN_FRONTEND=noninteractive
ADD scripts/install_dependencies.sh /usr/local/bin/
RUN /usr/local/bin/install_dependencies.sh

# build out ext components
COPY ./ext /home/V2X-Hub/ext
WORKDIR /home/V2X-Hub/ext/
RUN ./build.sh
54 changes: 54 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
// Docker Compose syntax from https://github.com/devcontainers/templates/blob/main/src/docker-existing-docker-compose/.devcontainer/devcontainer.json
// and https://github.com/microsoft/vscode-dev-containers/blob/main/container-templates/docker-compose/.devcontainer/devcontainer.json
"name": "V2XHUB Docker Compose Dev",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
"dockerComposeFile": "docker-compose-vscode.yml",

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "v2xhub",

// The 'workspaceFolder' property is the path VS Code should open by default when
// connected. Corresponds to a volume mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools",
"twxs.cmake"
]
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

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

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [
// {
// "source": "/var/run/docker.sock",
// "target": "/var/run/docker-host.sock",
// "type": "bind"
// }
// ]

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Loading

0 comments on commit 4a55aae

Please sign in to comment.