Skip to content

Commit

Permalink
Merge release/miura (4.6.0) branch into master (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaikrishnaBairamoni authored Aug 15, 2024
2 parents 58c37a0 + a6efa71 commit 1ce73d7
Show file tree
Hide file tree
Showing 25 changed files with 986 additions and 143 deletions.
70 changes: 0 additions & 70 deletions .circleci/config.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/deployment_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
push:
branches:
- develop
- master
- "release/*"
pull_request:
types: [opened, synchronize, reopened]
name: Deployment Test
jobs:
deployment_test:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
defaults:
run:
shell: bash
steps:
- name: Install git
# Installing git for checkout action
run: |
apt update
export DEBIAN_FRONTEND=noninteractive
apt-get install -y git
- name: Checkout
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
path: ${{ github.event.repository.name }}
submodules: recursive
- name: Move source code
run: mv $GITHUB_WORKSPACE/${{ github.event.repository.name }} /home/carma-cloud
- name: Install dependencies
run: |
cd /home/carma-cloud/scripts
./install_dependencies.sh
- name: Build
run: |
cd /home/carma-cloud/scripts
./build.sh
- name: Configure network and set privileges
run: |
echo -e '127.0.0.1\tcarmacloud' | tee -a /etc/hosts
groupadd tomcat
useradd -g tomcat -m tomcat
chmod g+r /opt/tomcat/conf/*
chmod -R o-rwx /opt/tomcat/webapps/*
chown -R root:tomcat /opt/tomcat
chown -R tomcat:tomcat /opt/tomcat/logs
chown -R tomcat:tomcat /opt/tomcat/temp
chown -R tomcat:tomcat /opt/tomcat/work
- name: Start Tomcat and verify deployment
run: |
/opt/tomcat/bin/catalina.sh start
sleep 10
if [[ `grep "startup in" /opt/tomcat/logs/catalina.out | wc -l` -ne "1" ]]; then exit 1; fi
if [[ `wget -O - http://carmacloud:8080 | grep "CARMAcloud Login" | wc -l` -ne "1" ]]; then exit 2; fi
if [[ `wget -O - --post-data="uname=ccadmin&pword=admin_testpw" http://carmacloud:8080/api/auth/login | grep "token" | wc -l` -ne "1" ]]; then exit 3; fi
9 changes: 9 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Docker build
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
docker:
uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main
with:
runner: ubuntu-latest
17 changes: 17 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Docker Hub build
on:
push:
branches:
- develop
- master
- "release/*"
tags:
- "carma-system-*"
jobs:
dockerhub:
uses: usdot-fhwa-stol/actions/.github/workflows/dockerhub.yml@main
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
runner: ubuntu-latest
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:22.04
# update package manager and install prerequisites
COPY scripts/install_dependencies.sh /home/carma-cloud/scripts/install_dependencies.sh
RUN /home/carma-cloud/scripts/install_dependencies.sh
COPY src /home/carma-cloud/src
COPY lib /home/carma-cloud/lib
COPY web /home/carma-cloud/web
COPY osmbin /home/carma-cloud/osmbin
COPY *.sh /home/carma-cloud/
COPY scripts/build.sh /home/carma-cloud/scripts/build.sh

# download carma-cloud source
RUN /home/carma-cloud/scripts/build.sh
ENTRYPOINT [ "/opt/tomcat/bin/catalina.sh", "run" ]

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@ Example:
> x<sub>(n-2)</sub><sub>0</sub>,y<sub>(n-2)</sub><sub>0</sub>,x<sub>(n-2)</sub><sub>1</sub>,y<sub>(n-2)</sub><sub>1</sub>,x<sub>(n-2)</sub><sub>2</sub>,y<sub>(n-2)</sub><sub>2</sub>,x<sub>(n-2)</sub><sub>3</sub>,y<sub>(n-2)</sub><sub>3</sub>
> x<sub>(n-1)</sub><sub>0</sub>,y<sub>(n-1)</sub><sub>0</sub>,x<sub>(n-1)</sub><sub>1</sub>,y<sub>(n-1)</sub><sub>1</sub>,x<sub>(n-1)</sub><sub>2</sub>,y<sub>(n-1)</sub><sub>2</sub>,x<sub>(n-1)</sub><sub>3</sub>,y<sub>(n-1)</sub><sub>3</sub>
## Testing Considerations

Upon startup, CARMA Cloud automatically creates traffic controls for later sending to CARMA platform by reading XML OpenDrive files placed in its XODR work folder, e.g. <tomcat_home>/work/xodr. This can result in thousands of traffic controls that are mostly uninteresting for testing purposes. The cc.util.FilterControls command-line application accepts a list of traffic control identifiers, and creates a much smaller and more manageable subset of traffic controls that can be saved along with their respective testing scenarios.

After CARMA Cloud has been started for the first time in a testing scenario, XODR files will have been processed, and the tester can login to CARMA Cloud to add traffic controls for his testing needs. Executing an ls -lrt in the traffic controls folder, typically <tomcat_home>/work/carmacloud/traf_ctrls, will put the newly created traffic controls at the bottom of the list. The hexadecimal encoded text for the 16-byte traffic control ids to be kept can then be derived from three levels of folder paths and the traffic control filename.

The FilterControls application takes the source work folder name, the destination work folder name, and a space-separated list of at least one 16-byte hexadecimal encoded text traffic control id.
```
<java_home>/bin/java -cp <path_to_carmacloud_classes>:<path_to_carmacloud_lib>/keccakj.jar cc.util.FilterControls <source_path> <destination_path> <id1> <id2> ... <idN>
```
For example:
```
<java_home>/bin/java -cp <path_to_carmacloud_classes>:<path_to_carmacloud_lib>/keccakj.jar cc.util.FilterControls <tomcat_home>/work/carmacloud <tomcat_home>/work/filtered 00109ab6d542f12ca8942b436c9c9d8d
```
FilterControls creates the destination folder structure containing geolanes, linearcs, td, and traf_ctrls subfolders. The filtered traffic control files can then be saved with the appropriate testing scenarios. Both the td and traf_ctrls folders should always contain at least one file, and it is also normal under some circumstances that the geolanes and linearcs folders may contain no files.

## 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](Contributing.md)

Expand Down
18 changes: 18 additions & 0 deletions SendTimeSyncMessage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import http.client
import json
import requests

connection = http.client.HTTPConnection("localhost:8080")
# headers = {'Content-type': 'application/json'}
foo = {'timestep': 100, 'seq': 1}

connection.request("POST", "/carmacloud/simulation/dumb", json.dumps(foo))
x = requests.post("http://127.0.0.1:8080/carmacloud/simulation/dumb", json.dumps(foo))
print(x)

response = connection.getresponse()
print(response.read().decode())

connection.request("GET", '/api/rop/details')
response = connection.getresponse()
print(response.read().decode())
18 changes: 18 additions & 0 deletions carma-cloud-config/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
status = warn
monitorInterval = 300

appender.rolling.type = RollingFile
appender.rolling.name = LogToRollingFile
appender.rolling.fileName = /opt/tomcat/logs/carmacloud.log
appender.rolling.filePattern = /opt/tomcat/logs/carmacloud-%d{yyyyMMdd}.log.gz
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [%-5level %d{HH:mm:ss.SSS} [%c{1}] - %msg%n
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = false
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 366

rootLogger.level = debug
rootLogger.appenderRef.stdout.ref = LogToRollingFile
Loading

0 comments on commit 1ce73d7

Please sign in to comment.