Skip to content

Commit

Permalink
Merge branch 'ode-466' into node-xy-dockerBuildsImage
Browse files Browse the repository at this point in the history
# Conflicts Resolved:
#	clean-build-and-deploy.cmd
#	docker-compose.yml
#	jpo-ode-plugins/src/test/java/us/dot/its/jpo/ode/plugin/j2735/builders/TravelerMessageFromHumanToAsnConverterTest.java
#	jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/heartbeat/RsuSnmpTest.java
#	jpo-s3-deposit
#	start-kafka-shell.bat
  • Loading branch information
hmusavi committed Nov 20, 2018
2 parents 2a91a93 + eec4df3 commit ae4a9ea
Show file tree
Hide file tree
Showing 71 changed files with 1,240 additions and 760 deletions.
2 changes: 2 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## ODE Release Notes ##
-----------------------
### 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
1 change: 1 addition & 0 deletions clean-build-and-deploy.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
call docker-compose stop
call docker-compose rm -f -v
call mvn clean install -DskipTests
call docker-compose up --build -d
call docker-compose ps
192 changes: 192 additions & 0 deletions docker-compose-ppm-nsv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# This docker-compose file configures PPM modules with self contained configuration and map files
# So the module can run without reliance on a shared volume. This was done to avoid corporate network
# and machine dress-code restrictions that would not permit the container sharing volume with host.
#
# DOCKER_SHARED_VOLUME_WINDOWS should be defined for Windows host machine as C: and not defined for Linux hosts

version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"

kafka:
build: ./docker/kafka
ports:
- "9092:9092"
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
ZK: ${DOCKER_HOST_IP}:2181
KAFKA_ADVERTISED_HOST_NAME: ${DOCKER_HOST_IP}
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_DELETE_TOPIC_ENABLED: "true"
KAFKA_CLEANUP_POLICY: "delete" # delete old logs
KAFKA_LOG_RETENTION_HOURS: 2
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 3000
KAFKA_RETENTION_MS: 7200000 # delete old logs after 2 hours
KAFKA_SEGMENT_MS: 7200000 # roll segment logs every 2 hours.
# This configuration controls the period of time after
# which Kafka will force the log to roll even if the segment
# file isn't full to ensure that retention can delete or compact old data.
depends_on:
- zookeeper
links:
- zookeeper
volumes:
- ${DOCKER_SHARED_VOLUME_WINDOWS}/var/run/docker.sock:/var/run/docker.sock

ode:
build: .
ports:
- "8080:8080"
- "9090:9090"
- "46753:46753/udp"
- "46800:46800/udp"
- "5555:5555/udp"
- "6666:6666/udp"
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
ZK: ${DOCKER_HOST_IP}:2181
SPRING_CONFIG_LOCATION: /host_share/config/
ODE_DDS_CAS_USERNAME: ${ODE_DDS_CAS_USERNAME}
ODE_DDS_CAS_PASSWORD: ${ODE_DDS_CAS_PASSWORD}
ODE_EXTERNAL_IPV4: ${ODE_EXTERNAL_IPV4}
ODE_EXTERNAL_IPV6: ${ODE_EXTERNAL_IPV6}
ODE_SECURITY_SVCS_SIGNATURE_URI: ${ODE_SECURITY_SVCS_SIGNATURE_URI}
# Commented out for latest schemaVersion. Uncomment to set for older schemaVersion
# ODE_OUTPUT_SCHEMA_VERSION: ${ODE_OUTPUT_SCHEMA_VERSION}
depends_on:
- kafka
links:
- kafka
- zookeeper
volumes:
- ${DOCKER_SHARED_VOLUME}/ode:/jpo-ode

adm:
build: ./asn1_codec
image: jpoode_acm:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
ACM_CONFIG_FILE: adm.properties
depends_on:
- kafka
links:
- kafka
volumes:
- ${DOCKER_SHARED_VOLUME}/adm:/asn1_codec_share

aem:
build: ./asn1_codec
image: jpoode_acm:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
ACM_CONFIG_FILE: aem.properties
depends_on:
- kafka
links:
- kafka
volumes:
- ${DOCKER_SHARED_VOLUME}/aem:/asn1_codec_share

ppm_bsm:
build:
context: ./jpo-cvdp
dockerfile: Dockerfile-nsv
args:
PPM_CONFIG_FILE: ${PPM_BSM_CONFIG_FILE}
PPM_MAP_FILE: ${PPM_MAP_FILE}
image: jpoode_ppm_bsm:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
PPM_CONFIG_FILE: ${PPM_BSM_CONFIG_FILE}
PPM_MAP_FILE: ${PPM_MAP_FILE}
volumes:
- ${DOCKER_SHARED_VOLUME}/ppm_bsm:/ppm_data
depends_on:
- kafka

ppm_tim:
build:
context: ./jpo-cvdp
dockerfile: Dockerfile-nsv
args:
PPM_CONFIG_FILE: ${PPM_TIM_CONFIG_FILE}
PPM_MAP_FILE: ${PPM_MAP_FILE}
image: jpoode_ppm_tim:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
PPM_CONFIG_FILE: ${PPM_TIM_CONFIG_FILE}
PPM_MAP_FILE: ${PPM_MAP_FILE}
volumes:
- ${DOCKER_SHARED_VOLUME}/ppm_tim:/ppm_data
depends_on:
- kafka

cvpep_bsm_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${CVPEP_BSM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${CVPEP_BSM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${CVPEP_BSM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${CVPEP_BSM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${CVPEP_BSM_TOPIC}
depends_on:
- kafka
links:
- kafka

rde_bsm_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${RDE_BSM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${RDE_BSM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${RDE_BSM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${RDE_BSM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${RDE_BSM_TOPIC}
depends_on:
- kafka
links:
- kafka

cvpep_tim_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${CVPEP_TIM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${CVPEP_TIM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${CVPEP_TIM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${CVPEP_TIM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${CVPEP_TIM_TOPIC}
depends_on:
- kafka
links:
- kafka

rde_tim_depositor:
build: ./jpo-s3-deposit
image: jpoode_s3dep:latest
environment:
AWS_ACCESS_KEY_ID: ${RDE_TIM_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${RDE_TIM_SECRET_ACCESS_KEY}
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
DEPOSIT_BUCKET_NAME: ${RDE_TIM_BUCKET_NAME}
DEPOSIT_KEY_NAME: ${RDE_TIM_DEPOSIT_KEY}
DEPOSIT_TOPIC: ${RDE_TIM_TOPIC}
depends_on:
- kafka
links:
- kafka
sec:
build: ./jpo-security-svcs
ports:
- "8090:8090"
environment:
SEC_CRYPTO_SERVICE_BASE_URI: ${SEC_CRYPTO_SERVICE_BASE_URI}
15 changes: 11 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DOCKER_SHARED_VOLUME_WINDOWS should be defined for Windows host machine as C: and not defined for Linux hosts

version: '3'
services:
zookeeper:
Expand Down Expand Up @@ -29,7 +31,7 @@ services:
links:
- zookeeper
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${DOCKER_SHARED_VOLUME_WINDOWS}/var/run/docker.sock:/var/run/docker.sock

ode:
build: .
Expand All @@ -46,7 +48,8 @@ services:
ODE_DDS_CAS_USERNAME: ${ODE_DDS_CAS_USERNAME}
ODE_DDS_CAS_PASSWORD: ${ODE_DDS_CAS_PASSWORD}
ODE_SECURITY_SVCS_SIGNATURE_URI: ${ODE_SECURITY_SVCS_SIGNATURE_URI}
ODE_OUTPUT_SCHEMA_VERSION: ${ODE_OUTPUT_SCHEMA_VERSION}
# Commented out for latest schemaVersion. Uncomment to set for older schemaVersion
# ODE_OUTPUT_SCHEMA_VERSION: ${ODE_OUTPUT_SCHEMA_VERSION}
depends_on:
- kafka
links:
Expand Down Expand Up @@ -82,7 +85,9 @@ services:
- ${DOCKER_SHARED_VOLUME}:/asn1_codec_share

ppm_bsm:
build: ./jpo-cvdp
build:
context: ./jpo-cvdp
dockerfile: Dockerfile
image: jpo-ode_ppm:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
Expand All @@ -93,7 +98,9 @@ services:
- kafka

ppm_tim:
build: ./jpo-cvdp
build:
context: ./jpo-cvdp
dockerfile: Dockerfile
image: jpo-ode_ppm:latest
environment:
DOCKER_HOST_IP: ${DOCKER_HOST_IP}
Expand Down
1 change: 1 addition & 0 deletions docker-run-ppm-env-file.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -it -v %DOCKER_SHARED_VOLUME%:/ppm_data --env-file=.env jpoode_ppm:latest %1
11 changes: 8 additions & 3 deletions docs/ODESwagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ definitions:
tim:
type: object
properties:
index:
type: integer
description: Index of message storage on RSU.
msgCnt:
type: integer
description: >-
Expand All @@ -308,8 +305,13 @@ definitions:
TravelerInputData:
type: object
properties:
request:
$ref: '#/definitions/request'
tim:
$ref: '#/definitions/tim'
request:
type: object
properties:
rsus:
type: array
items:
Expand Down Expand Up @@ -703,6 +705,9 @@ definitions:
type: object
description: 'Optional field, needed for SNMP deposit to RSU.'
properties:
rsuIndex:
type: integer
description: Index of message storage on RSU.
rsuTarget:
type: string
description: IPv4 address of RSU
Expand Down
Binary file modified docs/ODE_Output_Schema_Reference.docx
Binary file not shown.
2 changes: 1 addition & 1 deletion jpo-cvdp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ private DateTimeUtils() {
}

public static String now() {
return nowZDT().format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
return nowZDT().format(DateTimeFormatter.ISO_INSTANT);
}

public static ZonedDateTime nowZDT() {
return ZonedDateTime.now(ZoneId.of("UTC"));
}

public static String isoDateTime(ZonedDateTime zonedDateTime) {
return zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
return zonedDateTime.format(DateTimeFormatter.ISO_INSTANT);
}

public static ZonedDateTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void testIsoDateTime() throws ParseException {
expectedDate.getHour(),
expectedDate.getMinute(),
expectedDate.getSecond(),
expectedDate.getNano()/1000000).format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
expectedDate.getNano()/1000000).format(DateTimeFormatter.ISO_INSTANT);

assertEquals(sExpectedDate.substring(0, 18), sdate.substring(0, 18));
ZonedDateTime date2 = DateTimeUtils.isoDateTime("2015-11-30T16:06:15.679Z");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class AppContext {
public static final String ODE_HOSTNAME = "ODE_HOSTNAME";
public static final String PAYLOAD_STRING = "payload";
public static final String METADATA_STRING = "metadata";
public static final String ODE_ASN1_DATA = "OdeAsn1Data";
public static final String DATA_STRING = "data";
public static final String ENCODINGS_STRING = "encodings";
public static final String PAYLOAD_TYPE_STRING = "payloadType";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package us.dot.its.jpo.ode.model;

import us.dot.its.jpo.ode.plugin.ServiceRequest;

public class OdeRequestMsgMetadata extends OdeMsgMetadata {

/**
*
*/
private static final long serialVersionUID = 1L;

ServiceRequest request;

public OdeRequestMsgMetadata() {
super();
}

public OdeRequestMsgMetadata(OdeMsgPayload payload) {
super(payload);
}

public OdeRequestMsgMetadata(String payloadType, SerialId serialId, String receivedAt) {
super(payloadType, serialId, receivedAt);
}

public OdeRequestMsgMetadata(OdeMsgPayload payload, ServiceRequest request) {
super(payload);
setRequest(request);
}

public ServiceRequest getRequest() {
return request;
}

public void setRequest(ServiceRequest request) {
this.request = request;
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((request == null) ? 0 : request.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
OdeRequestMsgMetadata other = (OdeRequestMsgMetadata) obj;
if (request == null) {
if (other.request != null)
return false;
} else if (!request.equals(other.request))
return false;
return true;
}



}
Loading

0 comments on commit ae4a9ea

Please sign in to comment.