Skip to content

Commit

Permalink
Merge pull request usdot-jpo-ode#286 from usdot-jpo-ode/jsonArray2Xml…
Browse files Browse the repository at this point in the history
…Array

Json array2 xml array
  • Loading branch information
hmusavi committed Dec 7, 2018
2 parents 7990d33 + 3172637 commit 4c590c4
Show file tree
Hide file tree
Showing 231 changed files with 12,199 additions and 3,201 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# add git-ignore syntax here of things you don't want copied into docker image
.git
*Dockerfile*
*docker-compose*
node_modules
*target*
*.class
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ before_install:
- mvn clean
- mvn install
- cd ..
- echo "installing 1609.2 security library repository"
- git clone https://github.com/usdot-jpo-ode/jpo-security.git fedgov-cv-security-2016
- cd fedgov-cv-security-2016
- mvn clean
- mvn -DskipTests install
- cd ..
install: true #must disable pre-installation of dependencies because it fails due to missing oss.runtime dependency install
addons:
sonarqube:
Expand Down
97 changes: 49 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
FROM ubuntu:18.04
FROM maven:3.5.4-jdk-8-alpine as builder
MAINTAINER [email protected]

#Install necessary software
RUN apt-get update && \
apt-get install -y software-properties-common git
RUN apt-get update && \
apt-get install -y apt-utils
RUN apt-get update && \
apt-get install -y wget supervisor dnsutils curl jq net-tools
RUN apt-get update && \
apt-get install -y openjdk-8-jdk
RUN apt-get update && \
apt-get install -y vim
RUN apt-get update && \
apt-get install -y nano
#RUN apt-get update && \
# apt-cache search maven && \
# apt-get install -y maven
# Set up the private repo first
WORKDIR /home/jpo-ode-private

RUN apt-get clean

##install docker
#RUN apt-get install -y apt-transport-https ca-certificates
#RUN apt-key adv \
# --keyserver hkp:https://ha.pool.sks-keyservers.net:80 \
# --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
#RUN echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | tee /etc/apt/sources.list.d/docker.list
#RUN apt-get update && apt-get install -y docker docker-engine
#RUN apt-cache policy docker-engine
##RUN apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
#RUN service docker start

#Add ODE binary files
ADD jpo-ode-svcs/target/jpo-ode-svcs-0.0.1-SNAPSHOT.jar /home

ADD docker/start-ode.sh /usr/bin/start-ode.sh
ADD jpo-ode-svcs/src/main/resources/application.properties /home
ADD jpo-ode-svcs/src/main/resources/logback.xml /home

# Build ODE inside the image
#RUN cd /home/jpo-ode/jpo-ode-private && mvn clean && mvn install
#RUN cd /home/jpo-ode && mvn clean && mvn install
#RUN cp /home/jpo-ode/jpo-ode-svcs/target/jpo-ode-svcs-0.0.1-SNAPSHOT.jar /home

#Change permissions and run scripts
RUN chmod a+x /usr/bin/start-ode.sh

# Use "exec" form so that it runs as PID 1 (useful for graceful shutdown)
#CMD bash -c 'start-kafka.sh & ; start-ode.sh'
CMD bash -c 'start-ode.sh'
COPY ./jpo-ode-private/pom.xml ./
COPY ./jpo-ode-private/j2735/pom.xml ./j2735/
COPY ./jpo-ode-private/j2735/src ./j2735/src
COPY ./jpo-ode-private/ieee1609dot2/pom.xml ./ieee1609dot2/
COPY ./jpo-ode-private/ieee1609dot2/src ./ieee1609dot2/src
COPY ./jpo-ode-private/lib/*.jar ./lib/

RUN mvn clean
RUN mvn install -DskipTests

# Now set up the public repo
WORKDIR /home

COPY ./pom.xml ./
COPY ./jpo-ode-core/pom.xml ./jpo-ode-core/
COPY ./jpo-ode-core/src ./jpo-ode-core/src/
COPY ./jpo-ode-svcs/pom.xml ./jpo-ode-svcs/
COPY ./jpo-ode-svcs/src ./jpo-ode-svcs/src
COPY ./jpo-ode-plugins/pom.xml ./jpo-ode-plugins/
COPY ./jpo-ode-plugins/src ./jpo-ode-plugins/src
COPY ./jpo-ode-common/pom.xml ./jpo-ode-common/
COPY ./jpo-ode-common/src ./jpo-ode-common/src
COPY ./jpo-security/pom.xml ./jpo-security/
COPY ./jpo-security/src ./jpo-security/src

RUN mvn clean install -DskipTests

FROM openjdk:8u171-jre-alpine

WORKDIR /home

COPY --from=builder /home/jpo-ode-svcs/src/main/resources/application.properties /home
COPY --from=builder /home/jpo-ode-svcs/src/main/resources/logback.xml /home
COPY --from=builder /home/jpo-ode-svcs/target/jpo-ode-svcs-0.0.1-SNAPSHOT.jar /home

ENTRYPOINT ["java", \
"-Djava.rmi.server.hostname=$DOCKER_HOST_IP", \
"-Dcom.sun.management.jmxremote.port=9090", \
"-Dcom.sun.management.jmxremote.rmi.port=9090", \
"-Dcom.sun.management.jmxremote", \
"-Dcom.sun.management.jmxremote.local.only=true", \
"-Dcom.sun.management.jmxremote.authenticate=false", \
"-Dcom.sun.management.jmxremote.ssl=false", \
"-Dlogback.configurationFile=/home/logback.xml", \
"-jar", \
"/home/jpo-ode-svcs-0.0.1-SNAPSHOT.jar"]
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
default:
$(info Make target options:)
$(info `make start` to build and run the ODE)
$(info `make stop` to stop the ODE)
$(info `make delete` to destroy the current Docker containers)
$(info `make rebuild` to stop, delete, and then rebuild the containers)

start:
ifeq ("$(wildcard ./jpo-ode-private)", "")
$(error "ERROR: Directory `jpo-ode-private` not found in ${PWD}")
endif
ifeq ("$(wildcard ./asn1_codec/asn1c_combined/J2735_201603DA.ASN)", "")
cp ./jpo-ode-private/j2735/J2735_201603DA.ASN ./asn1_codec/asn1c_combined/J2735_201603DA.ASN
endif
ifndef DOCKER_HOST_IP
$(error ERROR: Environment variable DOCKER_HOST_IP is not set)
endif
ifndef DOCKER_SHARED_VOLUME
$(error ERROR: Environment variable DOCKER_SHARED_VOLUME is not set)
endif
ifeq ("$(wildcard .env)", "")
$(warning "WARNING: Environment file `.env` not found in ${PWD}")
endif
docker-compose up --build -d

stop:
docker-compose down

delete:
docker-compose rm -fvs

rebuild:
$(MAKE) stop delete start
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## ODE Release Notes ##
-----------------------
### December 2018
- ODE-466 serialId element of metadata will now provide a true serial number to help identify missing records.
### November 2018
- ODE-787 Publish J2735 version of Broadcast TIM in addition to the REST request version (see GitHub Issue #262). Please see https://github.com/usdot-jpo-ode/jpo-ode/wiki/Schema-Version-6-Change-Notice for details.
### Sprint 38
- ODE-769 Initiated output schema change SOP. See https://github.com/usdot-jpo-ode/jpo-ode/wiki/SchemaVersion-5-Change-Notice for details
- ODE-771 Fixed PPM crash bug
Expand Down
3 changes: 2 additions & 1 deletion build-and-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
docker-compose up --build --no-recreate -d
docker-compose down
docker-compose up --build -d
1 change: 1 addition & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
call docker-compose build
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mvn clean install
#!/bin/bash
docker-compose build
3 changes: 3 additions & 0 deletions clean-build-and-deploy-ppm-nsv.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
call docker-compose down
call docker-compose -f docker-compose-ppm-nsv.yml up --build -d
call docker-compose ps
4 changes: 1 addition & 3 deletions clean-build-and-deploy.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
call docker-compose stop
call docker-compose rm -f -v
call mvn clean install
call docker-compose down
call docker-compose up --build -d
call docker-compose ps
4 changes: 1 addition & 3 deletions clean-build-and-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
docker-compose stop
docker-compose rm -f -v
mvn -DskipTests clean install
docker-compose down
docker-compose up --build -d
docker-compose ps
3 changes: 0 additions & 3 deletions clean-build.cmd

This file was deleted.

110 changes: 110 additions & 0 deletions data/TIM_Message_Testing_Files/tim_geometry_multi_rsu_no_sdw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"request": {
"rsus": [
{
"rsuIndex": "10",
"rsuTarget": "127.0.0.1",
"rsuUsername": "v3user",
"rsuPassword": "password",
"rsuRetries": "0",
"rsuTimeout": "2000"
},
{
"rsuIndex": "10",
"rsuTarget": "127.0.0.2",
"rsuUsername": "v3user",
"rsuPassword": "password",
"rsuRetries": "1",
"rsuTimeout": "1000"
},
{
"rsuIndex": "10",
"rsuTarget": "127.0.0.3",
"rsuUsername": "v3user",
"rsuPassword": "password",
"rsuRetries": "1",
"rsuTimeout": "1000"
}
],
"snmp": {
"rsuid": "00000083",
"msgid": "31",
"mode": "1",
"channel": "178",
"interval": "2",
"deliverystart": "2017-06-01T17:47:11-05:00",
"deliverystop": "2018-01-01T17:47:11-05:15",
"enable": "1",
"status": "4"
}
},
"tim": {
"msgCnt": "13",
"timeStamp": "2017-03-13T01:07:11-05:00",
"packetID": "EC9C236B0000000000",
"urlB": "null",
"dataframes": [
{
"sspTimRights": "0",
"frameType": "advisory",
"msgId": {
"roadSignID": {
"position": {
"latitude": "41.678473",
"longitude": "-108.782775",
"elevation": "917.1432"
},
"viewAngle": "1010101010101010",
"mutcdCode": "warning",
"crc": "0000000000000000"
}
},
"startDateTime": "2017-12-01T17:47:11-05:00",
"durationTime": "22",
"priority": "0",
"sspLocationRights": "3",
"regions": [
{
"name": "bob",
"regulatorID": "23",
"segmentID": "33",
"anchorPosition": {
"latitude": "41.678473",
"longitude": "-108.782775",
"elevation": "917.1432"
},
"laneWidth": "7",
"directionality": "3",
"closedPath": "false",
"direction": "1010101010101010",
"description": "geometry",
"geometry": {
"direction": "1010101010101010",
"extent": "1",
"laneWidth": "33",
"circle": {
"position": {
"latitude": "41.678473",
"longitude": "-108.782775",
"elevation": "917.1432"
},
"radius": "15",
"units": "7"
}
}
}
],
"sspMsgTypes": "2",
"sspMsgContent": "3",
"content": "Advisory",
"items": [
"125",
"some text",
"250",
"'98765"
],
"url": "null"
}
]
}
}
Loading

0 comments on commit 4c590c4

Please sign in to comment.